Exemplo n.º 1
0
 /**
  * @return obj
  */
 public function show()
 {
     if (!isset(self::$_instance)) {
         $show = __CLASS__;
         self::$_instance = new $show();
     }
     return self::$_instance;
 }
Exemplo n.º 2
0
 function invoicelistAction()
 {
     if (!Pandamp_Controller_Action_Helper_IsAllowed::isAllowed('membership', 'all')) {
         $this->_redirect(ROOT_URL . '/' . $this->_zl->getLanguage() . '/error/restricted');
     }
     $this->_helper->layout->setLayout('layout-customer-credential');
     $id = $this->_getParam("id");
     $userInvoiceList = App_Model_Show_Invoice::show()->getInvoiceById($id);
     $this->view->userInvoiceList = $userInvoiceList;
     $user = App_Model_Show_User::show()->getUserById($id);
     if ($user) {
         $this->view->user = $user;
     }
     $this->view->identity = $this->_user;
     /**
      * UPDATED:July 25, 2012
      * @modifiedDate: 2012-11-20 15:10N
      * @todo Invoice can add more than one
      * comment line 897-899
      */
     if ($this->getRequest()->isPost()) {
         if (isset($user['paymentId']) && $user['paymentId'] != 0) {
             $tblInvoice = new App_Model_Db_Table_Invoice();
             //			$where = $tblInvoice->getAdapter()->quoteInto("uid=?",$this->getRequest()->getPost('kopel'));
             //			$rowInvoice = $tblInvoice->fetchAll($where);
             //			if (count($rowInvoice) <= 0)
             //			{
             $rowInvoice = $tblInvoice->fetchNew();
             $rowInvoice->uid = $this->getRequest()->getPost('kopel');
             $rowInvoice->price = $this->getRequest()->getPost('price');
             $rowInvoice->discount = $this->getRequest()->getPost('disc');
             $rowInvoice->invoiceOutDate = $this->getRequest()->getPost('invoiceOutDate');
             $rowInvoice->invoiceConfirmDate = $this->getRequest()->getPost('invoiceConfirmDate');
             $rowInvoice->clientBankAccount = $this->getRequest()->getPost('clientBankAccount');
             $rowInvoice->isPaid = $this->getRequest()->getPost('isPaid');
             $rowInvoice->expirationDate = $this->getRequest()->getPost('expirationDate');
             $rowInvoice->save();
         } else {
             die('Lamanya berlangganan kosong, silahkan edit dulu data pelanggan');
         }
         $this->_redirect(ROOT_URL . '/' . $this->_zl->getLanguage() . '/customer/user/invoicelist/id/' . $this->getRequest()->getPost('kopel'));
         //			}
     }
 }