add Hide Dashboard Content
This commit is contained in:
parent
671154d146
commit
f62f07d102
@ -188,6 +188,8 @@ CREATE TABLE `tb_languages` (
|
||||
`id` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
ALTER TABLE `tbl_voucher` ADD `generated_by` INT NOT NULL DEFAULT '0' COMMENT 'id admin' AFTER `status`;
|
||||
ALTER TABLE `tbl_users` ADD `root` INT NOT NULL DEFAULT '0' COMMENT 'for sub account' AFTER `id`;
|
||||
|
||||
ALTER TABLE `tbl_appconfig`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
@ -51,26 +51,28 @@ if (empty($c_all)) {
|
||||
}
|
||||
$ui->assign('c_all', $c_all);
|
||||
|
||||
//user expire
|
||||
$paginator = Paginator::build(ORM::for_table('tbl_user_recharges'));
|
||||
$expire = ORM::for_table('tbl_user_recharges')
|
||||
if($config['hide_uet'] != 'yes'){
|
||||
//user expire
|
||||
$paginator = Paginator::build(ORM::for_table('tbl_user_recharges'));
|
||||
$expire = ORM::for_table('tbl_user_recharges')
|
||||
->where_lte('expiration', $mdate)
|
||||
->offset($paginator['startpoint'])
|
||||
->limit($paginator['limit'])
|
||||
->order_by_desc('expiration')
|
||||
->find_many();
|
||||
|
||||
// Get the total count of expired records for pagination
|
||||
$totalCount = ORM::for_table('tbl_user_recharges')
|
||||
// Get the total count of expired records for pagination
|
||||
$totalCount = ORM::for_table('tbl_user_recharges')
|
||||
->where_lte('expiration', $mdate)
|
||||
->count();
|
||||
|
||||
// Pass the total count and current page to the paginator
|
||||
$paginator['total_count'] = $totalCount;
|
||||
// Pass the total count and current page to the paginator
|
||||
$paginator['total_count'] = $totalCount;
|
||||
|
||||
// Assign the pagination HTML to the template variable
|
||||
$ui->assign('paginator', $paginator);
|
||||
$ui->assign('expire', $expire);
|
||||
// Assign the pagination HTML to the template variable
|
||||
$ui->assign('paginator', $paginator);
|
||||
$ui->assign('expire', $expire);
|
||||
}
|
||||
|
||||
//activity log
|
||||
$dlog = ORM::for_table('tbl_logs')->limit(5)->order_by_desc('id')->find_many();
|
||||
@ -79,13 +81,14 @@ $log = ORM::for_table('tbl_logs')->count();
|
||||
$ui->assign('log', $log);
|
||||
|
||||
|
||||
$cacheStocksfile = File::pathFixer('system/cache/VoucherStocks.temp');
|
||||
$cachePlanfile = File::pathFixer('system/cache/VoucherPlans.temp');
|
||||
//Cache for 5 minutes
|
||||
if(file_exists($cacheStocksfile) && time()- filemtime($cacheStocksfile) < 600){
|
||||
if($config['hide_vs'] != 'yes'){
|
||||
$cacheStocksfile = File::pathFixer('system/cache/VoucherStocks.temp');
|
||||
$cachePlanfile = File::pathFixer('system/cache/VoucherPlans.temp');
|
||||
//Cache for 5 minutes
|
||||
if(file_exists($cacheStocksfile) && time()- filemtime($cacheStocksfile) < 600){
|
||||
$stocks = json_decode(file_get_contents($cacheStocksfile), true);
|
||||
$plans = json_decode(file_get_contents($cachePlanfile), true);
|
||||
}else{
|
||||
}else{
|
||||
// Count stock
|
||||
$tmp = $v = ORM::for_table('tbl_plans')->select('id')->select('name_plan')->find_many();
|
||||
$plans = array();
|
||||
@ -109,6 +112,7 @@ if(file_exists($cacheStocksfile) && time()- filemtime($cacheStocksfile) < 600){
|
||||
}
|
||||
file_put_contents($cacheStocksfile, json_encode($stocks));
|
||||
file_put_contents($cachePlanfile, json_encode($plans));
|
||||
}
|
||||
}
|
||||
|
||||
$cacheMRfile = File::pathFixer('system/cache/monthlyRegistered.temp');
|
||||
@ -181,7 +185,6 @@ if(file_exists($cacheMSfile) && time()- filemtime($cacheMSfile) < 43200){
|
||||
|
||||
// Assign the monthly sales data to Smarty
|
||||
$ui->assign('monthlySales', $monthlySales);
|
||||
$ui->assign('xheader', '<script src="https://cdn.jsdelivr.net/npm/apexcharts@3.28.0/dist/apexcharts.min.js"></script>');
|
||||
$ui->assign('xfooter', '');
|
||||
$ui->assign('monthlyRegistered', $monthlyRegistered);
|
||||
$ui->assign('stocks', $stocks);
|
||||
|
@ -299,6 +299,23 @@ switch ($action) {
|
||||
}
|
||||
}
|
||||
|
||||
//checkbox
|
||||
$checks = ['hide_mrc','hide_tms','hide_aui','hide_al','hide_uet','hide_vs','hide_pg'];
|
||||
foreach ($checks as $check) {
|
||||
if(!isset($_POST[$check])){
|
||||
$d = ORM::for_table('tbl_appconfig')->where('setting', $check)->find_one();
|
||||
if ($d) {
|
||||
$d->value = 'no';
|
||||
$d->save();
|
||||
} else {
|
||||
$d = ORM::for_table('tbl_appconfig')->create();
|
||||
$d->setting = $check;
|
||||
$d->value = 'no';
|
||||
$d->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_log('[' . $admin['username'] . ']: ' . $_L['Settings_Saved_Successfully'], 'Admin', $admin['id']);
|
||||
|
||||
r2(U . 'settings/app', 's', $_L['Settings_Saved_Successfully']);
|
||||
|
@ -86,6 +86,24 @@
|
||||
<p class="help-block col-md-4">edit at config.php</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-heading">
|
||||
<div class="btn-group pull-right">
|
||||
<button class="btn btn-primary btn-xs" title="save" type="submit"><span
|
||||
class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span></button>
|
||||
</div>
|
||||
Hide Dashboard Content
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><input type="checkbox" name="hide_mrc" value="yes" {if $_c['hide_mrc'] eq 'yes'}checked{/if}> {Lang::T('Monthly Registered Customers')}</label>
|
||||
<label class="col-md-2 control-label"><input type="checkbox" name="hide_tms" value="yes" {if $_c['hide_tms'] eq 'yes'}checked{/if}> {Lang::T('Total Monthly Sales')}</label>
|
||||
<label class="col-md-2 control-label"><input type="checkbox" name="hide_aui" value="yes" {if $_c['hide_aui'] eq 'yes'}checked{/if}> {Lang::T('All Users Insights')}</label>
|
||||
<label class="col-md-2 control-label"><input type="checkbox" name="hide_al" value="yes" {if $_c['hide_al'] eq 'yes'}checked{/if}> {$_L['Activity_Log']}</label>
|
||||
<label class="col-md-2 control-label"><input type="checkbox" name="hide_uet" value="yes" {if $_c['hide_uet'] eq 'yes'}checked{/if}> {$_L['User_Expired_Today']}</label>
|
||||
<label class="col-md-2 control-label"><input type="checkbox" name="hide_vs" value="yes" {if $_c['hide_vs'] eq 'yes'}checked{/if}> Vouchers Stock</label>
|
||||
<label class="col-md-2 control-label"><input type="checkbox" name="hide_pg" value="yes" {if $_c['hide_pg'] eq 'yes'}checked{/if}> Payment Gateway</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-heading">
|
||||
<div class="btn-group pull-right">
|
||||
<button class="btn btn-primary btn-xs" title="save" type="submit"><span
|
||||
@ -417,7 +435,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-heading" id="envato">
|
||||
{* <div class="panel-heading" id="envato">
|
||||
<div class="btn-group pull-right">
|
||||
<button class="btn btn-primary btn-xs" title="save" type="submit"><span
|
||||
class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span></button>
|
||||
@ -444,7 +462,7 @@
|
||||
class="btn btn-xs btn-primary">View MarketPlace</a>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div> *}
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
|
@ -61,7 +61,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- solid sales graph -->
|
||||
<div class="box box-solid ">
|
||||
{if $_c['hide_mrc'] != 'yes'}
|
||||
<div class="box box-solid ">
|
||||
<div class="box-header">
|
||||
<i class="fa fa-th"></i>
|
||||
|
||||
@ -77,9 +78,12 @@
|
||||
<div class="box-body border-radius-none">
|
||||
<canvas class="chart" id="chart" style="height: 250px;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- solid sales graph -->
|
||||
<div class="box box-solid ">
|
||||
{if $_c['hide_tms'] != 'yes'}
|
||||
<div class="box box-solid ">
|
||||
<div class="box-header">
|
||||
<i class="fa fa-inbox"></i>
|
||||
|
||||
@ -95,10 +99,12 @@
|
||||
<div class="box-body border-radius-none">
|
||||
<canvas class="chart" id="salesChart" style="height: 250px;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
{if $_c['disable_voucher'] != 'yes' && $stocks['unused']>0 || $stocks['used']>0}
|
||||
{if $_c['hide_vs'] != 'yes'}
|
||||
<div class="panel panel-primary mb20 panel-hovered project-stats table-responsive">
|
||||
<div class="panel-heading">Vouchers Stock</div>
|
||||
<div class="table-responsive">
|
||||
@ -128,6 +134,8 @@
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
{if $_c['hide_uet'] != 'yes'}
|
||||
<div class="panel panel-warning mb20 panel-hovered project-stats table-responsive">
|
||||
<div class="panel-heading">{$_L['User_Expired_Today']}</div>
|
||||
<div class="table-responsive">
|
||||
@ -157,19 +165,25 @@
|
||||
</div>
|
||||
{$paginator['contents']}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-5">
|
||||
{if $_c['hide_pg'] != 'yes'}
|
||||
<div class="panel panel-success panel-hovered mb20 activities">
|
||||
<div class="panel-heading">{Lang::T('Payment Gateway')}: {$_c['payment_gateway']}</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $_c['hide_aui'] != 'yes'}
|
||||
<div class="panel panel-info panel-hovered mb20 activities">
|
||||
<div class="panel-heading">{Lang::T('All Users Insights')}</div>
|
||||
<div class="panel-body">
|
||||
<canvas id="userRechargesChart"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $_c['hide_al'] != 'yes'}
|
||||
<div class="panel panel-info panel-hovered mb20 activities">
|
||||
<div class="panel-heading"><a href="{$_url}logs">{$_L['Activity_Log']}</a></div>
|
||||
<div class="panel-body">
|
||||
@ -184,6 +198,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
@ -191,8 +206,10 @@
|
||||
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.5.1/dist/chart.min.js"></script>
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
|
||||
<script type="text/javascript">
|
||||
{if $_c['hide_mrc'] != 'yes'}
|
||||
{literal}
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var counts = JSON.parse('{/literal}{$monthlyRegistered|json_encode}{literal}');
|
||||
|
||||
@ -241,9 +258,10 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
{/literal}
|
||||
{/if}
|
||||
{if $_c['hide_tmc'] != 'yes'}
|
||||
{literal}
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var monthlySales = JSON.parse('{/literal}{$monthlySales|json_encode}{literal}');
|
||||
|
||||
@ -301,8 +319,10 @@
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
{/literal}
|
||||
{/if}
|
||||
{if $_c['hide_aui'] != 'yes'}
|
||||
{literal}
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// Get the data from PHP and assign it to JavaScript variables
|
||||
var u_act = '{/literal}{$u_act}{literal}';
|
||||
@ -345,8 +365,9 @@
|
||||
options: options
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
{/literal}
|
||||
{/if}
|
||||
</script>
|
||||
<script>
|
||||
window.addEventListener('DOMContentLoaded', function() {
|
||||
$.getJSON("./version.json?" + Math.random(), function(data) {
|
||||
|
@ -279,10 +279,10 @@
|
||||
<a href="{$_url}pluginmanager"><i class="glyphicon glyphicon-tasks"></i>
|
||||
{Lang::T('Plugin Manager')} <small class="label pull-right">Free</small></a>
|
||||
</li>
|
||||
<li {if $_routes[0] eq 'codecanyon'}class="active" {/if}>
|
||||
{* <li {if $_routes[0] eq 'codecanyon'}class="active" {/if}>
|
||||
<a href="{$_url}codecanyon"><i class="glyphicon glyphicon-shopping-cart"></i>
|
||||
Codecanyon.net <small class="label pull-right">Paid</small></a>
|
||||
</li>
|
||||
</li> *}
|
||||
</ul>
|
||||
</li>
|
||||
{$_MENU_AFTER_SETTINGS}
|
||||
|
Loading…
x
Reference in New Issue
Block a user