Example #1
0
 public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     $this->setMethod('post');
     $bankModel = new App_Model_Bank();
     $bankMapper = new App_Model_BankMapper($bankModel);
     $allBanks = $bankMapper->fetchAll();
     $bankNames = array();
     foreach ($allBanks as $bank) {
         $bankNames[$bank->id] = $bank->bankName . " (" . $bank->identifier . ")";
     }
     $atmNetworkModel = new App_Model_AtmNetwork();
     $atmNetworkMapper = new App_Model_AtmNetworkMapper($atmNetworkModel);
     $allAtmNetworks = $atmNetworkMapper->fetchAll();
     $atmNetworkNames = array();
     foreach ($allAtmNetworks as $atmNetwork) {
         $atmNetworkNames[$atmNetwork->id] = $atmNetwork->name;
     }
     $this->addElement('select', 'BankId', array('label' => 'Bank', 'multiOptions' => $bankNames, 'required' => true));
     $this->addElement('select', 'AtmNetworkId', array('label' => 'Atm Network', 'multiOptions' => $atmNetworkNames, 'required' => true));
     $this->addElement('text', 'Latitude', array('label' => 'Latitude', 'required' => true));
     $this->addElement('text', 'Longitude', array('label' => 'Longitude', 'required' => true));
     $this->addElement('text', 'DescriptiveLocation', array('label' => 'Descriptive Location', 'required' => true));
     $this->addElement('text', 'Languages', array('label' => 'Languages', 'required' => true));
     $this->addElement('select', 'CardUsage', array('label' => 'Card Usage', 'multiOptions' => array('swipe', 'insert'), 'required' => true));
     $this->addElement('text', 'Charges', array('label' => 'Charges'));
     $this->addElement('text', 'OneTimeWithdrawLimit', array('label' => 'One Time Withdrawl Limit'));
     $this->addElement('text', 'AdditionalProperty', array('label' => 'Additional Property'));
     $this->addElement('text', 'Description', array('label' => 'Description'));
     $this->addElement('text', 'VerificationDescription', array('label' => 'Verification Description'));
     // Add the submit button
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Submit'));
     // And finally add some CSRF protection
     $this->addElement('hash', 'csrf', array('ignore' => true));
 }
 public function deleteAction()
 {
     $id = $this->getRequest()->getParam('id');
     $this->view->title = "Delete AtmNetwork ";
     $this->view->headTitle($this->view->title);
     if ($this->getRequest()->isPost()) {
         $del = $this->getRequest()->getPost('del');
         if ($del == 'Yes') {
             $id = $this->getRequest()->getPost('id');
             $tbl = new App_Model_AtmNetwork();
             $mapper = new App_Model_AtmNetworkMapper();
             $row = $tbl->find($id);
             $mapper->delete($tbl);
         }
         $this->_helper->redirector('index');
     } else {
         $tbl = new App_Model_AtmNetwork();
         $this->view->id = $id;
     }
 }
Example #3
0
 public function find($id)
 {
     $mapper = new App_Model_AtmNetworkMapper();
     $mapper->find($id, $this);
 }