Beispiel #1
0
 /**
  * Initialize the Home Page
  *
  * Gather billing stats and account stats from the database, then assign those
  * stats to template variables.
  */
 function init()
 {
     parent::init();
     // Current month
     $now = getDate(time());
     $this->smarty->assign("month", $now['month']);
     // Invoice Summary
     $stats = outstanding_invoices_stats();
     $this->smarty->assign("os_invoices_count", $stats['count']);
     $this->smarty->assign("os_invoices_total", $stats['total']);
     $this->smarty->assign("os_invoices_count_past_due", $stats['count_past_due']);
     $this->smarty->assign("os_invoices_total_past_due", $stats['total_past_due']);
     $this->smarty->assign("os_invoices_count_past_due_30", $stats['count_past_due_30']);
     $this->smarty->assign("os_invoices_total_past_due_30", $stats['total_past_due_30']);
     // Payment Summary
     $stats = payments_stats();
     $this->smarty->assign("payments_count", $stats['count']);
     $this->smarty->assign("payments_total", $stats['total']);
     // Account Summary
     $active_accounts = count_all_AccountDBO("status='Active'");
     $inactive_accounts = count_all_AccountDBO("status='Inactive'");
     $pending_accounts = count_all_AccountDBO("status='Pending'");
     $total_accounts = $active_accounts + $inactive_accounts;
     $this->smarty->assign("active_accounts_count", $active_accounts);
     $this->smarty->assign("inactive_accounts_count", $inactive_accounts);
     $this->smarty->assign("pending_accounts_count", $pending_accounts);
     $this->smarty->assign("total_accounts", $total_accounts);
 }
 /**
  * Initialize Accounts Page
  *
  * Gather account stats from the database and assign them to template variables.
  */
 function init()
 {
     parent::init();
     // Account Summary
     $active_accounts = count_all_AccountDBO("status='Active'");
     $inactive_accounts = count_all_AccountDBO("status='Inactive'");
     $pending_accounts = count_all_AccountDBO("status='Pending'");
     $total_accounts = $active_accounts + $inactive_accounts;
     $this->smarty->assign("active_accounts_count", $active_accounts);
     $this->smarty->assign("inactive_accounts_count", $inactive_accounts);
     $this->smarty->assign("pending_accounts_count", $pending_accounts);
     $this->smarty->assign("total_accounts", $total_accounts);
 }