Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store Logs #49

Open
wants to merge 3 commits into
base: 1.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions application/config/routes.php
Original file line number Diff line number Diff line change
@@ -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
*/
2 changes: 2 additions & 0 deletions application/language/english/admin_lang.php
Original file line number Diff line number Diff line change
@@ -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';
1 change: 1 addition & 0 deletions application/language/english/general_lang.php
Original file line number Diff line number Diff line change
@@ -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';
11 changes: 11 additions & 0 deletions application/modules/admin/controllers/Admin.php
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions application/modules/admin/models/Admin_model.php
Original file line number Diff line number Diff line change
@@ -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)
{
30 changes: 30 additions & 0 deletions application/modules/admin/views/store/store_logs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div class="uk-container uk-margin">
<div class="uk-card uk-card-default uk-card-body">
<table class="uk-table uk-table-middle uk-table-divider uk-table-small">
<thead>
<tr>
<th>ID Purchase</th>
<th>ID Account</th>
<th>ID Char</th>
<th>Item</th>
<th>Price DP</th>
<th>Price VP</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<?php foreach ($stores as $stores): ?>
<tr>
<td><?= $stores->id; ?></td>
<td><?= $stores->accountid; ?></td>
<td><?= $stores->charid; ?></td>
<td><?= $stores->item_name; ?></td>
<td><?= $stores->dp; ?></td>
<td><?= $stores->vp; ?></td>
<td><?= $stores->date; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
2 changes: 1 addition & 1 deletion application/modules/store/models/Store_model.php
Original file line number Diff line number Diff line change
@@ -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,
6 changes: 5 additions & 1 deletion application/modules/store/views/index.php
Original file line number Diff line number Diff line change
@@ -72,8 +72,12 @@
<?php endif; ?>
</div>
<div class="uk-width-auto">
<?php if ($this->wowrealm->RealmStatus($MultiRealm->realmID, $this->wowrealm->realmGetHostname($MultiRealm->realmID))): ?>
<button class="uk-button uk-button-default uk-button-small" id="button_item<?= $top->store_item ?>" value="<?= $top->store_item ?>" onclick="AddItem(event, this.value)"><i class="fas fa-cart-plus"></i> <?= $this->lang->line('button_cart'); ?></button>
</div>
<?php else: ?>
<button title="<?= $this->lang->line('panel_server_checkstatus'); ?>" class="uk-button uk-button-default uk-button-small" id="button_item<?= $top->store_item ?>" value="<?= $top->store_item ?> " onclick="AddItem(event, this.value)" disabled><i class="fas fa-cart-plus"></i> <?= $this->lang->line('button_cart'); ?></button>
<?php endif ?>
</div>
</div>
</div>
</div>
12 changes: 10 additions & 2 deletions application/themes/admin/views/layouts/layout.php
Original file line number Diff line number Diff line change
@@ -141,8 +141,6 @@
<li><a href="<?= base_url('admin/store'); ?>"><span class="admin-subnav-icon"><i class="fas fa-shopping-cart"></i></span><?= $this->lang->line('admin_nav_manage_store'); ?></a></li>
<li><a href="<?= base_url('admin/donate'); ?>"><span class="admin-subnav-icon"><i class="fas fa-donate"></i></span><?= $this->lang->line('admin_nav_donate_methods'); ?></a></li>
<li><a href="<?= base_url('admin/topsites'); ?>"><span class="admin-subnav-icon"><i class="fas fa-star"></i></span><?= $this->lang->line('admin_nav_topsites'); ?></a></li>
<li><a href="<?= base_url('admin/donate/logs'); ?>"><span class="admin-subnav-icon"><i class="fas fa-receipt"></i></span><?= $this->lang->line('admin_nav_donate_logs'); ?></a></li>
<li><a href="<?= base_url('admin/vote/logs'); ?>"><span class="admin-subnav-icon"><i class="fas fa-receipt"></i></span><?= $this->lang->line('admin_nav_vote_logs'); ?></a></li>
</ul>
</div>
</li>
@@ -155,6 +153,16 @@
</div>
</li>
<li><a href="<?= base_url('admin/tickets'); ?>"><span class="admin-subnav-icon"><i class="fas fa-scroll"></i></span><?= $this->lang->line('admin_nav_Tickets'); ?></a></li>
<li>
<a href="javascript:void(0)"><span class="uk-margin-small-right"><i class="fas fa-comments"></i></span><?= $this->lang->line('admin_nav_system_logs'); ?><span class="uk-margin-xsmall-top" uk-icon="icon: triangle-down"></span></a>
<div class="uk-navbar-dropdown">
<ul class="uk-nav uk-navbar-dropdown-nav">
<li><a href="<?= base_url('admin/store/logs'); ?>"><span class="admin-subnav-icon"><i class="fas fa-receipt"></i></span><?= $this->lang->line('admin_nav_store_logs'); ?></a></li>
<li><a href="<?= base_url('admin/donate/logs'); ?>"><span class="admin-subnav-icon"><i class="fas fa-receipt"></i></span><?= $this->lang->line('admin_nav_donate_logs'); ?></a></li>
<li><a href="<?= base_url('admin/vote/logs'); ?>"><span class="admin-subnav-icon"><i class="fas fa-receipt"></i></span><?= $this->lang->line('admin_nav_vote_logs'); ?></a></li>
</ul>
</div>
</li>
</ul>
</div>
<div class="uk-navbar-right"></div>