From a68710d507670c94aaca75f6ecb4e9bce693d494 Mon Sep 17 00:00:00 2001 From: SJ Date: Wed, 18 Sep 2013 22:59:51 +0200 Subject: [PATCH] minor accounting improvements --- webui/controller/accounting/accounting.php | 7 +++++++ webui/model/domain/domain.php | 6 ++++++ .../theme/default/templates/accounting/accounting.tpl | 6 +++--- .../theme/mobile/templates/accounting/accounting.tpl | 11 +++++++---- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/webui/controller/accounting/accounting.php b/webui/controller/accounting/accounting.php index 9531a720..880f58ce 100644 --- a/webui/controller/accounting/accounting.php +++ b/webui/controller/accounting/accounting.php @@ -14,6 +14,7 @@ class ControllerAccountingAccounting extends Controller { $this->load->model('user/user'); $this->load->model('group/group'); + $this->load->model('domain/domain'); $this->load->model('accounting/accounting'); if(ENABLE_SAAS == 1) { $this->load->model('saas/ldap'); @@ -70,12 +71,18 @@ class ControllerAccountingAccounting extends Controller { $this->data['accounting'] = $this->model_accounting_accounting->get_accounting('domain',$this->data['search'], $this->data['page'], $this->data['page_len'], $this->data['sort'], $this->data['order']); $this->data['total_records'] = $this->model_accounting_accounting->count_accounting('domain',$this->data['search']); + $this->data['mydomain_count'] = $this->model_domain_domain->count_mydomains(); + $this->data['user_count'] = 0; + if(ENABLE_SAAS == 1) { $this->data['accounts'] = array(); foreach($this->data['accounting'] as $a) { $this->data['accounts'][$a['item']] = $this->model_saas_ldap->get_accounts_in_domain($a['item']); + + $this->data['user_count'] += count($this->data['accounts'][$a['item']]); } + } } diff --git a/webui/model/domain/domain.php b/webui/model/domain/domain.php index a27c0527..20494250 100644 --- a/webui/model/domain/domain.php +++ b/webui/model/domain/domain.php @@ -2,6 +2,12 @@ class ModelDomainDomain extends Model { + public function count_mydomains() { + $query = $this->db->query("SELECT count(*) AS num FROM " . TABLE_DOMAIN); + return $query->row['num']; + } + + public function getDomains($s = '') { $data = array(); diff --git a/webui/view/theme/default/templates/accounting/accounting.tpl b/webui/view/theme/default/templates/accounting/accounting.tpl index c1613f44..a9d44219 100644 --- a/webui/view/theme/default/templates/accounting/accounting.tpl +++ b/webui/view/theme/default/templates/accounting/accounting.tpl @@ -27,15 +27,15 @@ - + - + - + diff --git a/webui/view/theme/mobile/templates/accounting/accounting.tpl b/webui/view/theme/mobile/templates/accounting/accounting.tpl index 583928c1..0491ee7d 100644 --- a/webui/view/theme/mobile/templates/accounting/accounting.tpl +++ b/webui/view/theme/mobile/templates/accounting/accounting.tpl @@ -22,17 +22,20 @@
 
 
 
+ +
 
+ +
 
 
 
 
-
 
-
+
()
-
+
()
@@ -50,7 +53,7 @@
-
+
  
() ()