Beispiel #1
0
 public function report_description_content()
 {
     $dbc = $this->connection;
     $dbc->selectDB($this->config->get('OP_DB'));
     $memtypes = new MemtypeModel($dbc);
     $ret = 'List of: ';
     if (!is_array($this->form->type)) {
         $this->form->type = array($this->form->type);
     }
     foreach ($this->form->type as $type) {
         $memtypes->memtype($type);
         $memtypes->load();
         $ret .= $memtypes->memDesc() . ', ';
     }
     return array($ret);
 }
Beispiel #2
0
 /**
   Get account using newer tables
 */
 private static function getAccount($dbc, $id)
 {
     if ($id == 0) {
         return self::getAllAccounts($dbc);
     }
     $account = new \CustomerAccountsModel($dbc);
     $customers = new \CustomersModel($dbc);
     $account->cardNo($id);
     if (!$account->load()) {
         // migrate already at this point?
         return false;
     }
     $customers->customerAccountID($account->customerAccountID());
     $ret = $account->toJSON();
     $ret['customers'] = array();
     foreach ($customers->find('accountHolder', true) as $c) {
         $ret['customers'][] = $c->toJSON();
     }
     $type = new \MemtypeModel($dbc);
     $type->memtype($account->customerTypeID());
     $type->load();
     $ret['customerType'] = $type->memDesc();
     return $ret;
 }