diff --git a/public/include/classes/base.class.php b/public/include/classes/base.class.php
index 3afba032..9d6bdf48 100644
--- a/public/include/classes/base.class.php
+++ b/public/include/classes/base.class.php
@@ -115,6 +115,32 @@ class Base {
}
}
+ /**
+ * Fetch count of all entries in table
+ * @param none
+ * @param data mixed Count or false
+ **/
+ public function getCount() {
+ $this->debug->append("STA " . __METHOD__, 4);
+ $stmt = $this->mysqli->prepare("SELECT COUNT(id) AS count FROM $this->table");
+ if ($this->checkStmt($stmt) && $stmt->execute() && $result = $stmt->get_result())
+ return $result->fetch_object()->count;
+ return $this->sqlError();
+ }
+
+ /**
+ * Fetch count of all entries in table filtered by a column/value
+ * @param none
+ * @param data mixed Count or false
+ **/
+ public function getCountFiltered($column='id', $value=NULL, $type='i') {
+ $this->debug->append("STA " . __METHOD__, 4);
+ $stmt = $this->mysqli->prepare("SELECT COUNT(id) AS count FROM $this->table WHERE $column = ?");
+ if ($this->checkStmt($stmt) && $stmt->bind_param($type, $value) && $stmt->execute() && $result = $stmt->get_result())
+ return $result->fetch_object()->count;
+ return $this->sqlError();
+ }
+
/**
* Fetch all entries as an assoc array from a table
* This should, in general, not be used but sometimes it's just easier
diff --git a/public/include/pages/admin/dashboard.inc.php b/public/include/pages/admin/dashboard.inc.php
index af32639a..53284c1c 100644
--- a/public/include/pages/admin/dashboard.inc.php
+++ b/public/include/pages/admin/dashboard.inc.php
@@ -36,6 +36,15 @@ foreach ($aCrons as $strCron) {
$smarty->assign('CRON_ERROR', $cron_errors);
$smarty->assign('CRON_DISABLED', $cron_disabled);
+// Fetch user information
+$aUserInfo = array(
+ 'total' => $user->getCount(),
+ 'locked' => $user->getCountFiltered('is_locked', 1),
+ 'admins' => $user->getCountFiltered('is_admin', 1),
+ 'nofees' => $user->getCountFiltered('no_fees', 1)
+);
+$smarty->assign('USER_INFO', $aUserInfo);
+
// Wallet status
$smarty->assign('WALLET_ERROR', $aGetInfo['errors']);
diff --git a/public/templates/mpos/admin/dashboard/default.tpl b/public/templates/mpos/admin/dashboard/default.tpl
index 2ac4b0a4..dc216a57 100644
--- a/public/templates/mpos/admin/dashboard/default.tpl
+++ b/public/templates/mpos/admin/dashboard/default.tpl
@@ -34,6 +34,29 @@
+
+
+
+
+
+
+ | Total |
+ Locked |
+ Admins |
+ No Fees |
+
+
+
+
+ | {$USER_INFO.total} |
+ {$USER_INFO.locked} |
+ {$USER_INFO.admins} |
+ {$USER_INFO.nofees} |
+
+
+
+
+