Обновление кода. Замена mysql_connect() в гравировках.
This commit is contained in:
parent
b6eada7fd5
commit
3b9f888947
14
repair.php
14
repair.php
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user