fix date range dashboard
This commit is contained in:
parent
d5d03875f0
commit
5c33806326
@ -25,16 +25,17 @@ if(empty($reset_day)){
|
||||
$reset_day = 1;
|
||||
}
|
||||
//first day of month
|
||||
if($reset_day >= date("d")){
|
||||
$first_day_month = date('Y-m-'.$reset_day);
|
||||
if (date("d") >= $reset_day) {
|
||||
$start_date = date('Y-m-' . $reset_day);
|
||||
} else {
|
||||
$first_day_month = date('Y-m-'.$reset_day, strtotime("-1 MONTH"));
|
||||
$start_date = date('Y-m-' . $reset_day, strtotime("-1 MONTH"));
|
||||
}
|
||||
$mdate = date('Y-m-d');
|
||||
|
||||
$current_date = date('Y-m-d');
|
||||
$month_n = date('n');
|
||||
|
||||
$iday = ORM::for_table('tbl_transactions')
|
||||
->where('recharged_on', $mdate)
|
||||
->where('recharged_on', $current_date)
|
||||
->where_not_equal('method', 'Customer - Balance')
|
||||
->where_not_equal('method', 'Recharge Balance - Administrator')
|
||||
->sum('price');
|
||||
@ -44,7 +45,11 @@ if ($iday == '') {
|
||||
}
|
||||
$ui->assign('iday', $iday);
|
||||
|
||||
$imonth = ORM::for_table('tbl_transactions')->where_not_equal('method', 'Customer - Balance')->where_not_equal('method', 'Recharge Balance - Administrator')->where_gte('recharged_on', $first_day_month)->where_lte('recharged_on', $mdate)->sum('price');
|
||||
$imonth = ORM::for_table('tbl_transactions')
|
||||
->where_not_equal('method', 'Customer - Balance')
|
||||
->where_not_equal('method', 'Recharge Balance - Administrator')
|
||||
->where_gte('recharged_on', $start_date)
|
||||
->where_lte('recharged_on', $current_date)->sum('price');
|
||||
if ($imonth == '') {
|
||||
$imonth = '0.00';
|
||||
}
|
||||
@ -72,13 +77,13 @@ $ui->assign('c_all', $c_all);
|
||||
if ($config['hide_uet'] != 'yes') {
|
||||
//user expire
|
||||
$query = ORM::for_table('tbl_user_recharges')
|
||||
->where_lte('expiration', $mdate)
|
||||
->where_lte('expiration', $current_date)
|
||||
->order_by_desc('expiration');
|
||||
$expire = Paginator::findMany($query);
|
||||
|
||||
// Get the total count of expired records for pagination
|
||||
$totalCount = ORM::for_table('tbl_user_recharges')
|
||||
->where_lte('expiration', $mdate)
|
||||
->where_lte('expiration', $current_date)
|
||||
->count();
|
||||
|
||||
// Pass the total count and current page to the paginator
|
||||
@ -200,7 +205,8 @@ if (file_exists($cacheMSfile) && time() - filemtime($cacheMSfile) < 43200) {
|
||||
}
|
||||
|
||||
// Assign the monthly sales data to Smarty
|
||||
$ui->assign('first_day_month',$first_day_month);
|
||||
$ui->assign('start_date', $start_date);
|
||||
$ui->assign('current_date', $current_date);
|
||||
$ui->assign('monthlySales', $monthlySales);
|
||||
$ui->assign('xfooter', '');
|
||||
$ui->assign('monthlyRegistered', $monthlyRegistered);
|
||||
|
@ -1,6 +1,5 @@
|
||||
{include file="sections/header.tpl"}
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-xs-6">
|
||||
<div class="small-box bg-aqua">
|
||||
@ -22,7 +21,7 @@
|
||||
<h4><sup>{$_c['currency_code']}</sup>
|
||||
{number_format($imonth,0,$_c['dec_point'],$_c['thousands_sep'])}</h4>
|
||||
|
||||
<p title="from {$first_day_month}">{Lang::T('Income This Month')}</p>
|
||||
<p>{Lang::T('Income This Month')}</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-stats-bars"></i>
|
||||
@ -60,6 +59,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ol class="breadcrumb">
|
||||
<li>{Lang::dateFormat($start_date)}</li>
|
||||
<li>{Lang::dateFormat($current_date)}</li>
|
||||
</ol>
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
|
||||
@ -156,7 +159,8 @@
|
||||
<tr>
|
||||
<td><a href="{$_url}customers/viewu/{$expired['username']}">{$expired['username']}</a></td>
|
||||
<td><small data-toggle="tooltip" data-placement="top"
|
||||
title="{Lang::dateAndTimeFormat($expired['recharged_on'],$expired['recharged_time'])}">{Lang::timeElapsed($rem_started)}</small> /
|
||||
title="{Lang::dateAndTimeFormat($expired['recharged_on'],$expired['recharged_time'])}">{Lang::timeElapsed($rem_started)}</small>
|
||||
/
|
||||
<span data-toggle="tooltip" data-placement="top"
|
||||
title="{Lang::dateAndTimeFormat($expired['expiration'],$expired['time'])}">{Lang::timeElapsed($rem_exp)}</span>
|
||||
</td>
|
||||
@ -176,7 +180,7 @@
|
||||
<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 class="panel-heading">{Lang::T('Payment Gateway')}: {str_replace(',',', ',$_c['payment_gateway'])}</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $_c['hide_aui'] != 'yes'}
|
||||
@ -399,7 +403,8 @@
|
||||
timerProgressBar: true,
|
||||
didOpen: (toast) => {
|
||||
toast.addEventListener('mouseenter', Swal.stopTimer)
|
||||
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
||||
toast.addEventListener('mouseleave', Swal
|
||||
.resumeTimer)
|
||||
}
|
||||
});
|
||||
setCookie(latestVersion, 'done', 7);
|
||||
|
Loading…
x
Reference in New Issue
Block a user