Удаление неиспользуемого входа в счёт.

This commit is contained in:
Igor Barkov [iwork] 2018-06-22 17:58:26 +03:00
parent 88c76483b5
commit 20aa7316b6

View File

@ -15,18 +15,7 @@ if ($user['battle'] != 0) {
die(); die();
} }
if ($_POST['enter'] && $_POST['pass']) { $bank = mysql_fetch_array(mysql_query("SELECT * FROM `bank` WHERE `id`='" . $_SESSION['uid'] . "';"));
$data = mysql_query("SELECT * FROM `bank` WHERE `id`='" . $user['id'] . "' AND `pass`='" . md5($_POST['pass']) . "';");
$data = mysql_fetch_array($data);
if ($data) {
$_SESSION['bankid'] = $_POST['id'];
err('Удачный вход.');
} else {
err('Ошибка входа.');
}
}
$bank = mysql_fetch_array(mysql_query("SELECT * FROM `bank` WHERE `id`='" . $_SESSION['bankid'] . "';"));
if (($_GET['set'] OR $_POST['set'])) { if (($_GET['set'] OR $_POST['set'])) {
if ($_GET['set']) { if ($_GET['set']) {
@ -85,7 +74,7 @@ if (($_GET['set'] OR $_POST['set'])) {
$allcost = $_POST['count'] * $dress['ecost']; $allcost = $_POST['count'] * $dress['ecost'];
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','\"" . $user['login'] . "\" купил товар: \"" . $dress['name'] . "\" " . $dresscount . "id:(" . $dressid . ") [0/" . $dress['maxdur'] . "] за " . $allcost . " екр. ',1,'" . time() . "');"); mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','\"" . $user['login'] . "\" купил товар: \"" . $dress['name'] . "\" " . $dresscount . "id:(" . $dressid . ") [0/" . $dress['maxdur'] . "] за " . $allcost . " екр. ',1,'" . time() . "');");
echo "<font color=red><b>Вы купили {$_POST['count']} шт. \"{$dress['name']}\".</b></font>"; echo "<font color=red><b>Вы купили {$_POST['count']} шт. \"{$dress['name']}\".</b></font>";
mysql_query("UPDATE `bank` set `ekr`=`ekr`-'" . ($allcost) . "' WHERE `id`='" . $_SESSION['bankid'] . "';"); mysql_query("UPDATE `bank` set `ekr`=`ekr`-'" . ($allcost) . "' WHERE `id`='" . $_SESSION['uid'] . "';");
$bank['ekr'] -= $allcost; $bank['ekr'] -= $allcost;
} }
} else { } else {
@ -131,30 +120,7 @@ if (($_GET['set'] OR $_POST['set'])) {
</tr> </tr>
</form> </form>
</table> </table>
<?
if (!$_SESSION['bankid']) {
?>
<form method=post>
<fieldset style="width:200px; height:130px;">
<legend>Войти в счет</legend>
<br> &nbsp;
<?
$banks = mysql_query("SELECT * FROM `bank` WHERE `id` = " . $user['id'] . ";");
echo "<select style='width:150px' name=id>";
while ($rah = mysql_fetch_array($banks)) {
echo "<option>", $rah['id'], "</option>";
}
echo "</select>";
?>
<br> &nbsp; Пароль <input type=password name=pass size=21>
<br><br>
<center><input type=submit name='enter' value='Войти'>
</fieldset>
</form>
<?
die();
}
?>
<table border=0 width=100% cellspacing="0" cellpadding="4"> <table border=0 width=100% cellspacing="0" cellpadding="4">
<tr> <tr>
<form method=POST action="ashop.php"> <form method=POST action="ashop.php">