This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/application/classes/Controller/Admin/Welcome.php

111 lines
3.3 KiB
PHP
Raw Normal View History

2011-08-16 02:27:19 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* OSB Admin Main home page
*
* @package OSB
* @subpackage Page/Home
* @category Controllers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
2011-12-09 04:10:53 +00:00
class Controller_Admin_Welcome extends Controller_TemplateDefault_Admin {
2011-08-16 02:27:19 +00:00
public $secure_actions = array(
'index'=>TRUE,
);
public function action_index() {
2012-11-09 23:13:57 +00:00
$ao = ORM::factory('Account',Auth::instance()->get_user()->id);
2011-08-16 02:27:19 +00:00
$t = time();
// Show outstanding invoices
2012-11-09 23:13:57 +00:00
$o = ORM::factory('Invoice');
2011-08-16 02:27:19 +00:00
Block_Sub::add(array(
2011-09-27 11:22:13 +00:00
'title'=>'Invoices Overdue - No Auto Billing',
'body'=>Table::display(
2011-09-27 11:22:13 +00:00
$o->list_overdue_billing($t),
25,
array(
'due_date'=>array('label'=>'Due Date'),
2011-10-12 22:20:08 +00:00
'account->accnum()'=>array('label'=>'Num'),
'account->name()'=>array('label'=>'Account'),
'account->display("status")'=>array('label'=>'Active'),
'id'=>array('label'=>'ID','url'=>URL::link('user','invoice/view/')),
'total(TRUE)'=>array('label'=>'Total','class'=>'right'),
'due(TRUE)'=>array('label'=>'Amount Due','class'=>'right'),
),
array('page'=>TRUE)),
2011-08-16 02:27:19 +00:00
'position'=>1,
'order'=>1,
));
2011-09-27 11:22:13 +00:00
Block_Sub::add(array(
'title'=>'Invoices Overdue - Auto Billing',
'body'=>Table::display(
$o->list_overdue_billing($t,TRUE),
25,
array(
'due_date'=>array('label'=>'Due Date'),
2011-10-12 22:20:08 +00:00
'account->accnum()'=>array('label'=>'Num'),
2011-09-27 11:22:13 +00:00
'account->name()'=>array('label'=>'Account'),
'account->display("status")'=>array('label'=>'Active'),
'id'=>array('label'=>'ID','url'=>URL::link('user','invoice/view/')),
'total(TRUE)'=>array('label'=>'Total','class'=>'right'),
2011-09-27 11:22:13 +00:00
'due(TRUE)'=>array('label'=>'Amount Due','class'=>'right'),
),
array('page'=>TRUE)),
'position'=>2,
'order'=>1,
));
2011-08-16 02:27:19 +00:00
Block_Sub::add(array(
'title'=>'Invoices Due',
'body'=>Table::display(
$o->list_due(),
25,
array(
'due_date'=>array('label'=>'Due Date'),
2011-10-12 22:20:08 +00:00
'account->accnum()'=>array('label'=>'Num'),
'account->name()'=>array('label'),
'account->display("status")'=>array('label'=>'Active'),
'id'=>array('label'=>'ID','url'=>URL::link('user','invoice/view/')),
'total(TRUE)'=>array('label'=>'Total','class'=>'right'),
'due(TRUE)'=>array('label'=>'Amount Due','class'=>'right'),
),
array('show_other'=>'due()')),
2011-09-27 11:22:13 +00:00
'position'=>3,
2011-08-16 02:27:19 +00:00
'order'=>1,
));
2012-08-01 12:43:33 +00:00
// Show un-applied payments
2011-08-16 02:27:19 +00:00
Block_Sub::add(array(
'title'=>'Unapplied Payments',
'body'=>Table::display(
2012-11-09 23:13:57 +00:00
ORM::factory('Payment')->list_unapplied(),
25,
array(
'date_payment'=>array('label'=>'Pay Date'),
2011-10-12 22:20:08 +00:00
'account->accnum()'=>array('label'=>'Num'),
'account->name()'=>array('label'=>'Account'),
'account->display("status")'=>array('label'=>'Active'),
'id'=>array('label'=>'ID','url'=>URL::link('admin','payment/view/')),
'total_amt'=>array('label'=>'Total','class'=>'right'),
'balance(TRUE)'=>array('label'=>'Balance','class'=>'right'),
),
array('show_other'=>'balance()')),
2011-09-27 11:22:13 +00:00
'position'=>1,
'order'=>2,
2011-08-16 02:27:19 +00:00
));
Block::add(array(
'title'=>sprintf('%s: %s %s',$ao->accnum(),$ao->first_name,$ao->last_name),
'subtitle'=>_('Administrator Overview'),
'body'=>(string)Block_Sub::factory(),
));
}
}
?>