$val) { $rows[] = array(array($col, 'width=1%'), $val); } echo('' . "\n"); echo(' ' . "\n"); echo $html->tableCells(array(array('Name', $tenant['Contact']['display_name']), array('Company', $tenant['Contact']['company_name']), array('SSN', $tenant['Contact']['id_federal']), array('ID', $tenant['Contact']['id_num'] . ($tenant['Contact']['id_state'] ? " - ".$tenant['Contact']['id_state'] : ""))), null, array('class' => "altrow"), false, false); echo('
Tenant Info
' . "\n"); /********************************************************************** * Phones */ $headers = array('Location', 'Preference', 'Type', 'Phone', 'Extension', 'Comment'); $rows = array(); foreach($tenant['ContactPhone'] AS $phone) { $rows[] = array($phone['ContactsMethod']['type'], $phone['ContactsMethod']['preference'], $phone['type'], phone($phone['phone']), $phone['ext'], $phone['comment']); } if (count($rows)) { echo('' . "\n"); echo(' ' . "\n"); echo $html->tableHeaders($headers); echo $html->tableCells($rows, null, array('class' => "altrow"), false, false); echo('
Phone
' . "\n"); } /********************************************************************** * Emails */ $headers = array('Location', 'Preference', 'Email', 'Comment'); $rows = array(); foreach($tenant['ContactEmail'] AS $email) { $rows[] = array($email['ContactsMethod']['type'], $email['ContactsMethod']['preference'], $email['email'], $email['comment']); } if (count($rows)) { echo('' . "\n"); echo(' ' . "\n"); echo $html->tableHeaders($headers); echo $html->tableCells($rows, null, array('class' => "altrow"), false, false); echo('
Email
' . "\n"); } /********************************************************************** * Addresses */ $headers = array('Location', 'Preference', 'Address', 'City', 'State', 'Zip', 'Country', 'Comment'); $rows = array(); foreach($tenant['ContactAddress'] AS $address) { $rows[] = array($address['ContactsMethod']['type'], $address['ContactsMethod']['preference'], $address['address'], $address['city'], $address['state'], $address['postcode'], $address['country'], $address['comment']); } if (count($rows)) { echo('' . "\n"); echo(' ' . "\n"); echo $html->tableHeaders($headers); echo $html->tableCells($rows, null, array('class' => "altrow"), false, false); echo('
Address
' . "\n"); } /********************************************************************** * Ledger History */ $grand_total = 0; foreach($tenant['Lease'] AS $lease) { $headers = array('Date', /*'Through',*/ /*'Charge/Receipt'*/'ID', 'Type', 'Comment', 'Amount', 'Total'); $rows = array(); $running_total = 0; foreach($lease['Charge'] AS $charge) { $amount = $charge['total']; $running_total += $amount; $rows[] = array(date_format(date_create($charge['charge_date']), $date_fmt) . ' - ' . date_format(date_create($charge['charge_to_date']), $date_fmt), '#'.$charge['id'], $charge['ChargeType']['name'], $charge['comment'], currency($amount), currency($running_total)); foreach ($charge['Receipt'] AS $receipt) { $amount = -1 * $receipt['ChargesReceipt']['amount']; $running_total += $amount; $rows[] = array(' -- ' .date_format(date_create($receipt['stamp']), $date_fmt), //null, '#'.$receipt['id'], 'Payment/Receipt', $receipt['comment'], currency($amount), currency($running_total)); } } $grand_total += $running_total; echo('' . "\n"); echo(' ' . "\n"); echo $html->tableHeaders($headers); echo $html->tableCells($rows, null, array('class' => "altrow"), false, false); echo('
Lease #'.$lease['number'].' (Unit '.$lease['Unit']['name'].')
' . "\n"); } ?>

Outstanding Balance: