diff --git a/shop.php b/shop.php index cb756b4..0be1493 100644 --- a/shop.php +++ b/shop.php @@ -100,23 +100,18 @@ if (!empty($_GET['buy'])) { 'nalign' => $dress['nalign'], 'dategoden' => $dress['dategoden'], 'goden' => $dress['goden'], - 'otdel' => $dress['otdel'],//s 'gmp' => $dress['gmp'], - 'gmeshok' => $dress['gmeshok'], - 'encicl' => $dress['encicl'],//s 'artefact' => $dress['artefact'], 'koll' => $dress['koll'] ]; - - db::c()->query('INSERT INTO `inventory` SET ?A[?i,?i,"?s",?i,?i,?i,"?s",?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,"?s",?i,?i,"?s",?i,?i]', $newItem); + db::c()->query('INSERT INTO `inventory` SET ?A[?i,?i,"?s",?i,?i,?i,"?s",?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i]', $newItem); $inventoryItemId = db::c()->getLastInsertId(); if ($dress['count'] != -1) db::c()->query('UPDATE `shop` SET `count` = `count` - 1 WHERE `id` = ?i', $_GET['buy']); $status = "Вы купили \"{$dress['name']}\"."; db::c()->query('UPDATE `users` set `money` = ?i WHERE `id` = ?i', $dress['cost'], $_SESSION['uid']); - - $deloText = "\"" . $user['login'] . "\" купил товар : \"" . $dress['name'] . " id:(" . $inventoryItemId . ") [0/" . $dress['maxdur'] . "] за " . $dress['cost'] . " кр."; - db::c()->query('INSERT INTO `delo` (`pers`, `text`, `type`, `date`) VALUES (?i, "?s", 1, ?i', $user['id'], $deloText, time()); + $deloText = "{$user['login']} купил товар «{$dress['name']}» id:({$inventoryItemId}) в магазине за {$dress['cost']} кр."; + addToDelo($deloText); } else { $status = "Недостаточно денег или нет вещей в наличии.";