Обновление кода. Замена mysql_connect() в гравировках.

This commit is contained in:
lopar 2018-12-12 01:00:19 +02:00
parent b6eada7fd5
commit 3b9f888947

View File

@ -1,17 +1,15 @@
<?php
session_start();
if(!isset($_SESSION['uid'])) { header("Location: index.php"); }
include("config.php");
include("functions.php");
$d = mysql_fetch_array(mysql_query("SELECT SUM(`massa`) FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0"));
require_once("functions.php");
$d = db::c()->query('SELECT SUM(`massa`) FROM `inventory` WHERE `dressed` = 0 AND `owner` = ?i',$_SESSION['uid'])->fetch_assoc();
if($user['room'] != 23) { header("Location: main.php"); die(); }
if($user['battle'] != 0) { header('location: fbattle.php'); die(); }
if($_POST['set'] && $_POST['count'] && ($user['money'] >= 30)) {
if(mysql_query("UPDATE `inventory` SET `text` = '".mysql_real_escape_string($_POST['count'])."' WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `id` = '".(int)$_POST['set']."' AND `setsale` = 0 LIMIT 1")) {
$user['money'] -= 30;
mysql_query("UPDATE `users` SET `money` = '".$user['money']."' WHERE id = {$user['id']} LIMIT 1");
}
// Гравировка
if(input::post('set') && input::post('count') && ($user['money'] >= 30)) {
if(db::c()->query('UPDATE `inventory` SET `text` = "?s" WHERE `dressed` = 0 AND `setsale` = 0 AND `owner` = ?i AND `id` = ?i',input::post('count'),$_SESSION['uid'],input::post('set')))
db::c()->query('UPDATE `users` SET `money` = `money` - 30 WHERE `id` = ?i',$_SESSION['uid']);
}
if($_GET['rep'] && ($_GET['sid'] == 2)) {