Example #1
0
 public function FrmSetServicePrice($data = null)
 {
     $_db = new Application_Model_DbTable_DbGlobal();
     $_year = $this->_year;
     $_session = $this->_session;
     $_batch = new Zend_Dojo_Form_Element_NumberTextBox("batch");
     $_batch->setAttribs(array('dojoType' => $this->t_num, 'required' => 'true', 'class' => 'fullside'));
     // 		$this->_year->setAttribs(array(
     // 				'data-dojo-Type'=>$this->tvalidate,
     // 				'data-dojo-props'=>"regExp:'[0-5]{1}',
     // 				'required':true,'class':'fullside',
     // 				'invalidMessage':'អាចបញ្ជូលពី 1 ដល់  5'"));
     $_degree = new Zend_Dojo_Form_Element_FilteringSelect('degree');
     $_degree->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'Onchange' => 'CheckDegree()'));
     $arr_opt = $_db->getAllDegree();
     $_degree->setMultiOptions($arr_opt);
     $_remark = new Zend_Dojo_Form_Element_TextBox('remark');
     $_remark->setAttribs(array('dojoType' => $this->text, 'class' => 'fullside'));
     $rows = $_db->getAllFecultyName();
     array_unshift($rows, array('dept_id' => -1, 'en_name' => "Add New"));
     $opt = "";
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $opt[$row['dept_id']] = $row['en_name'];
         }
     }
     $_faculty = new Zend_Dojo_Form_Element_FilteringSelect("faculty");
     $_faculty->setMultiOptions($opt);
     $_faculty->setAttribs(array('dojoType' => $this->filter, 'required' => 'true', 'class' => 'fullside', 'onchange' => 'showPopupDept()'));
     $_term = new Zend_Dojo_Form_Element_FilteringSelect("payment_term");
     $opt_term = $_db->getAllPaymentTerm();
     $_term->setMultiOptions($opt_term);
     $_term->setAttribs(array('dojoType' => $this->filter, 'required' => 'true', 'class' => 'fullside'));
     $_create_date = new Zend_Dojo_Form_Element_DateTextBox("create_date");
     $_create_date->setAttribs(array('dojoType' => $this->date, 'required' => 'true', 'class' => 'fullside'));
     $_create_date->setValue(date("Y-m-d"));
     $_rank = new Zend_Dojo_Form_Element_FilteringSelect("rank");
     $opt_rank = $_db->getAllMention();
     $_rank->setMultiOptions($opt_rank);
     $_rank->setAttribs(array('dojoType' => $this->filter, 'required' => 'true', 'class' => 'fullside'));
     $this->addElements(array($_degree, $_faculty, $_batch, $_year, $_session, $_term, $_remark, $_rank, $_create_date));
     return $this;
 }
Example #2
0
 public function editFeetuitionAction()
 {
     if ($this->getRequest()->isPost()) {
         try {
             $_data = $this->getRequest()->getPost();
             $_model = new Accounting_Model_DbTable_DbTuitionFee();
             $rs = $_model->addTuitionFee($_data);
             if (!empty($rs)) {
                 Application_Form_FrmMessage::Sucessfull("INSERT_SUCCESS", "/accounting/fee/add-feetuition");
             }
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("INSERT_FAIL");
             Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
         }
     }
     $id = $this->getRequest()->getParam('id');
     if (!empty($id)) {
         $_model = new Accounting_Model_DbTable_DbTuitionFee();
         $_rs = $_model->addTuitionFee($_data);
     } else {
         $this->_redirect("/accounting/fee/");
     }
     $frm = new Accounting_Form_FrmServicePrice();
     $frm_set_pric = $frm->FrmSetServicePrice();
     Application_Model_Decorator::removeAllDecorator($frm_set_pric);
     $this->view->frm_set_price = $frm_set_pric;
     $_model = new Application_Model_GlobalClass();
     $this->view->all_metion = $_model->getAllMetionOption();
     $this->view->all_faculty = $_model->getAllFacultyOption();
     $model = new Application_Model_DbTable_DbGlobal();
     $this->view->payment_term = $model->getAllPaymentTerm();
 }
Example #3
0
 public function getAllPayMentTermOption()
 {
     $_db = new Application_Model_DbTable_DbGlobal();
     $rows = $_db->getAllPaymentTerm();
     $option = '';
     if (!empty($rows)) {
         foreach ($rows as $key => $value) {
             $option .= '<option value="' . $key . '" >' . htmlspecialchars($value, ENT_QUOTES) . '</option>';
         }
     }
     return $option;
 }
Example #4
0
 public function FrmRegistarWU($data = null)
 {
     $_degree = $this->_degree;
     $_khname = $this->_khname;
     $_enname = $this->_enname;
     $_phone = $this->_phone;
     $_batch = $this->_batch;
     $_year = $this->_year;
     $_session = $this->_session;
     $_dob = $this->_dob;
     $_pay_date = $this->_pay_date;
     $_remark = $this->_remark;
     $_dob->setValue(date("Y-m-d"));
     $_invoice_no = new Zend_Dojo_Form_Element_TextBox('reciept_no');
     $_invoice_no->setAttribs(array('dojoType' => $this->tvalidate, 'class' => 'fullside', 'required' => 'true', 'class' => 'fullside'));
     $rs_metion_opt = Application_Model_DbTable_DbGlobal::getAllMention();
     $metion = new Zend_Dojo_Form_Element_FilteringSelect('metion');
     $metion->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside', 'onchange' => 'getTuitionFee();'));
     $metion->setMultiOptions($rs_metion_opt);
     $_new_student = new Zend_Form_Element_Checkbox('is_new');
     $_new_student->setAttribs(array('dojoType' => "dijit.form.CheckBox", 'class' => 'fullside', 'Onchange' => "getNewStudent();"));
     $_is_hold = new Zend_Form_Element_Checkbox('is_hold');
     $_is_hold->setAttribs(array('dojoType' => "dijit.form.CheckBox", 'class' => 'fullside'));
     //$_is_hold->setValue(1);
     $_year_one = new Zend_Dojo_Form_Element_TextBox('is_year_one');
     $_year_one->setAttribs(array('dojoType' => "dijit.form.CheckBox", 'class' => 'fullside', 'Onchange' => "getNewStudent();"));
     $_studid = new Zend_Dojo_Form_Element_TextBox('stu_id');
     $_studid->setAttribs(array('dojoType' => $this->text, 'class' => 'fullside'));
     $_sex = new Zend_Dojo_Form_Element_FilteringSelect('sex');
     $_sex->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside'));
     $sex_opt = array(1 => $this->tr->translate("MALE"), 2 => $this->tr->translate("FEMALE"));
     $_sex->setMultiOptions($sex_opt);
     $_db = new Application_Model_DbTable_DbGlobal();
     $rows = $_db->getAllFecultyName();
     $opt = '';
     //array(-1=>$this->tr->translate("SELECT_DEPT"));
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $opt[$row['dept_id']] = $row['en_name'];
         }
     }
     $_dept = new Zend_Dojo_Form_Element_FilteringSelect("dept");
     $_dept->setMultiOptions($opt);
     $_dept->setAttribs(array('dojoType' => $this->filter, 'required' => 'true', 'class' => 'fullside', 'onchange' => 'changeMajor();'));
     $opt_marjor = array(-1 => $this->tr->translate("SELECT_MAJOR"));
     $_major = new Zend_Dojo_Form_Element_FilteringSelect("major");
     $_major->setAttribs(array('dojoType' => $this->filter, 'required' => 'true', 'class' => 'fullside'));
     $_term = new Zend_Dojo_Form_Element_FilteringSelect("payment_term");
     $opt_term = $_db->getAllPaymentTerm();
     // 		  $opt_term = array(
     // 		  		1=>$this->tr->translate('QUARTER'),
     // 		  		2=>$this->tr->translate('SEMESTER'),
     // 		  		3=>$this->tr->translate('YEAR'),
     // 		  		4=>$this->tr->translate('OTHER')
     // 		  );
     $_term->setMultiOptions($opt_term);
     $_term->setAttribs(array('dojoType' => $this->filter, 'required' => 'true', 'class' => 'fullside', 'onchange' => 'getTuitionFee();'));
     $_fee = new Zend_Dojo_Form_Element_NumberTextBox('tuitionfee');
     $_fee->setAttribs(array('dojoType' => $this->t_num, 'required' => 'true', 'class' => 'fullside', 'onkeyup' => 'CheckAmount();'));
     $_disc = new Zend_Dojo_Form_Element_NumberTextBox('discount');
     $_disc->setAttribs(array('dojoType' => $this->text, 'class' => 'fullside', 'onkeyup' => 'CheckAmount();'));
     $_disc->setValue(0);
     $_paid = new Zend_Dojo_Form_Element_NumberTextBox('payment_paid');
     $_paid->setAttribs(array('dojoType' => $this->t_num, 'required' => 'true', 'class' => 'fullside'));
     $_paid_kh = new Zend_Dojo_Form_Element_Textarea('paid_kh');
     $_paid_kh->setAttribs(array('dojoType' => $this->text, 'class' => 'fullside'));
     $this->addElements(array($_year_one, $_new_student, $_invoice_no, $_pay_date, $_khname, $_enname, $_studid, $_sex, $_dob, $_degree, $metion, $_phone, $_dept, $_major, $_batch, $_year, $_session, $_term, $_fee, $_disc, $_paid, $_paid_kh, $_remark, $_is_hold));
     return $this;
 }