<?php //stop the direct browsing to this file - let index.php handle which files get displayed checkLogin(); $SI_PAYMENT_TYPES = new SimpleInvoices_Db_Table_PaymentTypes(); //TODO jsBegin(); jsFormValidationBegin("frmpost"); jsValidateRequired("pt_description",$LANG['payment_type_description']); jsFormValidationEnd(); jsEnd(); #get the invoice id $payment_type_id = $_GET['id']; $paymentType = $SI_PAYMENT_TYPES->getPaymentTypeById($payment_type_id); $smarty->assign('paymentType',$paymentType); $smarty -> assign('pageActive', 'payment_type'); $subPageActive = $_GET['action'] =="view" ? "payment_types_view" : "payment_types_edit" ; $smarty -> assign('subPageActive', $subPageActive); $smarty -> assign('active_tab', '#setting'); ?>
//$invoice = invoice::select($_GET['id']); $invoice = new SimpleInvoices_Invoice($_GET['id']); // NOTE: Doesn't this mess up payments? //else { // $sth = dbQuery("SELECT * FROM ".TB_PREFIX."invoices"); // $invoice = $sth->fetch(); // #$sth = new invoice(); // #$invoice = $sth->select_all(); //} $customer = $invoice->getCustomer(); $biller = $invoice->getBiller(); $defaults = $SI_SYSTEM_DEFAULTS->fetchAll(); $pt = $SI_PAYMENT_TYPES->getPaymentTypeById($defaults['payment_type']); $invoices = new invoice(); $invoices->sort='id'; $invoices->having='money_owed'; $invoice_all = $invoices->select_all('count'); $smarty -> assign('invoice_all',$invoice_all); $paymentTypes = $SI_PAYMENT_TYPES->fetchAllActive(); $smarty -> assign("paymentTypes",$paymentTypes); $smarty -> assign("defaults",$defaults); $smarty -> assign("biller",$biller->toArray()); $smarty -> assign("customer",$customer->toArray()); $smarty -> assign("invoice",$invoice->toArray()); $smarty -> assign("today",$today);
public function getType() { $paymentTypes = new SimpleInvoices_Db_Table_PaymentTypes(); return $paymentTypes->getPaymentTypeById($this->_data['ac_payment_type']); }