Exemplo n.º 1
0
 public function FrmGeneraljurnal($data = null)
 {
     $Brance = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
     $Brance->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true, 'onchange' => 'getJurnalcode();'));
     $db = new Application_Model_DbTable_DbGlobal();
     $rows = $db->getAllBranchName();
     $options = '';
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $rows = $db->getAllBranchName();
     $options = array('' => '---Select Branch---');
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $Brance->setMultiOptions($options);
     $_currency_type = new Zend_Dojo_Form_Element_FilteringSelect('currency_type');
     $_currency_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = $db->getVewOptoinTypeByType(15, 1, 3, 1);
     $_currency_type->setMultiOptions($opt);
     $_currency_type->setValue(2);
     $parent = new Zend_Dojo_Form_Element_FilteringSelect('parent');
     $parent->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true, 'onchange' => 'getAllAccountNameByParents();'));
     $db = new Accounting_Model_DbTable_DbChartaccount();
     $option = $db->getAllchartaccount(3, 1);
     $parent->setMultiOptions($option);
     $Add_Date = new Zend_Dojo_Form_Element_DateTextBox('add_date');
     $Add_Date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside', 'required' => true));
     $Add_Date->setValue(date('Y-m-d'));
     $Account_Number = new Zend_Dojo_Form_Element_TextBox('journal_code');
     $Account_Number->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'readOnly' => 'readOnly', 'required' => 'true'));
     $invoice = new Zend_Dojo_Form_Element_TextBox('invoice');
     $invoice->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $Note = new Zend_Dojo_Form_Element_TextBox('note');
     $Note->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $Debit = new Zend_Dojo_Form_Element_NumberTextBox('debit');
     $Debit->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => 1, 'readonly' => 'readonly'));
     // 		$Debit->setValue(0);
     $Credit = new Zend_Dojo_Form_Element_NumberTextBox('credit');
     $Credit->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => 1, 'readonly' => 'readonly'));
     $id = new Zend_Form_Element_Hidden('id');
     if ($data != null) {
         $id->setValue($data['id']);
         $Brance->setValue($data['branch_id']);
         $Account_Number->setValue($data['journal_code']);
         $invoice->setValue($data['receipt_number']);
         $_currency_type->setValue($data['currency_id']);
         $Note->setValue($data['note']);
         $Add_Date->setValue($data['date']);
         $Debit->setValue($data['debit']);
         $Credit->setValue($data['credit']);
     }
     // 		$Credit->setValue(0);
     $this->addElements(array($id, $invoice, $_currency_type, $parent, $Add_Date, $Account_Number, $Note, $Debit, $Credit, $Brance));
     return $this;
 }
Exemplo n.º 2
0
 public function Frmchengcallecterall()
 {
     $db = new Application_Model_DbTable_DbGlobal();
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $branch = new Zend_Dojo_Form_Element_FilteringSelect('branch');
     $branch->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true));
     $rows = $db->getAllBranchName();
     $options = '';
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $branch->setMultiOptions($options);
     $db = new Application_Model_DbTable_DbGlobal();
     $owner = new Zend_Dojo_Form_Element_FilteringSelect('owner');
     $owner->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => "popupCheckStaff();"));
     $options = $db->getGroupCodeById(2, 0, 1);
     $owner->setMultiOptions($options);
     $db = new Application_Model_DbTable_DbGlobal();
     $owner_code = new Zend_Dojo_Form_Element_FilteringSelect('owner_code');
     $group_opt = $db->getGroupCodeById(1, 0, 1);
     //code,individual,option
     $owner_code->setMultiOptions($group_opt);
     $owner_code->setValue($request->getParam('client_code'));
     $from = new Zend_Dojo_Form_Element_FilteringSelect('from');
     $from->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true));
     $from->setValue($request->getParam('from'));
     $opt = $db->getCollteralType(1);
     $from->setMultiOptions($opt);
     $to = new Zend_Dojo_Form_Element_FilteringSelect('to');
     $to->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true));
     $opt = $db->getCollteralType(1);
     $to->setMultiOptions($opt);
     $owners = new Zend_Dojo_Form_Element_TextBox('owners');
     $owners->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true));
     $_personal = new Zend_Dojo_Form_Element_FilteringSelect('personal');
     $_personal->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = array(1 => 'ផ្ទាល់ខ្លួន', 2 => 'អ្នកធានាជំនួស');
     $_personal->setMultiOptions($opt);
     $_personal->setValue(1);
     $numbernote = new Zend_Dojo_Form_Element_NumberTextBox('numbernote');
     $numbernote->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $date = new Zend_Dojo_Form_Element_DateTextBox('date');
     $date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside', 'required' => true));
     $date->setValue(date('Y-m-d'));
     $note = new Zend_Dojo_Form_Element_TextBox('note');
     $note->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true));
     $status = new Zend_Dojo_Form_Element_FilteringSelect('status');
     $status->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true));
     $options = array(1 => "ប្រើប្រាស់", 2 => "មិនប្រើប្រាស់");
     $status->setMultiOptions($options);
     $detial = new Zend_Dojo_Form_Element_TextBox('detial');
     $detial->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true));
     $this->addElements(array($branch, $owner, $from, $to, $date, $note, $status, $owners, $owner_code, $detial, $_personal, $numbernote));
     return $this;
 }
Exemplo n.º 3
0
 public function FrmGeneraljurnal($data = null)
 {
     $Brance = new Zend_Dojo_Form_Element_FilteringSelect('brance');
     $Brance->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true));
     $db = new Application_Model_DbTable_DbGlobal();
     $rows = $db->getAllBranchName();
     $options = '';
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $Brance->setMultiOptions($options);
     $Add_Date = new Zend_Dojo_Form_Element_DateTextBox('add_date');
     $Add_Date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside', 'required' => true));
     $Add_Date->setValue(date('Y-m-d'));
     $Account_Number = new Zend_Dojo_Form_Element_FilteringSelect('account_number');
     $Account_Number->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     $db = new Application_Model_DbTable_DbGlobal();
     $sql = "SELECT id,account_name_en,account_code FROM ln_account_name WHERE status=1";
     $rows = $db->getGlobalDb($sql);
     $opt = '';
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $opt[$row['id']] = $row['account_code'];
         }
     }
     $Account_Number->setMultiOptions($opt);
     $Account_name = new Zend_Dojo_Form_Element_FilteringSelect('account_name');
     $Account_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = '';
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $opt[$row['id']] = $row['account_name_en'];
         }
     }
     $Account_name->setMultiOptions($opt);
     $Note = new Zend_Dojo_Form_Element_TextBox('note');
     $Note->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $Debit = new Zend_Dojo_Form_Element_TextBox('debit');
     $Debit->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $Debit->setValue(0);
     $Credit = new Zend_Dojo_Form_Element_TextBox('credit');
     $Credit->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $Credit->setValue(0);
     $this->addElements(array($Add_Date, $Account_Number, $Account_name, $Note, $Debit, $Credit, $Brance));
     return $this;
 }
Exemplo n.º 4
0
 public function FrmIncome($data = null)
 {
     $account_id = new Zend_Dojo_Form_Element_TextBox('account_id');
     $account_id->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $for_date = new Zend_Dojo_Form_Element_FilteringSelect('for_date');
     $for_date->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt_month = "";
     for ($i = 1; $i <= 12; $i++) {
         $opt_month[$i] = $i;
     }
     $for_date->setMultiOptions($opt_month);
     $_Date = new Zend_Dojo_Form_Element_DateTextBox('Date');
     $_Date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'required' => true, 'class' => 'fullside'));
     $_Date->setValue(date('Y-m-d'));
     $_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
     $_branch_id->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => 'true', 'class' => 'fullside', 'onchange' => 'filterClient();'));
     $db = new Application_Model_DbTable_DbGlobal();
     $rows = $db->getAllBranchName();
     $options = array('' => '---Select Branch---');
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $_branch_id->setMultiOptions($options);
     $_stutas = new Zend_Dojo_Form_Element_FilteringSelect('Stutas');
     $_stutas->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $options = array(1 => "ប្រើប្រាស់", 2 => "មិនប្រើប្រាស់");
     $_stutas->setMultiOptions($options);
     $total_amount = new Zend_Dojo_Form_Element_NumberTextBox('total_amount');
     $total_amount->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside'));
     $_Description = new Zend_Dojo_Form_Element_Textarea('Description');
     $_Description->setAttribs(array('dojoType' => 'dijit.form.SimpleTextarea', 'class' => 'fullside', 'style' => 'width:98%'));
     $id = new Zend_Form_Element_Hidden("id");
     if ($data != null) {
         $_branch_id->setValue($data['branch_id']);
         $account_id->setValue($data['account_id']);
         $total_amount->setValue($data['total_amount']);
         $for_date->setValue($data['fordate']);
         $_Description->setValue($data['disc']);
         $_Date->setValue($data['date']);
         $_stutas->setValue($data['status']);
         $id->setValue($data['id']);
     }
     $this->addElements(array($account_id, $_Date, $_stutas, $total_amount, $_Description, $_branch_id, $for_date, $id));
     return $this;
 }
 public function AdvanceSearch($data = null, $type = null)
 {
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
     $_title->setAttribs(array('dojoType' => $this->tvalidate, 'onkeyup' => 'this.submit()', 'placeholder' => $this->tr->translate("ADVANCE_SEARCH")));
     $_title->setValue($request->getParam("adv_search"));
     $_status = new Zend_Dojo_Form_Element_FilteringSelect('status');
     $_status->setAttribs(array('dojoType' => $this->filter));
     $_status_opt = array(-1 => $this->tr->translate("ALL"), 1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $_status->setMultiOptions($_status_opt);
     $_status->setValue($request->getParam("status"));
     $db = new Application_Model_DbTable_DbGlobal();
     $employee = new Zend_Dojo_Form_Element_FilteringSelect('employee');
     $rows = $db->getAllCOName();
     $options = array('' => "---ស្វែងរកតាមរយៈឈ្មោះ---");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['co_id']] = $row['co_khname'];
         }
     }
     $employee->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'popupCheckCO();'));
     $employee->setMultiOptions($options);
     $employee->setValue($request->getParam('employee'));
     $_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
     $_btn_search->setAttribs(array('dojoType' => 'dijit.form.Button', 'iconclass' => 'dijitIconSearch', 'label' => 'Search'));
     $branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
     $branch_id->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     $rows = $db->getAllBranchName();
     $options_branch = array('' => "---ស្វែងរកតាមរយៈសាខា---");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options_branch[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $branch_id->setMultiOptions($options_branch);
     $branch_id->setValue($request->getParam("branch_id"));
     $approve_by = new Zend_Dojo_Form_Element_FilteringSelect('approve_by');
     $rows = $db->getAllCOName();
     $options_approve = array('' => "---ស្វែងរកអ្នកយល់ព្រម---");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options_approve[$row['co_id']] = $row['co_khname'];
         }
     }
     $approve_by->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'popupCheckCO();'));
     $approve_by->setMultiOptions($options_approve);
     $approve_by->setValue($request->getParam("approve_by"));
     $opt_type = $db->getVewOptoinTypeByType(7, 1);
     $type = new Zend_Dojo_Form_Element_FilteringSelect('type');
     $type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => true, 'class' => 'fullside'));
     $type->setMultiOptions($opt_type);
     $type->setValue($request->getParam("type"));
     // 		$from_date=new Zend_Dojo_Form_Element_DateTextBox('from_date');
     // 		$from_date->setAttribs(array(
     // 				'dojoType'=>'dijit.form.DateTextBox',
     // 				'required'=>true,
     // 				'class'=>'fullside'
     // 		));
     // 		$from_date->setValue(date('Y-m-d'));
     // // 		$from_date->setValue($request->getParam("from_date"));
     // 		$to_date=new Zend_Dojo_Form_Element_DateTextBox('to_date');
     // 		$to_date->setAttribs(array(
     // 				'dojoType'=>'dijit.form.DateTextBox',
     // 				'required'=>true,
     // 				'class'=>'fullside'
     // 		));
     // 		$to_date->setValue(date('Y-m-d'));
     // // 		$to_date->setValue($request->getParam("to_date"));
     $from_date = new Zend_Dojo_Form_Element_DateTextBox('start_date');
     $from_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'required' => 'true', 'class' => 'fullside', 'onchange' => 'CalculateDate();'));
     $_date = $request->getParam("start_date");
     if (empty($_date)) {
         $_date = date('Y-m-d');
     }
     $from_date->setValue($_date);
     $to_date = new Zend_Dojo_Form_Element_DateTextBox('end_date');
     $to_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'required' => 'true', 'class' => 'fullside'));
     $_date = $request->getParam("end_date");
     if (empty($_date)) {
         $_date = date("Y-m-d");
     }
     $to_date->setValue($_date);
     $position_ = new Zend_Dojo_Form_Element_FilteringSelect('position');
     $position_->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => true, 'class' => 'fullside'));
     $opt_position = $db->getAllStaffPosition(null, 1);
     $position_->setMultiOptions($opt_position);
     $position_->setValue($request->getParam("position"));
     $this->addElements(array($position_, $from_date, $to_date, $type, $employee, $_title, $_title, $_status, $_btn_search, $branch_id, $approve_by));
     return $this;
 }
Exemplo n.º 6
0
	public function FrmAddLoan($data=null){
		
		$_isgroup = new Zend_Dojo_Form_Element_CheckBox('is_group');
		$_isgroup->setAttribs(array(
				'dojoType'=>'dijit.form.CheckBox',
				'class'=>'fullside',
				// 				'onkeyup'=>'Calcuhundred()'
		));
		
		
		$_loan_code = new Zend_Dojo_Form_Element_TextBox('loan_code');
		$_loan_code->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'readonly'=>true,
				'style'=>'color:red; font-weight: bold;'
		));
		$db = new Application_Model_DbTable_DbGlobal();
		$loan_number = $db->getLoanNumber();
		$_loan_code->setValue($loan_number);
		
		$_client_code = new Zend_Dojo_Form_Element_TextBox('client_code');
		$_client_code->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$_group_code = new Zend_Dojo_Form_Element_FilteringSelect('group_code');
		$_group_code->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'getmemberIdGroup();'
		));
		$group_opt = $db ->getGroupCodeById(1,1,1);
		$_group_code->setMultiOptions($group_opt);
		
		$dbs = new Loan_Model_DbTable_DbLoanss();
		
		$_customer_code = new Zend_Dojo_Form_Element_FilteringSelect('customer_code');
		$_customer_code->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'getClientInfo(1);'
		));
		$group_opt = $dbs ->getClientByTypes(1);//code,individual,option
		$_customer_code->setMultiOptions($group_opt);
		
		
		$_member = new Zend_Dojo_Form_Element_FilteringSelect('member');
		$_member->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'getClientInfo(2)'
		));
		$options = $dbs->getClientByTypes(2);
		$_member->setMultiOptions($options);
		
		$db = new Application_Model_DbTable_DbGlobal();
		$_groupid = new Zend_Dojo_Form_Element_FilteringSelect('group_id');
		$_groupid->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
 				'onchange'=>'popupCheckClient();'
				));
		$options = $db ->getGroupCodeById(2,1,1);//show name,show group,show option
		$_groupid->setMultiOptions($options);
		
		$_coid = new Zend_Dojo_Form_Element_FilteringSelect('co_id');
		$_coid->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'popupCheckCO();'
		));
		$options = $db ->getAllCOName(1);
		$_coid->setMultiOptions($options);
		
		$_currency_type = new Zend_Dojo_Form_Element_FilteringSelect('currency_type');
		$_currency_type->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
		));
		$opt = array(2=>"Dollar",1=>'Khmer',3=>"Bath");
// 		$opt = $db->getVewOptoinTypeByType(15,1,3);
		$_currency_type->setMultiOptions($opt);
		
		$_zone = new Zend_Dojo_Form_Element_FilteringSelect('zone');
		$_zone->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'popupCheckZone();'
		));
		$options = $db ->getZoneList(1);
		$_zone->setMultiOptions($options);
		
		$_loan_fee = new Zend_Dojo_Form_Element_NumberTextBox('loan_fee');
		$_loan_fee->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
		));
		$_loan_fee->setValue(0);
		
		$_time_collect = new Zend_Dojo_Form_Element_NumberTextBox('amount_collect');
		$_time_collect->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'onkeyup'=>'getFirstPayment();'
		));
 		$_time_collect->setValue(1);
 		
 		$_time_collect_pri = new Zend_Dojo_Form_Element_NumberTextBox('amount_collect_pricipal');
 		$_time_collect_pri->setAttribs(array(
 				'dojoType'=>'dijit.form.NumberTextBox',
 				'class'=>'fullside',
 				'readonly'=>true,
 				'required'=>true
 		));
 		$_time_collect_pri->setValue(2);
 		
 		$dbs = new Loan_Model_DbTable_DbLoanss();
		$_amount = new Zend_Dojo_Form_Element_NumberTextBox('total_amount');
		$_amount->setAttribs(array(
						'dojoType'=>'dijit.form.NumberTextBox',
						'class'=>'fullside',
						'required' =>'true'
		));
		
		$_level = new Zend_Dojo_Form_Element_NumberTextBox('level');
		$_level->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		$_level->setValue(1);
		


		$_rate =  new Zend_Dojo_Form_Element_ValidationTextBox("interest_rate");
		$_rate->setAttribs(array(
				'data-dojo-Type'=>'dijit.form.ValidationTextBox',
				'data-dojo-props'=>"
				'required':true,
				'name':'interest_rate',
				'value':2.5,
				'class':'fullside',
				'invalidMessage':'អាចបញ្ជូលពី 1 ដល់  
				'"));
				
		$_period = new Zend_Dojo_Form_Element_NumberTextBox('period');
		$_period->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true',
				'onkeyup'=>'calCulatePeriod();'
		));
		$_period->setValue(12);
		
		$_releasedate = new Zend_Dojo_Form_Element_DateTextBox('release_date');
		$_releasedate->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside',
				'required' =>'true',
				'onchange'=>'checkReleaseDate();'
		));
		$s_date = date('Y-m-d');
		$_releasedate->setValue($s_date);
		
		$_first_payment = new Zend_Dojo_Form_Element_DateTextBox('first_payment');
		$_first_payment->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside',
				'required' =>'true',
				//'onchange'=>'calCulateFirstPayment();'
				
		));
		//$_first_payment->setValue('2005-12-30');
		
		$_dateline = new Zend_Dojo_Form_Element_DateTextBox('date_line');
		$_dateline->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside',
				'required' =>'true',
				'readonly'=>true,
		));
		
		
		$_graice_pariod = new Zend_Dojo_Form_Element_TextBox('graice_pariod');
		$_graice_pariod->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'required'=>'true',
				'onKeyup'=>'CompareGraicePariod();'
				//'readOnly'=>true,
		));
		$_graice_pariod->setValue(0);
		
		$_collect_term = new Zend_Dojo_Form_Element_FilteringSelect('collect_termtype');
		$_collect_term->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'changeGraicePeroid();'
		));
		$term_opt = $db->getVewOptoinTypeByType(1,1,3);
		$_collect_term->setMultiOptions($term_opt);
	
		$_payterm = new Zend_Dojo_Form_Element_FilteringSelect('payment_term');
		$_payterm->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true'
		));
// 		$options= array(1=>"Day",2=>"Week",3=>"Month");
// 		$_payterm->setMultiOptions($options);
		$_payterm->setMultiOptions($term_opt);
		
		$_pay_every = new Zend_Dojo_Form_Element_FilteringSelect('pay_every');
		$_pay_every->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true',
				'onchange'=>'changeCollectType();'
		));
// 		$options= array(1=>"Day",2=>"Week",3=>"Month");
// 		$_pay_every->setMultiOptions($options);
		$_pay_every->setValue(3);
		$_pay_every->setMultiOptions($term_opt);
		
		$_every_payamount = new Zend_Dojo_Form_Element_FilteringSelect('every_payamount');
		$_every_payamount->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true'
		));
		$options= array(2=>"After",1=>"Before",3=>"Normal");
		$_every_payamount->setMultiOptions($options);
		
		$_time= new Zend_Dojo_Form_Element_TextBox('time');
		$_time->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		$set_time='10:00-11:00 AM';
		$_time->setValue($set_time);
		
		$_paybefore = new Zend_Dojo_Form_Element_NumberTextBox('pay_before');
		$_paybefore->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		$_paybefore->setValue(0);
		
		$_pay_late = new Zend_Dojo_Form_Element_NumberTextBox('pay_late');
		$_pay_late->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		$_pay_late->setValue(0);
		
		$_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
		$_branch_id->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true'
		));
		
		$rows = $db->getAllBranchName();
		$options='';
			if(!empty($rows))foreach($rows AS $row){
				$options[$row['br_id']]=$row['branch_namekh'];
			}
		$_branch_id->setMultiOptions($options);
		
		$_repayment_method = new Zend_Dojo_Form_Element_FilteringSelect('repayment_method');
		$_repayment_method->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true',
				'onchange'=>'chechPaymentMethod()'
		));
		$options = $db->getAllPaymentMethod(null,1);
		$_repayment_method->setMultiOptions($options);
		
		$_holiday = new Zend_Dojo_Form_Element_FilteringSelect('holiday');
		$_holiday->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true'
		));
		$options= array(1=>"Befor",2=>"After",3=>"Cancel");
		$_holiday->setMultiOptions($options);
		
		$_id = new Zend_Form_Element_Hidden('id');
		if($data!=null){
// 			print_r($data);
			$_branch_id->setValue($data['branch_id']);
			$_loan_code->setValue($data['loan_number']);
			$_level->setValue($data['level']);
			$_loan_fee->setValue($data['admin_fee']);
			$_member->setValue($data['client_id']);
			$_customer_code->setValue($data['client_id']);
			$_coid->setValue($data['co_id']);
			$_zone->setValue($data['zone_id']);
			$_releasedate->setValue($data['date_release']);
			$_period->setValue($data['total_duration']);
			$_first_payment->setValue($data['first_payment']);
			$_time->setValue($data['time_collect']);
			$_every_payamount->setValue($data['holiday']);
			$_amount->setValue($data['total_capital']);
			$_currency_type->setValue($data['currency_type']);
			$_rate->setValue($data['interest_rate']);//
			$_rate->setAttribs(array(
					'data-dojo-props'=>"
					'value':'".$data['interest_rate']."'"));
			$_repayment_method->setValue($data['payment_method']);
			$_graice_pariod->setValue($data['graice_period']);
			$_time_collect_pri->setValue($data['semi']);
			$_dateline->setValue($data['date_line']);
			$_pay_every->setValue($data['pay_term']);
			$_time_collect->setValue($data['amount_collect_principal']);
			$_collect_term->setValue($data['collect_typeterm']);
			$_pay_late->setValue($data['pay_after']);
			$_paybefore->setValue($data['pay_before']);
			$_id->setValue($data['g_id']);
			
			$_group_code->setValue($data['client_id']);
			$_groupid->setValue($data['client_id']);
			
// 			print_r($data);
		}
		$this->addElements(array($_isgroup,$_groupid,$_client_code,$_time_collect,$_loan_fee,$_level,$_paybefore,$_pay_late,$_branch_id,$_member,$_coid,$_currency_type,$_zone,$_amount,$_rate,$_releasedate
				,$_payterm,$_every_payamount,$_time,$_time_collect_pri,$_holiday,$_graice_pariod,$_period,
				$_first_payment,$_repayment_method,$_pay_every,$_loan_code,$_collect_term,$_dateline,
				$_group_code,$_customer_code,$_id));
		return $this;
		
	}	
Exemplo n.º 7
0
	public function FrmAddLoan($data=null){
		
		$_isgroup = new Zend_Dojo_Form_Element_CheckBox('is_group');
		$_isgroup->setAttribs(array(
				'dojoType'=>'dijit.form.CheckBox',
				'class'=>'fullside',
				// 				'onkeyup'=>'Calcuhundred()'
		));
		
		
		$_loan_code = new Zend_Dojo_Form_Element_TextBox('loan_code');
		$_loan_code->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'readonly'=>true,
				'style'=>'color:red; font-weight: bold;'
		));
		$db = new Application_Model_DbTable_DbGlobal();
		$loan_number = $db->getLoanNumber();
		$_loan_code->setValue($loan_number);
		
		$_loan_codes = new Zend_Dojo_Form_Element_TextBox('loan_codes');
		$_loan_codes->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'readonly'=>true,
				'style'=>'color:red; font-weight: bold;'
		));
// 		$loan_numbers = $db->getLoanNumber();
// 		$_loan_codes->setValue($loan_numbers);
		
		$_client_code = new Zend_Dojo_Form_Element_TextBox('client_code');
		$_client_code->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				
		));

		$_client_codes = new Zend_Dojo_Form_Element_TextBox('client_codes');
		$_client_codes->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		
		));
		
		$_group_code = new Zend_Dojo_Form_Element_FilteringSelect('group_code');
		$_group_code->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'getmemberIdGroup();'
		));
// 		$group_opt = $db ->getGroupCodeById(1,1,1);
// 		$_group_code->setMultiOptions($group_opt);
		
		$get_laonnumber = new Zend_Dojo_Form_Element_FilteringSelect('get_laonnumber');
		$get_laonnumber->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'getInfoByLoanNumber();getLoanInfoByLoanNumber();'
		));
		$group_opt = $db->getLoanAllLoanNumber(1,1);
		$get_laonnumber->setMultiOptions($group_opt);
		
		$schedule_opt = new Zend_Dojo_Form_Element_FilteringSelect('reschedule_opt');
		$schedule_opt->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
		));
		$opt = $db->getVewOptoinTypeByType(25,1,null,1);
		$schedule_opt->setMultiOptions($opt);
		
		
		$dbs = new Loan_Model_DbTable_DbLoanIL();
		
		$_customer_code = new Zend_Dojo_Form_Element_FilteringSelect('customer_code');
		$_customer_code->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'showPopupclient;'
		));
// 		$group_opt = $dbs ->getClient(1);//code,individual,option
		$group_opt = $db->getGroupCodeById(1,0,1);//code,individual,option
		$_customer_code->setMultiOptions($group_opt);
		
		$_customer_codes = new Zend_Dojo_Form_Element_TextBox('customer_codes');
		$_customer_codes->setAttribs(array(
				'dojoType'=>'dijit.form.textbox',
				'class'=>'fullside',
				'onchange'=>'showPopupclient;'
		));
		// 		$group_opt = $dbs ->getClient(1);//code,individual,option
// 		$_member = new Zend_Dojo_Form_Element_FilteringSelect('member');
// 		$_member->setAttribs(array(
// 				'dojoType'=>'dijit.form.FilteringSelect',
// 				'class'=>'fullside',
// 				'onchange'=>'showPopupclient();'
// 		));
		
// 		$options = $db->getGroupCodeById(2,0,1);
// 		$_member->setMultiOptions($options);
		
		
		
		$_members = new Zend_Dojo_Form_Element_TextBox('members');
		$_members->setAttribs(array(
				'dojoType'=>'dijit.form.textbox',
				'class'=>'fullside',
				//'onchange'=>'showPopupclient();'
		));
		// 		$options = $dbs->getClient(2);
		
		
		$_groupid = new Zend_Dojo_Form_Element_FilteringSelect('group_id');
		$_groupid->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
 				'onchange'=>'popupCheckClient();'
				));
// 		$options = $db->getGroupCodeById(2,1,1);//show name,show group,show option
// 		$_groupid->setMultiOptions($options);
		
		$_coid = new Zend_Dojo_Form_Element_FilteringSelect('co_id');
		$_coid->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'popupCheckCO();'
		));
		$options = $db ->getAllCOName(1);
		$_coid->setMultiOptions($options);
		
		$_coids = new Zend_Dojo_Form_Element_FilteringSelect('co_ids');
		$_coids->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'popupCheckCO();'
		));
		$optionss = $db ->getAllCOName(1);
		$_coids->setMultiOptions($optionss);
		
		$_currency_type = new Zend_Dojo_Form_Element_FilteringSelect('currency_type');
		$_currency_type->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
		));
// 		$opt = array(2=>"Dollar",1=>'Khmer',3=>"Bath");
		$opt = $db->getVewOptoinTypeByType(15,1,3,1);
		$_currency_type->setMultiOptions($opt);
		$_currency_type->setValue(2);
		
		$_loan_type = new Zend_Dojo_Form_Element_FilteringSelect('loan_type');
		$_loan_type->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onChange'=>'loantype();'
		));
		$opt = $db->getVewOptoinTypeByType(24,1,null,1);
		$opt[-1]="--- Add New---";
		$_loan_type->setMultiOptions($opt);
		
		$_loan_types = new Zend_Dojo_Form_Element_FilteringSelect('loan_types');
		$_loan_types->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onChange'=>'loantype();'
		));
		$opts = $db->getVewOptoinTypeByType(24,1,null,1);
		$opt[-1]="--- Add New---";
		$_loan_types->setMultiOptions($opts);
		
		$_zone = new Zend_Dojo_Form_Element_FilteringSelect('zone');
		$_zone->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'zone();'
		));
		$options = $db ->getZoneList(1);
		$options[-1]="--- Add New---";
		$_zone->setMultiOptions($options);
		
		$_zones = new Zend_Dojo_Form_Element_FilteringSelect('zones');
		$_zones->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'zone();'
		));
		$optionsf = $db ->getZoneList(1);
		$optionsf[-1]="--- Add New---";
		$_zones->setMultiOptions($optionsf);
		
		$_loan_fee = new Zend_Dojo_Form_Element_NumberTextBox('loan_fee');
		$_loan_fee->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required'=>true
		));
		$_loan_fee->setValue(0);
		
		$_loan_fees = new Zend_Dojo_Form_Element_NumberTextBox('loan_fees');
		$_loan_fees->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required'=>true
		));
		$_loan_fees->setValue(0);
		
		$_other_fee = new Zend_Dojo_Form_Element_NumberTextBox('other_fee');
		$_other_fee->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required'=>true,
		));
		$_other_fee->setValue(0);
		
		$_other_fees = new Zend_Dojo_Form_Element_NumberTextBox('other_fees');
		$_other_fees->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required'=>true,
		));
		$_other_fees->setValue(0);
		
		$_time_collect = new Zend_Dojo_Form_Element_NumberTextBox('amount_collect');
		$_time_collect->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'onkeyup'=>'getFirstPayment();'
		));
 		$_time_collect->setValue(1);
 		
 		$_time_collect_pri = new Zend_Dojo_Form_Element_NumberTextBox('amount_collect_pricipal');
 		$_time_collect_pri->setAttribs(array(
 				'dojoType'=>'dijit.form.NumberTextBox',
 				'class'=>'fullside',
 				'readonly'=>true,
 				'required'=>true
 		));
 		$_time_collect_pri->setValue(0);
 		
 		$dbs = new Loan_Model_DbTable_DbLoanss();
		$_amount = new Zend_Dojo_Form_Element_NumberTextBox('total_amount');
		$_amount->setAttribs(array(
						'dojoType'=>'dijit.form.NumberTextBox',
						'class'=>'fullside',
						'required' =>'true',
				        'onkeyup'=>'calCulateAdminFee();'
		));
		
		$_level = new Zend_Dojo_Form_Element_NumberTextBox('level');
		$_level->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		$_level->setValue(1);
		$_levels = new Zend_Dojo_Form_Element_NumberTextBox('levels');
		$_levels->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		$_levels->setValue(1);


		$_rate =  new Zend_Dojo_Form_Element_NumberTextBox("interest_rate");
		$_rate->setAttribs(array(
				'data-dojo-Type'=>'dijit.form.NumberTextBox',
				'data-dojo-props'=>"
				'required':true,
				'name':'interest_rate',
				'value':2.5,
				'class':'fullside',
				'invalidMessage':'អាចបញ្ជូលពី 1 ដល់'
				 
				"));
				
		$_period = new Zend_Dojo_Form_Element_NumberTextBox('period');
		$_period->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true',
				'onkeyup'=>'calCulatePeriod();'
		));
		$_period->setValue(12);
		
		$_releasedate = new Zend_Dojo_Form_Element_DateTextBox('release_date');
		$_releasedate->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside',
				'required' =>'true',
				'onchange'=>'checkReleaseDate();'
		));
		$s_date = date('Y-m-d');
		$_releasedate->setValue($s_date);
		
		$_first_payment = new Zend_Dojo_Form_Element_DateTextBox('first_payment');
		$_first_payment->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside',
				'required' =>'true',
			    'onchange'=>'calCulateEndDate();'
				
		));
		//$_first_payment->setValue('2005-12-30');
		
		$_dateline = new Zend_Dojo_Form_Element_DateTextBox('date_line');
		$_dateline->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside',
				'required' =>'true',
				'readonly'=>true,
		));
		
		
		$_graice_pariod = new Zend_Dojo_Form_Element_TextBox('graice_pariod');
		$_graice_pariod->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'required'=>'true',
				'onKeyup'=>'CompareGraicePariod();'
				//'readOnly'=>true,
		));
		$_graice_pariod->setValue(0);
		
		$_collect_term = new Zend_Dojo_Form_Element_FilteringSelect('collect_termtype');
 		$_collect_term->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'changeGraicePeroid();'
		));
		$term_opt = $db->getVewOptoinTypeByType(14,1,3,1);
		$_collect_term->setMultiOptions($term_opt);
	
		$_payterm = new Zend_Dojo_Form_Element_FilteringSelect('payment_term');
		$_payterm->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true'
		));
		$_payterm->setMultiOptions($term_opt);
		$_pay_every = new Zend_Dojo_Form_Element_FilteringSelect('pay_every');
		$_pay_every->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true',
				'onchange'=>'changeCollectType();'
		));
// 		$options= array(1=>"Day",2=>"Week",3=>"Month");
// 		$_pay_every->setMultiOptions($options);
		$_pay_every->setValue(3);
		$_pay_every->setMultiOptions($term_opt);
		$_every_payamount = new Zend_Dojo_Form_Element_FilteringSelect('every_payamount');
		$_every_payamount->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true'
		));
		$options= array(2=>"After",1=>"Before",3=>"Normal");
		$_every_payamount->setMultiOptions($options);
		
		$_time= new Zend_Dojo_Form_Element_TextBox('time');
		$_time->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		$set_time='10:00-11:00 AM';
		$_time->setValue($set_time);
		
		$_paybefore = new Zend_Dojo_Form_Element_NumberTextBox('pay_before');
		$_paybefore->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		$_paybefore->setValue(0);
		
		$_pay_late = new Zend_Dojo_Form_Element_NumberTextBox('pay_late');
		$_pay_late->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		$_pay_late->setValue(0);
		$arr=$db->getSystemSetting('interest_late');
		$_pay_late->setValue($arr['value']);
		
// 		print_r($arr);exit();
		
		$_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
		$_branch_id->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true',
				'onchange'=>'filterClient();'
		));
		
		$rows = $db->getAllBranchName();
		$options=array(''=>'---Select Branch---');
			if(!empty($rows))foreach($rows AS $row){
				$options[$row['br_id']]=$row['branch_namekh'];
			}
		$_branch_id->setMultiOptions($options);
		
// 		$_branch_ids = new Zend_Dojo_Form_Element_FilteringSelect('branch_ids');
// 		$_branch_ids->setAttribs(array(
// 				'dojoType'=>'dijit.form.FilteringSelect',
// 				'class'=>'fullside',
// 				'required' =>'true',
// 				'onchange'=>'filterClient();'
// 		));
		
// 		$rows = $db->getAllBranchName();
// 		$optionsa=array(''=>'---Select Branch---');
// 		if(!empty($rows))foreach($rows AS $row){
// 			$optionsa[$row['br_id']]=$row['branch_namekh'];
// 		}
// 		$_branch_ids->setMultiOptions($optionsa);
		
		$_repayment_method = new Zend_Dojo_Form_Element_FilteringSelect('repayment_method');
		$_repayment_method->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true',
				'onchange'=>'chechPaymentMethod()'
		));
		$options = $db->getAllPaymentMethod(null,1);
		$_repayment_method->setMultiOptions($options);
		
		$_status = new Zend_Dojo_Form_Element_FilteringSelect('status_using');
		$_status->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true'
		));
// 		$options= array(1=>"Befor",2=>"After",3=>"Cancel");
		$options= array(1=>"Active",0=>"Cancel");
		$_status->setMultiOptions($options);
		
		$_interest = new Zend_Dojo_Form_Element_TextBox("interest");
		$_interest->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		
		$penalize = new Zend_Dojo_Form_Element_TextBox("penalize");
		$penalize->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		
		$_service_charge = new Zend_Dojo_Form_Element_TextBox("service_charge");
		$_service_charge->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		
		$_instalment_date = new Zend_Form_Element_Hidden("instalment_date");
		
		$_release_date = new Zend_Form_Element_Hidden("old_release_date");
		
		$_interest_rate = new Zend_Form_Element_Hidden("old_rate");
		
		$_old_payterm = new Zend_Form_Element_Hidden("old_payterm");
		
		$_id = new Zend_Form_Element_Hidden('id');
		if($data!=null){
// 			print_r($data);
			$_branch_id->setValue($data['branch_id']);
			$_loan_code->setValue($data['loan_number']);
			$_level->setValue($data['level']);
			$_loan_fee->setValue($data['admin_fee']);
			$_other_fee->setValue($data['other_fee']);
// 			$_member->setValue($data['client_id']);
			$_customer_code->setValue($data['client_id']);
			$_coid->setValue($data['co_id']);
			$_zone->setValue($data['zone_id']);
			$_releasedate->setValue($data['date_release']);
			$_period->setValue($data['total_duration']);
			$_first_payment->setValue($data['first_payment']);
			$_time->setValue($data['time_collect']);
			$_every_payamount->setValue($data['holiday']);
			$_amount->setValue($data['total_capital']);
			$_currency_type->setValue($data['currency_type']);
			$_rate->setValue($data['interest_rate']);//
			$_rate->setAttribs(array(
					'data-dojo-props'=>"
					'value':'".$data['interest_rate']."'"));
			$_repayment_method->setValue($data['payment_method']);
			$_graice_pariod->setValue($data['graice_period']);
			$_time_collect_pri->setValue($data['semi']);
			$_dateline->setValue($data['date_line']);
			$_pay_every->setValue($data['pay_term']);
			$_time_collect->setValue($data['amount_collect_principal']);
			$_collect_term->setValue($data['collect_typeterm']);
			$_pay_late->setValue($data['pay_after']);
			$_paybefore->setValue($data['pay_before']);
			$_id->setValue($data['g_id']);
			
			$_group_code->setValue($data['client_id']);
// 			$_groupid->setValue($data['client_id']);
			$get_laonnumber->setvalue($data['g_id']);
			$_status->setValue($data['status']);
			
// 			print_r($data);
		}
		$this->addElements(array($_groupid,$_old_payterm,$_interest_rate,$_release_date,$_instalment_date,$_interest,$penalize,$_service_charge,$schedule_opt,$_loan_types,$_loan_fees,$_other_fees,$_zones
				,$_client_codes,$_loan_codes,$_members,$_customer_codes,$_levels,$_coids,$get_laonnumber,$_loan_type,
				$_other_fee,$_isgroup,$_client_code,$_time_collect,$_loan_fee,$_level,$_paybefore,
				$_pay_late,$_branch_id,$_coid,$_currency_type,$_zone,$_amount,$_rate,$_releasedate
				,$_payterm,$_every_payamount,$_time,$_time_collect_pri,$_status,$_graice_pariod,$_period,
				$_first_payment,$_repayment_method,$_pay_every,$_loan_code,$_collect_term,$_dateline,
				$_group_code,$_customer_code,$_id));
		return $this;
		
	}	
Exemplo n.º 8
0
	public function frmSearch(){
		$request=Zend_Controller_Front::getInstance()->getRequest();
		$db = new Application_Model_DbTable_DbGlobal();
		$rows = $db->getAllBranchName();
		$options=array(-1=>'សូមជ្រើសរើស សាខា');
		if(!empty($rows))foreach($rows AS $row){
			$options[$row['br_id']]=$row['branch_namekh'];
		}
		
		$brance_from = new Zend_Dojo_Form_Element_FilteringSelect('brance_from');
		$brance_from->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect'
		));
		$brance_from->setMultiOptions($options);
		$brance_from->setValue($request->getParam("brance_from"));
		
		$brance_to = new Zend_Dojo_Form_Element_FilteringSelect('brance_to');
		$brance_to->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect'
		));
		$brance_to->setValue($request->getParam("brance_to"));
		$brance_to->setMultiOptions($options);
		
		$btnSearch=new Zend_Dojo_Form_Element_SubmitButton('btn_search');
		$btnSearch->setAttribs(array(
				'dojoType'=>'dijit.form.Button',
				'iconclass'=>'dijitIconSearch',
				'label'	=>	'Search'));
		
		$_stutas = new Zend_Dojo_Form_Element_FilteringSelect('status');
		$_stutas ->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
		));
		$options= array(-1=>"ជ្រើសរើស ស្ថានភាព",1=>"ប្រើប្រាស់",0=>"មិនប្រើប្រាស់");
		$_stutas->setMultiOptions($options);
		$_stutas->setValue($request->getParam("status"));
		
		$date=new Zend_Dojo_Form_Element_DateTextBox('date');
		$date->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox'
		));
		$date->setValue(date('Y-m-d'));
		$search = new Zend_Dojo_Form_Element_TextBox("search");
		$search->setAttribs(array('dojoType' => 'dijit.form.TextBox','placeHolder'   =>  'ឈ្មោះសាខា ជាភាសាខ្មែរ ឬ អង់គ្លេស',));
		$search->setValue($request->getParam("search"));
		
		
		return $this->addElements(array($search,$brance_from,$brance_to,$_stutas,$btnSearch,$date));
	}
Exemplo n.º 9
0
	public function FrmCallTeral($data=null){
		$db = new Application_Model_DbTable_DbGlobal();
		$request=Zend_Controller_Front::getInstance()->getRequest();
		
		$_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
		$_title->setAttribs(array(
				'dojoType'=>$this->tvalidate,
				'onkeyup'=>'this.submit()',
				'placeholder'=>$this->tr->translate("SEARCH_COLLTERAL")
		));
		$_title->setValue($request->getParam("adv_search"));
		
		$_status_search=  new Zend_Dojo_Form_Element_FilteringSelect('status_search');
		$_status_search->setAttribs(array('dojoType'=>$this->filter));
		$_status_opt = array(
				-1=>$this->tr->translate("ALL"),
				1=>$this->tr->translate("ACTIVE"),
				0=>$this->tr->translate("DACTIVE"));
		$_status_search->setMultiOptions($_status_opt);
		$_status_search->setValue($request->getParam("status_search"));
		
		$_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
		$_btn_search->setAttribs(array(
				'dojoType'=>'dijit.form.Button',
				'iconclass'=>'dijitIconSearch'
		));
		
		
		$_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
    	$_branch_id->setAttribs(array(
    			'dojoType'=>'dijit.form.FilteringSelect',
    			'class'=>'fullside',
    			'required' =>'true',
    			'Onchange'=>"filterClient();"
    			
    	));
    	$rows = $db->getAllBranchName();
    	$options=array(''=>"------Select Branch------");
    	if(!empty($rows))
    		foreach($rows AS $row){
    		$options[$row['br_id']]=$row['branch_namekh'];
    	}
    	$_branch_id->setMultiOptions($options);
    	$_branch_id->setValue($request->getParam('branch_id'));
		
		
		$db = new Application_Model_DbTable_DbGlobal();
		$co_name = new Zend_Dojo_Form_Element_FilteringSelect('co_name');
		$rows = $db ->getAllCOName();
		$options=array(''=>"------Select Staff------",-1=>"Add New");
		if(!empty($rows))foreach($rows AS $row) $options[$row['co_id']]=$row['co_khname'];
		$co_name->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'popupCheckCO();'
		));
		$co_name->setMultiOptions($options);
		$co_name->setValue($request->getParam('co_name'));
		$getter_name = new Zend_Dojo_Form_Element_ValidationTextBox('getter_name');
		$getter_name->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside',
				'required'=>true
		));
		
		$giver_name = new Zend_Dojo_Form_Element_TextBox('giver_name');
		$giver_name->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'required'=>true
		));
		
		$Date=new Zend_Dojo_Form_Element_DateTextBox('date');
		$Date->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside'
				));
		
		$_name=new Zend_Dojo_Form_Element_ValidationTextBox('name');
		$_name->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside'
				));
		$relattive=new Zend_Dojo_Form_Element_ValidationTextBox('names');
		$relattive->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside'
		));
		$guarantor=new Zend_Dojo_Form_Element_ValidationTextBox('owner');
		$guarantor->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside'
		));
		$relative_guarantor=new Zend_Dojo_Form_Element_ValidationTextBox('and_name');
		$relative_guarantor->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside'
		));
		$relative_guarantor_=new Zend_Dojo_Form_Element_ValidationTextBox('and_names');
		$relative_guarantor_->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside'
		));
		
//         $db = new Application_Model_DbTable_DbGlobal();
// 		$collteral_type=new Zend_Dojo_Form_Element_FilteringSelect('collteral_type');
// 		$collteral_type->setAttribs(array(
// 				'dojoType'=>'dijit.form.FilteringSelect',
// 				'class'=>'fullside'
// 				));
// 		$opt= $db->getCollteralType(1);
// 		$collteral_type->setMultiOptions($opt);
// 		$collteral_type->setValue($request->getParam('collteral_type'));
		
		$note=new Zend_Dojo_Form_Element_TextBox('note');
		$note->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		$Date_estate=new Zend_Dojo_Form_Element_DateTextBox('date_estate');
		$Date_estate->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside'
		));
		$Date_estate->setValue(date('Y-m-d'));
		$stutas = new Zend_Dojo_Form_Element_FilteringSelect('Stutas');
		$stutas ->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				));
		$options= array(1=>"ប្រើប្រាស់",2=>"មិនប្រើប្រាស់");
		$stutas->setMultiOptions($options);
		
		$cod_cal = new Zend_Dojo_Form_Element_TextBox('cod_cal');
		$cod_cal ->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'readOnly'=>'readOnly',
				'class'=>'fullside',
				'style'=>'color:red'
		));
		$code = Group_Model_DbTable_DbCallteral::getCallteralCode();
		$cod_cal->setValue($code);
		
		$from_date = new Zend_Dojo_Form_Element_DateTextBox('start_date');
		$from_date->setAttribs(array('dojoType'=>'dijit.form.DateTextBox','required'=>'true',
				'class'=>'fullside'));
		$_date = $request->getParam("start_date");
		
		if(empty($_date)){
			$_date = date('Y-m-d');
		}
		$from_date->setValue($_date);
		
		
		$to_date = new Zend_Dojo_Form_Element_DateTextBox('end_date');
		$to_date->setAttribs(array('dojoType'=>'dijit.form.DateTextBox','required'=>'true','class'=>'fullside',
		));
		$_date = $request->getParam("end_date");
		
		if(empty($_date)){
			$_date = date("Y-m-d");
		}
		$to_date->setValue($_date);
		
		
		$id = new Zend_Form_Element_Hidden("id");
		if($data!=null){
			$_branch_id->setValue($data['branch_id']);
			$cod_cal->setValue($data['collecteral_code']);
			$co_name->setValue($data['co_id']);

			$_name->setValue($data['join_with']);
			$relattive->setValue($data['relative']);
			$guarantor->setValue($data['guarantor']);
			$relative_guarantor->setValue($data['guarantor_relative']);
			$note->setValue($data['note']);
// 			$Date_estate->setValue($data['date_registration']);
			$stutas->setValue($data['status']);
			$id->setValue($data['id']);
			
		}


		$this->addElements(array($from_date,$to_date,$_btn_search,$_status_search,$_title,$co_name,$getter_name,$giver_name,$Date,
				$_name,$relattive,$guarantor,$relative_guarantor,$note,	$Date_estate,$_branch_id,$id,$stutas,$cod_cal));
		return $this;
		
	}	
Exemplo n.º 10
0
 public function FrmReturnCollteral($data = null)
 {
     $db = new Application_Model_DbTable_DbGlobal();
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $_client_code = new Zend_Dojo_Form_Element_FilteringSelect('client_code');
     $_client_code->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'getOwnerInfo();'));
     $group_opt = $db->getGroupCodeById(1, 0, 1);
     //code,individual,option
     $_client_code->setMultiOptions($group_opt);
     $_client_code->setValue($request->getParam('client_code'));
     $clint_name = new Zend_Dojo_Form_Element_FilteringSelect('client_name');
     $clint_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'checkClientCode()'));
     $options = $db->getGroupCodeById(2, 0, 1);
     $clint_name->setMultiOptions($options);
     $_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
     $_title->setAttribs(array('dojoType' => $this->tvalidate, 'onkeyup' => 'this.submit()', 'placeholder' => $this->tr->translate("ADVANCE_SEARCH")));
     $_title->setValue($request->getParam("adv_search"));
     $_status_search = new Zend_Dojo_Form_Element_FilteringSelect('status_search');
     $_status_search->setAttribs(array('dojoType' => $this->filter));
     $_status_opt = array(-1 => $this->tr->translate("ALL"), 1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $_status_search->setMultiOptions($_status_opt);
     $_status_search->setValue($request->getParam("status_search"));
     $_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
     $_btn_search->setAttribs(array('dojoType' => 'dijit.form.Button', 'iconclass' => 'dijitIconSearch'));
     $Date = new Zend_Dojo_Form_Element_DateTextBox('date');
     $Date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside'));
     $note = new Zend_Dojo_Form_Element_TextBox('note');
     $note->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $note->setValue('out of loan');
     $Date->setValue(date('Y-m-d'));
     $stutas = new Zend_Dojo_Form_Element_FilteringSelect('stutas');
     $stutas->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $options = array(1 => "ប្រើប្រាស់", 0 => "មិនប្រើប្រាស់");
     $stutas->setMultiOptions($options);
     $receiver_name = new Zend_Dojo_Form_Element_ValidationTextBox('receiver_name');
     $receiver_name->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside', 'required' => true));
     $giver_name = new Zend_Dojo_Form_Element_ValidationTextBox('giver_name');
     $giver_name->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside', 'required' => true));
     $from_date = new Zend_Dojo_Form_Element_DateTextBox('start_date');
     $from_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'required' => 'true', 'class' => 'fullside', 'onchange' => 'CalculateDate();'));
     $_date = $request->getParam("start_date");
     if (empty($_date)) {
         $_date = date('Y-m-d');
     }
     $from_date->setValue($_date);
     $to_date = new Zend_Dojo_Form_Element_DateTextBox('end_date');
     $to_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'required' => 'true', 'class' => 'fullside'));
     $_date = $request->getParam("end_date");
     if (empty($_date)) {
         $_date = date("Y-m-d");
     }
     $to_date->setValue($_date);
     $from = new Zend_Dojo_Form_Element_FilteringSelect('from');
     $from->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true));
     $from->setValue($request->getParam('from'));
     $opt = $db->getCollteralType(1);
     $from->setMultiOptions($opt);
     $_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
     $_branch_id->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     $rows = $db->getAllBranchName();
     $options = array('' => "------Select Branch Name------");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $_branch_id->setMultiOptions($options);
     $_branch_id->setValue($request->getParam('branch_id'));
     $collteral_type = new Zend_Dojo_Form_Element_FilteringSelect('collteral_type');
     $collteral_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = $db->getCollteralType(1);
     $collteral_type->setMultiOptions($opt);
     $collteral_type->setValue($request->getParam('collteral_type'));
     $id = new Zend_Form_Element_Hidden("id");
     $receiver_name->setValue($this->getUserName());
     if ($data != null) {
         $_branch_id->setValue($data['branch_id']);
         $clint_name->setValue($data['client_id']);
         $_client_code->setValue($data['client_id']);
         $giver_name->setValue($data['receiver_name']);
         $receiver_name->setValue($data['giver_name']);
         $note->setValue($data['note']);
         $Date->setValue($data['date']);
         $stutas->setValue($data['status']);
         $id->setValue($data['return_id']);
     }
     $this->addElements(array($collteral_type, $_branch_id, $from, $_client_code, $clint_name, $from_date, $to_date, $giver_name, $receiver_name, $_btn_search, $_status_search, $_title, $Date, $note, $Date, $id, $stutas));
     return $this;
 }
Exemplo n.º 11
0
	public function FrmBadLoan($data=null){
		$db = new Application_Model_DbTable_DbGlobal();
		$request=Zend_Controller_Front::getInstance()->getRequest();
		
		$_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
		$_title->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'placeholder'=>$this->tr->translate("SEARCH")
		));
		$_title->setValue($request->getParam("adv_search"));
		
		$_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch');
    	$_branch_id->setAttribs(array(
    			'dojoType'=>'dijit.form.FilteringSelect',
    			'class'=>'fullside',
    			'required' =>'true'
    	));
    	$rows = $db->getAllBranchName();
    	$options=array(''=>"---Select Branch Name---");
    	if(!empty($rows))
    		foreach($rows AS $row){
    		$options[$row['br_id']]=$row['branch_namekh'];
    	}
    	$_branch_id->setMultiOptions($options);
    	$_branch_id->setValue($request->getParam('branch'));
		
		$db = new Loan_Model_DbTable_DbBadloan();
		$client_code = new Zend_Dojo_Form_Element_FilteringSelect('client_code');
		$client_code->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'getClientInfo();'
		));
		$opt= $db->getClientByTypes(1);
		$opt[0]='---Select Client Code---';
		$client_code->setMultiOptions($opt);
		$client_code->setValue($request->getParam('client_code'));
		
		$client_codeadd = new Zend_Dojo_Form_Element_FilteringSelect('client_codeadd');
		$client_codeadd->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'getClientInfo();'
		));
		$opt= $db->getClientByTypesADD(1);
		$client_codeadd->setMultiOptions($opt);
		
		$client_name = new Zend_Dojo_Form_Element_FilteringSelect('client_name');
		$client_name->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
			    'onchange'=>"getClientInfo(1);"
				));
		$options = $db->getClientByTypes(2);
		$options[0]='---Select Client Name---';
		$client_name->setMultiOptions($options);
		$client_name->setValue($request->getParam('client_name'));
		
		$client_nameadd = new Zend_Dojo_Form_Element_FilteringSelect('client_nameadd');
		$client_nameadd->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>"getClientInfo(1);"
		));
		$options = $db->getClientByTypesADD(2);
		$client_nameadd->setMultiOptions($options);
		
		$number_code = new Zend_Dojo_Form_Element_FilteringSelect('number_code');
		$number_code->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>"getClientInfo(2);"
		));
		
		$options = $db->getClientByTypes(3);
		$number_code->setMultiOptions($options);
		
		$_date= new Zend_Dojo_Form_Element_DateTextBox('Date');
		$_date->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside',
		));
		$_date->setValue(date('Y-m-d'));
		
		
		$date_loss= new Zend_Dojo_Form_Element_DateTextBox('date_loss');
		$date_loss->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside',
		));
		$date_loss->setValue(date('Y-m-d'));
		
		$db = new Loan_Model_DbTable_DbBadloan();
		$total_amount = new Zend_Dojo_Form_Element_NumberTextBox('Total_amount');
		$total_amount->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required'=>true
							
		));
		
		$interest_amount = new Zend_Dojo_Form_Element_NumberTextBox('Interest_amount');
		$interest_amount->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required'=>true
				
		));
	
		$_note = new Zend_Dojo_Form_Element_Textarea('Note');
		$_note ->setAttribs(array(
				'dojoType'=>'dijit.form.SimpleTextarea',
				'class'=>'fullside',
				'style'=>'width:98%',
				'required' =>'true'
		));
		
		$_term = new Zend_Dojo_Form_Element_FilteringSelect('Term');
		$_term->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
		));
		
		$type_opt = array(
				''=>$this->tr->translate("---Select Long Term---"),
				1=>$this->tr->translate("Standard ,<= 10 Days"),
				2=>$this->tr->translate("Special Mention ,11-90 Days"),
				3=>$this->tr->translate("Substandard ,91-180 Days"),
				4=>$this->tr->translate("Doubtful ,181-360 Days"),
				5=>$this->tr->translate("Loan Loss ,>360 days"));
		 
		$_term->setMultiOptions($type_opt);
		$_term->setValue($request->getParam('Term'));
		
		$star_date = new Zend_Dojo_Form_Element_DateTextBox('start_date');
		$star_date->setAttribs(array('dojoType'=>'dijit.form.DateTextBox'));
		$date = $request->getParam("start_date");
		
		if(empty($date)){
			$date = date('Y-m-01');
		}
		$star_date->setValue($date);
		
		$_enddate = new Zend_Dojo_Form_Element_DateTextBox('end_date');
		$_enddate->setAttribs(array('dojoType'=>'dijit.form.DateTextBox',
				'required'=>'true',
				'class'=>'fullside',
		));
		$date = $request->getParam("end_date");
		
		if(empty($date)){
			$date = date("Y-m-d");
		}
		$_enddate->setValue($date);
		
		
// 		$cash_type = new Zend_Dojo_Form_Element_FilteringSelect('cash_type');
// 		$cash_type ->setAttribs(array(
// 				'dojoType'=>'dijit.form.FilteringSelect',
// 				'class'=>'fullside',
// 				'required'=>true
// 		));
// 		$cash_type_opt = array(
// 				1=>$this->tr->translate("DOLLA"),
// 				2=>$this->tr->translate("RIEAL"),
// 		        3=>$this->tr->translate("BATH"));
		       
// 		$cash_type->setMultiOptions($cash_type_opt);
		
		$cash_type = new Zend_Dojo_Form_Element_FilteringSelect('cash_type');
		$cash_type->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required'=>true
		));
		$opt = array(''=>"Select Currency Type",2=>"Dollar",1=>'Khmer',3=>"Bath");
		if($request->getActionName()!='index' AND $request->getActionName()!='rpt-loan-npl' ){
			unset($opt['']);
		}
		$cash_type->setMultiOptions($opt);
		$cash_type->setValue($request->getParam('cash_type'));
		
		
		$status = new Zend_Dojo_Form_Element_Textarea('status');
		$status ->setAttribs(array(
				'dojoType'=>'dijit.form.SimpleTextarea',
				'class'=>'fullside',
				'style'=>'width:98%'
		));
		 
		
		$_arr = array(''=>$this->tr->translate("ALL"),1=>$this->tr->translate("ACTIVE"),0=>$this->tr->translate("DACTIVE"));
		if($request->getActionName()!='index'){
			unset($_arr['']);
		}
		$_status = new Zend_Dojo_Form_Element_FilteringSelect("status");
		$_status->setMultiOptions($_arr);
		$_status->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'required'=>'true',
				'missingMessage'=>'Invalid Module!',
				'class'=>'fullside'));
		$_status->setValue($request->getParam('status'));
		
		$id = new Zend_Form_Element_Hidden("id");
		$id_cient = new Zend_Form_Element_Hidden("idclient");
// 		print_r($data);exit();
		$_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
		$_btn_search->setAttribs(array(
				'dojoType'=>'dijit.form.Button',
				'iconclass'=>'dijitIconSearch'
		));
		if($data!=null){
				
			$_branch_id->setValue($data['branch']);
			$client_code->setValue($data['client_code']);
			$client_name->setValue($data['client_name']);
			$number_code->setValue($data['number_code']);
			$_date->setValue($data['date']);
			$date_loss->setValue($data['loss_date']);
			$total_amount->setValue($data['total_amount']);
			$interest_amount->setValue($data['intrest_amount']);
			$_term->setValue($data['tem']);
			$_note->setValue($data['note']);
			$_status->setValue($data['status']);
			$id->setValue($data['id']);
			$id_cient->setValue($data['client_code']);
		}
		
		$this->addElements(array($_enddate,$star_date,$id_cient,$client_nameadd,$client_codeadd,$_btn_search,$_title,$_status,$cash_type,$id,$_branch_id,$client_code,$client_name,$number_code,$date_loss,$total_amount,$interest_amount,$_date,$_term,$_note));
		return $this;
		
	}	
Exemplo n.º 12
0
	public function FrmTransfer($data=null){
		
		$db = new Application_Model_DbTable_DbGlobal();
		$_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
		$_title->setAttribs(array(
				'dojoType'=>$this->tvalidate,
				'onkeyup'=>'this.submit()',
				'placeholder'=>$this->tr->translate("SEARCH")
		));
		$_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
		$_btn_search->setAttribs(array(
				'dojoType'=>'dijit.form.Button',
				'iconclass'=>'dijitIconSearch'
		));
		
		$request=Zend_Controller_Front::getInstance()->getRequest();
		$branch_name = new Zend_Dojo_Form_Element_FilteringSelect('branch_name');
    	$branch_name->setAttribs(array(
    			'dojoType'=>'dijit.form.FilteringSelect',
    			'class'=>'fullside',
    			'required' =>'true'
    	));
    	$rows = $db->getAllBranchName();
    	$options=array(''=>"------Select------");
    	if(!empty($rows))
    		foreach($rows AS $row){
    		$options[$row['br_id']]=$row['branch_namekh'];
    	}
    	$branch_name->setMultiOptions($options);
    	$branch_name->setValue($request->getParam('branch_id'));    	
    	
    	$co_name = new Zend_Dojo_Form_Element_FilteringSelect('co_code');
    	$co_name->setAttribs(array(
    			'dojoType'=>'dijit.form.FilteringSelect',
    			'class'=>'fullside',
    			'required' =>'true',
    			'onchange'=>'getClientInfo(1);'
    	));
    	$db_co = new Loan_Model_DbTable_DbTransferCo();
    	$row_co = $db_co->getcoinfo();
    	$options_co =array(''=>"---Select From CO Code---");
    	if (!empty($row_co))
    		foreach ($row_co AS $row_cos){
    		$options_co[$row_cos['co_id']] = $row_cos['co_code'];
    		}
    	$co_name->setMultiOptions($options_co);
		
		$_date= new Zend_Dojo_Form_Element_DateTextBox('Date');
		$_date->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside',
				
		));
		$_date->setValue(date('Y-m-d'));
		
		$db = new Loan_Model_DbTable_DbBadloan();
		$co_code = new Zend_Dojo_Form_Element_FilteringSelect('co_codes');
		$co_code->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
// 				'onchange'=>'getClientInfo();'
		));

// 		$opt= $db->getClientByTypes(1);
// 		$co_code->setMultiOptions($opt);
		
		$formc_co = new Zend_Dojo_Form_Element_FilteringSelect('formc_co');
		$formc_co->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
			    'onchange'=>"getClientInfo(2);"
				));
		$row_froms = $db_co->getcoinfo();
		$options_from =array(''=>"---Select From CO Name---");
		if (!empty($row_froms))
			foreach ($row_froms AS $row_from){
			$options_from[$row_from['co_id']] = $row_from['co_khname'];
		}
		$formc_co->setMultiOptions($options_from);
		
// 		$options = $db->getClientByTypes(2);
// 		$formc_co->setMultiOptions($options);
		
		$to_co = new Zend_Dojo_Form_Element_FilteringSelect('to_co');
		$to_co->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>"getClientInfo(3);"
		));
		$row_co = $db_co->getcoinfo();
		$options_co =array(''=>"---Select To CO Name---");
		if (!empty($row_co))
			foreach ($row_co AS $row_cos){
			$options_co[$row_cos['co_id']] = $row_cos['co_khname'];
		}
		$to_co->setMultiOptions($options_co);
		// 		$options = $db->getClientByTypes(2);
		// 		$formc_co->setMultiOptions($options);
		
		$to_co_code = new Zend_Dojo_Form_Element_FilteringSelect('to_co_code');
		$to_co_code->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>"getClientInfo(4);"
		));
		$row_froms = $db_co->getcoinfo();
		$options_from =array(''=>"---Select To CO Code---");
		if (!empty($row_froms))
			foreach ($row_froms AS $row_from){
			$options_from[$row_from['co_id']] = $row_from['co_code'];
		}
		$to_co_code->setMultiOptions($options_from);
		
		$note = new Zend_Dojo_Form_Element_Textarea('Note');
		$note ->setAttribs(array(
				'dojoType'=>'dijit.form.SimpleTextarea',
				'class'=>'fullside',
				'style'=>'width:98%',
				'required'=>true
		));
		$user_id = new Zend_Dojo_Form_Element_FilteringSelect('user_id');
		$user_id->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				//'onchange'=>"getClientInfo(1);"
		));
		$row_froms = $db_co->getcoinfo();
		$options_from =array(''=>"------Select------");
		if (!empty($row_froms))
			foreach ($row_froms AS $row_from){
			//$options_from[$row_from['co_id']] = $row_from['user_id'];
		}
		$user_id->setMultiOptions($options_from);
		
	

		$_arr = array(1=>$this->tr->translate("ACTIVE"),0=>$this->tr->translate("DACTIVE"));
		$_status = new Zend_Dojo_Form_Element_FilteringSelect("status");
		$_status->setMultiOptions($_arr);
		$_status->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'required'=>'true',
				'missingMessage'=>'Invalid Module!',
				'class'=>'fullside'));
		
		//$id = new Zend_Form_Element_Hidden("id");
		if($data!=null){				
			$branch_name->setValue($data['branch_id']);
			$co_name->setValue($data['code_from']);
			$formc_co->setValue($data['from']);
			$to_co->setValue($data['to']);
			$to_co_code->setValue($data['code_to']);			
			$_status->setValue($data['status']);
			$_date->setValue($data['date']);
			$note->setValue($data['note']);
			
		}		
		
		$this->addElements(array($_title,$_btn_search,$co_name,$_status,$branch_name,$_date,$co_code,$formc_co,$to_co,$to_co_code,$note,$user_id));
		return $this;
		
	}	
Exemplo n.º 13
0
	public function FrmTransfer($data=null){
		
		$request=Zend_Controller_Front::getInstance()->getRequest();
		
		$db = new Application_Model_DbTable_DbGlobal();
		$db_co = new Loan_Model_DbTable_DbTransferCoClient();
		$branch_name = new Zend_Dojo_Form_Element_FilteringSelect('branch_name');
    	$branch_name->setAttribs(array(
    			'dojoType'=>'dijit.form.FilteringSelect',
    			'class'=>'fullside',
    			'required' =>'true'
    	));
    	$rows = $db->getAllBranchName();
    	$options=array(''=>"------Select Branch Name------");
    	if(!empty($rows))
    		foreach($rows AS $row){
    		$options[$row['br_id']]=$row['branch_namekh'];
    	}
    	$branch_name->setMultiOptions($options);
    	$branch_name->setValue($request->getParam('branch_name'));    	
		
		$_date= new Zend_Dojo_Form_Element_DateTextBox('Date');
		$_date->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside',
				
		));
		$_date->setValue(date('Y-m-d'));
		$co_code = new Zend_Dojo_Form_Element_FilteringSelect('co_code');
		$co_code->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>"getClientInfo(1);"
		));
	
		$_member = new Zend_Dojo_Form_Element_FilteringSelect('member');
		$_member->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'getClientInfo(1);'
		));
		
		$db = new Application_Model_DbTable_DbGlobal();
		$options = $db->getGroupCodeById(2,0,1);
		$_member->setMultiOptions($options);
		
		$_customer_code = new Zend_Dojo_Form_Element_FilteringSelect('customer_code');
		$_customer_code->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				 'onchange'=>'getClientInfo(2);'
		));
		$group_opt = $db->getGroupCodeById(1,0,1);//code,individual,option
		$_customer_code->setMultiOptions($group_opt);
		
		
		$row_co = $db->getAllCOName();
		$options_co =array(''=>"------Select From CO ------");
		if (!empty($row_co))
			foreach ($row_co AS $row_cos){
			$options_co[$row_cos['co_id']] = $row_cos['co_firstname'];
		}
		$co_code->setMultiOptions($options_co);
		$co_code->setValue($request->getParam('co_code'));
		
		
		
		$formc_co = new Zend_Dojo_Form_Element_FilteringSelect('name_co');
		$formc_co->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
			    'onchange'=>"getClientInfo(2);"
				));
		$options = $db->getAllCOName(1);
		$options['']='---Select To CO---';
		$formc_co->setMultiOptions($options);
		$formc_co->setValue($request->getParam('name_co'));
		
		$name_client = new Zend_Dojo_Form_Element_FilteringSelect('name_client');
		$name_client->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>"getClientInfo(3);"
		));
		$row_co = $db_co->getcoinfo();
		$options_co =array(''=>"---Select Client Name---");
		if (!empty($row_co))
			foreach ($row_co AS $row_cos){
			$options_co[$row_cos['member_id']] = $row_cos['client_name'];
		}
		$name_client->setMultiOptions($options_co);
		
		$code_client = new Zend_Dojo_Form_Element_FilteringSelect('code_client');
		$code_client->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>"getClientInfo(4);"
		));
		$row_number = $db_co->getcoinfo();
		$options_numbers=array(''=>"---Select Client Code---");
		if (!empty($row_number))
			foreach ($row_number AS $row_client){
			$options_numbers[$row_client['member_id']] = $row_client['client_code'];
		}
		$code_client->setMultiOptions($options_numbers);
		
		$loan_number= new Zend_Dojo_Form_Element_FilteringSelect('loan_number');
		$loan_number->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>"getClientInfo(5);"
		));
		$row_number = $db_co->getcoinfo();
		$options_from =array(''=>"------Select Loan Number------");
		if (!empty($row_number))
			foreach ($row_number AS $row_numbers){
			$options_from[$row_numbers['member_id']] = $row_numbers['loan_number'];
		}		
		$loan_number->setMultiOptions($options_from);
		$loan_number->setValue($request->getParam("loan_number")); 
		
		$loan_client = new Zend_Dojo_Form_Element_FilteringSelect('loan_client');
		$loan_client->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>"getClientInfo(3);"
		));
		$loan_clientgroup = $db_co->getcoinfo();
		$options_loan_client =array(''=>"------Select Client Name------");
		if (!empty($loan_clientgroup))
			foreach ($loan_clientgroup AS $loan_clientgroups){
			$options_loan_client[$loan_clientgroups['member_id']] = $loan_clientgroups['client_name'];
		}
		$loan_client->setMultiOptions($options_loan_client);
		$loan_client->setValue($request->getParam('loan_client'));
		
		$desc = new Zend_Dojo_Form_Element_TextBox('note');
		$desc ->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		$desc->setValue($request->getParam('note'));
		
		$note = new Zend_Dojo_Form_Element_Textarea('Note');
		$note ->setAttribs(array(
				'dojoType'=>'dijit.form.SimpleTextarea',
				'class'=>'fullside',
				'required' =>true,
				'style'=>'width:98%'
		));
		
		$user_id = new Zend_Dojo_Form_Element_FilteringSelect('user_id');
		$user_id->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
		));
		$row_froms = $db_co->getcoinfo();
		$options_from =array(''=>"------Select------");
		if (!empty($row_froms))
			foreach ($row_froms AS $row_from){
		}
		$user_id->setMultiOptions($options_from);	

		$_arr = array(1=>$this->tr->translate("ACTIVE"),0=>$this->tr->translate("DACTIVE"),-1=>$this->tr->translate("ALL"));
		$_status = new Zend_Dojo_Form_Element_FilteringSelect("status");
		$_status->setMultiOptions($_arr);
		$_status->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'required'=>'true',
				'missingMessage'=>'Invalid Module!',
				'class'=>'fullside'));
		
		$star_date = new Zend_Dojo_Form_Element_DateTextBox('start_date');
		$star_date->setAttribs(array('dojoType'=>'dijit.form.DateTextBox'));
		$date = $request->getParam("start_date");
		
		if(empty($date)){
			$date = date('Y-m-01');
		}
		$star_date->setValue($date);
		
		$_enddate = new Zend_Dojo_Form_Element_DateTextBox('end_date');
		$_enddate->setAttribs(array('dojoType'=>'dijit.form.DateTextBox','required'=>'true',
		));
		$date = $request->getParam("end_date");
		
		if(empty($date)){
			$date = date("Y-m-d");
		}
		$_enddate->setValue($date);

		$_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
		$_btn_search->setAttribs(array(
				'dojoType'=>'dijit.form.Button',
				'iconclass'=>'dijitIconSearch',
		));
		
		if($data!=null){				
			$branch_name->setValue($data['branch_id']);
			$co_code->setValue($data['code_to']);
			$formc_co->setValue($data['to']);
			$name_client->setValue($data['client_id']);
			$code_client->setValue($data['client_id']);			
			$_status->setValue($data['status']);
			$_date->setValue($data['date']);
			$note->setValue($data['note']);
			$loan_number->setValue($data['loan_id']);
			$loan_client->setValue($data['loan_id']);
			$_member->setValue($data['client_id']);
			$_member->setValue($data['client_id']);
			$_customer_code->setValue($data['client_id']);
		}		
		
		$this->addElements(array($_customer_code,$_member,$_btn_search,$desc,$star_date,$_enddate,$loan_client,$loan_number,$_status,$branch_name,$_date,$formc_co,$name_client,$co_code,$code_client,$note,$user_id));
		return $this;
	}	
Exemplo n.º 14
0
 public function FrmAsset($data = null)
 {
     $asset_name = new Zend_Dojo_Form_Element_TextBox('asset_name');
     $asset_name->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true));
     $asset_code = new Zend_Dojo_Form_Element_NumberTextBox('asset_code');
     $asset_code->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $db = new Application_Model_DbTable_DbGlobal();
     $paid_type = new Zend_Dojo_Form_Element_FilteringSelect('paid_type');
     $paid_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true));
     $opt = $db->getVewOptoinTypeByType(7, 1);
     $paid_type->setMultiOptions($opt);
     $paid_type->setValue(1);
     $note = new Zend_Dojo_Form_Element_TextBox('note');
     $note->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true));
     $_stutas = new Zend_Dojo_Form_Element_FilteringSelect('status');
     $_stutas->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $options = array(1 => "ប្រើប្រាស់", 0 => "មិនប្រើប្រាស់");
     $_stutas->setMultiOptions($options);
     $some_payamount = new Zend_Dojo_Form_Element_TextBox('some_payamount');
     $some_payamount->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true));
     $asset_type = new Zend_Dojo_Form_Element_FilteringSelect('asset_type');
     $asset_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true));
     $opt = array(1 => 'Long Term', 2 => 'Short Term');
     $asset_type->setMultiOptions($opt);
     $asset_cost = new Zend_Dojo_Form_Element_NumberTextBox('asset_cost');
     $asset_cost->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => 'true'));
     $useful_life = new Zend_Dojo_Form_Element_NumberTextBox('usefull_life');
     $useful_life->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $salvage_value = new Zend_Dojo_Form_Element_NumberTextBox('salvage_value');
     $salvage_value->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => 'true'));
     $payment_method = new Zend_Dojo_Form_Element_FilteringSelect('payment_method');
     $payment_method->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $option = array(1 => 'Straight line', 2 => 'Double-declining banlance', 3 => 'Sum of the year');
     $payment_method->setMultiOptions($option);
     $Date = new Zend_Dojo_Form_Element_DateTextBox('date');
     $Date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside'));
     $Date->setValue(date('Y-m-d'));
     $start_date = new Zend_Dojo_Form_Element_DateTextBox('start_date');
     $start_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside'));
     $start_date->setValue(date('Y-m-d'));
     $_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch');
     $_branch_id->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     // 		$_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
     // 		$_branch_id->setAttribs(array(
     // 				'dojoType'=>'dijit.form.FilteringSelect',
     // 				'class'=>'fullside',
     // 				'required' =>'true'
     // 		));
     $db = new Application_Model_DbTable_DbGlobal();
     $rows = $db->getAllBranchName();
     $options = '';
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $_branch_id->setMultiOptions($options);
     $_id = new Zend_Form_Element_Hidden('id');
     if ($data != null) {
         $_branch_id->setValue($data['branch_id']);
         $asset_name->setValue($data['fixed_assetname']);
         $asset_type->setValue($data['fixed_asset_type']);
         $asset_cost->setValue($data['asset_cost']);
         $useful_life->setValue($data['usefull_life']);
         $salvage_value->setValue($data['salvagevalue']);
         $payment_method->setValue($data['payment_method']);
         $Date->setValue($data['depreciation_start']);
         $start_date->setValue($data['date']);
         $asset_code->setValue($data['asset_code']);
         $paid_type->setValue($data['pay_type']);
         $some_payamount->setValue($data['some_payamount']);
         $note->setValue($data['note']);
         $_stutas->setValue($data['status']);
         $_id->setValue($data['id']);
     }
     $this->addElements(array($asset_name, $asset_type, $asset_cost, $start_date, $useful_life, $salvage_value, $payment_method, $Date, $_branch_id, $_id, $asset_code, $paid_type, $note, $_stutas, $some_payamount));
     return $this;
 }
Exemplo n.º 15
0
	public function AdvanceSearch ($data=null){
		$request=Zend_Controller_Front::getInstance()->getRequest();
		$db = new Loan_Model_DbTable_DbGroupPayment();
		
		$payment_type = new Zend_Dojo_Form_Element_FilteringSelect("paymnet_type");
		$payment_type->setAttribs(array('class'=>'fullside','dojoType'=>'dijit.form.FilteringSelect'));
		$options= array(''=>'ប្រភេទបង់ប្រាក់',1=>'បង់ធម្មតា',2=>'បង់មុន',3=>'បង់រំលោះប្រាក់ដើម');
		$payment_type->setMultiOptions($options);
		$payment_type->setValue($request->getParam("paymnet_type"));
		
		$branch = new Zend_Dojo_Form_Element_FilteringSelect("branch_id");
		$branch->setAttribs(array('class'=>'fullside','dojoType'=>'dijit.form.FilteringSelect'));
		$opt_branch = array(-1=>'ជ្រើសរើស សាខា');
		$dbs = new Application_Model_DbTable_DbGlobal();
		$rows = $dbs->getAllBranchName();
			if(!empty($rows))foreach($rows AS $row){
				$opt_branch[$row['br_id']]=$row['branch_namekh'];
			}
		$branch->setMultiOptions($opt_branch);
		$branch->setValue($request->getParam("branch_id"));
		
		
		$advnceSearch = new Zend_Dojo_Form_Element_TextBox("advance_search");
		$advnceSearch->setAttribs(array('class'=>'fullside'
				,'dojoType'=>'dijit.form.TextBox'
				,'placeholder'=>$this->tr->translate("ADVANCE_SEARCH")));
		
		$client_name = new Zend_Dojo_Form_Element_FilteringSelect("client_name");
		$opt_client = array(''=>'ជ្រើសរើស ឈ្មោះអតិថិជន');
		$rows = $db->getIndividuleClient();
		if(!empty($rows))foreach($rows AS $row){
			$opt_client[$row['id']]=$row['name'];
		}
		$client_name->setMultiOptions($opt_client);
		$client_name->setAttribs(array('class'=>'fullside','dojoType'=>'dijit.form.FilteringSelect'));
		
		$g_client_name = new Zend_Dojo_Form_Element_FilteringSelect("g_client_name");
		$opt_client = array(''=>'ជ្រើសរើស ឈ្មោះអតិថិជន');
		$rows = $db->getAllClient();
		if(!empty($rows))foreach($rows AS $row){
			$opt_client[$row['id']]=$row['name'];
		}
		$g_client_name->setMultiOptions($opt_client);
		$g_client_name->setAttribs(array('class'=>'fullside','dojoType'=>'dijit.form.FilteringSelect'));
		
		$_coid = new Zend_Dojo_Form_Element_FilteringSelect('co_id');
		$_coid->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'onchange'=>'popupCheckCO();',
				'class'=>'fullside'
		));
		$options = $dbs->getAllCOName(1);
		$_coid->setMultiOptions($options);
		$_coid->setValue($request->getParam("co_id"));
		
		
		$start_date = new Zend_Dojo_Form_Element_DateTextBox("start_date");
		$start_date->setAttribs(array('class'=>'fullside','dojoType'=>'dijit.form.DateTextBox','placeholder'=>$this->tr->translate("ចាប់ពីថ្ងៃ")));
		//$start_date->setValue($date);
		$_date = $request->getParam("start_date");
		if(empty($_date)){
			$_date = date('Y-m-d');
		}
		$start_date->setValue($_date);
		
		$date = date("y-m-d");
		$end_date = new Zend_Dojo_Form_Element_DateTextBox("end_date");
		$end_date->setAttribs(array('class'=>'fullside','dojoType'=>'dijit.form.DateTextBox','placeholder'=>$this->tr->translate("រហូតដល់ថ្ងៃ")));
		//$end_date->setValue($date);
		
		$_date = $request->getParam("end_date");
		if(empty($_date)){
			$_date = date('Y-m-d');
		}
		$end_date->setValue($_date);
		
		$status = new Zend_Dojo_Form_Element_FilteringSelect("status");
		$status->setAttribs(array('class'=>'fullside','dojoType'=>'dijit.form.FilteringSelect','placeholder'=>$this->tr->translate("ស្ថានការ")));
		$opt_status = array(''=>'ជ្រើសរើស ស្ថានការ','1'=>'ដំណើការ','2'=>'មិនដំណើការ');
		$status->setMultiOptions($opt_status);
		
		$submit = new Zend_Dojo_Form_Element_SubmitButton("btn_submit");
		$submit->setAttribs(array('dojoType'=>'dijit.form.Button',
				'iconclass'=>'dijitIconSearch',
				'label'=>'Search'));
		$advnceSearch->setValue($request->getParam("advance_search"));
		$client_name->setValue($request->getParam("client_name"));
		//$start_date->setValue($request->getParam("start_date"));
		//$end_date->setValue($request->getParam("end_date"));
		$status->setValue($request->getParam("status"));
		
		$_currency_type = new Zend_Dojo_Form_Element_FilteringSelect('currency_type');
		$_currency_type->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
		));
		$opt = array(-1=>"--Select Currency Type--",2=>"Dollar",1=>'Khmer',3=>"Bath");
		$_currency_type->setMultiOptions($opt);
		$_currency_type->setValue($request->getParam("currency_type"));
		if($data!=null){
			$advnceSearch->setValue($request->getParam("advance_search"));
			$client_name->setValue($request->getParam("client_name"));
			$start_date->setValue($request->getParam("start_date"));
			$end_date->setValue($request->getParam("end_date"));
			$status->setValue($request->getParam("status"));
			
		}
		$this->addElements(array($g_client_name,$_currency_type,$payment_type,$_coid,$branch,$submit,$advnceSearch,$client_name,$start_date,$end_date,$status));
		return $this;
		
	}	
Exemplo n.º 16
0
 public function callecteralllist($data = null)
 {
     $db = new Application_Model_DbTable_DbGlobal();
     $branch = new Zend_Dojo_Form_Element_FilteringSelect('branch');
     $branch->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     $rows = $db->getAllBranchName();
     $options = '';
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $branch->setMultiOptions($options);
     $id_client = $db->getNewReceiptId();
     $receipt = new Zend_Dojo_Form_Element_TextBox('receipt');
     $receipt->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true, 'readonly' => true, 'style' => 'color:red; font-weight: bold;'));
     $receipt->setValue($id_client);
     $id_client = $db->getCodecallId();
     $code_call = new Zend_Dojo_Form_Element_TextBox('code_call');
     $code_call->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'readonly' => true, 'style' => 'color:red; font-weight: bold;'));
     $code_call->setValue($id_client);
     $db = new Application_Model_DbTable_DbGlobal();
     $customer_name = new Zend_Dojo_Form_Element_FilteringSelect('customer_name');
     $customer_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => "getClientInfo(1);"));
     $rows = $db->getClientByType();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['client_id']] = $row['name_en'];
         }
     }
     $customer_name->setMultiOptions($options);
     $db = new Application_Model_DbTable_DbGlobal();
     $cus_code = new Zend_Dojo_Form_Element_FilteringSelect('cus_code');
     $cus_code->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true, 'onchange' => "getClientInfo(2);"));
     $rows = $db->getClientByType();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['client_id']] = $row['client_number'];
         }
     }
     $cus_code->setMultiOptions($options);
     $db = new Application_Model_DbTable_DbGlobal();
     $callecterall_type = new Zend_Dojo_Form_Element_FilteringSelect('callecterall_type');
     $callecterall_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = $db->getVewOptoinTypeBys(1);
     $callecterall_type->setMultiOptions($opt);
     //$callecterall_type->setValue();
     $nameouner = new Zend_Dojo_Form_Element_TextBox('nameouner');
     $nameouner->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $callnumber = new Zend_Dojo_Form_Element_TextBox('callnumber');
     $callnumber->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $date_call = new Zend_Dojo_Form_Element_DateTextBox('date_call');
     $date_call->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside', 'onchange' => 'checkReleaseDate();', 'required' => true));
     $date_call->setValue(date('Y-m-d'));
     $db = new Application_Model_DbTable_DbGlobal();
     $time_think = new Zend_Dojo_Form_Element_FilteringSelect('time_think');
     $time_think->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'checkTerm();', 'required' => true));
     $opt = $db->getVewOptoinTypeByType(14, 1);
     $time_think->setMultiOptions($opt);
     $time_think->setValue(1);
     $time_boro = new Zend_Dojo_Form_Element_NumberTextBox('time_boro');
     $time_boro->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'onkeyup' => 'calCulatePeriod()', 'required' => true));
     $dayless = new Zend_Dojo_Form_Element_DateTextBox('dayless');
     $dayless->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside'));
     $dayless->setValue(date('Y-m-d'));
     $db = new Application_Model_DbTable_DbGlobal();
     $cash_type = new Zend_Dojo_Form_Element_FilteringSelect('cash_type');
     $cash_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = $db->getVewOptoinTypeByType(15, 1);
     $cash_type->setMultiOptions($opt);
     $cash_type->setValue(1);
     $much_boro = new Zend_Dojo_Form_Element_NumberTextBox('much_boro');
     $much_boro->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside'));
     $note = new Zend_Dojo_Form_Element_TextBox('note');
     $note->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $term_fun = new Zend_Dojo_Form_Element_FilteringSelect('term_fun');
     $term_fun->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt_fun = $db->getVewOptoinTypeByType(14, 1);
     $term_fun->setMultiOptions($opt_fun);
     $term_fun->setValue(1);
     $charge_term = new Zend_Dojo_Form_Element_FilteringSelect('charge_term');
     $charge_term->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true));
     $opt_ch_term = array(1 => 'គិតជាភាគរយ​ %', 2 => 'គិតជាលុយផ្ទាល់');
     $charge_term->setMultiOptions($opt_ch_term);
     $amount_money = new Zend_Dojo_Form_Element_TextBox('amount_money');
     $amount_money->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true));
     $_id = new Zend_Form_Element_Hidden('id');
     if ($data != null) {
         $branch->setValue($data['branch']);
         $receipt->setValue($data['receipt']);
         $code_call->setValue($data['code_call']);
         $customer_name->setValue($data['customer_id']);
         $callecterall_type->setValue($data['type_call']);
         $nameouner->setValue($data['owner_call']);
         $callnumber->setValue($data['callnumber']);
         $date_call->setValue($data['date_debt']);
         $time_think->setValue($data['term']);
         $time_boro->setValue($data['amount_term']);
         $dayless->setValue($data['date_line']);
         $cash_type->setValue($data['curr_type']);
         $much_boro->setValue($data['amount_debt']);
         $note->setValue($data['note']);
         $_id->setValue($data['id']);
         $cus_code->setValue($data['customer_id']);
         $amount_money->setValue($data['amount_money']);
         $charge_term->setValue($data['charge_term']);
         $term_fun->setValue($data['term_fun']);
     }
     $this->addElements(array($amount_money, $branch, $customer_name, $cus_code, $receipt, $time_think, $time_boro, $term_fun, $charge_term, $date_call, $callecterall_type, $code_call, $note, $cash_type, $much_boro, $_id, $dayless, $callnumber, $nameouner));
     return $this;
 }
Exemplo n.º 17
0
	public function FrmAddClient($data=null){
		$_spouse = new Zend_Dojo_Form_Element_TextBox('spouse');
		$_spouse->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$_releted = new Zend_Dojo_Form_Element_TextBox('relate_with');
		$_releted->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$clienttype_nameen= new Zend_Dojo_Form_Element_DateTextBox('clienttype_nameen');
		$clienttype_nameen->setAttribs(array('dojoType'=>'dijit.form.TextBox','class'=>'fullside'
		));
		$clienttype_namekh= new Zend_Dojo_Form_Element_DateTextBox('clienttype_namekh');
		$clienttype_namekh->setAttribs(array('dojoType'=>'dijit.form.TextBox','class'=>'fullside'
		));
		$dob_join_acc= new Zend_Dojo_Form_Element_DateTextBox('dob_join_acc');
		$dob_join_acc->setAttribs(array('dojoType'=>'dijit.form.DateTextBox','class'=>'fullside',
		));
		$_dob_Guarantor= new Zend_Dojo_Form_Element_DateTextBox('dob_guarantor');
		$_dob_Guarantor->setAttribs(array('dojoType'=>'dijit.form.DateTextBox','class'=>'fullside',
		));
		$_dob= new Zend_Dojo_Form_Element_DateTextBox('dob_client');
		$_dob->setAttribs(array('dojoType'=>'dijit.form.DateTextBox','class'=>'fullside',
		));
		
		
		$_relate_tel = new Zend_Dojo_Form_Element_TextBox('relate_tel');
		$_relate_tel->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$_guarantor_tel = new Zend_Dojo_Form_Element_TextBox('guarantor_tel');
		$_guarantor_tel->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$_guarantor_with = new Zend_Dojo_Form_Element_TextBox('guarantor_with');
		$_guarantor_with->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		
		$request=Zend_Controller_Front::getInstance()->getRequest();
		
		$_group = new Zend_Dojo_Form_Element_CheckBox('is_group');
		$_group->setAttribs(array(
				'dojoType'=>'dijit.form.CheckBox',
				'onClick'=>'getGroupCode();',
				));
		
		$_group_code = new Zend_Dojo_Form_Element_TextBox('group_code');
		$_group_code->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'readonly'=>'readonly',
				'style'=>'color:red;'
		));
		
// 		$db = new Application_Model_DbTable_DbGlobal();
// 		$id_client = $db->getNewClientId();
		
		$_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
		$_branch_id->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'Onchange'=>'getFunction();'
		));
		$db = new Application_Model_DbTable_DbGlobal();
		$rows = $db->getAllBranchName();
		$options=array(''=>"---Select Branch Name---");
		if(!empty($rows))foreach($rows AS $row) $options[$row['br_id']]=$row['displayby']==1?$row['branch_namekh']:$row['branch_nameen'];
		$_branch_id->setMultiOptions($options);
	
		
		
		$_member = new Zend_Dojo_Form_Element_FilteringSelect('group_id');
		$_member->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'getGroupCode();'
		));
		$db = new Application_Model_DbTable_DbGlobal();
		$rows = $db->getClientByType(1);
		$options=array(''=>"---Select Group Name---");
		if(!empty($rows))foreach($rows AS $row) $options[$row['client_id']]=$row['name_en'];
		$_member->setMultiOptions($options);
		
		$_namekh = new Zend_Dojo_Form_Element_TextBox('name_kh');
		$_namekh->setAttribs(array(
						'dojoType'=>'dijit.form.ValidationTextBox',
						'class'=>'fullside',
						'required' =>'true'
		));
		
 		$id_client = $db->getNewClientId();
		$_clientno = new Zend_Dojo_Form_Element_TextBox('client_no');
		$_clientno->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'readonly'=>'readonly',
				'style'=>'color:red;'
		));
 		$_clientno->setValue($id_client);
	
		$_nameen = new Zend_Dojo_Form_Element_ValidationTextBox('name_en');
		$_nameen->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		
		$_join_with = new Zend_Dojo_Form_Element_TextBox('join_with');
		$_join_with->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$_join_nation_id = new Zend_Dojo_Form_Element_TextBox('join_nation_id');
		$_join_nation_id->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$_sex = new Zend_Dojo_Form_Element_FilteringSelect('sex');
		$_sex->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
		));
// 		$opt = array(1=>"Male",2=>"Femail");
		$opt_status = $db->getVewOptoinTypeByType(11,1);
		unset($opt_status[-1]);
		unset($opt_status['']);
		$_sex->setMultiOptions($opt_status);
		
		
		$_situ_status = new Zend_Dojo_Form_Element_FilteringSelect('situ_status');
		$_situ_status->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
		));
		$opt_status = $db->getVewOptoinTypeByType(5,1);
		unset($opt_status[-1]);
		unset($opt_status['']);
		$_situ_status->setMultiOptions($opt_status);
		
		$client_d_type = new Zend_Dojo_Form_Element_FilteringSelect('client_d_type');
		$client_d_type->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
		));
// 		$opt_client_d_type= $db->getVewOptoinTypeByType(23,1);
// 		$client_d_type->setMultiOptions($opt_client_d_type);
		
// 		$join_d_type = new Zend_Dojo_Form_Element_FilteringSelect('join_d_type');
// 		$join_d_type->setAttribs(array(
// 				'dojoType'=>'dijit.form.FilteringSelect',
// 				'class'=>'fullside',
// 		));
// 		$join_d_type->setMultiOptions($opt_client_d_type);
		
// 		$guarantor_d_type = new Zend_Dojo_Form_Element_FilteringSelect('guarantor_d_type');
// 		$guarantor_d_type->setAttribs(array(
// 				'dojoType'=>'dijit.form.FilteringSelect',
// 				'class'=>'fullside',
// 		));
// 		$guarantor_d_type->setMultiOptions($opt_client_d_type);
		
		$guarantor_address = new Zend_Dojo_Form_Element_TextBox('guarantor_address');
		$guarantor_address->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		///////////////////////////////////
		
		$_province = new Zend_Dojo_Form_Element_FilteringSelect('province');
		$_province->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'filterDistrict();',
				
		));
		
		$rows =  $db->getAllProvince();
		$options=array($this->tr->translate("SELECT_PROVINCE")); //array(''=>"------Select Province------",-1=>"Add New");
		if(!empty($rows))foreach($rows AS $row) $options[$row['province_id']]=$row['province_en_name'];
		$_province->setMultiOptions($options);
// 		$_province->setValue($request->getParam('province'));
		
		
		$_district = new Zend_Dojo_Form_Element_FilteringSelect('district');
// 		$rows =  $db->getAllDistrict();
// 		$options=array(''=>"------Select------",-1=>"Add New");
// 		if(!empty($rows))foreach($rows AS $row) $options[$row['dis_id']]=$row['district_name'];
// 		$_district->setMultiOptions($options);
		$_district->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'popupCheckDistrict();'
		));
		
		$_commune = new Zend_Dojo_Form_Element_FilteringSelect('commune');
// 		$rows =  $db->getCommune();
		$options=array(''=>"------Select------",-1=>"Add New");
// 		if(!empty($rows))foreach($rows AS $row) $options[$row['com_id']]=$row['commune_name'];
		$_commune->setMultiOptions($options);
		$_commune->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'popupCheckCommune();'
		));
		
		$_village = new Zend_Dojo_Form_Element_FilteringSelect('village');
		$_village->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true',
				'onchange'=>'popupCheckVillage();'
		));
		$rows =  $db->getVillage();
		$options=array(''=>"------Select------",-1=>"Add New");
		if(!empty($rows))foreach($rows AS $row) $options[$row['vill_id']]=$row['village_name'];
		$_village->setMultiOptions($options);
		
		$_house = new Zend_Dojo_Form_Element_TextBox('house');
		$_house->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside',
		));
		
		$_street = new Zend_Dojo_Form_Element_TextBox('street');
		$_street->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside',
				//'required' =>'true'
		));
		
// 		$_id_type = new Zend_Dojo_Form_Element_FilteringSelect('id_type');
// 		$_id_type->setAttribs(array(
// 				'dojoType'=>'dijit.form.FilteringSelect',
// 				'class'=>'fullside',
// 				'required' =>'true'
// 		));
// 		$rows =  $db->GetAllIDType();
// 		$_id_type->setMultiOptions($rows);
		
		$_id_no = new Zend_Dojo_Form_Element_TextBox('id_no');
		$_id_no->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		
		
		$_phone = new Zend_Dojo_Form_Element_TextBox('phone');
		$_phone->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		$_spouse = new Zend_Dojo_Form_Element_TextBox('spouse');
		$_spouse->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		$photo=new Zend_Form_Element_File('photo');
		$photo->setAttribs(array(
		));
		$job = new Zend_Dojo_Form_Element_TextBox('job');
		$job->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		$national_id=new Zend_Dojo_Form_Element_TextBox('national_id');
		$national_id->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				));
		
		$spouse_nationid=new Zend_Dojo_Form_Element_TextBox('spouse_nationid');
		$spouse_nationid->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
		));
		
		
		$chackcall = new Zend_Dojo_Form_Element_CheckBox('chackcall');
		$chackcall->setAttribs(array(
				'dojoType'=>'dijit.form.CheckBox',
				//'checked'=>'checked'
		));
// 		$_id=new Zend_Form_Element_Hidden('id');
		$_id = new Zend_Form_Element_Hidden("id");
		$_desc = new Zend_Dojo_Form_Element_TextBox('desc');
		$_desc->setAttribs(array('dojoType'=>'dijit.form.TextBox','class'=>'fullside',
				'style'=>'width:96%;min-height:50px;'));
		
		$_status=  new Zend_Dojo_Form_Element_FilteringSelect('status');
		$_status->setAttribs(array('dojoType'=>'dijit.form.FilteringSelect','class'=>'fullside',));
		$_status_opt = array(
				1=>$this->tr->translate("ACTIVE"),
				0=>$this->tr->translate("DACTIVE"));
		$_status->setMultiOptions($_status_opt);
		
// 		$_id = new Zend_Form_Element_Hidden('id');
		if($data!=null){
// 			print_r($data);
			$_branch_id->setValue($data['branch_id']);
			$_member->setValue($data['parent_id']);
			$_group->setValue($data['is_group']);
			$_namekh->setValue($data['name_kh']);
			$_nameen->setValue($data['name_en']);
			$_sex->setValue($data['sex']);
			$_situ_status->setValue($data['sit_status']);
			$_province->setValue($data['pro_id']);
			$_district->setValue($data['dis_id']);
			$_commune->setValue($data['com_id']);
			$_village->setValue($data['village_id']);
			$_house->setValue($data['house']);
			$_street->setValue($data['street']);
// 			$_id_type->setValue($data['id_type']);
			$_id_no->setValue($data['id_number']);
			$_phone->setValue($data['phone']);
			$_spouse->setValue($data['spouse_name']);
			$_desc->setValue($data['remark']);
			$_status->setValue($data['status']);
			$_clientno->setValue($data['client_number']);	
			$photo->setValue($data['photo_name']);
			$_id->setValue($data['client_id']);
			$_group_code->setValue($data['group_code']);
			$job->setValue($data['job']);
			$national_id->setValue($data['nation_id']);
			$spouse_nationid->setValue($data['spouse_nationid']);
			$_join_with->setValue($data['join_with']);
			$_join_nation_id->setValue($data['join_nation_id']);
			$_relate_tel->setValue($data['join_tel']);
			$_releted->setValue($data['relate_with']);
			$_guarantor_with->setValue($data['guarantor_with']);
			$_guarantor_tel->setValue($data['guarantor_tel']);
            $client_d_type->setValue($data['client_d_type']);
// 			$join_d_type->setValue($data['join_d_type']);
// 			$guarantor_d_type->setValue($data['guarantor_d_type']);
			$guarantor_address->setValue($data['guarantor_address']);

			$_dob_Guarantor->setValue($data['dob_guarantor']);
			$dob_join_acc->setValue($data['dob_join_acc']);
			$_dob->setValue($data['dob']);
// 			print_r($data);
		}
		$this->addElements(array($client_d_type,$guarantor_address,$_relate_tel,$_guarantor_tel,$_guarantor_with,$_releted,$_join_nation_id,$_join_with,$spouse_nationid,$_id,$photo,$_spouse,$job,$national_id,$chackcall,$_group_code,$_branch_id,$_member,$_group,$_namekh,$_nameen,$_sex,$_situ_status,
				$_province,$_district,$_commune,$_village,$_house,$_street,$_id_no,
				$_phone,$_spouse,$_desc,$_status,$_clientno,$_dob,$dob_join_acc,$_dob_Guarantor,$clienttype_namekh,$clienttype_nameen));
		return $this;
		
	}	
Exemplo n.º 18
0
 public function FrmAddLoan($data = null)
 {
     $_isgroup = new Zend_Dojo_Form_Element_CheckBox('is_group');
     $_isgroup->setAttribs(array('dojoType' => 'dijit.form.CheckBox', 'class' => 'fullside'));
     $_loan_code = new Zend_Dojo_Form_Element_TextBox('loan_code');
     $_loan_code->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'readonly' => true, 'style' => 'color:red; font-weight: bold;'));
     $db = new Application_Model_DbTable_DbGlobal();
     $loan_number = $db->getLoanNumber();
     $_loan_code->setValue($loan_number);
     $_collect_term = new Zend_Dojo_Form_Element_FilteringSelect('collect_termtype');
     $_collect_term->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'changeGraicePeroid();'));
     $term_opt = $db->getVewOptoinTypeByType(1, 1, 3);
     $_collect_term->setMultiOptions($term_opt);
     $_client_code = new Zend_Dojo_Form_Element_TextBox('client_code');
     $_client_code->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $_groupid = new Zend_Dojo_Form_Element_FilteringSelect('group_id');
     $_groupid->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'popupCheckClient();'));
     $rows = $db->getClientByType(1);
     $options = array('' => "------Select------", -1 => "Add New new group");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['client_id']] = $row['name_en'] . ',' . $row['province_en_name'] . ',' . $row['district_name'] . ',' . $row['commune_name'] . ',' . $row['village_name'];
         }
     }
     $_groupid->setMultiOptions($options);
     $_coid = new Zend_Dojo_Form_Element_FilteringSelect('co_id');
     $rows = $db->getAllCOName();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['co_id']] = $row['co_khname'];
         }
     }
     $_coid->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'popupCheckCO();'));
     $_coid->setMultiOptions($options);
     $_member = new Zend_Dojo_Form_Element_FilteringSelect('member');
     $_member->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $rows = $db->getClientByType();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['client_id']] = $row['name_en'];
         }
     }
     $_member->setMultiOptions($options);
     $_currency_type = new Zend_Dojo_Form_Element_FilteringSelect('currency_type');
     $_currency_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = array(2 => "Dollar", 1 => 'Khmer', 3 => "Bath");
     $_currency_type->setMultiOptions($opt);
     $_zone = new Zend_Dojo_Form_Element_FilteringSelect('zone');
     $_zone->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'popupCheckZone();'));
     $rows = $db->getZoneList();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['zone_id']] = $row['zone_name'];
         }
     }
     $_zone->setMultiOptions($options);
     $_loan_fee = new Zend_Dojo_Form_Element_NumberTextBox('loan_fee');
     $_loan_fee->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside'));
     $_loan_fee->setValue(0);
     $_time_collect = new Zend_Dojo_Form_Element_NumberTextBox('amount_collect');
     $_time_collect->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'onkeyup' => 'getFirstPayment();'));
     $_time_collect->setValue(1);
     $_time_collect_pri = new Zend_Dojo_Form_Element_NumberTextBox('amount_collect_pricipal');
     $_time_collect_pri->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'readonly' => true, 'required' => true));
     $_time_collect_pri->setValue(2);
     $_amount = new Zend_Dojo_Form_Element_NumberTextBox('total_amount');
     $_amount->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => 'true'));
     $_level = new Zend_Dojo_Form_Element_NumberTextBox('level');
     $_level->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => 'true'));
     $_level->setValue(1);
     // 		$_rate = new Zend_Dojo_Form_Element_NumberTextBox('interest_rate');
     // 		$_rate->setAttribs(array(
     // 				'data-dojo-Type'=>'dijit.form.NumberTextBox',
     // 				'data-dojo-props'=>"regExp:'[0-9]{1,2}',
     // 				'required':true,
     // 				'name':'batch',
     // 				'value':2.5,
     // 				'class':'fullside',
     // 				'invalidMessage':'អាចបញ្ជូលពី 1 ដល់ 99'"));
     $_rate = new Zend_Dojo_Form_Element_ValidationTextBox("interest_rate");
     $_rate->setAttribs(array('data-dojo-Type' => 'dijit.form.ValidationTextBox', 'data-dojo-props' => "\r\n\t\t\t\t'required':true,\r\n\t\t\t\t'name':'interest_rate',\r\n\t\t\t\t'value':2.5,\r\n\t\t\t\t'class':'fullside',\r\n\t\t\t\t'invalidMessage':'អាចបញ្ជូលពី 1 ដល់  100'"));
     // 		$value_interest = 2.5;
     // 		$_rate->setValue($value_interest);
     $_period = new Zend_Dojo_Form_Element_NumberTextBox('period');
     $_period->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => 'true', 'onkeyup' => 'calCulatePeriod();'));
     $_period->setValue(12);
     $_releasedate = new Zend_Dojo_Form_Element_DateTextBox('release_date');
     $_releasedate->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside', 'required' => 'true', 'onchange' => 'checkReleaseDate();'));
     $s_date = date('Y-m-d');
     $_releasedate->setValue($s_date);
     $_first_payment = new Zend_Dojo_Form_Element_DateTextBox('first_payment');
     $_first_payment->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside', 'required' => 'true'));
     //$_first_payment->setValue('2005-12-30');
     $_dateline = new Zend_Dojo_Form_Element_DateTextBox('date_line');
     $_dateline->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside', 'required' => 'true', 'readonly' => true));
     $_graice_pariod = new Zend_Dojo_Form_Element_TextBox('graice_pariod');
     $_graice_pariod->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => 'true'));
     $_graice_pariod->setValue(0);
     $_payterm = new Zend_Dojo_Form_Element_FilteringSelect('payment_term');
     $_payterm->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     $options = array(1 => "Day", 2 => "Week", 3 => "Month");
     $_payterm->setMultiOptions($options);
     $_pay_every = new Zend_Dojo_Form_Element_FilteringSelect('pay_every');
     $_pay_every->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true', 'onchange' => 'changeCollectType();'));
     $options = array(1 => "Day", 2 => "Week", 3 => "Month");
     $_pay_every->setMultiOptions($options);
     $_pay_every->setValue(3);
     $_every_payamount = new Zend_Dojo_Form_Element_FilteringSelect('every_payamount');
     $_every_payamount->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     $options = array(2 => "After", 1 => "Before", 3 => "Normal");
     $_every_payamount->setMultiOptions($options);
     $_time = new Zend_Dojo_Form_Element_TextBox('time');
     $_time->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $set_time = '10:00-11:00 AM';
     $_time->setValue($set_time);
     $_paybefore = new Zend_Dojo_Form_Element_NumberTextBox('pay_before');
     $_paybefore->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => 'true'));
     $_paybefore->setValue(0);
     $_pay_late = new Zend_Dojo_Form_Element_NumberTextBox('pay_late');
     $_pay_late->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => 'true'));
     $_pay_late->setValue(0);
     $_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
     $_branch_id->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     $rows = $db->getAllBranchName();
     $options = '';
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $_branch_id->setMultiOptions($options);
     $_repayment_method = new Zend_Dojo_Form_Element_FilteringSelect('repayment_method');
     $_repayment_method->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true', 'onchange' => 'chechPaymentMethod()'));
     //$options= array(1=>"Decline",2=>"Baloon",3=>"Fixed Rate",4=>"Fixed Payment",5=>"Semi Baloon");
     // 		$options= array(
     // 				1=>"Decline",
     // 				2=>"Baloon",
     // 				3=>"Fixed Rate",
     // 				4=>"Fixed Pyment(Full Last Period)",
     // 				5=>"Semi Baloon",
     // 				6=>"Fixed Payment (Fixed Rate)");
     $options = $db->getAllPaymentMethod(null, 1);
     $_repayment_method->setMultiOptions($options);
     $_holiday = new Zend_Dojo_Form_Element_FilteringSelect('holiday');
     $_holiday->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     $options = array(1 => "Befor", 2 => "After", 3 => "Cancel");
     $_holiday->setMultiOptions($options);
     if ($data != null) {
         print_r($data);
         $_branch_id->setValue($data['member_id']);
         $_level->setValue($data['level']);
         $_loan_fee->setValue($data['admin_fee']);
         $_member->setValue($data['client_id']);
         $_coid->setValue($data['co_id']);
         $_zone->setValue($data['zone_id']);
         $_releasedate->setValue($data['date_release']);
         $_period->setValue($data['zone_id']);
         $_first_payment->setValue($data['zone_id']);
         $_time->setValue($data['time_collect']);
         $_every_payamount->setValue($data['pay_term']);
         $_amount->setValue($data['total_capital']);
         $_currency_type->setValue($data['payment_method']);
         $_rate->setValue($data['zone_id']);
         $_repayment_method->setValue($data['payment_method']);
         $_graice_pariod->setValue($data['graice_pariod']);
         $_time_collect_pri->setValue($data['amount_collect_pricipal']);
     }
     $this->addElements(array($_isgroup, $_groupid, $_client_code, $_time_collect, $_loan_fee, $_level, $_paybefore, $_pay_late, $_branch_id, $_member, $_coid, $_currency_type, $_zone, $_amount, $_rate, $_releasedate, $_payterm, $_every_payamount, $_time, $_time_collect_pri, $_holiday, $_graice_pariod, $_period, $_first_payment, $_repayment_method, $_pay_every, $_loan_code, $_collect_term, $_dateline));
     return $this;
 }
Exemplo n.º 19
0
	public function quickPayment(){
		$db = new Application_Model_DbTable_DbGlobal();
		
		$branch_id = new Zend_Dojo_Form_Element_FilteringSelect("branch_id");
		$branch_id->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true',
				'OnChange'	=> 'filterCo();'
		));
		
		$rows = $db->getAllBranchName();
		$options=array(''=>'------Select------');
		if(!empty($rows))foreach($rows AS $row){
			$options[$row['br_id']]=$row['branch_namekh'];
		}
		$branch_id->setMultiOptions($options);
		
		$_coid = new Zend_Dojo_Form_Element_FilteringSelect('co_id');
		$rows = $db ->getAllCOName();
		$options=array(''=>"------Select------",-1=>"Add New");
		if(!empty($rows))foreach($rows AS $row) $options[$row['co_id']]=$row['co_khname'];
		$_coid->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				//'onchange'=>'getLoan();'
		));
		$_coid->setMultiOptions($options);
		
		$_cocode = new Zend_Dojo_Form_Element_FilteringSelect('co_code');
		$rows = $db ->getAllCOName();
		$options=array(''=>"------Select------",-1=>"Add New");
		if(!empty($rows))foreach($rows AS $row) $options[$row['co_id']]=$row['co_code'];
		$_cocode->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'getLoan();'
		));
		$_cocode->setMultiOptions($options);
		
		
		$_priciple_amount = new Zend_Dojo_Form_Element_NumberTextBox('priciple_amount');
		$_priciple_amount->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'readOnly'=>'readOnly'
		));
		
		$_loan_fee = new Zend_Dojo_Form_Element_NumberTextBox('loan_fee');
		$_loan_fee->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'readOnly'=>'readOnly'
		));
		
		$_os_amount = new Zend_Dojo_Form_Element_NumberTextBox('os_amount');
		$_os_amount->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'readOnly'=>'readOnly',
				'required'=>true,
		));
		
		$_rate = new Zend_Dojo_Form_Element_NumberTextBox('total_interest');
		$_rate->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true',
				'style'=>'color:red;',
				'readOnly'=>'readOnly',
				'required'=>true,
		));
		// 		$value_interest = 2.5;
		// 		$_rate->setValue($value_interest);
		
		$_penalize_amount = new Zend_Dojo_Form_Element_NumberTextBox('penalize_amount');
		$_penalize_amount->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required'=>true,
				'readOnly'=>'readOnly'
		));
		$_penalize_amount->setValue(0);
		
		$_total_payment = new Zend_Dojo_Form_Element_NumberTextBox('total_payment');
		$_total_payment->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true',
				'style'=>'color:red;',
				'required'=>true,
				'readOnly'=>'readOnly'
		));
		
		$_hide_total_payment = new Zend_Form_Element_Hidden('hide_total_payment');
		$_hide_total_payment->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
		));
		
		$_note = new Zend_Dojo_Form_Element_TextBox('note');
		$_note->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				//'required' =>'true'
		));
		
		$_collect_date = new Zend_Dojo_Form_Element_DateTextBox('collect_date');
		$_collect_date->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside',
				'required' =>'true',
				//'Onchange'	=>	'getLoan();calculateTotal();'
		));
		$c_date = date('Y-m-d');
		$_collect_date->setValue($c_date);
		
		$date_input = new Zend_Form_Element_Hidden('date_input');
		$date_input->setAttribs(array(
				//'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside',
				'required' =>true
		));
		$date_input->setValue($c_date);
		
		$_interest_rate = new Zend_Dojo_Form_Element_TextBox("interest_rate");
		$_interest_rate->setAttribs(array(
				'dojoType'=>'dijit.form.TextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		
		$_service_charge = new Zend_Dojo_Form_Element_NumberTextBox('service_charge');
		$_service_charge->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'readOnly'=>'readOnly',
				//'onkeyUp'=>'totalReturn();'
		));
		$_service_charge->setValue(0);
		
		$total_amount_loan = new Zend_Dojo_Form_Element_TextBox("total_amount_loan");
		$total_amount_loan->setAttribs(array('dojoType'=>'dijit.form.TextBox','class'=>'fullside','readOnly'=>'readOnly'));
		
		$reciever = new Zend_Form_Element_Hidden("reciever");
		$reciever->setAttribs(array('dojoType'=>'dijit.form.TextBox'));
		
		$_amount_return = new Zend_Dojo_Form_Element_NumberTextBox('amount_return');
		$_amount_return->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'readOnly'=>'readOnly',
				//'onkeyup'	=>	'netReturn();'
		));
		$_rate = new Zend_Dojo_Form_Element_NumberTextBox('total_interest');
		$_rate->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true',
				'style'=>'color:red;',
				'readOnly'=>'readOnly',
				'required'=>true,
		));
		
		$_amount_receive = new Zend_Dojo_Form_Element_NumberTextBox('amount_receive');
		$_amount_receive->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'onChange'=>'netReturn();',
				'style'=>'color:red;',
				'required'=>true
		));
		
		$_currency_type = new Zend_Dojo_Form_Element_FilteringSelect('currency_type');
		$_currency_type->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				//'onchange'=>'getLoan();'
		));
		$opt = array(-1=>"--Select Currency Type--",2=>"Dollar",1=>'Khmer',3=>"Bath");
		$_currency_type->setMultiOptions($opt);
		$_currency_type->setValue(2);
		
		$reciever = new Zend_Form_Element_Hidden("reciever");
		$reciever->setAttribs(array('dojoType'=>'dijit.form.TextBox'));
		
		$this->addElements(array($reciever,$_currency_type,$date_input,$_note,$_amount_receive,$_rate,$_amount_return,$_service_charge,$branch_id,$_cocode,$_coid,$_collect_date,$_os_amount,$_penalize_amount,$_priciple_amount,$_total_payment));
		return $this;
	}
Exemplo n.º 20
0
 public function FrmChangeCollteral($data = null)
 {
     $db = new Application_Model_DbTable_DbGlobal();
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
     $_title->setAttribs(array('dojoType' => $this->tvalidate, 'onkeyup' => 'this.submit()', 'placeholder' => $this->tr->translate("ADVANCE_SEARCH")));
     $_title->setValue($request->getParam("adv_search"));
     $_client_code = new Zend_Dojo_Form_Element_FilteringSelect('client_code');
     $_client_code->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'onchange' => 'getOwnerInfo();'));
     $group_opt = $db->getGroupCodeById(1, 0, 1);
     //code,individual,option
     $_client_code->setMultiOptions($group_opt);
     $_client_code->setValue($request->getParam('client_code'));
     $_status_search = new Zend_Dojo_Form_Element_FilteringSelect('status_search');
     $_status_search->setAttribs(array('dojoType' => $this->filter));
     $_status_opt = array(-1 => $this->tr->translate("ALL"), 1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $_status_search->setMultiOptions($_status_opt);
     $_status_search->setValue($request->getParam("status_search"));
     $_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
     $_btn_search->setAttribs(array('dojoType' => 'dijit.form.Button', 'iconclass' => 'dijitIconSearch'));
     $_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
     $_branch_id->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => 'true', 'onchange' => 'filterClient();'));
     $rows = $db->getAllBranchName();
     $options = array('' => "---Select Branch Name---");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $_branch_id->setMultiOptions($options);
     $_branch_id->setValue($request->getParam('branch_id'));
     $db = new Application_Model_DbTable_DbGlobal();
     $co_name = new Zend_Dojo_Form_Element_FilteringSelect('co_name');
     $rows = $db->getAllCOName();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['co_id']] = $row['co_khname'];
         }
     }
     $co_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'onchange' => 'popupCheckCO();'));
     $Date = new Zend_Dojo_Form_Element_DateTextBox('date');
     $Date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox'));
     $number_code = new Zend_Dojo_Form_Element_NumberTextBox('number_code');
     $number_code->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'required' => true));
     $contract_code = new Zend_Dojo_Form_Element_NumberTextBox('contract_code');
     $contract_code->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'required' => true));
     $_code = new Zend_Dojo_Form_Element_NumberTextBox('code');
     $_code->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'required' => true));
     $clint_name = new Zend_Dojo_Form_Element_FilteringSelect('client_name');
     $clint_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'onchange' => 'checkClientCode()'));
     $options = $db->getGroupCodeById(2, 0, 1);
     $clint_name->setMultiOptions($options);
     $owner = new Zend_Dojo_Form_Element_ValidationTextBox('owner');
     $owner->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox'));
     $db = new Application_Model_DbTable_DbGlobal();
     $collteral_type = new Zend_Dojo_Form_Element_FilteringSelect('collteral_type');
     $collteral_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect'));
     $opt = $db->getCollteralType(1);
     $opt = array('' => '------Select------', 1 => 'ផ្ទាល់ខ្លួន', 2 => 'អ្នកធានាជំនួស');
     $collteral_type->setMultiOptions($opt);
     $collteral_type->setValue($request->getParam('collteral_type'));
     $note = new Zend_Dojo_Form_Element_TextBox('note');
     $note->setAttribs(array('dojoType' => 'dijit.form.TextBox'));
     $_note = new Zend_Dojo_Form_Element_TextBox('_note');
     $_note->setAttribs(array('dojoType' => 'dijit.form.TextBox'));
     $_note->setValue('return back to client');
     $Date = new Zend_Dojo_Form_Element_DateTextBox('date');
     $Date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox'));
     $Date->setValue(date('Y-m-d'));
     $stutas = new Zend_Dojo_Form_Element_FilteringSelect('Stutas');
     $stutas->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect'));
     $options = array(1 => "ប្រើប្រាស់", 0 => "មិនប្រើប្រាស់");
     $stutas->setMultiOptions($options);
     $cod_cal = new Zend_Dojo_Form_Element_TextBox('cod_cal');
     $cod_cal->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'readOnly' => 'readOnly', 'style' => 'color:red'));
     $code = Group_Model_DbTable_DbCallteral::getCallteralCode();
     $cod_cal->setValue($code);
     $db = new Application_Model_DbTable_DbGlobal();
     $from = new Zend_Dojo_Form_Element_FilteringSelect('from');
     $from->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => true));
     $from->setValue($request->getParam('from'));
     $opt = $db->getCollteralType(1);
     $from->setMultiOptions($opt);
     $to = new Zend_Dojo_Form_Element_FilteringSelect('to');
     $to->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => true));
     $opt = $db->getCollteralType(1);
     $to->setMultiOptions($opt);
     $to->setValue($request->getParam('to'));
     $receiver_name = new Zend_Dojo_Form_Element_ValidationTextBox('receiver_name');
     $receiver_name->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'required' => true));
     $giver_name = new Zend_Dojo_Form_Element_ValidationTextBox('giver_name');
     $giver_name->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'required' => true));
     $owner_name = new Zend_Dojo_Form_Element_TextBox('owner_name');
     $owner_name->setAttribs(array('dojoType' => 'dijit.form.TextBox'));
     $collteral_id = new Zend_Form_Element_Hidden('collteral_id');
     $collteral_id->setAttribs(array('dojoType' => 'dijit.form.TextBox'));
     $changecollteral_id = new Zend_Form_Element_Text('changecollteral_id');
     $changecollteral_id->setAttribs(array('dojoType' => 'dijit.form.TextBox'));
     $from_date = new Zend_Dojo_Form_Element_DateTextBox('start_date');
     $from_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'onchange' => 'CalculateDate();'));
     $_date = $request->getParam("start_date");
     if (empty($_date)) {
         $_date = date('Y-m-d');
     }
     $from_date->setValue($_date);
     $to_date = new Zend_Dojo_Form_Element_DateTextBox('end_date');
     $to_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'required' => 'true'));
     $_date = $request->getParam("end_date");
     if (empty($_date)) {
         $_date = date("Y-m-d");
     }
     $to_date->setValue($_date);
     $id = new Zend_Form_Element_Hidden("id");
     $receiver_name->setValue($this->getUserName());
     if ($data != null) {
         $_branch_id->setValue($data['branch_id']);
         $giver_name->setValue($data['giver_name']);
         $receiver_name->setValue($data['receiver_name']);
         $note->setValue($data['note']);
         $Date->setValue($data['date']);
         $stutas->setValue($data['status']);
         $_note->setValue($data['return_note']);
         $id->setValue($data['id']);
         //$_client_code->setValue($data['owner_code_id']);
         //$clint_name->setValue($data['owner_id']);
         //$collteral_id->setValue($data['collteral_id']);
         //$changecollteral_id->setValue($data['id']);
         //$to->setValue($data['to_id']);
         //$collteral_type->setValue($data['collteral_type']);
         //$number_code->setValue($data['number_code']);
         // $owner_name->setValue($data['owner']);
     }
     $this->addElements(array($from_date, $to_date, $changecollteral_id, $collteral_id, $owner_name, $giver_name, $receiver_name, $_note, $from, $to, $_client_code, $_btn_search, $_status_search, $_title, $co_name, $Date, $number_code, $contract_code, $_code, $clint_name, $owner, $collteral_type, $note, $Date, $_branch_id, $id, $stutas, $cod_cal));
     return $this;
 }
Exemplo n.º 21
0
    public function frmaddSalary($data=null)
    {
    	
    	$request=Zend_Controller_Front::getInstance()->getRequest();
    	 
    	$_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
    	$_title->setAttribs(array('dojoType'=>$this->tvalidate,
    			'onkeyup'=>'this.submit()',
    			'placeholder'=>$this->tr->translate("SEARCH_SALARY_INFO")
    	));
    	$_title->setValue($request->getParam("adv_search"));
    	 
    	$_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
    	$_btn_search->setAttribs(array(
    			'dojoType'=>'dijit.form.Button',
    			'iconclass'=>'dijitIconSearch'
    	));
    	 
    	 
    	$_status_search=  new Zend_Dojo_Form_Element_FilteringSelect('status_search');
    	$_status_search->setAttribs(array('dojoType'=>$this->filter));
    	$_status_opt = array(
    			-1=>$this->tr->translate("ALL"),
    			1=>$this->tr->translate("ACTIVE"),
    			0=>$this->tr->translate("DACTIVE"));
    	$_status_search->setMultiOptions($_status_opt);
    	$_status_search->setValue($request->getParam("status_search"));

    	$db = new Application_Model_DbTable_DbGlobal();
    	$staff_name = new Zend_Dojo_Form_Element_FilteringSelect('staff_name');
    	$rows = $db ->getAllCOName();
    	$options=array(''=>"------Select------",-1=>"Add New");
    	if(!empty($rows))foreach($rows AS $row) $options[$row['co_id']]=$row['co_khname'];
    	$staff_name->setAttribs(array(
    			'dojoType'=>'dijit.form.FilteringSelect',
    			'class'=>'fullside',
    			'onchange'=>'popupCheckStaff(1);'
    	));
    	$staff_name->setMultiOptions($options);
    	
    	$db_Sex=new Application_Model_DbTable_DbGlobal();
    	$opt_Sex=$db_Sex->getVewOptoinTypeByType(8,1);
    	$Sex=new Zend_Dojo_Form_Element_FilteringSelect('sex');
    	$Sex->setAttribs(array(
    			'dojoType'=>'dijit.form.FilteringSelect',
    			'required'=>true,
    			'class'=>'fullside'
    	));
    	$Sex->setMultiOptions($opt_Sex);
    	
    	$position_=new Zend_Dojo_Form_Element_FilteringSelect('position');
    	$position_->setAttribs(array(
    			'dojoType'=>'dijit.form.FilteringSelect',
//     			'dojoType'=>$this->filter,
    			'required'=>true,
    			'class'=>'fullside'
    			));
    	
    	$db_position=new Application_Model_DbTable_DbGlobal();
    	$opt_position=$db_position->getAllStaffPosition(null,1);
    	$position_->setMultiOptions($opt_position);
    	$position_->setValue($request->getParam('position'));
    	
    	$Basic_salary=new Zend_Dojo_Form_Element_NumberTextBox('basic_salary');
    	$Basic_salary->setAttribs(array(
    			'dojoType'=>'dijit.form.NumberTextBox',
    			'required'=>true,
    			'class'=>'fullside'
    			));
    	$Basic_salary->setValue(0);
    	
    	
    	$date_start=new Zend_Dojo_Form_Element_DateTextBox('date_start');
    	$date_start->setAttribs(array(
    			'dojoType'=>'dijit.form.DateTextBox',
    			'class'=>'fullside',
    			));
    	$date_start->setValue(date('Y-m-d'));
    	
    	$date_get_salary=new Zend_Dojo_Form_Element_DateTextBox('date_get_salary');
    	$date_get_salary->setAttribs(array(
    			'dojoType'=>'dijit.form.DateTextBox',
    			'class'=>'fullside',
    			));
    	$date_get_salary->setValue(date('Y-m-d'));
    	
    	$date_end_contract=new Zend_Dojo_Form_Element_DateTextBox('date_end_contract');
    	$date_end_contract->setAttribs(array(
    			'dojoType'=>'dijit.form.DateTextBox',
    			'class'=>'fullside',
    			));
    	$date_end_contract->setValue(date('Y-m-d'));
    	
    	$status=  new Zend_Dojo_Form_Element_FilteringSelect('status');
    	$status->setAttribs(array('dojoType'=>'dijit.form.FilteringSelect','class'=>'fullside',));
    	$status_opt = array(
    			1=>$this->tr->translate("ACTIVE"),
    			0=>$this->tr->translate("DACTIVE"));
    	$status->setMultiOptions($status_opt);
    	
    	$db = new Application_Model_DbTable_DbGlobal();
    	$_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
    	$_branch_id->setAttribs(array(
    			'dojoType'=>'dijit.form.FilteringSelect',
    			'class'=>'fullside',
    			'required' =>'true'
    	));
    	$rows = $db->getAllBranchName();
    	$options=array(''=>"---ស្វែងរកសាខា---");
    	if(!empty($rows))
    		foreach($rows AS $row){
    		$options[$row['br_id']]=$row['branch_namekh'];
    	}
    	$_branch_id->setMultiOptions($options);
    	$_branch_id->setValue($request->getParam('branch_id'));
    	
    	
    	$staff_code=new Zend_Dojo_Form_Element_NumberTextBox('staff_code');
    	$staff_code->setAttribs(array(
    			'dojoType'=>'dijit.form.NumberTextBox',
    			'class'=>'fullside',
    			'required'=>true
    			));
    	
    	$for_month=new Zend_Dojo_Form_Element_FilteringSelect('for_month');
    	$for_month->setAttribs(array(
    			'dojoType'=>'dijit.form.FilteringSelect',
    			'class'=>'fullside',
    			'required'=>true
    	));
    	$opt_month="";
    	for($i=1;$i<=12;$i++){
    		$opt_month[$i]=$i;
    	}
    	$for_month->setMultiOptions($opt_month);
    	
    	$employee = new Zend_Dojo_Form_Element_FilteringSelect('employee');
    	$rows = $db ->getAllCOName();
    	$options=array(''=>"---ស្វែងរកតាមរយៈឈ្មោះ---");
    	if(!empty($rows))foreach($rows AS $row) $options[$row['co_id']]=$row['co_khname'];
    	$employee->setAttribs(array(
    			'dojoType'=>'dijit.form.FilteringSelect',
    			'class'=>'fullside',
    			'onchange'=>'popupCheckCO();'
    	));
    	$employee->setMultiOptions($options);
    	$employee->setValue($request->getParam('employee'));
    	
    	$from_date=new Zend_Dojo_Form_Element_DateTextBox('from_date');
    	$from_date->setAttribs(array(
    			'dojoType'=>'dijit.form.DateTextBox',
    			'required'=>true,
    			'class'=>'fullside'
    	));
    	$fromdate=$request->getParam("from_date");
    	if(empty($fromdate)){
    		$fromdate=date('Y-m-d');
    	}
    	$from_date->setValue($fromdate);
    	
    	$to_date=new Zend_Dojo_Form_Element_DateTextBox('to_date');
    	$to_date->setAttribs(array(
    			'dojoType'=>'dijit.form.DateTextBox',
    			'required'=>true,
    			'class'=>'fullside'
    	));
    	$todate=$request->getParam("to_date");
     	if(empty($todate)){
     		$todate=date('Y-m-d');
     	}

    	$to_date->setValue($todate);
    	
    	$_id = new Zend_Form_Element_Hidden('id');
    	if($data!=null){
    		$Basic_salary->setValue($data['basic_salary']);
    		$date_start->setValue($data['date_start']);
    		$date_get_salary->setValue($data['date_get_salary']);
    		$status->setValue($data['status']);
    		$_branch_id->setValue($data['branch_id']);
    		$_id->setValue($data['id']);
    	}
    	
		$this->addElements(array($from_date,$to_date,$employee,$_status_search,$_btn_search,$_title,$_id,$date_end_contract,$position_,$staff_code,$for_month,$status,$_branch_id,$_id,$staff_name,$Basic_salary,$date_start,$date_get_salary));
		return $this;
    }
Exemplo n.º 22
0
	function JurnalSearch($data=null){
		
		
		$db = new Application_Model_DbTable_DbGlobal();
		$request=Zend_Controller_Front::getInstance()->getRequest();
		
		$_currency_type = new Zend_Dojo_Form_Element_FilteringSelect('currency_type');
		$_currency_type->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
		));
		$opt = $db->getVewOptoinTypeByType(15,1,3,1);
		$opt['-1']=("--Select Currency Type--");
		$_currency_type->setMultiOptions($opt);
		
		$_valuecurr=$request->getParam("currency_type");
		if(empty($_valuecurr) AND $_valuecurr!=-1){
			$_currency_type->setValue(-1);
		}else{
			$_currency_type->setValue($_valuecurr);
		}
		
		
		$_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
		$_title->setAttribs(array('dojoType'=>'dijit.form.TextBox',
				'onkeyup'=>'this.submit()',
				'placeholder'=>$this->tr->translate("ADVANCE_SEARCH")
		));
		$_title->setValue($request->getParam("adv_search"));
		
		
		$_releasedate = new Zend_Dojo_Form_Element_DateTextBox('start_date');
		$_releasedate->setAttribs(array('dojoType'=>'dijit.form.DateTextBox',
		// 				'class'=>'fullside',
				'onchange'=>'CalculateDate();'));
		$_date = $request->getParam("start_date");
		
		if(empty($_date)){
			$_date = date('Y-m-d');
		}
		$_releasedate->setValue($_date);
		
		
		$_dateline = new Zend_Dojo_Form_Element_DateTextBox('end_date');
		$_dateline->setAttribs(array('dojoType'=>'dijit.form.DateTextBox','required'=>'true',
		// 				'class'=>'fullside',
		));
		$_date = $request->getParam("end_date");
		
		if(empty($_date)){
			$_date = date("Y-m-d");
		}
		$_dateline->setValue($_date);
		
		
		$_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
		$_branch_id->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
		));
		
		$rows = $db->getAllBranchName();
		$options=array(-1=>'---Select Branch---');
		if(!empty($rows))foreach($rows AS $row){
			$options[$row['br_id']]=$row['branch_namekh'];
		}
		$_branch_id->setMultiOptions($options);
		$_branch_id->setValue($request->getParam("branch_id"));
		
		
		if($data!=null){
			//print_r($data);
			$_branch_id->setValue($data['member_id']);
			$_releasedate->setValue($data['date_release']);
			$_currency_type->setValue($data['payment_method']);
		}
		$this->addElements(array($_title,$_branch_id,$_currency_type,$_releasedate,$_dateline));
		return $this;
		
	}
Exemplo n.º 23
0
 public function FrmAddCO($_data = null)
 {
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
     $_title->setAttribs(array('dojoType' => $this->tvalidate, 'onkeyup' => 'this.submit()', 'placeholder' => $this->tr->translate("SEARCH_STAFF_INFO")));
     $_title->setValue($request->getParam("adv_search"));
     $_status_search = new Zend_Dojo_Form_Element_FilteringSelect('status_search');
     $_status_search->setAttribs(array('dojoType' => $this->filter));
     $_status_opt = array(-1 => $this->tr->translate("ALL"), 1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $_status_search->setMultiOptions($_status_opt);
     $_status_search->setValue($request->getParam("status_search"));
     $_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
     $_btn_search->setAttribs(array('dojoType' => 'dijit.form.Button', 'iconclass' => 'dijitIconSearch'));
     $_co_id = new Zend_Dojo_Form_Element_TextBox('co_id');
     $_co_id->setAttribs(array('dojoType' => $this->tvalidate, 'required' => 'true', 'class' => 'fullside'));
     $_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
     $_branch_id->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     $db = new Application_Model_DbTable_DbGlobal();
     $rows = $db->getAllBranchName();
     $options = '';
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $_branch_id->setMultiOptions($options);
     $_name_kh = new Zend_Dojo_Form_Element_TextBox('name_kh');
     $_name_kh->setAttribs(array('dojoType' => $this->tvalidate, 'required' => 'true', 'class' => 'fullside'));
     $_enname = new Zend_Dojo_Form_Element_TextBox('first_name');
     $_enname->setAttribs(array('dojoType' => $this->tvalidate, 'required' => 'true', 'class' => 'fullside'));
     $_lname = new Zend_Dojo_Form_Element_TextBox('last_name');
     $_lname->setAttribs(array('dojoType' => $this->text, 'class' => 'fullside'));
     $_sex = new Zend_Dojo_Form_Element_FilteringSelect('co_sex');
     $_sex->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = array(1 => "Male", 2 => "Femail");
     $_sex->setMultiOptions($opt);
     $_tel = new Zend_Dojo_Form_Element_TextBox('tel');
     $_tel->setAttribs(array('dojoType' => $this->tvalidate, 'class' => 'fullside'));
     $_position = new Zend_Dojo_Form_Element_FilteringSelect('position');
     $_position->setAttribs(array('dojoType' => $this->filter, 'required' => 'true', 'class' => 'fullside'));
     $db = new Application_Model_DbTable_DbGlobal();
     $opt = $db->getAllStaffPosition(null, 1);
     $_position->setMultiOptions($opt);
     $_department = new Zend_Dojo_Form_Element_FilteringSelect('department_id');
     $_department->setAttribs(array('dojoType' => $this->filter, 'required' => 'true', 'class' => 'fullside', 'OnChange' => 'popupDepartment()'));
     $db = new Application_Model_DbTable_DbGlobal();
     $opt = $db->getAllDepartment(null, 1);
     $_department->setMultiOptions($opt);
     $_figer_print_id = new Zend_Dojo_Form_Element_TextBox('figer_print_id');
     $_figer_print_id->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $_email = new Zend_Dojo_Form_Element_ValidationTextBox('email');
     $_email->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside'));
     // 		$pattern="/^[a-zA-Z]+[a-zA-Z0-9]*@[a-zA-Z]+[a-zA-Z0-9][a-zA-Z]{2,4}([a-zA-Z]{2,4})?$/";
     // 		if(preg_match($pattern,$_email));
     $_national_id = new Zend_Dojo_Form_Element_TextBox('national_id');
     $_national_id->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside'));
     $_address = new Zend_Dojo_Form_Element_TextBox('address');
     $_address->setAttribs(array('dojoType' => $this->text, 'class' => 'fullside'));
     $_pob = new Zend_Dojo_Form_Element_TextBox('pob');
     $_pob->setAttribs(array('dojoType' => $this->text, 'class' => 'fullside'));
     $_status = new Zend_Dojo_Form_Element_FilteringSelect('status');
     $_status->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside'));
     $_status_opt = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $_status->setMultiOptions($_status_opt);
     $_display = new Zend_Dojo_Form_Element_FilteringSelect('display');
     $_display->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside'));
     $_display_opt = array(1 => $this->tr->translate("NAME_KHMER"), 2 => $this->tr->translate("NAME_ENGLISH"));
     $_display->setMultiOptions($_display_opt);
     $_degree = new Zend_Dojo_Form_Element_FilteringSelect('degree');
     $_degree->setAttribs(array('dojoType' => $this->filter, 'class' => 'fullside'));
     $degree_opt = $db->getAllDegree();
     $_degree->setMultiOptions($degree_opt);
     $_degree->setValue($request->getParam('degree'));
     $_basic_salary = new Zend_Dojo_Form_Element_NumberTextBox('basic_salary');
     $_basic_salary->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true));
     $_start_work = new Zend_Dojo_Form_Element_DateTextBox('start_date');
     $_start_work->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside', 'onchange' => 'calculateDay();'));
     $_start_work->setValue(date('Y-m-d'));
     $_end_work = new Zend_Dojo_Form_Element_DateTextBox('end_date');
     $_end_work->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside'));
     $_photo = new Zend_Form_Element_File('photo');
     $_end_work->setValue(date('Y-m-d'));
     $_contract = new Zend_Dojo_Form_Element_TextBox('contract_no');
     $_contract->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $_note = new Zend_Dojo_Form_Element_TextBox('note');
     $_note->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $opt_shift = array(1 => 'ពេញម៉ោង', 2 => 'ក្រៅម៉ោង');
     $_shift = new Zend_Dojo_Form_Element_FilteringSelect('shift');
     $_shift->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'Checktime(2)'));
     $_shift->setMultiOptions($opt_shift);
     $opt_workingtime = array(1 => 'ពេលព្រឹក និង ពេលល្ងាច​', 2 => 'ពេលព្រឹក', 3 => 'ពេលល្ងាច');
     $_workingtime = new Zend_Dojo_Form_Element_FilteringSelect('workingtime');
     $_workingtime->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'Checktime(1)'));
     $_workingtime->setMultiOptions($opt_workingtime);
     $_annual_lives = new Zend_Dojo_Form_Element_NumberTextBox('annual_lives');
     $_annual_lives->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside'));
     $_id = new Zend_Form_Element_Hidden('id');
     if (!empty($_data)) {
         $_co_id->setValue($_data['co_code']);
         $_name_kh->setValue($_data['co_khname']);
         $_enname->setValue($_data['co_firstname']);
         $_lname->setValue($_data['co_lastname']);
         $_annual_lives->setValue($_data['annual_lives']);
         $_position->setValue($_data['position_id']);
         $_display->setValue($_data['displayby']);
         $_national_id->setValue($_data['national_id']);
         $_pob->setValue($_data['pob']);
         $_degree->setValue($_data['degree']);
         $_tel->setValue($_data['tel']);
         $_email->setValue($_data['email']);
         $_address->setValue($_data['address']);
         $_status->setValue($_data['status']);
         $_id->setValue($_data['co_id']);
         $_basic_salary->setValue($_data['basic_salary']);
         $_start_work->setValue($_data['start_date']);
         $_end_work->setValue($_data['end_date']);
         $_contract->setValue($_data['contract_no']);
         $_note->setValue($_data['note']);
         //echo $_data['note']; exit();
         $_shift->setValue($_data['shift']);
         $_workingtime->setValue($_data['workingtime']);
         $_department->setValue($_data['department_id']);
         $_figer_print_id->setValue($_data['figer_print_id']);
         $_photo->setValue($_data['photo']);
     }
     $this->addElements(array($_figer_print_id, $_department, $_photo, $_annual_lives, $_btn_search, $_status_search, $_title, $_id, $_co_id, $_name_kh, $_branch_id, $_degree, $_national_id, $_display, $_enname, $_lname, $_sex, $_tel, $_email, $_pob, $_address, $_shift, $_workingtime, $_status, $_position, $_basic_salary, $_start_work, $_end_work, $_contract, $_note));
     return $this;
 }
Exemplo n.º 24
0
 public function FrmAsset($data = null)
 {
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
     $_title->setAttribs(array('dojoType' => $this->tvalidate, 'onkeyup' => 'this.submit()', 'placeholder' => $this->tr->translate("SEARCH_FIXD_NAME")));
     $_title->setValue($request->getParam("adv_search"));
     $db = new Application_Model_DbTable_DbGlobal();
     $asset_name = new Zend_Dojo_Form_Element_FilteringSelect('asset_name');
     $asset_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => "getAssetInfo(1);"));
     $rows = $db->getAssetByType();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['id']] = $row['account_name_en'];
         }
     }
     $asset_name->setMultiOptions($options);
     $asset_code = new Zend_Dojo_Form_Element_FilteringSelect('asset_code');
     $asset_code->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => "getAssetInfo(2);", 'required' => true));
     $rows = $db->getAssetByType();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['id']] = $row['account_code'];
         }
     }
     $asset_code->setMultiOptions($options);
     $db = new Application_Model_DbTable_DbGlobal();
     $paid_type = new Zend_Dojo_Form_Element_FilteringSelect('paid_type');
     $paid_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'checkasset();', 'required' => true));
     $opt = $db->getVewOptoinTypeByType(19, 1);
     $paid_type->setMultiOptions($opt);
     // 		$paid_type->setValue(1);
     $note = new Zend_Dojo_Form_Element_TextBox('note');
     $note->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true));
     $_stutas = new Zend_Dojo_Form_Element_FilteringSelect('status');
     $_stutas->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $options = array(1 => "ប្រើប្រាស់", 0 => "មិនប្រើប្រាស់");
     $_stutas->setMultiOptions($options);
     $some_payamount = new Zend_Dojo_Form_Element_TextBox('some_payamount');
     $some_payamount->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true));
     $asset_type = new Zend_Dojo_Form_Element_FilteringSelect('asset_type');
     $asset_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true));
     $opt = array(1 => 'Long Term', 2 => 'Short Term');
     $asset_type->setMultiOptions($opt);
     $asset_cost = new Zend_Dojo_Form_Element_NumberTextBox('asset_cost');
     $asset_cost->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'onchange' => 'calculateDepreciation();', 'class' => 'fullside', 'required' => 'true'));
     $useful_life = new Zend_Dojo_Form_Element_NumberTextBox('usefull_life');
     $useful_life->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'onchange' => 'calculateDepreciation();', 'class' => 'fullside', 'required' => true));
     $salvage_value = new Zend_Dojo_Form_Element_NumberTextBox('salvage_value');
     $salvage_value->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'onchange' => 'calculateDepreciation();', 'required' => 'true'));
     $payment_method = new Zend_Dojo_Form_Element_FilteringSelect('payment_method');
     $payment_method->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $option = array(1 => 'Straight line', 2 => 'Double-declining banlance', 3 => 'Sum of the year');
     $payment_method->setMultiOptions($option);
     $Date = new Zend_Dojo_Form_Element_DateTextBox('date');
     $Date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside'));
     $Date->setValue(date('Y-m-d'));
     $start_date = new Zend_Dojo_Form_Element_DateTextBox('start_date');
     $start_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside'));
     $start_date->setValue(date('Y-m-d'));
     $_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch');
     $_branch_id->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     // 		$_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
     // 		$_branch_id->setAttribs(array(
     // 				'dojoType'=>'dijit.form.FilteringSelect',
     // 				'class'=>'fullside',
     // 				'required' =>'true'
     // 		));
     $db = new Application_Model_DbTable_DbGlobal();
     $rows = $db->getAllBranchName();
     $options = '';
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $_branch_id->setMultiOptions($options);
     $current_type = new Zend_Dojo_Form_Element_FilteringSelect('current_type');
     $current_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true));
     $opt = $db->getVewOptoinTypeByType(15, 1);
     $current_type->setMultiOptions($opt);
     $current_type->setValue(1);
     $tem_type = new Zend_Dojo_Form_Element_FilteringSelect('tem_type');
     $tem_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true));
     $opt = $db->getVewOptoinTypeByType(20, 1);
     $tem_type->setMultiOptions($opt);
     $tem_type->setValue(1);
     $journal = new Zend_Dojo_Form_Element_CheckBox('journal');
     $journal->setAttribs(array('dojoType' => 'dijit.form.CheckBox', 'class' => 'fullside', 'required' => true));
     $amount = new Zend_Dojo_Form_Element_TextBox('amount');
     $amount->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true));
     $_id = new Zend_Form_Element_Hidden('id');
     // 		print_r($data);exit();
     if ($data != null) {
         $_branch_id->setValue($data['branch_id']);
         $asset_name->setValue($data['fixed_assetname']);
         $asset_type->setValue($data['fixed_asset_type']);
         $asset_cost->setValue($data['asset_cost']);
         $useful_life->setValue($data['usefull_life']);
         $salvage_value->setValue($data['salvagevalue']);
         $amount->setValue($data['total_amount']);
         $payment_method->setValue($data['payment_method']);
         $Date->setValue($data['depreciation_start']);
         $start_date->setValue($data['date']);
         $asset_code->setValue($data['asset_code']);
         $paid_type->setValue($data['pay_type']);
         $some_payamount->setValue($data['some_payamount']);
         $note->setValue($data['note']);
         $_stutas->setValue($data['status']);
         $journal->setValue($data['auto_post']);
         $_id->setValue($data['id']);
     }
     $this->addElements(array($_title, $asset_name, $asset_type, $asset_cost, $start_date, $useful_life, $salvage_value, $payment_method, $amount, $Date, $_branch_id, $_id, $asset_code, $paid_type, $note, $_stutas, $some_payamount, $current_type, $journal, $tem_type));
     return $this;
 }
Exemplo n.º 25
0
	public function FrmTeller($data=null){
		
		$db = new Application_Model_DbTable_DbGlobal();
		$_groupid = new Zend_Dojo_Form_Element_FilteringSelect('group_id');
		$_groupid->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
 				'onchange'=>'popupCheckClient();'
				));
		$bran_=new Zend_Dojo_Form_Element_FilteringSelect('bran');
		$bran_->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside'
				));
		$rows = $db->getAllBranchName();
		$options='';
		if(!empty($rows))foreach($rows AS $row){
			$options[$row['br_id']]=$row['branch_namekh'];
		}
		$bran_->setMultiOptions($options);
		
		$account_number=new Zend_Dojo_Form_Element_NumberTextBox('account_number');
		$account_number->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside'
				));
		$rows = $db ->getClientByType(1);
		$options="";
		if(!empty($rows))foreach($rows AS $row){
			$options[$row['client_id']]=$row['name_en'].','.$row['province_en_name'].','.$row['district_name'].','.$row['commune_name'].','.$row['village_name'];
		}
		$_groupid->setMultiOptions($options);
		
		$_coid = new Zend_Dojo_Form_Element_FilteringSelect('co_id');
		$_coid = new Zend_Dojo_Form_Element_FilteringSelect('co_id');
		$rows = $db ->getAllCOName();
		$options=array(''=>"------Select------",-1=>"Add New");
		if(!empty($rows))foreach($rows AS $row) $options[$row['co_id']]=$row['co_khname'];
		$_coid->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
								'class'=>'fullside',
		 						'onchange'=>'popupCheckCO();'
		));
		
		$_coid->setMultiOptions($options);
		
		$_priciple_amount = new Zend_Dojo_Form_Element_NumberTextBox('priciple_amount');
		$_priciple_amount->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
		));
		
		$_loan_fee = new Zend_Dojo_Form_Element_NumberTextBox('loan_fee');
		$_loan_fee->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
		));
		
		$_os_amount = new Zend_Dojo_Form_Element_NumberTextBox('os_amount');
		$_os_amount->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
		));
		
		$_rate = new Zend_Dojo_Form_Element_NumberTextBox('total_interest');
		$_rate->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		
// 		$value_interest = 2.5;
// 		$_rate->setValue($value_interest);
		
		$_penalize_amount = new Zend_Dojo_Form_Element_NumberTextBox('penalize_amount');
		$_penalize_amount->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
		));
		
		$_penalize_amount->setValue(0);
		
		$_total_payment = new Zend_Dojo_Form_Element_NumberTextBox('total_payment');
		$_total_payment->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		
		$_note = new Zend_Dojo_Form_Element_NumberTextBox('note');
		$_note->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		
		$cash_got=new Zend_Dojo_Form_Element_NumberTextBox('cash_got');
		$cash_got->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside'
				));
		
		$cash_return=new Zend_Dojo_Form_Element_NumberTextBox('cash_return');
		$cash_return->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside'
		));
		
		$_collect_date = new Zend_Dojo_Form_Element_DateTextBox('collect_date');
		$_collect_date->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		
		$_date_paymented = new Zend_Dojo_Form_Element_DateTextBox('date_payment');
		$_date_paymented->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		$invoice_number = new Zend_Dojo_Form_Element_ValidationTextBox('invoice_number');
		$invoice_number->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside',
				'required' =>'true'
		));
		
		$c_date = date('Y-d-m');
		$_collect_date->setValue($c_date);
	
		$this->addElements(array($invoice_number,$_date_paymented,$bran_,$account_number,$_groupid,$_coid,$_priciple_amount,$_loan_fee,$_os_amount,$_rate,
				$_penalize_amount,$_collect_date,$_total_payment,$cash_got,$cash_return,$_note));
		return $this;
		
	}	
Exemplo n.º 26
0
 public function Frmrefundcallecterall()
 {
     $db = new Application_Model_DbTable_DbGlobal();
     $branch = new Zend_Dojo_Form_Element_FilteringSelect('branch');
     $branch->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     $rows = $db->getAllBranchName();
     $options = '';
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $branch->setMultiOptions($options);
     $db = new Application_Model_DbTable_DbGlobal();
     $customer_name = new Zend_Dojo_Form_Element_FilteringSelect('customer_name');
     $customer_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => "getClientInfo(1);"));
     $rows = $db->getClientByType();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['client_id']] = $row['name_en'];
         }
     }
     $customer_name->setMultiOptions($options);
     $db = new Application_Model_DbTable_DbGlobal();
     $cus_code = new Zend_Dojo_Form_Element_FilteringSelect('cus_code');
     $cus_code->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true, 'onchange' => "getClientInfo(2);"));
     $rows = $db->getClientByType();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['client_id']] = $row['client_number'];
         }
     }
     $cus_code->setMultiOptions($options);
     $callecterall_code = new Zend_Dojo_Form_Element_TextBox('callecterall_code');
     $callecterall_code->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'readonly' => true, 'style' => 'color:red; font-weight: bold;'));
     $client_id = new Zend_Dojo_Form_Element_FilteringSelect('client_id');
     $client_id->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true));
     $fund_amount = new Zend_Dojo_Form_Element_TextBox('fund_amount');
     $fund_amount->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true));
     $date = new Zend_Dojo_Form_Element_FilteringSelect('date');
     $date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside', 'required' => true));
     $innalization = new Zend_Dojo_Form_Element_TextBox('innalization');
     $innalization->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true));
     $note = new Zend_Dojo_Form_Element_TextBox('note');
     $note->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true));
     $_arr = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $stastu = new Zend_Dojo_Form_Element_FilteringSelect("status");
     $stastu->setMultiOptions($_arr);
     $stastu->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => 'true', 'missingMessage' => 'Invalid Module!', 'class' => 'fullside'));
     $db = new Application_Model_DbTable_DbGlobal();
     $callecterall_type = new Zend_Dojo_Form_Element_FilteringSelect('callecterall_type');
     $callecterall_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = $db->getVewOptoinTypeBys(1);
     $callecterall_type->setMultiOptions($opt);
     $dayless = new Zend_Dojo_Form_Element_DateTextBox('dayless');
     $dayless->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside'));
     $dayless->setValue(date('Y-m-d'));
     $db = new Application_Model_DbTable_DbGlobal();
     $cash_type = new Zend_Dojo_Form_Element_FilteringSelect('cash_type');
     $cash_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = $db->getVewOptoinTypeByType(15, 1);
     $cash_type->setMultiOptions($opt);
     $cash_type->setValue(1);
     $much_boro = new Zend_Dojo_Form_Element_NumberTextBox('much_boro');
     $much_boro->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside'));
     $term_fun = new Zend_Dojo_Form_Element_FilteringSelect('term_fun');
     $term_fun->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt_fun = $db->getVewOptoinTypeByType(14, 1);
     $term_fun->setMultiOptions($opt_fun);
     $term_fun->setValue(1);
     $charge_term = new Zend_Dojo_Form_Element_FilteringSelect('charge_term');
     $charge_term->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => true));
     $opt_ch_term = array(1 => 'គិតជាភាគរយ​ %', 2 => 'គិតជាលុយផ្ទាល់');
     $charge_term->setMultiOptions($opt_ch_term);
     $amount_money = new Zend_Dojo_Form_Element_TextBox('amount_money');
     $amount_money->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'required' => true));
     $_id = new Zend_Form_Element_Hidden('id');
     $this->addElements(array($branch, $stastu, $note, $innalization, $date, $fund_amount, $client_id, $cash_type, $customer_name, $cus_code, $callecterall_type, $dayless, $much_boro, $term_fun, $charge_term, $amount_money, $callecterall_code));
     return $this;
 }
Exemplo n.º 27
0
	public function AdvanceSearch ($data=null){
		
		$db = new Application_Model_DbTable_DbGlobal();
		
		$request=Zend_Controller_Front::getInstance()->getRequest();
		$_status=  new Zend_Dojo_Form_Element_FilteringSelect('status');
		$_status->setAttribs(array('dojoType'=>'dijit.form.FilteringSelect'));
		$_status_opt = array(
				-1=>$this->tr->translate("ALL"),
				1=>$this->tr->translate("ACTIVE"),
				0=>$this->tr->translate("DACTIVE"));
		$_status->setMultiOptions($_status_opt);
		$_status->setValue($request->getParam("status"));
		
		$_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
		$_title->setAttribs(array('dojoType'=>'dijit.form.TextBox',
				'onkeyup'=>'this.submit()',
				'placeholder'=>$this->tr->translate("ADVANCE_SEARCH")
		));
		$_title->setValue($request->getParam("adv_search"));
		
		$_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
		$_btn_search->setAttribs(array(
				'dojoType'=>'dijit.form.Button',
				'iconclass'=>'dijitIconSearch',
		
		));
		
		$_group_code = new Zend_Dojo_Form_Element_FilteringSelect('group_code');
		$_group_code->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'getmemberIdGroup();'
		));
		$group_opt = $db ->getGroupCodeById(1,1,1);
		$_group_code->setMultiOptions($group_opt);
		$_group_code->setValue($request->getParam("group_code"));
		
		$_customer_code = new Zend_Dojo_Form_Element_FilteringSelect('customer_code');
		$_customer_code->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'onchange'=>'getmemberIdGroup();'
		));
		$group_opt = $db ->getGroupCodeById(1,0,1);//code,individual,option
		$_customer_code->setMultiOptions($group_opt);
		$_customer_code->setValue($request->getParam("customer_code"));
		
		$_member = new Zend_Dojo_Form_Element_FilteringSelect('member');
		$_member->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'onchange'=>'checkMember()'
		));
		$options = $db->getGroupCodeById(2,0,1);
		$_member->setMultiOptions($options);
		$_member->setValue($request->getParam("member"));
		
		$_groupid = new Zend_Dojo_Form_Element_FilteringSelect('group_id');
		$_groupid->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
 				'onchange'=>'popupCheckClient();'
				));
		$options = $db ->getGroupCodeById(2,1,1);//show name,show group,show option
		$_groupid->setMultiOptions($options);
		$_groupid->setValue($request->getParam("group_id"));
		
		$_coid = new Zend_Dojo_Form_Element_FilteringSelect('co_id');
		$_coid->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'onchange'=>'popupCheckCO();'
		));
		$options = $db ->getAllCOName(1);
		$_coid->setMultiOptions($options);
		$_coid->setValue($request->getParam("co_id"));
		
		$_currency_type = new Zend_Dojo_Form_Element_FilteringSelect('currency_type');
		$_currency_type->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
		));
		$opt = array(2=>"Dollar",1=>'Khmer',3=>"Bath");
		$_currency_type->setMultiOptions($opt);
		$_currency_type->setValue($request->getParam("currency_type"));
		
		$_repayment_method = new Zend_Dojo_Form_Element_FilteringSelect('repayment_method');
		$_repayment_method->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'required' =>'true',
				'onchange'=>'chechPaymentMethod()'
		));
		$options = $db->getAllPaymentMethod(null,1);
		$_repayment_method->setMultiOptions($options);
		$_repayment_method->setValue($request->getParam("repayment_method"));
		
		$_zone = new Zend_Dojo_Form_Element_FilteringSelect('zone');
		$_zone->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'onchange'=>'popupCheckZone();'
		));
		$options = $db ->getZoneList(1);
		$_zone->setMultiOptions($options);
		$_zone->setValue($request->getParam("zone"));
		
		$_releasedate = new Zend_Dojo_Form_Element_DateTextBox('from_date');
		$_releasedate->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
		));
		$s_date = date('Y-m-d');
		$_releasedate->setValue($s_date);
		
		
		$_dateline = new Zend_Dojo_Form_Element_DateTextBox('to_date');
		$_dateline->setAttribs(array(
				'dojoType'=>'dijit.form.DateTextBox',
		));
		$_dateline->setValue($s_date);
		
		$_payterm = new Zend_Dojo_Form_Element_FilteringSelect('payment_term');
		$_payterm->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'required' =>'true'
		));
		$options= array(1=>"Day",2=>"Week",3=>"Month");
		$_payterm->setMultiOptions($options);
		$_payterm->setValue($request->getParam("payment_term"));
		
		$_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
		$_branch_id->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
		));
		
		$rows = $db->getAllBranchName();
		$options='';
			if(!empty($rows))foreach($rows AS $row){
				$options[$row['br_id']]=$row['branch_namekh'];
			}
		$_branch_id->setMultiOptions($options);
		$_branch_id->setValue($request->getParam("branch_id"));
		
		if($data!=null){
			print_r($data);
			$_branch_id->setValue($data['member_id']);
			$_member->setValue($data['client_id']);
			$_coid->setValue($data['co_id']);
			$_zone->setValue($data['zone_id']);
			$_releasedate->setValue($data['date_release']);
			$_currency_type->setValue($data['payment_method']);
		}
		$this->addElements(array($_groupid,$_title,$_branch_id,$_member,$_coid,$_currency_type,$_zone,$_releasedate
				,$_payterm,$_dateline,$_group_code,$_customer_code,$_status,$_btn_search,$_repayment_method));
		return $this;
		
	}	
Exemplo n.º 28
0
 public function FrmAddClient($data = null)
 {
     $_group = new Zend_Dojo_Form_Element_CheckBox('is_group');
     $_group->setAttribs(array('dojoType' => 'dijit.form.CheckBox', 'onchange' => 'getGroupCode();'));
     $_group_code = new Zend_Dojo_Form_Element_TextBox('group_code');
     $_group_code->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'readonly' => 'readonly', 'style' => 'color:red;'));
     // 		$db = new Application_Model_DbTable_DbGlobal();
     // 		$id_client = $db->getNewClientId();
     $_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
     $_branch_id->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $db = new Application_Model_DbTable_DbGlobal();
     $rows = $db->getAllBranchName();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['displayby'] == 1 ? $row['branch_namekh'] : $row['branch_nameen'];
         }
     }
     $_branch_id->setMultiOptions($options);
     $_member = new Zend_Dojo_Form_Element_FilteringSelect('group_id');
     $_member->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $db = new Application_Model_DbTable_DbGlobal();
     $rows = $db->getClientByType();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['client_id']] = $row['name_en'];
         }
     }
     $_member->setMultiOptions($options);
     $_namekh = new Zend_Dojo_Form_Element_TextBox('name_kh');
     $_namekh->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside', 'required' => 'true'));
     $id_client = $db->getNewClientId();
     $_clientno = new Zend_Dojo_Form_Element_TextBox('client_no');
     $_clientno->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'readonly' => 'readonly', 'style' => 'color:red;'));
     $_clientno->setValue($id_client);
     $_nameen = new Zend_Dojo_Form_Element_TextBox('name_en');
     $_nameen->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside', 'required' => 'true'));
     $_sex = new Zend_Dojo_Form_Element_FilteringSelect('sex');
     $_sex->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = array(1 => "Male", 2 => "Femail");
     $_sex->setMultiOptions($opt);
     $_situ_status = new Zend_Dojo_Form_Element_FilteringSelect('situ_status');
     $_situ_status->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt_status = $db->getAllSituation();
     $_situ_status->setMultiOptions($opt_status);
     $_province = new Zend_Dojo_Form_Element_FilteringSelect('province');
     $_province->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $rows = $db->getAllProvince();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['province_id']] = $row['province_en_name'];
         }
     }
     $_province->setMultiOptions($options);
     $_district = new Zend_Dojo_Form_Element_FilteringSelect('district');
     $rows = $db->getAllDistrict();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['dis_id']] = $row['district_name'];
         }
     }
     $_district->setMultiOptions($options);
     $_district->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'popupCheckDistrict();'));
     $_commune = new Zend_Dojo_Form_Element_FilteringSelect('commune');
     $rows = $db->getCommune();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['com_id']] = $row['commune_name'];
         }
     }
     $_commune->setMultiOptions($options);
     $_commune->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'onchange' => 'popupCheckCommune();'));
     $_village = new Zend_Dojo_Form_Element_FilteringSelect('village');
     $_village->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true', 'onchange' => 'popupCheckVillage();'));
     $rows = $db->getVillage();
     $options = array('' => "------Select------", -1 => "Add New");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['vill_id']] = $row['village_name'];
         }
     }
     $_village->setMultiOptions($options);
     $_house = new Zend_Dojo_Form_Element_TextBox('house');
     $_house->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside'));
     $_street = new Zend_Dojo_Form_Element_TextBox('street');
     $_street->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside', 'required' => 'true'));
     $_id_type = new Zend_Dojo_Form_Element_FilteringSelect('id_type');
     $_id_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     $rows = $db->GetAllIDType();
     $_id_type->setMultiOptions($rows);
     $_id_no = new Zend_Dojo_Form_Element_TextBox('id_no');
     $_id_no->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside', 'required' => 'true'));
     $_phone = new Zend_Dojo_Form_Element_TextBox('phone');
     $_phone->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $_spouse = new Zend_Dojo_Form_Element_TextBox('spouse');
     $_spouse->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside'));
     $_desc = new Zend_Dojo_Form_Element_Textarea('desc');
     $_desc->setAttribs(array('dojoType' => 'dijit.form.SimpleTextarea', 'class' => 'fullside', 'style' => 'width:96%;min-height:50px;'));
     $_status = new Zend_Dojo_Form_Element_FilteringSelect('status');
     $_status->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $_status_opt = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $_status->setMultiOptions($_status_opt);
     $_id = new Zend_Form_Element_Hidden('id');
     if ($data != null) {
         $_id->setValue($data['client_id']);
         $_member->setValue($data['parent_id']);
         $_group->setValue($data['is_group']);
         $_namekh->setValue($data['name_kh']);
         $_nameen->setValue($data['name_en']);
         $_sex->setValue($data['sex']);
         $_situ_status->setValue($data['sit_status']);
         $_province->setValue($data['pro_id']);
         $_district->setValue($data['dis_id']);
         $_commune->setValue($data['com_id']);
         $_village->setValue($data['village_id']);
         $_house->setValue($data['house']);
         $_street->setValue($data['street']);
         $_id_type->setValue($data['id_type']);
         $_id_no->setValue($data['id_number']);
         $_phone->setValue($data['phone']);
         $_spouse->setValue($data['spouse_name']);
         $_desc->setValue($data['remark']);
         $_status->setValue($data['status']);
         $_clientno->setValue($data['client_number']);
     }
     $this->addElements(array($_id, $_group_code, $_branch_id, $_member, $_group, $_namekh, $_nameen, $_sex, $_situ_status, $_province, $_district, $_commune, $_village, $_house, $_street, $_id_type, $_id_no, $_phone, $_spouse, $_desc, $_status, $_clientno));
     return $this;
 }
Exemplo n.º 29
0
 public function FrmClientBlackList($data = null)
 {
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $_title = new Zend_Dojo_Form_Element_TextBox('adv_search');
     $_title->setAttribs(array('dojoType' => $this->tvalidate, 'onkeyup' => 'this.submit()', 'placeholder' => $this->tr->translate("ADVANCE_SEARCH")));
     $_title->setValue($request->getParam("adv_search"));
     $_status = new Zend_Dojo_Form_Element_FilteringSelect('status_search');
     $_status->setAttribs(array('dojoType' => $this->filter));
     $_status_opt = array(-1 => $this->tr->translate("ALL"), 1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $_status->setMultiOptions($_status_opt);
     $_status->setValue($request->getParam("status_search"));
     $_btn_search = new Zend_Dojo_Form_Element_SubmitButton('btn_search');
     $_btn_search->setAttribs(array('dojoType' => 'dijit.form.Button', 'iconclass' => 'dijitIconSearch'));
     $db = new Application_Model_DbTable_DbGlobal();
     $branch = new Zend_Dojo_Form_Element_FilteringSelect('branch');
     $branch->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $rows = $db->getAllBranchName();
     $options = '';
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $branch->setMultiOptions($options);
     $client_code = new Zend_Dojo_Form_Element_FilteringSelect('client_code');
     $client_code->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true', 'onchange' => 'getmemberIdGroup();'));
     $group_opt = $db->getGroupCodeById(1, 0, 1);
     //code,individual,option
     $client_code->setMultiOptions($group_opt);
     $client_name = new Zend_Dojo_Form_Element_FilteringSelect('client_name');
     $client_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true', 'onchange' => 'checkMember()'));
     $options = $db->getGroupCodeById(2, 0, 1);
     $client_name->setMultiOptions($options);
     $problem = new Zend_Dojo_Form_Element_ValidationTextBox('problem');
     $problem->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside', 'required' => true));
     $date = new Zend_Dojo_Form_Element_DateTextBox('date');
     $date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside', 'required' => true));
     $date->setValue(date('Y-m-d'));
     $status = new Zend_Dojo_Form_Element_FilteringSelect('status');
     $status->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside'));
     $opt = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $status->setMultiOptions($opt);
     $from_date = new Zend_Dojo_Form_Element_DateTextBox('start_date');
     $from_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside', 'onchange' => 'CalculateDate();'));
     $_date = $request->getParam("start_date");
     if (empty($_date)) {
         $_date = date('Y-m-d');
     }
     $from_date->setValue($_date);
     $to_date = new Zend_Dojo_Form_Element_DateTextBox('end_date');
     $to_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'required' => 'true', 'class' => 'fullside'));
     $_date = $request->getParam("end_date");
     if (empty($_date)) {
         $_date = date("Y-m-d");
     }
     $to_date->setValue($_date);
     $_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
     $_branch_id->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside', 'required' => 'true'));
     $rows = $db->getAllBranchName();
     $options = array('' => "------Select Branch Name------");
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $options[$row['br_id']] = $row['branch_namekh'];
         }
     }
     $_branch_id->setMultiOptions($options);
     $_branch_id->setValue($request->getParam('branch_id'));
     $_id = new Zend_Form_Element_Hidden('id');
     if ($data != null) {
         $branch->setValue($data['branch_id']);
         $client_code->setValue($data['client_id']);
         $client_name->setValue($data['client_id']);
         $problem->setValue($data['reasonblack_list']);
         $date->setValue($data['date_blacklist']);
         $status->setValue($data['status_blacklist']);
         $_id->setValue($data['client_id']);
     }
     $this->addElements(array($_branch_id, $from_date, $to_date, $_id, $_title, $_status, $_btn_search, $branch, $client_code, $client_name, $problem, $date, $status));
     return $this;
 }
Exemplo n.º 30
0
    public function xchange()
    {
        /* Form Elements & Other Definitions Here ... */
    	
    	$Onetomany=new Zend_Dojo_Form_Element_FilteringSelect('onetomany');
    	$Onetomany->setAttribs(array(
    			'dojoType'=>'dijit.form.FilteringSelect'));
    	$name=array(1=>'ពីមួយទៅច្រើន',2=>'ពីច្រើនទៅមួយ',3=>'ពីមួយទៅមួយ');
    	$Onetomany->setMultiOptions($name);
    	
    	$moneyinaccount=new Zend_Dojo_Form_Element_TextBox('moneyinaccount');
    	$moneyinaccount->setAttribs(array(
    			'dojoType'=>'dijit.form.TextBox'));
    	$Date=new Zend_Dojo_Form_Element_DateTextBox('date');
    	$Date->setAttribs(array(
    			'dojoType'=>'dijit.form.DateTextBox'));
    	$Date->setValue(date('Y-m-d'));
    	$Cusomer=new Zend_Dojo_Form_Element_FilteringSelect('customer');
    	$Cusomer->setAttribs(array(
    			'dojoType'=>'dijit.form.FilteringSelect'));
    	$name=array(1=>'General Customer');
    	$Cusomer->setMultiOptions($name);
    	
    	$number_code=new Zend_Dojo_Form_Element_TextBox('number_code');
    	$number_code->setAttribs(array(
    			'dojoType'=>'dijit.form.TextBox',
    			'readOnly'=>true,'style'=>'color:red'));
    	
    	$db = new Application_Model_DbTable_DbGlobal();
    	$iv_numbber = $db->getNewInvoiceExchange();
    	$number_code->setValue($iv_numbber);
    	
    	$_branch_id = new Zend_Dojo_Form_Element_FilteringSelect('branch_id');
		$_branch_id->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
// 				'class'=>'fullside',
				'required' =>'true'
		));
		
		$rows = $db->getAllBranchName();
		$options='';
			if(!empty($rows))foreach($rows AS $row){
				$options[$row['br_id']]=$row['branch_namekh'];
			}
		$_branch_id->setMultiOptions($options);
		
		$sell_dollar=new Zend_Dojo_Form_Element_NumberTextBox('sell_dollar');
		$sell_dollar->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox'));
		$sell_dollar->setValue(0);
		
		$sell_riel=new Zend_Dojo_Form_Element_NumberTextBox('sell_riel');
		$sell_riel->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox'));
		$sell_riel->setValue(0);
		
		$sell_bath=new Zend_Dojo_Form_Element_NumberTextBox('sell_bath');
		$sell_bath->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox'));
		$sell_bath->setValue(0);
		
    	$Payusa=new Zend_Dojo_Form_Element_NumberTextBox('payusa');
    	$Payusa->setAttribs(array(
    			'dojoType'=>'dijit.form.NumberTextBox'));
    	$Payusa->setValue(0);
    	
    	$Payr=new Zend_Dojo_Form_Element_NumberTextBox('payr');
    	$Payr->setAttribs(array(
    			'dojoType'=>'dijit.form.NumberTextBox'));
    	$Payr->setValue(0);
    	
    	$Payb=new Zend_Dojo_Form_Element_NumberTextBox('payb');
    	$Payb->setAttribs(array(
    			'dojoType'=>'dijit.form.NumberTextBox'));
    	$Payb->setValue(0);
    	
    	$Getusa=new Zend_Dojo_Form_Element_NumberTextBox('getusa');
    	$Getusa->setAttribs(array(
    			'dojoType'=>'dijit.form.NumberTextBox',
    			'onkeyup'=>'returnMoney(2);'));
    	$Getusa->setValue(0);
    	
    	$Getr=new Zend_Dojo_Form_Element_NumberTextBox('getr');
    	$Getr->setAttribs(array(
    			'dojoType'=>'dijit.form.NumberTextBox',
    			'onkeyup'=>'returnMoney(1);'));
    	$Getr->setValue(0);
    	
    	$Getb=new Zend_Dojo_Form_Element_NumberTextBox('getb');
    	$Getb->setAttribs(array(
    			'dojoType'=>'dijit.form.NumberTextBox',
    			'onkeyup'=>'returnMoney(3);'));
    	$Getb->setValue(0);
    	
    	$Returnb=new Zend_Dojo_Form_Element_NumberTextBox('returnb');
    	$Returnb->setAttribs(array(
    			'dojoType'=>'dijit.form.NumberTextBox'));
    	$Returnb->setValue(0);
    	
    	$Returnusa=new Zend_Dojo_Form_Element_NumberTextBox('returnusa');
    	$Returnusa->setAttribs(array(
    			'dojoType'=>'dijit.form.NumberTextBox'));
    	$Returnusa->setValue(0);
    	
    	$Returnr=new Zend_Dojo_Form_Element_NumberTextBox('returnr');
    	$Returnr->setAttribs(array(
    			'dojoType'=>'dijit.form.NumberTextBox'));
    	$Returnr->setValue(0);
		$this->addElements(array($_branch_id,$Cusomer,$Date,$Onetomany,$Payusa,$Payr,$Payb,
				$Getusa,$Getr,$Getb,$Returnusa,$Returnb,$Returnr,$number_code
				,$sell_dollar,$sell_riel,$sell_bath));
		return $this;
    }