From c6316820a082705cefb09a9900c46a26aa434007 Mon Sep 17 00:00:00 2001 From: lopar Date: Sat, 4 Jul 2020 13:49:43 +0300 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D1=87=D0=B0=D1=82=D0=BA=D0=B8=20MV?= =?UTF-8?q?C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/ItemTypes.php | 56 ++++++++++++++++++++++++++++++++++++++ classes/Rooms.php | 59 ++++++++++++++++++++++++++++++++++++++++ classes/User.php | 9 ++++++ inf.php | 9 ++++-- models/PresentsModel.php | 13 +++++++++ views/presents-list.php | 3 ++ 6 files changed, 146 insertions(+), 3 deletions(-) create mode 100644 classes/ItemTypes.php create mode 100644 classes/Rooms.php create mode 100644 models/PresentsModel.php create mode 100644 views/presents-list.php diff --git a/classes/ItemTypes.php b/classes/ItemTypes.php new file mode 100644 index 0000000..3728109 --- /dev/null +++ b/classes/ItemTypes.php @@ -0,0 +1,56 @@ +typename = 'Серьги'; + break; + case 2: + $this->typename = 'Ожерелье'; + break; + case 3: + $this->typename = 'Оружие'; + break; + case 4: + $this->typename = 'Броня'; + break; + case 5: + $this->typename = 'Кольцо'; + break; + + case 8: + $this->typename = 'Шлем'; + break; + case 9: + $this->typename = 'Перчатки'; + break; + case 10: + $this->typename = 'Щит'; + break; + case 11: + $this->typename = 'Обувь'; + break; + case 12: + $this->typename = 'Магический свиток'; + break; + case 22: + $this->typename = 'Рубашка'; + break; + case 50: + $this->typename = 'Волшебное зелье'; + break; + case 200: + $this->typename = 'Сувенир'; + break; + default: + $this->typename = 'Хлам'; + } + } +} \ No newline at end of file diff --git a/classes/Rooms.php b/classes/Rooms.php new file mode 100644 index 0000000..40a5d30 --- /dev/null +++ b/classes/Rooms.php @@ -0,0 +1,59 @@ +roomname = "Неизвестная локация"; + break; + case 1: + $this->roomname = "Дом поединков"; + break; + case 20: + $this->roomname = "Центральная площадь"; + break; + case 21: + $this->roomname = "Страшилкина улица"; + break; + case 22: + $this->roomname = "Магазин"; + break; + case 23: + $this->roomname = "Ремонтная мастерская"; + break; + case 24: + $this->roomname = "Памятник Архангелу"; + break; + case 25: + $this->roomname = "Комиссионный магазин"; + break; + case 26: + $this->roomname = "Большая парковая улица"; + break; + case 27: + $this->roomname = "Почта"; + break; + case 28: + $this->roomname = "Регистратура кланов"; + break; + case 29: + $this->roomname = "Банк"; + break; + } + return $this->roomname; + } +} \ No newline at end of file diff --git a/classes/User.php b/classes/User.php index af27916..1d5e95d 100644 --- a/classes/User.php +++ b/classes/User.php @@ -31,6 +31,8 @@ class User public $exp; public $stats; + use Rooms; + public function __construct($user) { $user_query = db::c()->query('SELECT * FROM users WHERE id = "?s" OR login = "?s"', $user, $user)->fetch_assoc(); @@ -62,4 +64,11 @@ PRESENT_AFTER; } } + public function showUserInfo() { + $dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i' AND dressed_slot > 0, $this->id); + foreach ($dressed_items->fetch_assoc() as $item) { + + } + } + } \ No newline at end of file diff --git a/inf.php b/inf.php index 938bd25..7cb7038 100644 --- a/inf.php +++ b/inf.php @@ -1,7 +1,7 @@ getAllPresents($user->id); + if (empty($user->id)): ?> @@ -49,7 +52,7 @@ if (empty($user->id)): ?>
- married)): ?> В браке с <?= $user->married ?>realname)) { ?>

info) ?>


-showPresents(); ?> + query('SELECT sender_id, image FROM `users_presents` WHERE owner_id = ?i', $user_id); + } +} \ No newline at end of file diff --git a/views/presents-list.php b/views/presents-list.php new file mode 100644 index 0000000..b876949 --- /dev/null +++ b/views/presents-list.php @@ -0,0 +1,3 @@ + + <?= $row['sender'] ?> +