Пример #1
0
 public function init()
 {
     $resultdtID = new Zend_Form_Element_Hidden("result_dtl_id");
     $resultmodel = new Admin_Model_Result();
     $option = $resultmodel->getKeysAndValues();
     $result = new Zend_Form_Element_Hidden("result_id");
     $subjectmodel = new Admin_Model_Subject();
     $options = $subjectmodel->getKeysAndValues();
     $subject = new Zend_Form_Element_Select("subject_id");
     $subject->setLabel("Subject")->addMultiOptions($options)->setAttribs(array('class' => 'form-select'));
     $marks = new Zend_Form_Element_Text("marks");
     $marks->setLabel("Marks")->setAttribs(array('size' => 30, 'class' => 'form-text'))->setRequired(true);
     $submit = new Zend_Form_Element_Submit("submit");
     $submit->setLabel("Submit");
     $this->addElements(array($resultdtID, $result, $subject, $marks, $marks, $submit));
 }
Пример #2
0
 public function deleteAction()
 {
     $id = $this->_getParam('id', 0);
     $resultModel = new Admin_Model_Result();
     $this->view->id = $id;
     if ($this->getRequest()->isPost()) {
         try {
             $delete = $this->_getParam('delete');
             if ('Yes' == $delete) {
                 $resultModel->delete($id);
             }
             $this->_helper->redirector("index");
         } catch (Exception $e) {
             $this->view->message = $e->getMessage();
         }
     }
 }