function init() { // Set the method for the display form to POST $this->setMethod('post'); $this->addAttribs(array('id' => 'addGroup', 'class' => '')); $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART); $control = new Zend_Form_Element_Hidden('control'); $control->setValue('addGroup'); $this->addElement($control); // begin inputs $name = new Zend_Form_Element_Text('name'); $name->setAttribs(array('class' => 'text validate[required] rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_category_name'))); $name->setRequired(true); $this->addElement($name); // begin inputs $color = new Zend_Form_Element_Text('color'); $color->setAttribs(array('class' => 'text validate[required] rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_color_for_charts'))); $color->setRequired(true); $this->addElement($color); // begin inputs $type = new Zend_Form_Element_Select('type'); $options = array('' => Zend_Registry::get('translate')->_('admin_category_select_type'), '0' => Zend_Registry::get('translate')->_('admin_expenses'), '1' => Zend_Registry::get('translate')->_('admin_income')); $type->setMultiOptions($options); $type->addValidator(new Zend_Validate_InArray(array_keys($options))); $type->setAttribs(array('class' => 'select', 'id' => 'type')); $type->setRequired(true); $this->addElement($type); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue(Zend_Registry::get('translate')->_('admin_add')); $submit->setAttribs(array('class' => 'submit')); $submit->setIgnore(true); $this->addElement($submit); }
public function addBrand($data = null) { $tr = Application_Form_FrmLanguages::getCurrentlanguage(); $db = new Application_Model_DbTable_DbGlobal(); $rowsbrand = $db->getGlobalDb('SELECT branch_id, Name FROM tb_branch WHERE Name!="" '); $options = array('' => $tr->translate('Please_Select')); if ($rowsbrand) { foreach ($rowsbrand as $readBrand) { $options[$readBrand['branch_id']] = $readBrand['Name']; } } $brandElement = new Zend_Form_Element_Select('Parent brand'); $brandElement->setAttribs(array('class' => 'demo-code-language')); $brandElement->setMultiOptions($options); $this->addElement($brandElement); $b_nameElement = new Zend_Form_Element_Text('brand Name'); $b_nameElement->setAttribs(array('class' => 'validate[required]')); $this->addElement($b_nameElement); $optionsStatus = array(1 => $tr->translate("ACTIVE"), 2 => $tr->translate('DEACTIVE')); $statusElement = new Zend_Form_Element_Select('status'); $statusElement->setAttribs(array('class' => 'demo-code-language')); $statusElement->setMultiOptions($optionsStatus); $this->addElement($statusElement); if ($data != null) { $idElement = new Zend_Form_Element_Hidden('id'); $this->addElement($idElement); $statusElement->setValue($data["IsActive"]); $idElement->setValue($data['branch_id']); $b_nameElement->setValue($data['Name']); $brandElement->setValue($data['parent_id']); } return $this; }
public function init() { // contato_nome $contato_nome = new Zend_Form_Element_Text("contato_nome"); $contato_nome->setLabel("Nome"); $contato_nome->setRequired(); $contato_nome->setAttribs(array('class' => 'form-control')); $contato_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators); // contato_email $contato_email = new Zend_Form_Element_Text("contato_email"); $contato_email->setLabel("E-mail"); $contato_email->setRequired(); $contato_email->setAttribs(array('class' => 'form-control')); $contato_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators); // contato_assunto $contato_assunto = new Zend_Form_Element_Select("contato_assunto"); $contato_assunto->setLabel("Assunto"); $contato_assunto->setRequired(); $contato_assunto->setAttribs(array('class' => 'form-control')); $contato_assunto->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $contato_assunto->setMultiOptions(array("" => "Selecione o assunto...", "Informação" => "Informação", "Elogio" => "Eologio", "Crítica" => "Crítica", "Sugestão" => "Sugestão", "Outros" => "Outros")); // contato_mensagem $contato_mensagem = new Zend_Form_Element_Textarea("contato_mensagem"); $contato_mensagem->setLabel("mensagem"); $contato_mensagem->setRequired(); $contato_mensagem->setAttribs(array('class' => 'form-control', 'rows' => 5)); $contato_mensagem->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $this->addElements(array($contato_nome, $contato_email, $contato_assunto, $contato_mensagem)); parent::init(); }
public function FrmBrand($frm = null) { $db = new Application_Model_DbTable_DbGlobal(); $status = new Zend_Form_Element_Select('status'); $_arr_status = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE")); $status->setMultiOptions($_arr_status); $status->setAttribs(array('class' => 'form-control validate[required]')); $parent = new Zend_Form_Element_Select("parent_id"); $parent->setAttribs(array('class' => 'select', 'style' => 'width:100%')); $category = $db->getAllBrand(); if (empty($category)) { $option_category = array('0' => 'No Brand To Select'); } else { $option_category = array('0' => 'Choose Brand'); foreach ($category as $row_cat) { $option_category[$row_cat["brand_id"]] = $row_cat["name_kh"]; } } $parent->setMultiOptions($option_category); $brand_en = new Zend_Form_Element_Text("name_en"); $brand_en->setAttribs(array('class' => 'validate[required]', 'placeholder' => ' Brand Name In English', "OnChange" => "GetBrandName(1)")); $brand_km = new Zend_Form_Element_Text("name_km"); $brand_km->setAttribs(array('class' => 'validate[required]', 'placeholder' => ' Brand Name In Khmer', "OnChange" => "GetBrandName(2)")); $icon = new Zend_Form_Element_File("icon"); $this->addElements(array($icon, $status, $brand_en, $brand_km, $parent)); if ($frm != "") { $parent->setValue($frm["parent_id"]); $brand_en->setValue($frm["name_en"]); $brand_km->setValue($frm["name_kh"]); $status->setValue($frm["status"]); } return $this; }
public function FrmProCate($frm = null) { $vendor_name = new Zend_Form_Element_Text("vendor_name"); $vendor_name->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'ឈ្មោះអ្នផ្ឌត់ផ្ឌង់')); $phone = new Zend_Form_Element_Text("phone"); $phone->setAttribs(array('class' => 'validate[required]', 'placeholder' => '')); $contact = new Zend_Form_Element_Text("contact"); $contact->setAttribs(array('class' => 'validate[required]', 'placeholder' => '')); $email = new Zend_Form_Element_Text("email"); $email->setAttribs(array('class' => 'validate[required]', 'placeholder' => '')); $address = new Zend_Form_Element_Textarea("address"); $address->setAttribs(array('class' => '', 'placeholder' => '')); $status = new Zend_Form_Element_Select('status'); $_arr_status = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE")); $status->setMultiOptions($_arr_status); $status->setAttribs(array('class' => 'form-control validate[required]')); $this->addElements(array($vendor_name, $phone, $contact, $email, $address, $status)); if ($frm != "") { $vendor_name->setValue($frm["v_name"]); $phone->setValue($frm["phone"]); $contact->setValue($frm["contact_name"]); $email->setValue($frm["email"]); $address->setValue($frm["vendor_remark"]); $status->setValue($frm["is_active"]); } return $this; }
public function FrmProCate($frm = null) { $db = new Application_Model_DbTable_DbGlobal(); $id_code = new Zend_Form_Element_Text('id_code'); $id_code->setAttribs(array('class' => 'form-control', "readonly" => "")); $code = table_Model_DbTable_DbTable::getCallteralCode(); $id_code->setValue($code); $cat_name_en = new Zend_Form_Element_Text("name_en"); $cat_name_en->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Name In English', "OnChange" => "GetCatName(1)")); $cat_name_km = new Zend_Form_Element_Text("name_km"); $cat_name_km->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Name In Khmer', "OnChange" => "GetCatName(2)")); $status = new Zend_Form_Element_Select('status'); $_arr_status = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE")); $status->setMultiOptions($_arr_status); $status->setAttribs(array('class' => 'form-control validate[required]')); $icon = new Zend_Form_Element_File("icon"); $description = new Zend_Form_Element_Textarea("description"); $this->addElements(array($icon, $status, $cat_name_en, $cat_name_km, $id_code, $description)); if ($frm != "") { $id_code->setValue($frm["code"]); $cat_name_en->setValue($frm["name_en"]); $cat_name_km->setValue($frm["name_km"]); $status->setValue($frm["status"]); $description->setValue($frm["description"]); } return $this; }
public function init() { $request = Zend_Controller_Front::getInstance()->getRequest(); $db = new Application_Model_DbTable_DbGlobal(); /////////////Filter stock///////////////// $tr = Application_Form_FrmLanguages::getCurrentlanguage(); $nameElement = new Zend_Form_Element_Text('s_name'); $nameValue = $request->getParam('s_name'); $nameElement->setValue($nameValue); $this->addElement($nameElement); $phonevalue = $request->getParam('phone'); $phoneElement = new Zend_Form_Element_Text('phone'); $phoneElement->setValue($phonevalue); $this->addElement($phoneElement); $rs = $db->getGlobalDb('SELECT LocationId,Name FROM tb_sublocation ORDER BY LocationId DESC '); $options = array('' => $tr->translate('Please_Select')); $agentValue = $request->getParam('stock_location'); foreach ($rs as $read) { $options[$read['LocationId']] = $read['Name']; } $sale_agent = new Zend_Form_Element_Select('stock_location'); $sale_agent->setMultiOptions($options); $sale_agent->setAttribs(array('id' => 'LocationId', 'class' => 'demo-code-language')); $sale_agent->setValue($agentValue); $this->addElement($sale_agent); return $this; }
public function FrmInvoice($data = null) { $customer_id = new Zend_Form_Element_Select('customer_id'); $customer_id->setAttribs(array('class' => 'form-control')); $general_opt = array("" => $this->tr->translate("GENERAL_CUSTOMER")); $customer_id->setMultiOptions($general_opt); $general = new Zend_Form_Element_Text('general'); $general->setAttribs(array('class' => 'form-control')); $session = new Zend_Form_Element_Text('session'); $session->setAttribs(array('class' => 'form-control')); $contact_name = new Zend_Form_Element_Select('contact_name'); $contact_name->setAttribs(array('class' => 'form-control', 'required' => true)); $check = new Zend_Form_Element_Text('check'); $check->setAttribs(array('class' => 'form-control')); $phone = new Zend_Form_Element_Text('phone'); $phone->setAttribs(array('class' => 'form-control')); $pay_date = new Zend_Form_Element_Text('pay_date'); $pay_date->setAttribs(array('class' => 'form-control')); $fax = new Zend_Form_Element_Text('fax'); $fax->setAttribs(array('class' => 'form-control')); $account_num = new Zend_Form_Element_Select('account_no'); $account_num->setAttribs(array('class' => 'form-control')); $undeposit = new Zend_Form_Element_Text('undeposit'); $undeposit->setAttribs(array('class' => 'form-control')); $address = new Zend_Form_Element_Text('address'); $address->setAttribs(array('class' => 'form-control')); $address1 = new Zend_Form_Element_Text('address1'); $address1->setAttribs(array('class' => 'form-control')); $pay_amount = new Zend_Form_Element_Text('pay_amount'); $pay_amount->setAttribs(array('class' => 'form-control')); $remaining = new Zend_Form_Element_Text('remaining_amount'); $remaining->setAttribs(array('class' => 'form-control')); $this->addElements(array($address1, $customer_id, $general, $contact_name, $session, $check, $phone, $pay_date, $fax, $account_num, $undeposit, $address, $pay_amount, $remaining)); return $this; }
public function init() { /** * projeto_id */ $modelProjeto = new Model_DbTable_Projeto(); $projeto_id = new Zend_Form_Element_Select("projeto_id"); $projeto_id->setLabel("Projeto: "); $projeto_id->setAttribs(array('class' => 'form-control')); $projeto_id->setMultiOptions($modelProjeto->fetchPairs()); $this->addElement($projeto_id); /** * tarefa_nome */ $tarefa_nome = new Zend_Form_Element_Text("tarefa_nome"); $tarefa_nome->setLabel("Título: "); $tarefa_nome->setAttribs(array('class' => 'form-control')); $tarefa_nome->setRequired(); $this->addElement($tarefa_nome); /** * tarefa_descricao */ $tarefa_descricao = new Zend_Form_Element_Textarea("tarefa_descricao"); $tarefa_descricao->setLabel("Descrição: "); $tarefa_descricao->setAttribs(array('class' => 'form-control', 'rows' => 10)); $tarefa_descricao->setRequired(); $this->addElement($tarefa_descricao); parent::init(); }
public function init() { // profissional_beleza_id $profissional_beleza_id = new Zend_Form_Element_Radio("profissional_beleza_id"); $profissional_beleza_id->setLabel("Selecione o profissional desejado: "); $profissional_beleza_id->setRegisterInArrayValidator(false); $profissional_beleza_id->setRequired(); $profissional_beleza_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); // agenda_data $agenda_data = new Zend_Form_Element_Text("agenda_data"); $agenda_data->setLabel("Selecione a data: "); $agenda_data->setAttribs(array('class' => 'form-control', 'autocomplete' => 'off')); $agenda_data->setRequired(); $agenda_data->setDecorators(App_Forms_Decorators::$simpleElementDecorators); // agenda_hora $agenda_hora = new Zend_Form_Element_Select("agenda_hora"); $agenda_hora->setLabel('Selecione a hora: '); $agenda_hora->setAttribs(array('class' => 'form-control')); $agenda_hora->setMultiOptions(array('' => 'Horários')); $agenda_hora->setRequired(); $agenda_hora->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $agenda_hora->setRegisterInArrayValidator(false); // agenda_observacao $agenda_observacao = new Zend_Form_Element_Textarea("agenda_observacao"); $agenda_observacao->setLabel("Observações: "); $agenda_observacao->setAttribs(array('class' => 'form-control', 'rows' => 7, 'placeholder' => 'Informe alguma observação, por exemplo, alguma preferência de produto, etc.')); // salao_id $salao_id = new Zend_Form_Element_Hidden('salao_id'); // especialidade_id $especialidade_id = new Zend_Form_Element_Hidden("especialidade_id"); // usuario_id $usuario_id = new Zend_Form_Element_Hidden("usuario_id"); $this->addElements(array($profissional_beleza_id, $agenda_data, $agenda_hora, $agenda_observacao, $salao_id, $especialidade_id, $usuario_id)); parent::init(); }
public function FrmSaleOrderUpdate($frm = null) { $db = new saleorder_Model_DbTable_DbSaleOrder(); $rs_table = $db->getAllTable(); $option_table = array('0' => $this->tr->translate("CHOOSE_TABLE")); foreach ($rs_table as $row) { $option_table[$row["tab_id"]] = $row["code"] . ":" . $row["name_en"] . "-" . $row["name_km"]; } $table = new Zend_Form_Element_Select("tables"); $table->setAttribs(array('class' => 'select validate[required]', 'style' => 'width:100%')); $table->setMultiOptions($option_table); $rs_product = $db->getAllProduct(); $option_product = array(0 => $this->tr->translate('CHOOSE_PRODUCT')); foreach ($rs_product as $row) { $option_product[$row["pro_id"]] = $row["item_code"] . '-' . $row["name_kh"] . '-' . $row["name_en"]; } $product = new Zend_Form_Element_Select("product"); $product->setAttribs(array('class' => 'select form-control', 'style' => 'width:100%')); $product->setMultiOptions($option_product); $c_date = date('Y-m-d'); $date = new Zend_Form_Element_Text('dates'); $date->setAttribs(array('id' => 'dates', 'style' => 'float:left;width:100%', 'class' => 'form-control validate[required]')); //$date->setValue($c_date); $saleorder_num = $db->getSaleOrderNo(); $saleorder_no = new Zend_Form_Element_Text("saleorder_nos"); $saleorder_no->setAttribs(array('class' => 'validate[required]', 'readOnly' => 'readOnly', 'style' => 'color:red')); $saleorder_no->setValue($saleorder_num); $this->addElements(array($product, $table, $date, $saleorder_no)); if ($frm != "") { $saleorder_no->setValue($frm["saleorder_no"]); $table->setValue($frm["tab_id"]); $date->setValue($frm["date"]); } return $this; }
public function FrmReceive($data = null) { $wherehouse_id = new Zend_Form_Element_Select('wherehouse_id'); $wherehouse_id->setAttribs(array('class' => 'form-control')); $wherehouse_id_opt = array("1" => $this->tr->translate("..."), "2" => $this->tr->translate("...")); $wherehouse_id->setMultiOptions($wherehouse_id_opt); $combo = new Zend_Form_Element_Checkbox('combo'); $combo->setAttribs(array('class' => 'red')); $handow = new Zend_Form_Element_Text('handow'); $handow->setAttribs(array('class' => 'form-control')); $document = new Zend_Form_Element_Button('3'); $document->setAttribs(array('class' => 'form-control')); $session = new Zend_Form_Element_Button('7'); $session->setAttribs(array('class' => 'form-control')); $item_code = new Zend_Form_Element_Select('item_code'); $item_code->setAttribs(array('class' => 'form-control')); $company_opt = array("1" => $this->tr->translate("SELECT_COMPANY"), "2" => $this->tr->translate("SELECT_COMPANY_NAME")); $item_code->setMultiOptions($company_opt); $combo = new Zend_Form_Element_Checkbox('combo'); $combo->setAttribs(array('class' => 'red')); $ptd_usage_value = new Zend_Form_Element_Text('ptd_usage_value'); $ptd_usage_value->setAttribs(array('class' => 'form-control')); $qty_onhand = new Zend_Form_Element_Text('demo3'); $qty_onhand->setAttribs(array('class' => 'form-control', 'id' => 'demo3')); $branch = new Zend_Form_Element_Select('branch'); $branch->setAttribs(array('class' => 'form-control')); $wherehouse_id_opt = array("1" => $this->tr->translate("..."), "2" => $this->tr->translate("...")); $branch->setMultiOptions($wherehouse_id_opt); $combo = new Zend_Form_Element_Checkbox('combo'); $combo->setAttribs(array('class' => 'red')); $blank_smaler = new Zend_Form_Element_Select('blank_smaler'); $blank_smaler->setAttribs(array('class' => 'form-control')); $company_opt = array("1" => $this->tr->translate("SELECT_COMPANY"), "2" => $this->tr->translate("SELECT_COMPANY_NAME")); $blank_smaler->setMultiOptions($company_opt); $combo = new Zend_Form_Element_Checkbox('combo'); $combo->setAttribs(array('class' => 'red')); $average_cost = new Zend_Form_Element_Text('average_cost'); $average_cost->setAttribs(array('class' => 'form-control')); $ptd_sale_value = new Zend_Form_Element_Text('ptd_sale_value'); $ptd_sale_value->setAttribs(array('class' => 'form-control')); $unit_cost = new Zend_Form_Element_Radio('unit_cost'); $unit_cost->setAttribs(array('class' => 'red')); $total_cost = new Zend_Form_Element_Radio('total_cost'); $total_cost->setAttribs(array('class' => 'red')); $serial = new Zend_Form_Element_Text('serial'); $serial->setAttribs(array('class' => 'form-control')); $lot = new Zend_Form_Element_Text('lot'); $lot->setAttribs(array('class' => 'form-control')); $add_lind = new Zend_Form_Element_Button('add_lind'); $add_lind->setAttribs(array('class' => 'form-control')); $edit_lind = new Zend_Form_Element_Button('edit_lind'); $edit_lind->setAttribs(array('class' => 'form-control')); $delete_lind = new Zend_Form_Element_Button('delete_lind'); $delete_lind->setAttribs(array('class' => 'form-control')); $concel_lind = new Zend_Form_Element_Button('concel_lind'); $concel_lind->setAttribs(array('class' => 'form-control')); $this->addElements(array($combo, $wherehouse_id, $handow, $item_code, $branch, $document, $session, $blank_smaler, $ptd_usage_value, $qty_onhand, $unit_cost, $total_cost, $serial, $lot, $add_lind, $edit_lind, $delete_lind, $concel_lind)); return $this; }
public function Frm_table_type($data = null) { $menu_code = new Zend_Form_Element_Text('type_code'); $menu_code->setAttribs(array('class' => 'form-control', 'required' => true)); $description = new Zend_Form_Element_Text('description'); $description->setAttribs(array('class' => 'form-control')); $lang_1 = new Zend_Form_Element_Text('lang_1'); $lang_1->setAttribs(array('class' => 'form-control')); $lang_2 = new Zend_Form_Element_Text('lang_2'); $lang_2->setAttribs(array('checked' => 'checked', 'class' => 'form-control')); $lang_3 = new Zend_Form_Element_Text('lang_3'); $lang_3->setAttribs(array('checked' => 'checked', 'class' => 'form-control')); if ($data != null) { // print_r($data); } $show_description = new Zend_Form_Element_Select('show_description'); $show_description->setAttribs(array('class' => 'form-control')); $description_opt = array("" => $this->tr->translate("SELECT_DESCRIPTION")); $show_description->setMultiOptions($description_opt); $photo = new Zend_Form_Element_File('photo'); $background = new Zend_Form_Element_Text('background'); $background->setAttribs(array('class' => 'form-control color-picker-rgba')); $font_color = new Zend_Form_Element_Text('font_color'); $font_color->setAttribs(array('class' => 'form-control', 'id' => "selected-color1")); $font_size = new Zend_Form_Element_Text('demo3'); $font_size->setAttribs(array('class' => 'form-control', 'id' => "demo3", 'value' => 12, 'placeholder' => '12')); $apply = new Zend_Form_Element_Select('apply'); $apply->setAttribs(array('class' => 'form-control')); $apply_opt = array("" => $this->tr->translate("SELECT_APPLY_TO_COMPANY")); $apply->setMultiOptions($apply_opt); $combo = new Zend_Form_Element_Checkbox('combo'); $combo->setAttribs(array('class' => 'red')); $active = new Zend_Form_Element_Checkbox('active'); $active->setAttribs(array('class' => 'red')); $format = new Zend_Form_Element_Text('demo4'); $format->setAttribs(array('class' => 'form-control', 'id' => "demo4", 'value' => 12, 'placeholder' => '12')); $setting = new Zend_Form_Element_Select('setting'); $setting->setAttribs(array('class' => 'form-control')); $setting_opt = array("" => $this->tr->translate("SELECT_SETTING")); $setting->setMultiOptions($setting_opt); $arrange = new Zend_Form_Element_Text('arrange'); $arrange->setAttribs(array('class' => 'form-control')); $resize = new Zend_Form_Element_Text('resize'); $resize->setAttribs(array('class' => 'form-control', 'id' => "resize", 'value' => 12, 'placeholder' => '12')); $note = new Zend_Form_Element_Textarea('note'); $note->setAttribs(array('class' => 'form-control', 'style' => "margin-top: 0px; margin-bottom: 0px; height: 100px;")); $id = new Zend_Form_Element_Hidden('id'); if ($data != null) { $id->setValue($data['id']); $menu_code->setValue($data['code']); $description->setValue($data['description']); $lang_1->setValue($data['lang1']); $lang_2->setValue($data['lang2']); $note->setValue($data['note']); } $this->addElements(array($id, $apply, $active, $combo, $menu_code, $description, $lang_1, $lang_2, $lang_3, $show_description, $background, $font_color, $font_size, $format, $setting, $arrange, $resize, $note)); return $this; }
public function FrmSelect($data = null) { $company = new Zend_Form_Element_Select('company '); $company->setAttribs(array('class' => 'form-control')); $company_opt = array("" => $this->tr->translate("VSS Our set")); $company->setMultiOptions($company_opt); $this->addElements(array($company)); return $this; }
public function frm_table_time_charge($data = null) { $menu_code = new Zend_Form_Element_Text('menu_code'); $menu_code->setAttribs(array('class' => 'form-control')); $description = new Zend_Form_Element_Text('description'); $description->setAttribs(array('class' => 'form-control', 'required' => true)); $amount_to_charge = new Zend_Form_Element_Text('amount_to_charge'); $amount_to_charge->setAttribs(array('class' => 'form-control')); $free_amt = new Zend_Form_Element_Text('free_amt'); $free_amt->setAttribs(array('class' => 'form-control')); $child = new Zend_Form_Element_Text('child'); $child->setAttribs(array('checked' => 'checked', 'class' => 'form-control')); $show_description = new Zend_Form_Element_Text('show_description'); $show_description->setAttribs(array('class' => 'form-control')); $photo = new Zend_Form_Element_File('photo'); $background = new Zend_Form_Element_Text('background'); $background->setAttribs(array('class' => 'form-control color-picker-rgba')); $font_color = new Zend_Form_Element_Text('font_color'); $font_color->setAttribs(array('class' => 'form-control', 'id' => "selected-color1")); $interval_time = new Zend_Form_Element_Text('interval_time'); $interval_time->setAttribs(array('class' => 'form-control')); $apply = new Zend_Form_Element_Select('apply'); $apply->setAttribs(array('class' => 'form-control')); $apply_opt = array("" => $this->tr->translate("SELECT_APPLY_TO_COMPANY")); $apply->setMultiOptions($apply_opt); $combo = new Zend_Form_Element_Checkbox('combo'); $combo->setAttribs(array('class' => 'red')); $active = new Zend_Form_Element_Checkbox('active'); $active->setAttribs(array('class' => 'form-control')); $execute_number = new Zend_Form_Element_Text('execute_number'); $execute_number->setAttribs(array('class' => 'form-control')); $setting = new Zend_Form_Element_Select('setting'); $setting->setAttribs(array('class' => 'form-control')); $setting_opt = array("" => $this->tr->translate("SELECT_SETTING")); $setting->setMultiOptions($setting_opt); $arrange = new Zend_Form_Element_Text('arrange'); $arrange->setAttribs(array('class' => 'form-control')); $resize = new Zend_Form_Element_Text('resize'); $resize->setAttribs(array('class' => 'form-control', 'id' => "resize", 'value' => 12, 'placeholder' => '12')); $note = new Zend_Form_Element_Textarea('note'); $note->setAttribs(array('class' => 'form-control', 'style' => "margin-top: 0px; margin-bottom: 0px; height: 100px;")); $id = new Zend_Form_Element_Hidden('id'); if ($data != null) { // print_r($data); $id->setValue($data['id']); $description->setValue($data['description']); $interval_time->setValue($data['time_interval']); $execute_number->setValue($data['execute_amount']); $amount_to_charge->setValue($data['fee_charge']); $free_amt->setValue($data['free_amount']); $child->setValue($data['chil_per']); $active->setValue($data['nul_mul']); } $this->addElements(array($id, $apply, $active, $combo, $menu_code, $description, $amount_to_charge, $free_amt, $child, $show_description, $background, $font_color, $interval_time, $execute_number, $setting, $arrange, $resize, $note)); return $this; }
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 FrmMenu($data = null) { //$db = new menu_Model_DbTable_DbMenuGroup(); $menu_code = new Zend_Form_Element_Text('menu_code'); $menu_code->setAttribs(array('class' => 'form-control', "data-required" => "1", 'aria-describedby' => 'name-error name-error', 'aria-invalid' => 'true')); $description = new Zend_Form_Element_Text('description'); $description->setAttribs(array('class' => 'form-control', "data-required" => "1")); $lang_1 = new Zend_Form_Element_Text('lang_1'); $lang_1->setAttribs(array('class' => 'form-control', "data-required" => "1")); $lang_2 = new Zend_Form_Element_Text('lang_2'); $lang_2->setAttribs(array('checked' => 'checked', 'class' => 'form-control')); if ($data != null) { // print_r($data); } $show_description = new Zend_Form_Element_Select('show_description'); $show_description->setAttribs(array('class' => 'form-control')); $description_opt = array(0 => $this->tr->translate("SELECT_DESCRIPTION"), 1 => $this->tr->translate("CODE"), 2 => $this->tr->translate("DESCRIPTION"), 3 => $this->tr->translate("LANG_ONE"), 4 => $this->tr->translate("LANG_TWO")); $show_description->setMultiOptions($description_opt); $photo = new Zend_Form_Element_File('photo'); $background = new Zend_Form_Element_Text('background'); $background->setAttribs(array('class' => 'form-control color-picker-rgba')); $font_color = new Zend_Form_Element_Text('font_color'); $font_color->setAttribs(array('class' => 'form-control', 'id' => "selected-color1")); $font_size = new Zend_Form_Element_Text('demo3'); $font_size->setAttribs(array('class' => 'form-control', 'id' => "demo3", 'value' => 12, 'placeholder' => '12')); $apply = new Zend_Form_Element_Select('apply'); $apply->setAttribs(array('class' => 'form-control')); $apply_opt = array("" => $this->tr->translate("SELECT_APPLY_TO_COMPANY")); $apply->setMultiOptions($apply_opt); $combo = new Zend_Form_Element_Checkbox('combo'); $combo->setAttribs(array('class' => 'red')); $active = new Zend_Form_Element_Checkbox('active'); $active->setAttribs(array('class' => 'red')); $format = new Zend_Form_Element_Text('demo4'); $format->setAttribs(array('class' => 'form-control', 'id' => "demo4", 'value' => 12, 'placeholder' => '12')); $setting = new Zend_Form_Element_Select('setting'); $setting->setAttribs(array('class' => 'form-control')); $setting_opt = array("" => $this->tr->translate("SELECT_SETTING")); $setting->setMultiOptions($setting_opt); $arrange = new Zend_Form_Element_Text('arrange'); $arrange->setAttribs(array('class' => 'form-control')); $resize = new Zend_Form_Element_Text('resize'); $resize->setAttribs(array('class' => 'form-control', 'id' => "resize", 'value' => 12, 'placeholder' => '12')); $note = new Zend_Form_Element_Textarea('note'); $note->setAttribs(array('class' => 'form-control', 'style' => "margin-top: 0px; margin-bottom: 0px; height: 100px;")); $this->addElements(array($apply, $active, $combo, $menu_code, $description, $lang_1, $lang_2, $show_description, $background, $font_color, $font_size, $format, $setting, $arrange, $resize, $note)); if ($data != "") { $menu_code->setValue($data['menu_group_code']); $description->setValue($data['menu_group']); $lang_1->setValue($data['menu_group2']); $lang_2->setValue($data['menu_group3']); $show_description->setValue($data['show_group']); } return $this; }
public function init() { // proposta_id /* $proposta_id = new Zend_Form_Element_Select("proposta_id"); $proposta_id->setLabel("Proposta: "); $proposta_id->setAttribs(array( 'class' => 'form-control' )); $proposta_id->setMultiOptions($this->getPropostas()); */ // cliente $cliente = new Zend_Form_Element_Select("cliente"); $cliente->setLabel("Cliente: "); $cliente->setAttribs(array('class' => 'form-control')); $cliente->setRequired(false); $cliente->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $cliente->setMultiOptions($this->getClientes()); // cliente_id $cliente_id = new Zend_Form_Element_Hidden("cliente_id"); // projeto_nome $projeto_nome = new Zend_Form_Element_Text("projeto_nome"); $projeto_nome->setLabel("Nome: "); $projeto_nome->setAttribs(array('class' => 'form-control')); $projeto_nome->setRequired(); $projeto_nome->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); // projeto_horas /* $projeto_horas = new Zend_Form_Element_Text("projeto_horas"); $projeto_horas->setLabel("Horas: "); $projeto_horas->setAttribs(array( 'class' => 'form-control', 'readonly' => true )); $projeto_horas->setRequired(); $projeto_horas->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); */ // projeto_valor /* $projeto_valor = new Zend_Form_Element_Text("projeto_valor"); $projeto_valor->setLabel("Valor: "); $projeto_valor->setAttribs(array( 'class' => 'form-control', 'readonly' => true )); $projeto_valor->setRequired(); $projeto_valor->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); */ /** * Add Elements */ $this->addElements(array($cliente, $cliente_id, $projeto_nome)); 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 FrmChangekey($data = null) { $changeby = new Zend_Form_Element_Select('changeby '); $changeby->setAttribs(array('class' => 'form-control')); $changeby_opt = array("" => $this->tr->translate("Item Master")); $changeby->setMultiOptions($changeby_opt); $oldcode = new Zend_Form_Element_Text('oldcode '); $oldcode->setAttribs(array('class' => 'form-control')); $newcode = new Zend_Form_Element_Text('newcode'); $newcode->setAttribs(array('class' => 'form-control')); $this->addElements(array($changeby, $oldcode, $newcode)); return $this; }
public function init() { $configManager = new Library_Helper_Config(); $config = $configManager->getConfig(__CLASS__); $currencies = $config->currencies->toArray(); $this->setAction('/index/currencyRate')->setMethod('post'); $firstCurrencyElement = new Zend_Form_Element_Select('firstCurrency'); $firstCurrencyElement->setAttribs(['options' => $currencies]); $this->addElement($firstCurrencyElement); $secondCurrencyElement = new Zend_Form_Element_Select('secondCurrency'); $secondCurrencyElement->setAttribs(['options' => $currencies]); $this->addElement($secondCurrencyElement); }
public function FrmSystemuser($data = null) { $user_id = new Zend_Form_Element_Select('user_id'); $user_id->setAttribs(array('class' => 'form-control')); $user_opt = array("" => $this->tr->translate("ADMIN")); $user_id->setMultiOptions($user_opt); $user_name = new Zend_Form_Element_Text('user_name'); $user_name->setAttribs(array('class' => 'form-control')); $user_name2 = new Zend_Form_Element_Text('user_name2'); $user_name2->setAttribs(array('class' => 'form-control')); $gender = new Zend_Form_Element_Text('gender'); $gender->setAttribs(array('class' => 'form-control')); $language = new Zend_Form_Element_Text('language'); $language->setAttribs(array('class' => 'form-control')); $user_level = new Zend_Form_Element_Text('user_level'); $user_level->setAttribs(array('class' => 'form-control')); $report_language = new Zend_Form_Element_Text('report_language'); $report_language->setAttribs(array('class' => 'form-control')); $access_to_company = new Zend_Form_Element_Text('access_to_company'); $access_to_company->setAttribs(array('class' => 'form-control')); $default_company = new Zend_Form_Element_Text('default_company'); $default_company->setAttribs(array('class' => 'form-control')); $password = new Zend_Form_Element_Text('password'); $password->setAttribs(array('class' => 'form-control')); $confirm_password = new Zend_Form_Element_Text('confirm_password'); $confirm_password->setAttribs(array('class' => 'form-control')); $sale = new Zend_Form_Element_Text('sale'); $sale->setAttribs(array('class' => 'form-control')); $usergroup = new Zend_Form_Element_Text('usergroup'); $usergroup->setAttribs(array('class' => 'form-control')); $login = new Zend_Form_Element_Text('login'); $login->setAttribs(array('class' => 'form-control')); $price = new Zend_Form_Element_Text('price'); $price->setAttribs(array('class' => 'form-control')); $autolock = new Zend_Form_Element_Text('autolock'); $autolock->setAttribs(array('class' => 'form-control')); $active = new Zend_Form_Element_Checkbox('active'); $active->setAttribs(array('class' => 'yellow')); $usermust = new Zend_Form_Element_Checkbox('usermust'); $usermust->setAttribs(array('class' => 'red')); $userpwd = new Zend_Form_Element_Checkbox('$userpwd'); $userpwd->setAttribs(array('class' => 'red')); $userschedule = new Zend_Form_Element_Checkbox('userschedule'); $userschedule->setAttribs(array('class' => 'red')); $note = new Zend_Form_Element_Text('note'); $note->setAttribs(array('class' => 'form-control')); $des = new Zend_Form_Element_Text('des'); $des->setAttribs(array('class' => 'form-control')); $this->addElements(array($user_id, $user_name, $user_name2, $gender, $language, $user_level, $report_language, $access_to_company, $default_company, $password, $confirm_password, $sale, $usergroup, $login, $price, $autolock, $active, $usermust, $userpwd, $userschedule, $note, $des)); return $this; }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'addUser', 'class' => '')); $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART); $action = new Zend_Form_Element_Hidden('action'); $action->setValue('add'); $this->addElement($action); // BEGIN: Name $name = new Zend_Form_Element_Text('name'); $name->setAttribs(array('class' => 'text large rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_full_name'), 'id' => 'name')); $name->setRequired(true); $this->addElement($name); // END: Name // BEGIN: Account Name $accountName = new Zend_Form_Element_Text('accountName'); $accountName->setAttribs(array('class' => 'text large rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_account_name'), 'id' => 'accountName')); $accountName->setRequired(true); $this->addElement($accountName); // END: Account Name // BEGIN: Email $email = new Zend_Form_Element_Text('email'); $email->setAttribs(array('class' => 'text large rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_email_address'), 'id' => 'email')); $validatorEmail = new Zend_Validate_Db_NoRecordExists('users', 'email'); $email->addValidator($validatorEmail); $email->setRequired(true); $this->addElement($email); // END: Email //BEGIN:Level $idLevel = new Zend_Form_Element_Select('idRole'); $options = array('' => Zend_Registry::get('translate')->_('admin_select_user_level')); $levels = new Default_Model_Role(); $select = $levels->getMapper()->getDbTable()->select()->where('id != ?', 1)->where('NOT deleted')->order('id DESC'); $result = $levels->fetchAll($select); if (NULL != $result) { foreach ($result as $value) { $options[$value->getId()] = $value->getName(); } } $idLevel->addMultiOptions($options); $idLevel->addValidator(new Zend_Validate_InArray(array_keys($options))); $idLevel->setAttribs(array('class' => 'rightAdd', 'id' => 'idRole')); $idLevel->setRequired(false); $this->addElement($idLevel); //END:Level $add = new Zend_Form_Element_Submit('add'); $add->setValue(Zend_Registry::get('translate')->_('admin_add_user')); $add->setAttribs(array('class' => 'submit', 'id' => '')); $add->setIgnore(true); $this->addElement($add); }
public function FrmCurrency($data = null) { $currency_code = new Zend_Form_Element_Text('currency_code'); $currency_code->setAttribs(array('class' => 'form-control', 'required' => true)); $currency_text = new Zend_Form_Element_Text('currency_text'); $currency_text->setAttribs(array('class' => 'form-control')); $currency_sy = new Zend_Form_Element_Text('currency_sy'); $currency_sy->setAttribs(array('class' => 'form-control')); $decimal = new Zend_Form_Element_Text('decimal '); $decimal->setAttribs(array('class' => 'form-control')); $exchange = new Zend_Form_Element_Text('exchange'); $exchange->setAttribs(array('class' => 'form-control')); $combo = new Zend_Form_Element_Checkbox('combo'); $combo->setAttribs(array('class' => 'red')); $active = new Zend_Form_Element_Checkbox('active'); $active->setAttribs(array('class' => 'yellow')); $photo = new Zend_Form_Element_File('photo'); $background = new Zend_Form_Element_Text('background'); $background->setAttribs(array('class' => 'form-control color-picker-rgba')); $phone_2 = new Zend_Form_Element_Text('$phone_2'); $phone_2->setAttribs(array('class' => 'form-control')); $radio1 = new Zend_Form_Element_Checkbox('radio1'); $radio1->setAttribs(array()); $base = new Zend_Form_Element_Checkbox('base'); $base->setAttribs(array('class' => 'red')); $format = new Zend_Form_Element_Text('demo4'); $format->setAttribs(array('class' => 'form-control', 'id' => "demo4", 'value' => 12, 'placeholder' => '12')); $setting = new Zend_Form_Element_Select('setting'); $setting->setAttribs(array('class' => 'form-control')); $setting_opt = array("" => $this->tr->translate("SELECT_SETTING")); $setting->setMultiOptions($setting_opt); $arrange = new Zend_Form_Element_Text('arrange'); $arrange->setAttribs(array('class' => 'form-control')); $resize = new Zend_Form_Element_Text('resize'); $resize->setAttribs(array('class' => 'form-control', 'id' => "resize", 'value' => 12, 'placeholder' => '12')); $note = new Zend_Form_Element_Textarea('note'); $note->setAttribs(array('class' => 'form-control', 'style' => "margin-top: 0px; margin-bottom: 0px; height: 100px;")); $id = new Zend_Form_Element_Hidden('id'); if ($data != null) { $id->setValue($data['id']); $currency_code->setValue($data['curr_code']); $currency_text->setValue($data['curr_title']); $currency_sy->setValue($data['symbol']); $decimal->setValue($data['decimal_place']); $exchange->setValue($data['exchange_rate']); } $this->addElements(array($id, $radio1, $currency_code, $currency_text, $currency_sy, $decimal, $exchange, $base, $format, $setting, $arrange, $resize, $note)); return $this; }
public function init() { // especialidade_id $especialidade_id = new Zend_Form_Element_Select("especialidade_id"); $especialidade_id->setLabel('Especialidade: '); $especialidade_id->setRequired(); $especialidade_id->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $especialidade_id->setMultiOptions($this->getEspecialidades()); $especialidade_id->setAttribs(array('class' => 'form-control')); // profissional_beleza_id $profissional_beleza_id = new Zend_Form_Element_Select("profissional_beleza_id"); $profissional_beleza_id->setLabel('Profissional: '); $profissional_beleza_id->setRequired(); $profissional_beleza_id->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $profissional_beleza_id->setMultiOptions($this->getProfissionaisBeleza()); $profissional_beleza_id->setAttribs(array('class' => 'form-control')); // agenda_data $agenda_data = new Zend_Form_Element_Text("agenda_data"); $agenda_data->setLabel('Data: '); $agenda_data->setRequired(); $agenda_data->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $agenda_data->setAttribs(array('class' => 'form-control', 'autocomplete' => 'off')); // agenda_horario $agenda_horario = new Zend_Form_Element_Text("agenda_horario"); $agenda_horario->setLabel('Horário: '); $agenda_horario->setRequired(); $agenda_horario->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $agenda_horario->setAttribs(array('class' => 'form-control')); // agenda_manual_nome $agenda_manual_nome = new Zend_Form_Element_Text("agenda_manual_nome"); $agenda_manual_nome->setLabel('Cliente: '); $agenda_manual_nome->setRequired(); $agenda_manual_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $agenda_manual_nome->setAttribs(array('class' => 'form-control')); // agenda_manual_email $agenda_manual_email = new Zend_Form_Element_Text("agenda_manual_email"); $agenda_manual_email->setLabel('E-mail: '); //$agenda_manual_email->setRequired(); $agenda_manual_email->setAttribs(array('class' => 'form-control')); // agenda_manual_telefone $agenda_manual_telefone = new Zend_Form_Element_Text("agenda_manual_telefone"); $agenda_manual_telefone->setLabel('Telefone: '); $agenda_manual_telefone->setRequired(); $agenda_manual_telefone->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $agenda_manual_telefone->setAttribs(array('class' => 'form-control')); $this->addElements(array($especialidade_id, $profissional_beleza_id, $agenda_data, $agenda_horario, $agenda_manual_nome, $agenda_manual_email, $agenda_manual_telefone)); parent::init(); }
public function FrmProCate($frm = null) { $db = new Application_Model_DbTable_DbGlobal(); $status = new Zend_Form_Element_Select('status'); $_arr_status = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE")); $status->setMultiOptions($_arr_status); $status->setAttribs(array('class' => 'form-control validate[required]')); $id_code = new Zend_Form_Element_Text('id_code'); $id_code->setAttribs(array('class' => 'form-control', "readonly" => "")); $code = product_Model_DbTable_DbProduct::getCallteralCode(); $id_code->setValue($code); $cat_id = new Zend_Form_Element_Select("cat_id"); $cat_id->setAttribs(array('class' => 'select', 'style' => 'width:100%')); $category = $db->getAllProCategories(); $option_category = array(0 => 'Choose Category'); foreach ($category as $row_cat) { $option_category[$row_cat["cat_id"]] = $row_cat["cat_name_km"] . " - " . $row_cat["cat_name_en"]; } $cat_id->setMultiOptions($option_category); $cat_name_en = new Zend_Form_Element_Text("name_en"); $cat_name_en->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Name In English', "OnChange" => "GetCatName(1)")); $currency = new Zend_Form_Element_Select("currency"); $currency->setAttribs(array('class' => 'form-control validate[required]')); $dbp = new product_Model_DbTable_DbProduct(); $currencys = $dbp->getAllPro(); $option_currency = array(0 => 'Choose Currency'); foreach ($currencys as $row_currency) { $option_currency[$row_currency["cu_id"]] = $row_currency["cu_name_km"] . " - " . $row_currency["cu_name_en"]; } $currency->setMultiOptions($option_currency); $price = new Zend_Form_Element_Text("price"); $price->setAttribs(array('class' => 'validate[required]')); $description = new Zend_Form_Element_Textarea("description"); $cat_name_km = new Zend_Form_Element_Text("name_km"); $cat_name_km->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Name In Khmer', "OnChange" => "GetCatName(2)")); $icon = new Zend_Form_Element_File("icon"); $this->addElements(array($description, $price, $icon, $status, $cat_name_en, $cat_name_km, $cat_id, $id_code, $currency)); if ($frm != "") { $cat_id->setValue($frm["cat_id"]); $cat_name_en->setValue($frm["pro_name_en"]); $cat_name_km->setValue($frm["pro_name_km"]); $status->setValue($frm["status"]); $currency->setValue($frm["cu_id"]); $price->setValue($frm["price_out"]); $description->setValue($frm["description"]); } return $this; }
function init() { // Set the method for the display form to POST $this->setMethod('post'); $this->addAttribs(array('id' => 'addExpense', 'class' => '')); $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART); $control = new Zend_Form_Element_Hidden('control'); $control->setValue('addExpense'); $this->addElement($control); // begin inputs $name = new Zend_Form_Element_Text('name'); $name->setAttribs(array('class' => 'text validate[required] rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_recurrent_expense_description'))); $name->setRequired(true); $this->addElement($name); $price = new Zend_Form_Element_Text('price'); $price->setAttribs(array('class' => 'text validate[required] rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_price'))); $price->setRequired(true); $this->addElement($price); //BEGIN: Date $date = new Zend_Form_Element_Text('date'); $date->setAttribs(array('class' => 'rightAdd dateSearch w_315', 'placeholder' => 'Date')); $date->setLabel('Select day'); $this->addElement($date); // END: Date //BEGIN:Id Group $idGroup = new Zend_Form_Element_Select('idGroup'); $options = array(); $pm = new Default_Model_Groups(); $select = $pm->getMapper()->getDbTable()->select()->where('NOT deleted')->order('name ASC'); $result = $pm->fetchAll($select); if (NULL != $result) { foreach ($result as $value) { $options[$value->getId()] = $value->getName(); } } $idGroup->addMultiOptions($options); $idGroup->addValidator(new Zend_Validate_InArray(array_keys($options))); $idGroup->setAttribs(array('class' => 'select')); $idGroup->setRequired(false); $this->addElement($idGroup); //END:Id Group $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue(Zend_Registry::get('translate')->_('admin_add_recurrent_expense')); $submit->setAttribs(array('class' => 'submit')); $submit->setIgnore(true); $this->addElement($submit); }
public function showSaleAgentForm($data = null, $stockID = null) { $db = new Application_Model_DbTable_DbGlobal(); $nameElement = new Zend_Form_Element_Text('name'); $nameElement->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Enter Agent Name')); $this->addElement($nameElement); $phoneElement = new Zend_Form_Element_Text('phone'); $phoneElement->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Enter Phone Number')); $this->addElement($phoneElement); $emailElement = new Zend_Form_Element_Text('email'); $emailElement->setAttribs(array('class' => 'validate[custom[email]]', 'placeholder' => 'Enter Email Address')); $this->addElement($emailElement); $addressElement = new Zend_Form_Element_Text('address'); $addressElement->setAttribs(array('placeholder' => 'Enter Current Address')); $this->addElement($addressElement); $jobTitleElement = new Zend_Form_Element_Text('job_title'); $jobTitleElement->setAttribs(array('placeholder' => 'Enter Position')); $this->addElement($jobTitleElement); $descriptionElement = new Zend_Form_Element_Textarea('description'); $descriptionElement->setAttribs(array('placeholder' => 'Descrtion Here...')); $this->addElement($descriptionElement); $rowsStock = $db->getGlobalDb('SELECT LocationId,Name FROM tb_sublocation WHERE Name!="" ORDER BY LocationId DESC '); $optionsStock = array('1' => 'Default Location', '-1' => 'Add New Location'); if (count($rowsStock) > 0) { foreach ($rowsStock as $readStock) { $optionsStock[$readStock['LocationId']] = $readStock['Name']; } } $mainStockElement = new Zend_Form_Element_Select('main_stock_id'); $mainStockElement->setAttribs(array('OnChange' => 'AddLocation()', 'class' => 'demo-code-language')); $mainStockElement->setMultiOptions($optionsStock); $this->addElement($mainStockElement); //set value when edit if ($data != null) { $idElement = new Zend_Form_Element_Hidden('id'); $this->addElement($idElement); $idElement->setValue($data['agent_id']); $nameElement->setValue($data['name']); $phoneElement->setValue($data['phone']); $emailElement->setValue($data['email']); $addressElement->setValue($data['address']); $jobTitleElement->setValue($data['job_title']); $mainStockElement->setValue($data["stock_id"]); $descriptionElement->setValue($data['description']); } return $this; }
public function init() { // cliente_tipo $cliente_tipo = new Zend_Form_Element_Radio("cliente_tipo"); $cliente_tipo->setLabel("Tipo: "); $cliente_tipo->setRequired(); $cliente_tipo->setDecorators(App_Forms_Decorators::$checkboxElementDecorators); $cliente_tipo->setMultiOptions(array('PF' => ' Pessoa Física', 'PJ' => ' Pessoa Jurídica')); // cliente_empresa $cliente_empresa = new Zend_Form_Element_Text("cliente_empresa"); $cliente_empresa->setLabel("Empresa:"); $cliente_empresa->setAttribs(array('class' => 'form-control')); // cliente_nome $cliente_nome = new Zend_Form_Element_Text("cliente_nome"); $cliente_nome->setLabel("Contato:"); $cliente_nome->setRequired(); $cliente_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $cliente_nome->setAttribs(array('class' => 'form-control')); // cliente_email $cliente_email = new Zend_Form_Element_Text("cliente_email"); $cliente_email->setLabel("E-mail:"); $cliente_email->setRequired(); $cliente_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $cliente_email->setAttribs(array('class' => 'form-control')); // cliente_telefone $cliente_telefone = new Zend_Form_Element_Text("cliente_telefone"); $cliente_telefone->setLabel("Telefone:"); $cliente_telefone->setAttribs(array('class' => 'form-control')); // cliente_celular $cliente_celular = new Zend_Form_Element_Text("cliente_celular"); $cliente_celular->setLabel("Celular:"); $cliente_celular->setAttribs(array('class' => 'form-control')); // cliente_cidade $cliente_cidade = new Zend_Form_Element_Text("cliente_cidade"); $cliente_cidade->setLabel("Cidade:"); $cliente_cidade->setAttribs(array('class' => 'form-control')); // cliente_estado $cliente_estado = new Zend_Form_Element_Select("cliente_estado"); $cliente_estado->setLabel("Estado:"); $cliente_estado->setAttribs(array('class' => 'form-control')); $cliente_estado->setMultiOptions($this->getEstados()); /** * Add elements */ $this->addElements(array($cliente_tipo, $cliente_empresa, $cliente_nome, $cliente_email, $cliente_telefone, $cliente_celular, $cliente_cidade, $cliente_estado)); parent::init(); }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'filterForm', 'class' => '')); $this->setAction(WEBROOT . 'recurrent-expenses'); // BEGIN: nume text $nameSearch = new Zend_Form_Element_Text('nameSearch'); $nameSearch->setAttribs(array('class' => 'text large', 'placeholder' => Zend_Registry::get('translate')->_('admin_name'))); $nameSearch->setRequired(false); $this->addElement($nameSearch); // END: nume text // BEGIN: prenume text $idGroupSearch = new Zend_Form_Element_Select('idGroupSearch'); $options = array('' => Zend_Registry::get('translate')->_('admin_select_expense')); $groups = new Default_Model_Groups(); $select = $groups->getMapper()->getDbTable()->select()->where('type=?', 0)->where('NOT deleted')->order('name ASC'); $result = $groups->fetchAll($select); if (NULL != $result) { foreach ($result as $value) { $options[$value->getId()] = $value->getName(); } } $idGroupSearch->addMultiOptions($options); $idGroupSearch->addValidator(new Zend_Validate_InArray(array_keys($options))); $idGroupSearch->setAttribs(array('class' => 'select uniformSelect filter_selector')); $idGroupSearch->setRequired(false); $this->addElement($idGroupSearch); // END: prenume text // BEGIN: fromDate text $fromDate = new Zend_Form_Element_Text('fromDate'); $fromDate->setAttribs(array('class' => 'text large', 'placeholder' => Zend_Registry::get('translate')->_('admin_from_date'))); $fromDate->setRequired(false); $this->addElement($fromDate); // END: fromDate text // BEGIN: toDate text $toDate = new Zend_Form_Element_Text('toDate'); $toDate->setAttribs(array('class' => 'text large', 'placeholder' => Zend_Registry::get('translate')->_('admin_to_date'))); $toDate->setRequired(false); $this->addElement($toDate); // END: toDate text $search = new Zend_Form_Element_Submit('searchProduct'); $search->setValue(Zend_Registry::get('translate')->_('admin_filter')); $search->setAttribs(array('class' => 'submit')); $search->setIgnore(true); $this->addElement($search); }