mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-07 22:41:59 +01:00
minor accounting improvements
This commit is contained in:
parent
bf3da73f17
commit
a68710d507
@ -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']]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -27,15 +27,15 @@
|
||||
<table class="table table-striped table-condensed">
|
||||
|
||||
<tr>
|
||||
<th colspan="3"> </th>
|
||||
<th colspan="<?php if(ENABLE_SAAS == 1 && $view == 'domain') { ?>5<?php } else { ?>4<?php } ?>"> </th>
|
||||
<th colspan="3"><?php print $text_sent; ?></th>
|
||||
<th colspan="3"><?php print $text_received; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $viewname; ?> <a href="index.php?route=accounting/accounting&view=<?php echo $view; ?>&sort=item&order=0"><i class="icon-chevron-up"></i></a> <a href="index.php?route=accounting/accounting&view=<?php echo $view; ?>&sort=item&order=1"><i class="icon-chevron-down"></i></a></th>
|
||||
<th><?php echo $viewname; ?> <?php if(ENABLE_SAAS == 1 && $view == 'domain') { ?>(<?php print $mydomain_count; ?>)<?php } ?> <a href="index.php?route=accounting/accounting&view=<?php echo $view; ?>&sort=item&order=0"><i class="icon-chevron-up"></i></a> <a href="index.php?route=accounting/accounting&view=<?php echo $view; ?>&sort=item&order=1"><i class="icon-chevron-down"></i></a></th>
|
||||
|
||||
<?php if(ENABLE_SAAS == 1 && $view == 'domain') { ?>
|
||||
<th><?php print $text_users; ?></th>
|
||||
<th><?php print $text_users; ?> (<?php print $user_count; ?>)</th>
|
||||
<?php } ?>
|
||||
|
||||
<th><?php print $text_oldest_record; ?> <a href="index.php?route=accounting/accounting&view=<?php echo $view; ?>&sort=oldest&order=0"><i class="icon-chevron-up"></i></a> <a href="index.php?route=accounting/accounting&view=<?php echo $view; ?>&sort=oldest&order=1"><i class="icon-chevron-down"></i></a></th>
|
||||
|
@ -22,17 +22,20 @@
|
||||
<div class="domaincell"> </div>
|
||||
<div class="domaincell"> </div>
|
||||
<div class="domaincell"> </div>
|
||||
<?php if(ENABLE_SAAS == 1 && $view == 'domain') { ?>
|
||||
<div class="domaincell"> </div>
|
||||
<?php } ?>
|
||||
<div class="domaincell"> </div>
|
||||
<div class="domaincell"><?php print $text_sent; ?></div>
|
||||
<div class="domaincell"> </div>
|
||||
<div class="domaincell"> </div>
|
||||
<div class="domaincell"><?php print $text_received; ?></div>
|
||||
<div class="domaincell"> </div>
|
||||
<div class="domaincell"> </div>
|
||||
</div>
|
||||
<div class="domainrow">
|
||||
<div class="domaincell"><?php echo $viewname; ?> <a href="index.php?route=accounting/accounting&view=<?php echo $view; ?>&sort=item&order=0"><i class="icon-chevron-up"></i></a> <a href="index.php?route=accounting/accounting&view=<?php echo $view; ?>&sort=item&order=1"><i class="icon-chevron-down"></i></a></div>
|
||||
<div class="domaincell"><?php echo $viewname; ?> <?php if(ENABLE_SAAS == 1 && $view == 'domain') { ?>(<?php print $mydomain_count; ?>)<?php } ?> <a href="index.php?route=accounting/accounting&view=<?php echo $view; ?>&sort=item&order=0"><i class="icon-chevron-up"></i></a> <a href="index.php?route=accounting/accounting&view=<?php echo $view; ?>&sort=item&order=1"><i class="icon-chevron-down"></i></a></div>
|
||||
<?php if(ENABLE_SAAS == 1 && $view == 'domain') { ?>
|
||||
<div class="domaincell"><?php print $text_users; ?></div>
|
||||
<div class="domaincell"><?php print $text_users; ?> (<?php print $user_count; ?>)</div>
|
||||
<?php } ?>
|
||||
<div class="domaincell"><?php print $text_oldest_record; ?> <a href="index.php?route=accounting/accounting&view=<?php echo $view; ?>&sort=oldest&order=0"><i class="icon-chevron-up"></i></a> <a href="index.php?route=accounting/accounting&view=<?php echo $view; ?>&sort=oldest&order=1"><i class="icon-chevron-down"></i></a></div>
|
||||
<div class="domaincell"><?php print $text_newest_record; ?> <a href="index.php?route=accounting/accounting&view=<?php echo $view; ?>&sort=newest&order=0"><i class="icon-chevron-up"></i></a> <a href="index.php?route=accounting/accounting&view=<?php echo $view; ?>&sort=newest&order=1"><i class="icon-chevron-down"></i></a></div>
|
||||
@ -50,7 +53,7 @@
|
||||
<div class="domaincell"><?php echo $details['item']; ?></div>
|
||||
|
||||
<?php if(ENABLE_SAAS == 1 && $view == 'domain') { ?>
|
||||
<div><a href="index.php?route=accounting/accounting&view=accounts&domain=<?php echo $details['item']; ?>"><?php echo count($accounts[$details['item']]); ?></a></div>
|
||||
<div class="domaincell center"><a href="index.php?route=accounting/accounting&view=accounts&domain=<?php echo $details['item']; ?>"><?php echo count($accounts[$details['item']]); ?></a></div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="domaincell"><?php echo date(DATE_TEMPLATE, $details['oldest']); ?></div>
|
||||
|
Loading…
Reference in New Issue
Block a user