*
* @return array Array containing status, suggested view, and any data
*/
- public function __construct ($wpdb, $config)
+ public function __construct ( $wpdb, $config )
{
// Save WordPress Database object
* Note, the third parameter is a flag that indicates to the Contacts
* data class that it should flag a group of fields as 'view_only'.
*/
- parent::__construct(false, false, true);
+ parent::__construct( false, false, true );
}
$filterAccounts = false;
// Get any provided option
- if (isset($_REQUEST['option'])) {
+ if ( isset( $_REQUEST['option'] ) ) {
$option = $_REQUEST['option'];
}
$InvoiceTypesObj = new GlmDataInvoiceTypes( $this->wpdb, $this->config );
$invoiceTypes = $InvoiceTypesObj->getList();
// Sort the types by parent child
- $invoiceTypes = $InvoiceTypesObj->sortParentChild($invoiceTypes);
+ $invoiceTypes = $InvoiceTypesObj->sortParentChild( $invoiceTypes );
// Need to get the accounts
$Accounts = new GlmDataAccounts( $this->wpdb, $this->config );
$accounts = $Accounts->getList( '', 'ref_name' );
$view = 'editInvoice';
$InvoiceTypesObj = new GlmDataInvoiceTypes( $this->wpdb, $this->config );
$invoiceTypes = $InvoiceTypesObj->getList();
- $invoiceTypes = $InvoiceTypesObj->sortParentChild($invoiceTypes);
+ $invoiceTypes = $InvoiceTypesObj->sortParentChild( $invoiceTypes );
if ( isset( $invoiceTypes ) ) {
foreach ( $invoiceTypes as $invoiceType ) {
$invTypes[$invoiceType['id']] = array(
break;
case 'edit':
- $accounts = $this->editEntry($this->account_id);
+ $accounts = $this->editEntry( $this->account_id );
// If we have a good accounts
if ($accounts['status']) {
}
// If we're locked to a member as a contact user and the accounts member doesn't equal the contact member
- if ($lockedToMember && $accounts['fieldData']['ref_dest_id'] != $lockedToMember) {
+ if ( $lockedToMember && $accounts['fieldData']['ref_dest_id'] != $lockedToMember ) {
$haveTransactions = false;
$accounts = false;
}
// Need to remove any line items for the invoice also
// $accounts = $this->deleteTransactions($this->account_id);
- if ($accounts) {
+ if ( $accounts ) {
$invoiceDeleted = true;
} else {
$invoiceDeleteError = true;
) {
$accounts[$filterAccounts]['selected'] = true;
$where_params[] = "T.id = $filterAccounts";
+ } else if ( isset( $_REQUEST['searchName'] )
+ && $searchName = filter_var( $_REQUEST['searchName'], FILTER_SANITIZE_STRING )
+ ) {
+ // $where_parems[] = "T.";
}
// Get the list of accounts and determine number of accounts in list
$orderBy = 'ref_name';
- $accountsResult = $this->getList($where, $orderBy, true, 'id', $start, $limit);
- $totalAccounts = $this->getStats($where);
+ $accountsResult = $this->getList( $where, $orderBy, true, 'id', $start, $limit );
+ $totalAccounts = $this->getStats( $where );
// Get paging results
$numbDisplayed = $accountsResult['returned'];
$lastDisplayed = $accountsResult['last'];
- if ($start == 1) {
+ if ( $start == 1 ) {
$prevStart = false;
} else {
$prevStart = $start - $limit;
- if ($start < 1) {
+ if ( $start < 1 ) {
$start = 1;
}
}
- if ($accountsResult['returned'] == $limit) {
+ if ( $accountsResult['returned'] == $limit ) {
$nextStart = $start + $limit;
}
// since we're doing paging, we have to break out just the accounts data
$accounts = $accountsResult['list'];
- if (count($accounts)>0) {
+ if ( count( $accounts ) > 0 ) {
$haveAccounts = true;
}
- unset($accountsResult);
+ unset( $accountsResult );
// echo '<pre>$accounts: ' . print_r( $accounts, true ) . '</pre>';