From 47f6cea968159b59b876395484355d30c387ac15 Mon Sep 17 00:00:00 2001 From: Awixs777 Date: Wed, 6 Apr 2022 00:51:18 +0300 Subject: [PATCH 1/2] Store Logs Store Logs --- application/config/routes.php | 5 ++++ application/language/english/admin_lang.php | 2 ++ .../modules/admin/controllers/Admin.php | 11 +++++++ .../modules/admin/models/Admin_model.php | 5 ++++ .../modules/admin/views/store/store_logs.php | 30 +++++++++++++++++++ .../modules/store/models/Store_model.php | 2 +- .../themes/admin/views/layouts/layout.php | 12 ++++++-- 7 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 application/modules/admin/views/store/store_logs.php diff --git a/application/config/routes.php b/application/config/routes.php index 5ddf15c1..2326ee1e 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -363,6 +363,11 @@ */ $route[$lang.'/admin/vote/logs'] = 'admin/votelogs'; +/* + * Store (admin) +*/ +$route[$lang.'/admin/store/logs'] = 'admin/storelogs'; + /* * To check the soap connection */ diff --git a/application/language/english/admin_lang.php b/application/language/english/admin_lang.php index 52f14afd..67340e06 100644 --- a/application/language/english/admin_lang.php +++ b/application/language/english/admin_lang.php @@ -53,6 +53,8 @@ $lang['admin_nav_topsites'] = 'Topsites'; $lang['admin_nav_donate_logs'] = 'Donate Logs'; $lang['admin_nav_vote_logs'] = 'Vote Logs'; +$lang['admin_nav_store_logs'] = 'Store Logs'; +$lang['admin_nav_system_logs'] = 'Logs'; $lang['admin_nav_store'] = 'Store'; $lang['admin_nav_manage_store'] = 'Manage Store'; $lang['admin_nav_forum'] = 'Forum'; diff --git a/application/modules/admin/controllers/Admin.php b/application/modules/admin/controllers/Admin.php index fe9e862a..46554ee2 100644 --- a/application/modules/admin/controllers/Admin.php +++ b/application/modules/admin/controllers/Admin.php @@ -1211,6 +1211,17 @@ public function votelogs() $this->template->build('vote/vote_logs', $data); } + + public function storelogs() + { + $data = [ + 'pagetitle' => 'Store Logs', + 'lang' => $this->lang->lang(), + 'stores' => $this->admin_model->getStoreLogs() + ]; + + $this->template->build('store/store_logs', $data); + } /** * Forum functions diff --git a/application/modules/admin/models/Admin_model.php b/application/modules/admin/models/Admin_model.php index 876759ed..176ee4d2 100644 --- a/application/modules/admin/models/Admin_model.php +++ b/application/modules/admin/models/Admin_model.php @@ -77,6 +77,11 @@ public function getVoteLogs() { return $this->db->order_by('id', 'DESC')->get('votes_logs')->result(); } + + public function getStoreLogs() + { + return $this->db->order_by('id', 'DESC')->get('store_logs')->result(); + } public function updateAccountData($id, $dp, $vp) { diff --git a/application/modules/admin/views/store/store_logs.php b/application/modules/admin/views/store/store_logs.php new file mode 100644 index 00000000..08529504 --- /dev/null +++ b/application/modules/admin/views/store/store_logs.php @@ -0,0 +1,30 @@ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ID PurchaseID AccountID CharItemPrice DPPrice VPDate
id; ?>accountid; ?>charid; ?>item_name; ?>dp; ?>vp; ?>date; ?>
+
+
diff --git a/application/modules/store/models/Store_model.php b/application/modules/store/models/Store_model.php index 35951df7..5ed80144 100644 --- a/application/modules/store/models/Store_model.php +++ b/application/modules/store/models/Store_model.php @@ -120,7 +120,7 @@ public function getItem($id) public function insertStoreLog($accountid, $charid, $name, $type, $pricetype, $dp, $vp) { - $date = $this->wowgeneral->getTimestamp(); + $date = date("Y-m-d H:i:s"); $data = array( 'accountid' => $accountid, diff --git a/application/themes/admin/views/layouts/layout.php b/application/themes/admin/views/layouts/layout.php index 6f3be977..7f4bef9b 100644 --- a/application/themes/admin/views/layouts/layout.php +++ b/application/themes/admin/views/layouts/layout.php @@ -141,8 +141,6 @@
  • lang->line('admin_nav_manage_store'); ?>
  • lang->line('admin_nav_donate_methods'); ?>
  • lang->line('admin_nav_topsites'); ?>
  • -
  • lang->line('admin_nav_donate_logs'); ?>
  • -
  • lang->line('admin_nav_vote_logs'); ?>
  • @@ -155,6 +153,16 @@
  • lang->line('admin_nav_Tickets'); ?>
  • +
  • + lang->line('admin_nav_system_logs'); ?> + +
  • From 7ee5bd6faf34ee13ca9d70ee22ba187415f0b8ad Mon Sep 17 00:00:00 2001 From: Awixs777 Date: Wed, 6 Apr 2022 01:00:19 +0300 Subject: [PATCH 2/2] Store check status Checking server status. If disabled, purchases are not available. --- application/language/english/general_lang.php | 1 + application/modules/store/views/index.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/application/language/english/general_lang.php b/application/language/english/general_lang.php index afda5249..c1d4acd0 100644 --- a/application/language/english/general_lang.php +++ b/application/language/english/general_lang.php @@ -224,6 +224,7 @@ $lang['panel_current_username'] = 'Current Username'; $lang['panel_current_email'] = 'Current Email Address'; $lang['panel_replace_email_by'] = 'Replace Email by'; +$lang['panel_server_checkstatus'] = 'Server is offline. Purchases are not available.'; /*Home Lang*/ $lang['home_latest_news'] = 'Latest News'; diff --git a/application/modules/store/views/index.php b/application/modules/store/views/index.php index 17e5b67b..26d27a33 100644 --- a/application/modules/store/views/index.php +++ b/application/modules/store/views/index.php @@ -72,8 +72,12 @@
    + wowrealm->RealmStatus($MultiRealm->realmID, $this->wowrealm->realmGetHostname($MultiRealm->realmID))): ?> -
    + + + +