3
* AccountTableWidget.class.php
5
* This file contains the definition of the AccountTableWidget class.
8
* @author John Diamond <jdiamond@solid-state.org>
9
* @copyright John Diamond <jdiamond@solid-state.org>
10
* @license http://www.opensource.org/licenses/gpl-license.php GNU Public License
17
* @author John Diamond <jdiamond@solid-state.org>
19
class AccountTableWidget extends TableWidget
22
* @var string Account status filter
24
private $statusFilter = null;
27
* Initialize the Table
29
* @param array $params Parameters from the {form_table} tag
31
public function init( $params )
33
parent::init( $params );
35
// Build an account filter
36
$where = isset( $this->statusFilter ) ?
37
sprintf( "status='%s'", $this->statusFilter ) : null;
39
// Load the Account Table
42
$accounts = load_array_AccountDBO( $where );
44
foreach( $accounts as $dbo )
46
// Put the row into the table
48
array( "id" => $dbo->getID(),
49
"accountname" => $dbo->getAccountName(),
50
"type" => $dbo->getType(),
51
"status" => $dbo->getStatus(),
52
"balance" => $dbo->getBalance(),
53
"billingstatus" => $dbo->getBillingStatus(),
54
"billingday" => $dbo->getBillingDay(),
55
"businessname" => $dbo->getBusinessName(),
56
"contactname" => $dbo->getContactName(),
57
"contactemail" => $dbo->getContactEmail() );
60
catch( DBNoRowsFoundException $e ) {}
64
* Set Account Status Filter
66
* @param string $status Account status
68
public function setStatus( $status )
70
$this->statusFilter = $status;
b'\\ No newline at end of file'