Обновление кода. Замена mysql_connect() в гравировках.
This commit is contained in:
parent
b6eada7fd5
commit
3b9f888947
14
repair.php
14
repair.php
@ -1,17 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
if(!isset($_SESSION['uid'])) { header("Location: index.php"); }
|
if(!isset($_SESSION['uid'])) { header("Location: index.php"); }
|
||||||
include("config.php");
|
require_once("functions.php");
|
||||||
include("functions.php");
|
$d = db::c()->query('SELECT SUM(`massa`) FROM `inventory` WHERE `dressed` = 0 AND `owner` = ?i',$_SESSION['uid'])->fetch_assoc();
|
||||||
$d = mysql_fetch_array(mysql_query("SELECT SUM(`massa`) FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0"));
|
|
||||||
if($user['room'] != 23) { header("Location: main.php"); die(); }
|
if($user['room'] != 23) { header("Location: main.php"); die(); }
|
||||||
if($user['battle'] != 0) { header('location: fbattle.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")) {
|
if(input::post('set') && input::post('count') && ($user['money'] >= 30)) {
|
||||||
$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')))
|
||||||
mysql_query("UPDATE `users` SET `money` = '".$user['money']."' WHERE id = {$user['id']} LIMIT 1");
|
db::c()->query('UPDATE `users` SET `money` = `money` - 30 WHERE `id` = ?i',$_SESSION['uid']);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_GET['rep'] && ($_GET['sid'] == 2)) {
|
if($_GET['rep'] && ($_GET['sid'] == 2)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user