From 5783ea05f985d0febb7cf19fac0fda43b52db596 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Fri, 26 Jul 2024 15:55:17 +0700 Subject: [PATCH] show Total Customer Balance --- system/controllers/dashboard.php | 4 ++ ui/ui/dashboard.tpl | 72 ++++++++++++++++---------------- version.json | 2 +- 3 files changed, 40 insertions(+), 38 deletions(-) diff --git a/system/controllers/dashboard.php b/system/controllers/dashboard.php index aee57c36..1858a334 100644 --- a/system/controllers/dashboard.php +++ b/system/controllers/dashboard.php @@ -55,6 +55,10 @@ if ($imonth == '') { } $ui->assign('imonth', $imonth); +$cb = ORM::for_table('tbl_customers')->whereGte('balance', 0)->sum('balance'); + +$ui->assign('cb', $cb); + $u_act = ORM::for_table('tbl_user_recharges')->where('status', 'on')->count(); if (empty($u_act)) { $u_act = '0'; diff --git a/ui/ui/dashboard.tpl b/ui/ui/dashboard.tpl index 45b409eb..1b9814ee 100644 --- a/ui/ui/dashboard.tpl +++ b/ui/ui/dashboard.tpl @@ -1,67 +1,64 @@ {include file="sections/header.tpl"}
-
-
-
-

{$_c['currency_code']} - {number_format($iday,0,$_c['dec_point'],$_c['thousands_sep'])}

-

{Lang::T('Income Today')}

+ {if in_array($_admin['user_type'],['SuperAdmin','Admin', 'Report'])} +
+
+
+

{$_c['currency_code']} + {number_format($iday,0,$_c['dec_point'],$_c['thousands_sep'])}

+
+
+ +
+ {Lang::T('Income Today')}
-
- -
- {Lang::T('View Reports')}
-
-
-
-
-

{$_c['currency_code']} - {number_format($imonth,0,$_c['dec_point'],$_c['thousands_sep'])}

- -

{Lang::T('Income This Month')}

+
+
+
+

{$_c['currency_code']} + {number_format($imonth,0,$_c['dec_point'],$_c['thousands_sep'])}

+
+
+ +
+ {Lang::T('Income This Month')}
-
- -
- {Lang::T('View Reports')}
-
+ {/if}
-

{$u_act}/{$u_all}

- -

{Lang::T('Users Active')}

+

{$u_act}/{$u_all-$u_act}

- {Lang::T('View All')} + {Lang::T('Active')}/{Lang::T('Expired')}
-

{$c_all}

- -

{Lang::T('Total Users')}

+

{$c_all}

- +
- {Lang::T('View All')} + {Lang::T('Customers')}
@@ -180,7 +177,8 @@
{if $_c['hide_pg'] != 'yes'}
-
{Lang::T('Payment Gateway')}: {str_replace(',',', ',$_c['payment_gateway'])}
+
{Lang::T('Payment Gateway')}: {str_replace(',',', ',$_c['payment_gateway'])} +
{/if} {if $_c['hide_aui'] != 'yes'} diff --git a/version.json b/version.json index dcbda585..4f057aaa 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "2024.7.25" + "version": "2024.7.26" } \ No newline at end of file