public function init() { // projeto_id $projeto_id = new Zend_Form_Element_Select("projeto_id"); $projeto_id->setLabel("Projeto: "); $projeto_id->setAttribs(array('class' => 'form-control')); $projeto_id->setMultiOptions($this->getProjetos()); // cliente_id $cliente_id = new Zend_Form_Element_Select("cliente_id"); $cliente_id->setLabel("Cliente: "); $cliente_id->setAttribs(array('class' => 'form-control')); $cliente_id->setRequired(false); $cliente_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $cliente_id->setMultiOptions($this->getClientes()); // faturamento_tipo $faturamento_tipo = new Zend_Form_Element_Select("faturamento_tipo"); $faturamento_tipo->setLabel("Tipo: "); $faturamento_tipo->setAttribs(array('class' => 'form-control')); $faturamento_tipo->setRequired(false); $faturamento_tipo->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $faturamento_tipo->setMultiOptions(array(1 => 'Boleto', 2 => 'Transferência')); // faturamento_valor $faturamento_valor = new Zend_Form_Element_Text("faturamento_valor"); $faturamento_valor->setLabel("Valor: "); $faturamento_valor->setAttribs(array('class' => 'form-control')); //$faturamento_valor->setRequired(); $faturamento_valor->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); // faturamento_descricao $faturamento_descricao = new Zend_Form_Element_Text("faturamento_descricao"); $faturamento_descricao->setLabel("Descrição: "); $faturamento_descricao->setAttribs(array('class' => 'form-control')); $faturamento_descricao->setRequired(); $faturamento_descricao->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); // faturamento_nosso_numero $faturamento_nosso_numero = new Zend_Form_Element_Text("faturamento_nosso_numero"); $faturamento_nosso_numero->setLabel("Nosso Nº: "); $faturamento_nosso_numero->setAttribs(array('class' => 'form-control')); //$faturamento_nosso_numero->setRequired(); $faturamento_nosso_numero->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); // faturamento_vencimento $faturamento_vencimento = new Zend_Form_Element_Text("faturamento_vencimento"); $faturamento_vencimento->setLabel("Vencimento: "); $faturamento_vencimento->setAttribs(array('class' => 'form-control')); $faturamento_vencimento->setRequired(); $faturamento_vencimento->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); // faturamento_nota_fiscal $faturamento_nota_fiscal = new Zend_Form_Element_File("faturamento_nota_fiscal"); $faturamento_nota_fiscal->setLabel("Nota Fiscal:"); $faturamento_nota_fiscal->addDecorators(App_Forms_Decorators::$ElementDecoratorFile); $faturamento_nota_fiscal->setAttribs(array('class' => 'filestyle', 'data-buttonText' => 'Selecione a Nota Fiscal', 'data-iconName' => 'fa fa-file')); //$faturamento_nota_fiscal->setRequired(); $faturamento_nota_fiscal->setDestination(Zend_Registry::get('config')->notafiscal->filepath); $faturamento_nota_fiscal->addValidators(array(array('Extension', false, 'pdf'))); $this->addElements(array($projeto_id, $cliente_id, $faturamento_tipo, $faturamento_vencimento, $faturamento_valor, $faturamento_nosso_numero, $faturamento_descricao, $faturamento_nota_fiscal)); parent::init(); }
public function init() { // proposta_numero $proposta_numero = new Zend_Form_Element_Text("proposta_numero"); $proposta_numero->setLabel("Número: "); $proposta_numero->setAttribs(array('class' => 'form-control')); // proposta_tipo_id $proposta_tipo_id = new Zend_Form_Element_Select("proposta_tipo_id"); $proposta_tipo_id->setLabel("Tipo Proposta: "); $proposta_tipo_id->setAttribs(array('class' => 'form-control')); $proposta_tipo_id->setRequired(); $proposta_tipo_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $proposta_tipo_id->setMultiOptions($this->getPropostaTipo()); // cliente_id $cliente_id = new Zend_Form_Element_Select("cliente_id"); $cliente_id->setLabel("Cliente: "); $cliente_id->setAttribs(array('class' => 'form-control')); $cliente_id->setRequired(); $cliente_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $cliente_id->setMultiOptions($this->getClientes()); // tipo_servico_id $tipo_servico_id = new Zend_Form_Element_Select("tipo_servico_id"); $tipo_servico_id->setLabel("Tipo de Serviço: "); $tipo_servico_id->setAttribs(array('class' => 'form-control')); $tipo_servico_id->setRequired(); $tipo_servico_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $tipo_servico_id->setMultiOptions($this->getTipoServicos()); // proposta_horas $proposta_horas = new Zend_Form_Element_Text("proposta_horas"); $proposta_horas->setLabel("Horas: "); $proposta_horas->setAttribs(array('class' => 'form-control')); // proposta_valor $proposta_valor = new Zend_Form_Element_Text("proposta_valor"); $proposta_valor->setLabel("Valor: "); $proposta_valor->setAttribs(array('class' => 'form-control')); // proposta_data $proposta_data = new Zend_Form_Element_Text("proposta_data"); $proposta_data->setLabel("Data: "); $proposta_data->setAttribs(array('class' => 'form-control')); // proposta_vencimento $proposta_vencimento = new Zend_Form_Element_Text("proposta_vencimento"); $proposta_vencimento->setLabel("Vencimento: "); $proposta_vencimento->setAttribs(array('class' => 'form-control')); // proposta_documento $proposta_documento = new Zend_Form_Element_File("proposta_documento"); $proposta_documento->setLabel("Proposta:"); $proposta_documento->addDecorators(App_Forms_Decorators::$ElementDecoratorFile); $proposta_documento->setAttribs(array('class' => 'filestyle', 'data-buttonText' => 'Selecione o PDF', 'data-iconName' => 'fa fa-file')); //$proposta_documento->setRequired(); $proposta_documento->setDestination(Zend_Registry::get('config')->proposta->filepath); $proposta_documento->addValidators(array(array('Extension', false, 'pdf'))); $this->addElements(array($proposta_numero, $cliente_id, $proposta_tipo_id, $tipo_servico_id, $proposta_horas, $proposta_valor, $proposta_data, $proposta_vencimento, $proposta_documento)); parent::init(); }
public function init() { // profissional_beleza_nome $profissional_beleza_nome = new Zend_Form_Element_Text("profissional_beleza_nome"); $profissional_beleza_nome->setLabel("Nome: "); $profissional_beleza_nome->setAttribs(array('class' => 'form-control')); $profissional_beleza_nome->setRequired(); $profissional_beleza_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators); // profissional_beleza_email $profissional_beleza_email = new Zend_Form_Element_Text("profissional_beleza_email"); $profissional_beleza_email->setLabel("E-mail: "); $profissional_beleza_email->setValidators(array('EmailAddress')); $profissional_beleza_email->addValidator(new App_Validate_ProfissionalBeleza()); $profissional_beleza_email->setAttribs(array('class' => 'form-control')); $profissional_beleza_email->setRequired(); $profissional_beleza_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators); /** * profisional_beleza_sexo */ $profissional_beleza_sexo = new Zend_Form_Element_Radio("profissional_beleza_sexo"); $profissional_beleza_sexo->setLabel("Sexo:"); $profissional_beleza_sexo->setRequired(); $profissional_beleza_sexo->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $profissional_beleza_sexo->setMultiOptions(array('M' => ' Masculino', 'F' => ' Feminino')); // profissional_beleza_avatar $profissional_beleza_avatar = new Zend_Form_Element_File("profissional_beleza_avatar"); $profissional_beleza_avatar->setLabel(" \n Foto: \n "); $profissional_beleza_avatar->addDecorators(App_Forms_Decorators::$ElementDecoratorFile); $profissional_beleza_avatar->setAttribs(array('class' => 'filestyle', 'data-buttonText' => 'Selecione a foto', 'data-iconName' => 'fa fa-user')); $profissional_beleza_avatar->setRequired(); $profissional_beleza_avatar->setDestination(Zend_Registry::get('config')->profissional->avatar->path); $profissional_beleza_avatar->addValidators(array(array('Extension', false, 'jpg,jpeg,png'))); $profissional_beleza_avatar->addFilter(new Skoch_Filter_File_Resize(array('width' => 160, 'keepRatio' => true))); // especialidade_id $especialidade_id = new Zend_Form_Element_MultiCheckbox("especialidade_id"); $especialidade_id->setLabel("Selecione as especialidades: "); $especialidade_id->setAttribs(array('class' => '')); $especialidade_id->setRequired(); $especialidade_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $especialidade_id->setSeparator(' '); $especialidade_id->setMultiOptions($this->getEspecialidades()); // addElements $this->addElements(array($profissional_beleza_nome, $profissional_beleza_email, $profissional_beleza_sexo, $profissional_beleza_avatar, $especialidade_id)); parent::init(); }
public function FrmaddGuide($data = null) { $pob = new Zend_Dojo_Form_Element_TextBox('pob'); $pob->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside')); $att_file = new Zend_Form_Element_File('att_file'); $att_file->setAttribs(array('class' => 'fullside')); $_dob = new Zend_Dojo_Form_Element_DateTextBox('dob_client'); $_dob->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside')); $_dob->setValue(date("Y-m-d")); $nationality = new Zend_Dojo_Form_Element_TextBox('nationality'); $nationality->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside')); $request = Zend_Controller_Front::getInstance()->getRequest(); $_email = new Zend_Dojo_Form_Element_TextBox('email'); $_email->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside')); $db = new Application_Model_DbTable_DbGlobal(); $_namekh = new Zend_Dojo_Form_Element_TextBox('name_kh'); $_namekh->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'class' => 'fullside', 'required' => 'true')); $id_client = $db->getDriverCode(); $_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')); $_sex = new Zend_Dojo_Form_Element_FilteringSelect('sex'); $_sex->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside')); $opt_status = $db->getVewOptoinTypeByType(1, 1); unset($opt_status[-1]); unset($opt_status['']); $_sex->setMultiOptions($opt_status); $_phone = new Zend_Dojo_Form_Element_TextBox('phone'); $_phone->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside')); $normalprice = new Zend_Dojo_Form_Element_NumberTextBox('cnormalprice'); $normalprice->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true)); $otprice = new Zend_Dojo_Form_Element_NumberTextBox('cotprice'); $otprice->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true)); $pnormalprice = new Zend_Dojo_Form_Element_NumberTextBox('pnormalprice'); $pnormalprice->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true)); $potprice = new Zend_Dojo_Form_Element_NumberTextBox('potprice'); $potprice->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true)); $photo = new Zend_Form_Element_File('photo'); $photo->setAttribs(array()); $national_id = new Zend_Dojo_Form_Element_TextBox('national_id'); $national_id->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside')); $experience = new Zend_Dojo_Form_Element_TextBox('experience'); $experience->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside')); $publicholiday = new Zend_Dojo_Form_Element_NumberTextBox('poblicholiday_price'); $publicholiday->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true)); $weekend_price = new Zend_Dojo_Form_Element_NumberTextBox('weekend_price'); $weekend_price->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true)); $experience_num = new Zend_Dojo_Form_Element_NumberTextBox('experience_number'); $experience_num->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true)); $p_popublicholiday = new Zend_Dojo_Form_Element_NumberTextBox('ppoblicholiday_price'); $p_popublicholiday->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true)); $p_weekend = new Zend_Dojo_Form_Element_NumberTextBox('pweekend_price'); $p_weekend->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true)); $monthly_price = new Zend_Dojo_Form_Element_NumberTextBox('monthly_price'); $monthly_price->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true)); $_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:30px;')); $lang = new Zend_Dojo_Form_Element_TextBox('lang'); $lang->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')); $opt = array(1 => "Active", 0 => "Deactive"); $_status->setMultiOptions($opt); $_type = new Zend_Dojo_Form_Element_FilteringSelect('type'); $_type->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'class' => 'fullside')); $_status_opt = array(1 => $this->tr->translate("Guide"), 2 => $this->tr->translate("Driver"), 3 => $this->tr->translate("Both")); $_status_opt = $db->getVewOptoinTypeByType(8, 1, null, 1); $_type->setMultiOptions($_status_opt); $address = new Zend_Dojo_Form_Element_TextBox('home'); $address->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside')); $groupnum = new Zend_Dojo_Form_Element_TextBox('group'); $groupnum->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside')); $streetnum = new Zend_Dojo_Form_Element_TextBox('street'); $streetnum->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside')); $commune = new Zend_Dojo_Form_Element_TextBox('commune'); $commune->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside')); $district = new Zend_Dojo_Form_Element_TextBox('district'); $district->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')); $opt = $db->getAllProvince(1); $province->setMultiOptions($opt); $id_card = new Zend_Dojo_Form_Element_TextBox('id_card'); $id_card->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside')); $issued_date = new Zend_Dojo_Form_Element_DateTextBox('issued_date'); $issued_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside')); $issued_date->setValue(date("Y-m-d")); $registered_date = new Zend_Dojo_Form_Element_DateTextBox('registered_date'); $registered_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside')); $registered_date->setValue(date("Y-m-d")); $expired_date = new Zend_Dojo_Form_Element_DateTextBox('expired_date'); $expired_date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox', 'class' => 'fullside')); $expired_date->setValue(date("Y-m-d")); $_email = new Zend_Dojo_Form_Element_TextBox('email'); $_email->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'class' => 'fullside', 'style' => 'color:red;')); /////////////////////// $citynormalprice = new Zend_Dojo_Form_Element_NumberTextBox('citynormalprice'); $citynormalprice->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true)); $cityweekendprice = new Zend_Dojo_Form_Element_NumberTextBox('cityweekendprice'); $cityweekendprice->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true)); $cityotprice = new Zend_Dojo_Form_Element_NumberTextBox('cityotprice'); $cityotprice->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true)); $citypublic = new Zend_Dojo_Form_Element_NumberTextBox('citypublicprice'); $citypublic->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'class' => 'fullside', 'required' => true)); $_id_no = new Zend_Form_Element_Hidden('id'); if ($data != null) { $_id_no->setValue($data['id']); $_clientno->setValue($data['driver_id']); $_namekh->setValue($data['first_name']); $_nameen->setValue($data['last_name']); $_sex->setValue($data['sex']); $_dob->setValue($data['dob']); $pob->setValue($data['pob']); $nationality->setValue($data['nationality']); $national_id->setValue($data['doc_number']); $_desc->setValue($data['lang_note']); $_type->setValue($data['position_type']); $id_card->setValue($data['id_card']); $issued_date->setValue($data['issue_date']); $expired_date->setValue($data['expired_date']); $registered_date->setValue($data['register_date']); $experience->setValue($data['experience_desc']); $_phone->setValue($data['tel']); $_email->setValue($data['email']); $groupnum->setValue($data['group_num']); $address->setValue($data['home_num']); $streetnum->setValue($data['street']); $commune->setValue($data['commune']); $district->setValue($data['district']); $province->setValue($data['province_id']); $pnormalprice->setValue($data['p_normalprice']); $p_weekend->setValue($data['p_weekendprice']); $p_popublicholiday->setValue($data['p_holidayprice']); $potprice->setValue($data['p_otprice']); $normalprice->setValue($data['c_normalprice']); $weekend_price->setValue($data['c_weekendprice']); $publicholiday->setValue($data['c_holidayprice']); $otprice->setValue($data['c_otprice']); $citypublic->setValue($data['citypublicprice']); $cityweekendprice->setValue($data['cityweekendprice']); $cityotprice->setValue($data['cityotprice']); $citynormalprice->setValue($data['citynormalprice']); $_status->setValue($data['status']); } $this->addElements(array($monthly_price, $citypublic, $cityotprice, $citynormalprice, $cityweekendprice, $province, $expired_date, $issued_date, $registered_date, $id_card, $district, $commune, $streetnum, $groupnum, $p_popublicholiday, $p_weekend, $experience, $publicholiday, $weekend_price, $pnormalprice, $potprice, $normalprice, $otprice, $lang, $address, $_type, $nationality, $_id, $photo, $national_id, $_email, $_namekh, $_nameen, $_sex, $_id_no, $_phone, $_desc, $_status, $_clientno, $_dob, $att_file, $pob)); return $this; }
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; }
public function FrmCustomer($data = null) { $_dob = new Zend_Form_Element_Text('dob_client'); $_dob->setValue(date("d-m-Y")); $_dob->setAttribs(array('class' => 'fullside', "style" => "width:100%")); $request = Zend_Controller_Front::getInstance()->getRequest(); $db = new Application_Model_DbTable_DbGlobal(); $_namekh = new Zend_Form_Element_Text('name_kh'); $_namekh->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $_clientno = new Zend_Form_Element_Text('client_no'); $_clientno->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $id_client = $db->getNewClientId(); $_clientno->setValue($id_client); $_nameen = new Zend_Form_Element_Text('name_en'); $_nameen->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $_sex = new Zend_Form_Element_Select('sex'); $_sex->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $opt_status = $db->getVewOptoinTypeByType(1, 1); unset($opt_status[-1]); unset($opt_status['']); $_sex->setMultiOptions($opt_status); $_situ_status = new Zend_Form_Element_Select('status'); $_situ_status->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $home = new Zend_Form_Element_Text('home'); $home->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $group_num = new Zend_Form_Element_Text('group_num'); $group_num->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $i_group_num = new Zend_Form_Element_Text('igroup_num'); $i_group_num->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $country = new Zend_Form_Element_Select('country'); $country->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $row = $db->getAllCountry(); $opt_country = array(); if (!empty($row)) { foreach ($row as $rs) { $opt_country[$rs['id']] = $rs['country_name']; } } $country->setMultiOptions($opt_country); $state = new Zend_Form_Element_Text('state'); $state->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $commune = new Zend_Form_Element_Text('commune'); $commune->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $district = new Zend_Form_Element_Text('district'); $district->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $icommune = new Zend_Form_Element_Text('zip'); $icommune->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $city = new Zend_Form_Element_Text('city'); $city->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $province = new Zend_Form_Element_Select('province'); $province->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $opt = $db->getAllProvince(1); $province->setMultiOptions($opt); $_street = new Zend_Form_Element_Text('street'); $_street->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $address1 = new Zend_Form_Element_Text('address1'); $address1->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $_id_type = new Zend_Form_Element_Select('id_type'); $_id_type->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $address = new Zend_Form_Element_Text('address'); $address->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $_phone = new Zend_Form_Element_Text('phone'); $_phone->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $photo = new Zend_Form_Element_File('photo'); $photo->setAttribs(array()); $job = new Zend_Form_Element_Text('job'); $job->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $national_id = new Zend_Form_Element_Text('national_id'); $national_id->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $email = new Zend_Form_Element_Text('email'); $email->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $iemail = new Zend_Form_Element_Text('iemail'); $iemail->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $fax = new Zend_Form_Element_Text('fax'); $fax->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $balance = new Zend_Form_Element_Text('balance'); $balance->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $_id = new Zend_Form_Element_Hidden("id"); $_desc = new Zend_Form_Element_Text('desc'); $_desc->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $_status = new Zend_Form_Element_Select('status'); $_status->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $_status_opt = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE")); $_status->setMultiOptions($_status_opt); $_title = new Zend_Form_Element_Select('title'); $_title->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $_status_opt = array(1 => $this->tr->translate("Mr."), 2 => $this->tr->translate("Ms"), 3 => $this->tr->translate("Miss")); $_title->setMultiOptions($_status_opt); $customer_type = new Zend_Form_Element_Select('customer_type'); $customer_type->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;')); $_status_opt = array(1 => $this->tr->translate("Self"), 2 => $this->tr->translate("Agency")); $customer_type->setMultiOptions($_status_opt); $nationality = new Zend_Form_Element_Text('nationality'); $nationality->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $company_name = new Zend_Form_Element_Text('company_name'); $company_name->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $passport = new Zend_Form_Element_Text('passport'); $passport->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $p_issuedate = new Zend_Form_Element_Text('pissue_date'); $p_issuedate->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $p_issuedate->setValue(date("Y-m-d")); $p_expireddate = new Zend_Form_Element_Text('pexpired_date'); $p_expireddate->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $p_expireddate->setValue(date("Y-m-d")); $card_code = new Zend_Form_Element_Text('card_code'); $card_code->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $c_issuedate = new Zend_Form_Element_Text('cissue_date'); $c_issuedate->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $c_issuedate->setValue(date("Y-m-d")); $c_expireddate = new Zend_Form_Element_Text('cexpired_date'); $c_expireddate->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $c_expireddate->setValue(date("Y-m-d")); $ftb = new Zend_Form_Element_Text('ftb'); $ftb->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $f_issuedate = new Zend_Form_Element_Text('fissue_date'); $f_issuedate->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $f_issuedate->setValue(date("Y-m-d")); $f_expireddate = new Zend_Form_Element_Text('fexpired_date'); $f_expireddate->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $f_expireddate->setValue(date("Y-m-d")); $address2 = new Zend_Form_Element_Text('address2'); $address2->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $in_city = new Zend_Form_Element_Text('i_city'); $in_city->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $in_province = new Zend_Form_Element_Text('country'); $in_province->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $in_zipcode = new Zend_Form_Element_Text('i_zipcode'); $in_zipcode->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $in_phone = new Zend_Form_Element_Text('i_phone'); $in_phone->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $in_note = new Zend_Form_Element_Text('i_note'); $in_note->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $old_photo = new Zend_Form_Element_Hidden('old_photo'); $ids = new Zend_Form_Element_Hidden('id'); $loc_address = new Zend_Form_Element_Textarea("loc_add"); $in_add = new Zend_Form_Element_Textarea("int_add"); $fly_no = new Zend_Form_Element_Text("fly_no"); $fly_no->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $fly_date = new Zend_Form_Element_Text("fly_date"); $fly_date->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $fly_time = new Zend_Form_Element_Text("fly_time"); $fly_time->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $fly_destination = new Zend_Form_Element_Text("fly_destination"); $fly_destination->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $occupation = new Zend_Form_Element_Text('occupation'); $occupation->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); $photo = new Zend_Form_Element_File('photo'); $photo->setAttribs(array()); $fax = new Zend_Form_Element_Text('fax'); $fax->setAttribs(array('style' => 'width: 100% !important;padding:1px !important;', 'class' => 'control_style')); if ($data != null) { $home->setValue($data["house_num"]); $district->setValue($data["district"]); $ids->setValue($data['id']); $_title->setValue($data['title']); $_namekh->setValue($data['first_name']); $_nameen->setValue($data['last_name']); $_sex->setValue($data['sex']); $_clientno->setValue($data['customer_code']); $_dob->setValue(date("d-m-Y"), strtotime($data['dob'])); $country->setValue($data['pob']); $nationality->setValue($data['nationality']); $company_name->setValue($data['company_name']); $_phone->setValue($data['phone']); $email->setValue($data['email']); $group_num->setValue($data['group_num']); $address->setValue($data['house_num']); $_street->setValue($data['street']); $commune->setValue($data['commune']); $province->setValue($data['province_id']); $address1->setValue($data["address1"]); $address2->setValue($data['address2']); $in_city->setValue($data['i_city']); $state->setValue($data['i_state']); $in_zipcode->setValue($data['i_zipcode']); $icommune->setValue($data['i_zipcode']); $in_phone->setValue($data['i_phone']); $city->setValue($data['i_city']); $fax->setValue($data['fax']); $national_id->setValue($data['nationality']); $occupation->setValue($data['occupation']); } $this->addElements(array($state, $fax, $photo, $occupation, $fly_date, $fly_destination, $fly_no, $fly_time, $iemail, $city, $icommune, $address1, $i_group_num, $home, $loc_address, $in_add, $old_photo, $ids, $in_note, $in_phone, $in_zipcode, $in_province, $in_city, $address2, $customer_type, $commune, $district, $province, $p_issuedate, $p_expireddate, $c_issuedate, $c_expireddate, $f_issuedate, $f_expireddate, $passport, $card_code, $ftb, $company_name, $nationality, $_title, $balance, $fax, $email, $group_num, $country, $_id, $photo, $job, $national_id, $_namekh, $_nameen, $_sex, $_situ_status, $_street, $_id_type, $address, $_phone, $_desc, $_status, $_clientno, $_dob)); return $this; }
public function addPartner($data = NULL) { $_db = new Application_Model_DbTable_DbGlobal(); $id = new Zend_Form_Element_Hidden('id'); /* Form Elements & Other Definitions Here ... */ $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 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')); //////------------------------------- $mainbranch = new Zend_Dojo_Form_Element_FilteringSelect('main_branch'); $mainbranch->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect')); $db = new Partner_Model_DbTable_DbPartner(); $opt = $db->getNamePartnerparent(null, 1); $mainbranch->setMultiOptions($opt); $mainbranch->setValue($request->getParam('main_branch')); $rows_provice = $_db->getAllProvince(); $opt_province = ""; $opt_province = array('-1' => "------Select Province------"); if (!empty($rows_provice)) { foreach ($rows_provice as $row) { $opt_province[$row['id']] = $row['name']; } } $province_name = new Zend_Dojo_Form_Element_FilteringSelect('province_name'); $province_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'onchange' => 'filterDistrict();')); $province_name->setMultiOptions($opt_province); $province_name->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect', 'required' => 'true')); //------------------------------------------------------------------------ $branchname = new Zend_Dojo_Form_Element_ValidationTextBox('branch_name'); $branchname->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'required' => true)); $cade_number = new Zend_Dojo_Form_Element_TextBox('cade_number'); $cade_number->setAttribs(array('dojoType' => 'dijit.form.TextBox')); $partnername = new Zend_Dojo_Form_Element_TextBox('partner_name'); $partnername->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'Required' => true)); $photo = new Zend_Form_Element_File('photo'); $photo->setAttribs(array()); $id_accournnumber = $db->getNewAccountNumber(1); $accournnumber = new Zend_Dojo_Form_Element_TextBox('account_number'); $accournnumber->setAttribs(array('dojoType' => 'dijit.form.TextBox', 'readonly' => 'readonly', 'style' => 'color:red;')); $accournnumber->setValue($id_accournnumber); $Address = new Zend_Dojo_Form_Element_TextBox('address'); $Address->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox')); $homenumber = new Zend_Dojo_Form_Element_TextBox('home_number'); $homenumber->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox')); $groupnumber = new Zend_Dojo_Form_Element_TextBox('group_number'); $groupnumber->setAttribs(array('dojoType' => 'dijit.form.TextBox')); $streetnumber = new Zend_Dojo_Form_Element_TextBox('street_number'); $streetnumber->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox')); $communnumber = new Zend_Dojo_Form_Element_ValidationTextBox('commun_number'); $communnumber->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox', 'required' => true)); $phonenumber = new Zend_Dojo_Form_Element_TextBox('phone_number'); $phonenumber->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox')); $faxnumber = new Zend_Dojo_Form_Element_TextBox('fax_number'); $faxnumber->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox')); $salephone = new Zend_Dojo_Form_Element_TextBox('sele_phone'); $salephone->setAttribs(array('dojoType' => 'dijit.form.ValidationTextBox')); $status = new Zend_Dojo_Form_Element_FilteringSelect('status'); $status->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect')); $opt = array(1 => 'ប្រើប្រាស់', 0 => 'មិនបានប្រើប្រាស់'); $status->setMultiOptions($opt); $note = new Zend_Dojo_Form_Element_SimpleTextarea('note'); $note->setAttribs(array('dojoType' => 'dijit.form.SimpleTextarea')); $money_usa = new Zend_Dojo_Form_Element_NumberTextBox('money_usa'); $money_usa->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'required' => true)); $money_usa->setValue(0); $money_bath = new Zend_Dojo_Form_Element_NumberTextBox('money_bath'); $money_bath->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'Required' => true)); $money_bath->setValue(0); $money_real = new Zend_Dojo_Form_Element_NumberTextBox('money_riel'); $money_real->setAttribs(array('dojoType' => 'dijit.form.NumberTextBox', 'Required' => true)); $money_real->setValue(0); $status_getmoney = new Zend_Dojo_Form_Element_FilteringSelect('status_getmoney'); $status_getmoney->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect')); $opt_status = array(1 => 'ដៃគូមេ', 2 => 'ដៃគូកូន'); $status_getmoney->setMultiOptions($opt_status); $status_tran = new Zend_Dojo_Form_Element_FilteringSelect('tran_type'); $status_tran->setAttribs(array('dojoType' => 'dijit.form.FilteringSelect')); $status_option = array(1 => 'ប្រើប្រាស់សាច់ប្រាក់', 2 => 'ទូទាត់ខាងក្រៅ'); $status_tran->setMultiOptions($status_option); $date = new Zend_Dojo_Form_Element_DateTextBox('date'); $date->setAttribs(array('dojoType' => 'dijit.form.DateTextBox')); $date->setValue(date('Y-m-d')); $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-01'); } $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); if ($data != null) { $mainbranch->setValue($data['parent']); $branchname->setValue($data['partner_brand']); //$sub_branch->setValue($data['partner_brand']); $partnername->setValue($data['partner_name']); $accournnumber->setValue($data['account_no']); $cade_number->setValue($data['nation_id']); $homenumber->setValue($data['house_no']); $groupnumber->setValue($data['group_no']); $streetnumber->setValue($data['street']); // $commune_name->setValue($data['commune']); // $districtnumber->setValue($data['district']); // $provicenumber->setValue($data['province']); $province_name->setValue($data['province']); // $district_name->setValue($data['district']); $faxnumber->setValue($data['tel']); $salephone->setValue($data['mobile']); $note->setValue($data['note']); $money_usa->setValue($data['cash_dollar']); $money_bath->setValue($data['cash_bath']); $money_real->setValue($data['cash_riel']); $status_tran->setValue($data['is_cashoperation']); $Address->setValue($data['address']); $date->setValue($data['date']); $id->setValue($data['id']); $status->setValue($data['status']); } $this->addElements(array($id, $_title, $_status_search, $_btn_search, $date, $to_date, $from_date, $branchname, $partnername, $photo, $Address, $accournnumber, $homenumber, $groupnumber, $streetnumber, $communnumber, $phonenumber, $faxnumber, $salephone, $note, $status, $cade_number, $mainbranch, $money_usa, $money_bath, $money_real, $status_tran, $status_getmoney, $province_name)); return $this; }
public function showItemForm($data = null) { $db = new Application_Model_DbTable_DbGlobal(); $tr = Application_Form_FrmLanguages::getCurrentlanguage(); $nameElement = new Zend_Form_Element_Text('name'); $nameElement->setAttribs(array('class' => 'validate[required]')); $this->addElement($nameElement); $codeElement = new Zend_Form_Element_Text('item_code'); $this->addElement($codeElement); $statusElement = new Zend_Form_Element_Select('status'); $statusElement->setMultiOptions(array(1 => $tr->translate("ACTIVE"), 2 => $tr->translate("INACTIVE"))); $this->addElement($statusElement); $saleStartdateElement = new Zend_Form_Element_Text('sale_startdate'); $this->addElement($saleStartdateElement); $saleEnddateElement = new Zend_Form_Element_Text('sale_enddate'); $this->addElement($saleEnddateElement); $rowsUnit = $db->getGlobalDb('SELECT id, name FROM rsmk_productunit'); $optionsUnit = array(); if ($rowsUnit) { foreach ($rowsUnit as $readUnit) { $optionsUnit[$readUnit['id']] = $readUnit['name']; } } $usageUnitElement = new Zend_Form_Element_Select('usage_unit'); $usageUnitElement->setAttribs(array('class' => 'validate[required]')); $usageUnitElement->setMultiOptions($optionsUnit); $this->addElement($usageUnitElement); $qtyPerUnitElement = new Zend_Form_Element_Text('qty_per_unit'); $qtyPerUnitElement->setAttribs(array('class' => 'validate[custom[number]]')); $this->addElement($qtyPerUnitElement); $unitPriceElement = new Zend_Form_Element_Text('unit_price'); $unitPriceElement->setAttribs(array('class' => 'validate[custom[number]]')); $this->addElement($unitPriceElement); $itemImageElement = new Zend_Form_Element_File('item_image'); if ($data == null) { $itemImageElement->setAttribs(array('class' => 'validate[required]')); } $this->addElement($itemImageElement); $descriptionElement = new Zend_Form_Element_Textarea('description'); $this->addElement($descriptionElement); // Select Element which get data from other Table $rows = $db->getGlobalDb('SELECT id, name FROM rsmk_product'); $options = array(); if ($rows) { foreach ($rows as $read) { $options[$read['id']] = $read['name']; } } $productElement = new Zend_Form_Element_Select('product_id'); $productElement->setMultiOptions($options); $this->addElement($productElement); // Select Element which get data from table category $rowsCategory = $db->getGlobalDb('SELECT CategoryId, Name FROM tb_category'); $optionsCategory = array(); if ($rowsCategory) { foreach ($rowsCategory as $readCategory) { $optionsCategory[$readCategory['CategoryId']] = $readCategory['Name']; } } $categoryElement = new Zend_Form_Element_Select('category'); $categoryElement->setMultiOptions($optionsCategory); $this->addElement($categoryElement); Application_Form_DateTimePicker::addDateField(array('sale_startdate', 'sale_enddate')); //set value when edit if ($data != null) { $idElement = new Zend_Form_Element_Hidden('pr'); $this->addElement($idElement); $idElement->setValue($data['pro_id']); $nameElement->setValue($data['name']); $codeElement->setValue($data['item_code']); $statusElement->setValue($data['status']); $saleStartdateElement->setValue($data['sale_startdate']); $saleEnddateElement->setValue($data['sale_enddate']); $usageUnitElement->setValue($data['usage_unit']); $qtyPerUnitElement->setValue($data['qty_per_unit']); $unitPriceElement->setValue($data['unit_price']); $itemImageElement->setValue($data['item_image']); $descriptionElement->setValue($data['description']); $productElement->setValue($data['product_id']); $categoryElement->setValue($data['category_id']); //$stockElement->setValue($data['stock_id']); } return $this; }