/** * Prepare form * * @param Uni_Core_Form $form */ protected function _prepareForm(Uni_Core_Form $form) { $form->setName('menu')->setMethod('post'); $subForm1 = new Zend_Form_SubForm(); $subForm1->setLegend('Menu Item Information'); $subForm1->setDescription('Menu Item Information'); $idField = new Zend_Form_Element_Hidden('id'); $title = new Zend_Form_Element_Text('title', array('class' => 'required', 'maxlength' => 200)); $title->setRequired(true)->setLabel('Title')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $link = new Zend_Form_Element_Text('link', array('maxlength' => 200)); $link->setLabel('Link')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDescription('Use module/controller/action for internal links or http://www.example.com for external links'); $open_window = new Zend_Form_Element_Select('open_window', array('class' => 'required', 'maxlength' => 200)); $open_window->setRequired(true)->setLabel('Open Window')->setMultiOptions(Fox::getModel('navigation/menu')->getAllTargetWindows()); $status = new Zend_Form_Element_Select('status', array('class' => 'required', 'maxlength' => 200)); $status->setRequired(true)->setLabel('Status')->setMultiOptions(Fox::getModel('navigation/menu')->getAllStatuses()); $sort_order = new Zend_Form_Element_Text('sort_order', array('class' => 'required', 'maxlength' => 200)); $sort_order->setRequired(true)->setLabel('Sort Order')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $style_class = new Zend_Form_Element_Text('style_class'); $style_class->setLabel('Style Class')->addFilter('StripTags')->addFilter('StringTrim'); $menugroup = new Zend_Form_Element_Multiselect('menu_group', array('class' => 'required')); $menugroup->setRequired(true)->setLabel('Menu Group')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setMultiOptions(Fox::getModel('navigation/menugroup')->getMenuGroupOptions()); $subForm1->addElements(array($idField, $title, $link, $open_window, $sort_order, $style_class, $status, $menugroup)); $form->addSubForm($subForm1, 'subform1'); parent::_prepareForm($form); }
public function init() { $this->setName('f2')->setMethod('post'); $id = new Zend_Form_Element_Hidden('id'); $id->addFilter('Int'); $ma = new Zend_Form_Element_Text('ma'); $ma->setLabel('Mã')->addFilter('StripTags')->addFilter('StringTrim')->addValidator(new Zend_Validate_StringLength(0, 10))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input')); $ho_ten = new Zend_Form_Element_Text('ho_ten'); $ho_ten->setLabel('Họ tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 120))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input'); $chuc_vu = new Zend_Form_Element_Text('chuc_vu'); $chuc_vu->setLabel('Chức vụ')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input'); $don_vi = new Default_Model_DonVi(); $dvOptions = array("multiOptions" => $don_vi->getDSDV()); $ma_don_vi = new Zend_Form_Element_Select('ma_don_vi', $dvOptions); $ma_don_vi->setRequired(true)->setLabel('Đơn vị (*)')->setValue(Default_Model_Constraints::ID_DHSG)->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $hoc_vi = new Default_Model_HocVi(); $hvOptions = array("multiOptions" => $hoc_vi->getDSHV()); $ma_hoc_vi = new Zend_Form_Element_Select('ma_hoc_vi', $hvOptions); $ma_hoc_vi->setRequired(true)->setLabel('Học vị (*)')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $email = new Zend_Form_Element_Text('email'); $email->setLabel('Email')->addFilter('StripTags')->addFilter('StringTrim')->addValidator(new Zend_Validate_EmailAddress())->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'email')); $so_dien_thoai = new Zend_Form_Element_Text('so_dien_thoai'); $so_dien_thoai->setLabel('Số điện thoại')->addFilter('StringTrim')->addValidator(new Zend_Validate_Int())->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'onkeypress' => 'return inputNumber(event)')); $submitCon = new Zend_Form_Element_Submit('submitCon'); $submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button')); $submitExit = new Zend_Form_Element_Submit('submitExit'); $submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button')); $link = Zend_Controller_Front::getInstance()->getRouter()->assemble(array('module' => 'admin', 'controller' => 'giang-vien', 'action' => 'index'), null, true); $cancel = new Zend_Form_Element_Button('cancel'); $cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"')); $this->addElements(array($id, $ma, $ho_ten, $ma_don_vi, $ma_hoc_vi, $chuc_vu, $email, $so_dien_thoai, $submitCon, $submitExit, $cancel)); $this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn'))))); $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'giang_vien')), 'Form')); }
public function init() { $this->setMethod('post'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'emailcontacts'); $this->setAttrib('action', BASE_URL . 'emailcontacts/add/'); $id = new Zend_Form_Element_Hidden('id'); $group_id = new Zend_Form_Element_Select("group_id"); $group_id->setRegisterInArrayValidator(false); $group_id->setRequired(true); $group_id->addValidator('NotEmpty', false, array('messages' => 'Please select group.')); $business_unit_id = new Zend_Form_Element_Select("business_unit_id"); $business_unit_id->setRegisterInArrayValidator(false); $business_unit_id->setRequired(true); $business_unit_id->addValidator('NotEmpty', false, array('messages' => 'Please select business unit.')); $business_unit_id->setAttrib('onchange', "bunit_emailcontacts('business_unit_id');"); //Group Email.... $grpEmail = new Zend_Form_Element_Text('groupEmail'); $grpEmail->addFilters(array('StringTrim', 'StripTags')); $grpEmail->setRequired(true); $grpEmail->addValidator('NotEmpty', false, array('messages' => 'Please enter group email.')); $grpEmail->addValidator("regex", true, array('pattern' => '/^(?!.*\\.{2})[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid email.'))); $grpEmail->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_emailcontacts', 'field' => 'groupEmail', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive = 1'))); $grpEmail->getValidator('Db_NoRecordExists')->setMessage('Group email already exists.'); // Form Submit ......... $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $submit->setLabel('Save'); $this->addElements(array($id, $group_id, $grpEmail, $submit, $business_unit_id)); $this->setElementDecorators(array('ViewHelper')); }
public function __construct($options = null) { parent::__construct($options); $accountId1 = new Zend_Form_Element_Hidden('accountId'); $productId1 = new Zend_Form_Element_Hidden('productId'); $memberId1 = new Zend_Form_Element_Hidden('memberId'); $maturedamount = new Zend_Form_Element_Hidden('maturedinterestamount'); $interestamountto = new Zend_Form_Element_Hidden('interestamountto'); $capitalamount = new Zend_Form_Element_Hidden('capitalamount'); $penalinterest = new Zend_Form_Element_Hidden('penalinterest'); $paymenttype = new Zend_Form_Element_Select('paymenttype'); $paymenttype->addMultiOption('', 'select..'); $paymenttype->setAttrib('class', 'NormalBtn'); $paymenttype->setAttrib('id', 'paymenttype'); $paymenttype->setAttrib('onchange', 'toggleField();'); $paymenttype->setRequired(true); $description = new Zend_Form_Element_Textarea('transactiondescription'); $description->setAttrib('class', 'textfield'); $description->setAttrib('rows', '2'); $description->setAttrib('cols', '20'); $no = new Zend_Form_Element_Textarea('paymenttype_details'); $no->setAttrib('class', 'textfield'); $no->setAttrib('rows', '1'); $no->setAttrib('cols', '20'); $no->setAttrib('id', 'paymenttype_details'); $no->setAttrib('style', 'display:none;'); $no->setRequired(true); $submit = new Zend_Form_Element_Submit('Finalize'); $submit->setLabel('Finalize'); $submit->setAttrib('class', 'recurring'); $this->addElements(array($accountId1, $productId1, $memberId1, $maturedamount, $submit, $capitalamount, $interestamountto, $penalinterest, $paymenttype, $description, $no)); }
public function init() { $this->setMethod('post'); $this->setAttrib('action', DOMAIN . 'workeligibilitydoctypes/edit'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'workeligibilitydoctypes'); $id = new Zend_Form_Element_Hidden('id'); $documenttype = new Zend_Form_Element_Text('documenttype'); $documenttype->setAttrib('maxLength', 50); $documenttype->setRequired(true); $documenttype->addValidator('NotEmpty', false, array('messages' => 'Please enter document type.')); $documenttype->addValidator("regex", true, array('pattern' => '/^(?=.*[a-zA-Z])([^ ][a-zA-Z0-9\\-\\s]*)$/', 'messages' => array('regexNotMatch' => 'Please enter valid document type.'))); $documenttype->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_workeligibilitydoctypes', 'field' => 'documenttype', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive=1'))); $documenttype->getValidator('Db_NoRecordExists')->setMessage('Document type already exists.'); $issuingauthority = new Zend_Form_Element_Select('issuingauthority'); $issuingauthority->setRegisterInArrayValidator(false); $issuingauthority->setMultiOptions(array('' => 'Select issuing authority', '1' => 'Country', '2' => 'State', '3' => 'City')); $issuingauthority->setRequired(true); $issuingauthority->addValidator('NotEmpty', false, array('messages' => 'Please select issuing authority.')); $description = new Zend_Form_Element_Textarea('description'); $description->setAttrib('rows', 10); $description->setAttrib('cols', 50); $description->setAttrib('maxlength', '200'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $submit->setLabel('Save'); $this->addElements(array($id, $documenttype, $issuingauthority, $description, $submit)); $this->setElementDecorators(array('ViewHelper')); }
public function __construct() { $transactionType = new Zend_Form_Element_Select('transactionType'); $transactionType->setAttrib('class', 'NormalBtn'); $transactionType->setRequired(true)->addValidators(array(array('NotEmpty'))); $transactionMode = new Zend_Form_Element_Select('transactionMode'); $transactionMode->setAttrib('class', 'NormalBtn'); $transactionMode->setRequired(true); // ->addValidators(array(array('NotEmpty'))); $transactionMode->setAttrib('onchange', 'display(this.value);'); $transaction_interest_amount = new Zend_Form_Element_Text('transaction_interest_amount'); $transaction_interest_amount->setAttrib('class', 'NormalBtn'); $transaction_fine_amount = new Zend_Form_Element_Text('transaction_fine_amount'); $transaction_fine_amount->setAttrib('class', 'NormalBtn'); $account_id = new Zend_Form_Element_Text('account_id'); $account_id->setAttrib('class', 'NormalBtn'); $transaction_date = new Zend_Form_Element_Text('transaction_date'); $transaction_date->setAttrib('class', 'NormalBtn'); $transaction_date->setRequired(true)->addValidators(array(array('NotEmpty'))); $transaction_date->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date'))); $transaction_amount = new Zend_Form_Element_Text('transaction_amount'); $transaction_amount->setAttrib('class', 'NormalBtn'); $transaction_remarks = new Zend_Form_Element_Textarea('transaction_remarks', array('rows' => 3, 'cols' => 15)); $transaction_remarks->setAttrib('class', 'NormalBtn'); $transaction_remarks->setRequired(true)->addValidators(array(array('NotEmpty'))); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submit'); $submit->setAttrib('class', 'NormalBtn'); $submit->setLabel('submit'); $this->addElements(array($transactionType, $transactionMode, $transaction_interest_amount, $transaction_fine_amount, $account_id, $transaction_date, $transaction_amount, $transaction_remarks, $submit)); }
public function __construct($options = null) { Zend_Dojo::enableForm($this); parent::__construct($options); $category_id = new Zend_Form_Element_Select('category_id'); $category_id->addMultiOption('', 'Select...'); $category_id->setAttrib('class', 'txt_put')->setLabel('Category Name'); $category_id->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $productname = new Zend_Form_Element_Text('productname'); $productname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_productdetails', 'productname')); $productname->setAttrib('class', 'txt_put')->setLabel('Product Name'); $productname->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $product_id = new Zend_Form_Element_Hidden('product_id'); $product_id->setAttrib('class', 'txt_put'); $productshortname = new Zend_Form_Element_Text('productshortname'); $productshortname->setAttrib('class', 'txt_put')->setLabel('Product Short Name'); $productshortname->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $product_description = new Zend_Form_Element_Textarea('product_description', array('rows' => 3, 'cols' => 20)); $product_description->setAttrib('class', '')->setLabel('Productdescription'); $product_description->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setAttrib('id', 'save')->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('colspan' => '8 ')), array(array('data' => 'HtmlTag'), array('tag' => 'td ', 'colspan' => '8')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $this->addElements(array($category_id, $productname, $productshortname, $product_description, $product_id, $submit)); $this->setDecorators(array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'table', 'id' => 'hor-minimalist-b')), 'Form')); }
public function init() { $this->setName('f3')->setMethod('get'); $ma = new Zend_Form_Element_Text('ma'); $ma->setLabel('Mã')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('class' => 'text-input', 'style' => 'width: 70px')); $ho = new Zend_Form_Element_Text('ho'); $ho->setLabel('Họ')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('class' => 'text-input', 'style' => 'width: 100px')); $ten = new Zend_Form_Element_Text('ten'); $ten->setLabel('Tên')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('class' => 'text-input', 'style' => 'width: 50px', 'id' => 'ten')); $don_vi = new Default_Model_DonVi(); $dv = $don_vi->getDSDV(); $dv = array('0' => '=============== Tất cả ===============') + $dv; $dvOptions = array("multiOptions" => $dv); $ma_don_vi = new Zend_Form_Element_Select('ma_don_vi', $dvOptions); $ma_don_vi->setRequired(true)->setLabel('Đơn vị')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('id' => 'ma_don_vi')); $submit = new Zend_Form_Element_Button('loc', array('type' => 'submit')); $submit->setLabel('Lọc')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_l'))))->setAttribs(array('class' => 'button')); $url = new Zend_View_Helper_Url(); $link = $url->url(array('module' => 'admin', 'controller' => 'giang-vien', 'action' => 'index'), null, true); $reset = new Zend_Form_Element_Button('reset'); $reset->setLabel('Làm mới')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_r'))))->setAttribs(array('class' => 'button', 'id' => 'reset', 'onclick' => 'window.location.href="' . $link . '"')); $this->addElements(array($ma, $ho, $ten, $ma_don_vi, $submit, $reset)); // Element: order $this->addElement('Hidden', 'order', array('order' => 10004)); // Element: direction $this->addElement('Hidden', 'direction', array('order' => 10005)); $this->addDisplayGroup(array('ma', 'ho', 'ten', 'ma_don_vi', 'loc', 'reset'), 'filter', array('order' => '0', 'decorators' => array('FormElements', array('HtmlTag', array('tag' => 'tr', 'align' => 'left', 'class' => 'text'))))); $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'filter_gv')), 'Form')); }
public function init() { $this->setName('f3')->setMethod('get'); $linh_vuc = new Default_Model_LinhVuc(); $lv = $linh_vuc->getDSLV(); $lv = array('0' => '========= Tất cả =========') + $lv; $lvOptions = array("multiOptions" => $lv); $ma_linh_vuc = new Zend_Form_Element_Select('ma_linh_vuc', $lvOptions); $ma_linh_vuc->setRequired(true)->setLabel('Lĩnh vực')->setValue('0')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('id' => 'ma_linh_vuc')); $nams = Default_Model_Constraints::nam(); $nams = array('0' => '== Tất cả ==') + $nams; ksort($nams); $namOption = array("multiOptions" => $nams); $nam = new Zend_Form_Element_Select('nam', $namOption); $nam->setLabel('Năm')->setValue(date('Y'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('id' => 'nam')); $submit = new Zend_Form_Element_Submit('loc'); $submit->setLabel('Lọc')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_l'))))->setAttribs(array('class' => 'button')); $url = new Zend_View_Helper_Url(); $link = $url->url(array('module' => 'admin', 'controller' => 'hoi-dong', 'action' => 'danh-sach-hdd'), null, true); $reset = new Zend_Form_Element_Button('reset'); $reset->setLabel('Làm mới')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_r'))))->setAttribs(array('class' => 'button', 'id' => 'reset', 'onclick' => 'window.location.href="' . $link . '"')); $this->addElements(array($ma_linh_vuc, $nam, $submit, $reset)); // Element: order $this->addElement('Hidden', 'order', array('order' => 10004)); // Element: direction $this->addElement('Hidden', 'direction', array('order' => 10005)); $this->addDisplayGroup(array('ma_linh_vuc', 'nam', 'loc', 'reset'), 'group1', array('order' => 1, 'decorators' => array('FormElements', array('HtmlTag', array('tag' => 'tr', 'align' => 'left', 'class' => 'text'))))); $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'filter_hdd', 'style' => 'width : 65%')), 'Form')); }
public function init() { $this->setName(strtolower(get_class())); $this->setMethod("post"); $oFormName = new Zend_Form_Element_Hidden("form_name"); $oFormName->setValue(get_class()); $oFormName->setIgnore(FALSE)->removeDecorator("Label"); $this->addElement($oFormName); $oTranslation = new Zend_Form_Element_Select("translation"); $oTranslation->setLabel("Tłumaczenie:"); $oTranslation->setRequired(TRUE)->setAttrib("class", "valid"); $oTranslation->addMultiOptions($this->_aAllLang); $this->addElement($oTranslation); $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200)); $this->getElement("csrf_token")->removeDecorator("Label"); $oSubmit = $this->createElement("submit", "submit"); $oSubmit->setLabel("Dalej"); $this->addElement($oSubmit); $oViewScript = new Zend_Form_Decorator_ViewScript(); $oViewScript->setViewModule("admin"); $oViewScript->setViewScript("_forms/lang.phtml"); $this->clearDecorators(); $this->setDecorators(array(array($oViewScript))); $oElements = $this->getElements(); foreach ($oElements as $oElement) { $oElement->setFilters($this->_aFilters); $oElement->removeDecorator("Errors"); } }
public function init($stateId) { global $mySession; $db = new Db(); $CountryId = ""; $StateName = ""; if ($stateId != "") { $PageData = $db->runQuery("select * from " . STATE . " where state_id='" . $stateId . "'"); $CountryId = $PageData[0]['country_id']; $StateName = $PageData[0]['state_name']; } $CounyryArr = array(); $CounyryArr[0]['key'] = ""; $CounyryArr[0]['value'] = "- - Country - -"; $CounyryData = $db->runQuery("select * from " . COUNTRIES . " order by country_name"); if ($CounyryData != "" and count($CounyryData) > 0) { $i = 1; foreach ($CounyryData as $key => $CounyryValues) { $CounyryArr[$i]['key'] = $CounyryValues['country_id']; $CounyryArr[$i]['value'] = $CounyryValues['country_name']; $i++; } } $country_id = new Zend_Form_Element_Select('country_id'); $country_id->setRequired(true)->addMultiOptions($CounyryArr)->addValidator('NotEmpty', true, array('messages' => 'Country is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "required")->setValue($CountryId); $state_name = new Zend_Form_Element_Text('state_name'); $state_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'State Name is required.'))->addValidator('regex', true, array('pattern' => '/^[a-zA-Z\\-]+$/', 'messages' => array('regexNotMatch' => 'Please enter proper name and without space')))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($StateName); $this->addElements(array($country_id, $state_name)); }
public function init() { $this->setMethod('post')->setAttrib('id', 'frmVenta')->setAttrib('style', 'width: 300px;margin:auto;'); // Producto $e = new Zend_Form_Element_Select('id_producto'); $e->setLabel('Producto'); $e->setRequired(); $_producto = new Application_Model_Producto(); $e->addMultiOption(-1, '--Producto--'); $e->addMultiOptions($_producto->getComboValues()); $e->addValidator(new Zend_Validate_InArray($_producto->getComboValidValues())); $this->addElement($e); // Cantidad $e = new Zend_Form_Element_Text('cantidad'); $e->setLabel('Cantidad'); $e->setRequired(); $e->addValidator(new Zend_Validate_Int(new Zend_Locale('US'))); $e->addValidator(new Zend_Validate_GreaterThan(0)); $e->addValidator(new Zend_Validate_LessThan(100)); $this->addElement($e); // AddVentaDetalles $e = new Zend_Form_Element_Hidden('is_detalle'); $e->setValue(true); $e->setRequired(); $this->addElement($e); //Submit $e = new Zend_Form_Element_Submit('submit'); $e->setLabel('Agregar'); $this->addElement($e); }
public function __construct($options = null) { parent::__construct($options); parent::__construct(); $accountCode = new Zend_Form_Element_Hidden('accountcode'); $memberId = new Zend_Form_Element_Hidden('membercode'); $categoryId = new Zend_Form_Element_Hidden('categoryId'); $newStatus = new Zend_Form_Element_Select('newStatus'); $newStatus->setAttrib('class', 'NormalBtn'); $newStatus->setRequired(true); $newStatus->addMultiOption('', 'Select...'); $description = new Zend_Form_Element_Textarea('description'); $description->setAttrib('rows', '2'); $description->setAttrib('cols', '20'); $description->setRequired(true); $totalamount = new Zend_Form_Element_Text('totalamount'); $totalamount->setAttrib('class', 'textfield'); $totalamount->setAttrib('id', 'totalamount'); $totalamount->setAttrib('readonly', 'true'); $newStatus1 = new Zend_Form_Element_Hidden('newStatus1'); $description1 = new Zend_Form_Element_Hidden('description1'); $totalamount1 = new Zend_Form_Element_Hidden('totalamount1'); $confirm = new Zend_Form_Element_Submit('confirm'); $confirm->setAttrib('class', 'officesubmit'); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setAttrib('class', 'officesubmit'); $this->addElements(array($submit, $newStatus, $description, $accountCode, $memberId, $categoryId, $totalamount, $confirm, $newStatus1, $description1, $totalamount1)); }
public function init() { $holidayname = new Zend_Form_Element_Text('holidayname'); $holidayname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_holidayupdates', 'holidayname')); $holidayname->setAttrib('class', 'txt_put'); $holidayname->setRequired(true)->addValidators(array(array('NotEmpty'))); $office_id = new Zend_Form_Element_Select('office_id'); $office_id->addMultiOption('', 'Select...'); $office_id->addMultiOption('All', 'All'); $office_id->setAttrib('class', 'txt_put'); $office_id->setRequired(true)->addValidators(array(array('NotEmpty'))); $holidayupdate_id = new Zend_Form_Element_Hidden('holidayupdate_id'); $holidayfrom = new ZendX_JQuery_Form_Element_DatePicker('holidayfrom'); $holidayfrom->setAttrib('class', 'txt_put'); $holidayfrom->setJQueryParam('dateFormat', 'yy-mm-dd'); $holidayfrom->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date'))); $holidayupto = new ZendX_JQuery_Form_Element_DatePicker('holidayupto'); $holidayupto->setAttrib('class', 'txt_put'); $holidayupto->setJQueryParam('dateFormat', 'yy-mm-dd'); $holidayupto->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date'))); $repayment_date = new ZendX_JQuery_Form_Element_DatePicker('repayment_date'); $repayment_date->setAttrib('class', 'txt_put'); $repayment_date->setJQueryParam('dateFormat', 'yy-mm-dd'); $repayment_date->setRequired(true)->addValidators(array(array('NotEmpty'))); array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')); $submit = new Zend_Form_Element_Submit('Submit'); $submit->removeDecorator('DtDdWrapper'); $this->addElements(array($holidayname, $office_id, $holidayfrom, $holidayupto, $repayment_date, $holidayupdate_id, $submit)); }
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 __construct($options = null) { Zend_Dojo::enableForm($this); parent::__construct($options); $app = APPLICATION_PATH; $accountHeader = new Zend_Form_Element_Text('accountHeader'); $accountHeader->setAttrib('class', 'txt_put'); $accountHeader->setAttrib('id', 'accountHeader'); $accountHeader->setRequired(true)->addValidators(array(array('NotEmpty'))); $glcodeDescription = new Zend_Form_Element_Textarea('glcodeDescription', array('rows' => 3, 'cols' => 25)); $glcodeDescription->setAttrib('id', 'glcodeDescription'); $glcodeDescription->setRequired(true)->addValidators(array(array('NotEmpty'))); $product = new Zend_Form_Element_Select('product'); $product->setAttrib('select', '-----'); $product->setAttrib('class', 'txt_put'); $product->setRequired(true)->addValidators(array(array('NotEmpty'))); $offerproduct = new Zend_Form_Element_Select('offerproduct'); $offerproduct->setAttrib('select', '-----'); $offerproduct->setAttrib('class', 'txt_put'); $subheader = new Zend_Form_Element_Text('subheader'); $subheader->setAttrib('class', 'txt_put'); $subheader->setAttrib('id', 'subheader'); $glsubaccountdescription = new Zend_Form_Element_Textarea('glsubaccountdescription', array('rows' => 3, 'cols' => 25)); $glsubaccountdescription->setAttrib('id', 'glsubaccountdescription'); $submit = new Zend_Form_Element_Submit('Save'); $submit->setAttrib('id', 'Save'); $submit->setAttrib('class', 'holiday1'); $this->addElements(array($submit, $accountHeader, $glcodeDescription, $subheader, $glsubaccountdescription, $product, $offerproduct)); $glcodeUpdateId = new Zend_Form_Element_Hidden('glcodeUpdateId'); $glsubcodeupdate_id = new Zend_Form_Element_Hidden('glsubcodeupdate_id'); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setAttrib('class', 'holiday'); $this->addElements(array($submit, $glcodeUpdateId, $glsubcodeupdate_id)); }
public function init() { $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/add-show-rebroadcast.phtml')))); $relativeDates = array(); $relativeDates[""] = ""; for ($i = 0; $i <= 30; $i++) { $relativeDates["{$i} days"] = "+{$i} " . _("days"); } for ($i = 1; $i <= 10; $i++) { $select = new Zend_Form_Element_Select("add_show_rebroadcast_date_{$i}"); $select->setAttrib('class', 'input_select'); $select->setMultiOptions($relativeDates); $select->setRequired(false); $select->setDecorators(array('ViewHelper')); $this->addElement($select); $text = new Zend_Form_Element_Text("add_show_rebroadcast_time_{$i}"); $text->setAttrib('class', 'input_text'); $text->addFilter('StringTrim'); $text->addValidator('date', false, array('HH:mm')); $text->addValidator('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered'))); $text->setRequired(false); $text->setDecorators(array('ViewHelper')); $this->addElement($text); } }
public function init() { $this->setMethod('post'); $this->setAttrib('action', DOMAIN . 'employee/add'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'empskills'); $id = new Zend_Form_Element_Hidden('id'); $userid = new Zend_Form_Element_Hidden('user_id'); $skillname = new Zend_Form_Element_Text('skillname'); $skillname->setRequired(true); $skillname->setAttrib('maxLength', 50); $skillname->addFilter('StripTags'); $skillname->addFilter('StringTrim'); $skillname->addValidator('NotEmpty', false, array('messages' => 'Please enter skill.')); $yearsofexp = new Zend_Form_Element_Text('yearsofexp'); $yearsofexp->setAttrib('maxLength', 5); $yearsofexp->addFilter(new Zend_Filter_StringTrim()); $yearsofexp->setRequired(true); $yearsofexp->addValidator('NotEmpty', false, array('messages' => 'Please enter years of experience.')); $yearsofexp->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9]\\d{0,1}(\\.\\d*)?$/', 'messages' => array('regexNotMatch' => 'Please enter numbers less than 100.'))))); $competencylevelid = new Zend_Form_Element_Select('competencylevelid'); $competencylevelid->setRequired(true)->addErrorMessage('Please select competency level.'); $competencylevelid->addValidator('NotEmpty', false, array('messages' => 'Please select competency level.')); $competencylevelid->setRegisterInArrayValidator(false); $year_skill = new ZendX_JQuery_Form_Element_DatePicker('year_skill_last_used'); $year_skill->setOptions(array('class' => 'brdr_none')); $year_skill->setAttrib('readonly', 'true'); $year_skill->setAttrib('onfocus', 'this.blur()'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $submit->setLabel('Save'); $this->addElements(array($id, $userid, $skillname, $yearsofexp, $competencylevelid, $year_skill, $submit)); $this->setElementDecorators(array('ViewHelper')); $this->setElementDecorators(array('UiWidgetElement'), array('year_skill_last_used')); }
public function __construct($recurringBeginDate, $recurringClosedDate, $recurringMinAmount, $recurringMaxAmount, $app) { parent::__construct($recurringBeginDate, $recurringClosedDate, $recurringMinAmount, $recurringMaxAmount, $app); $startdate = new ZendX_JQuery_Form_Element_DatePicker('startdate'); $startdate->setAttrib('id', 'startdate'); $startdate->setAttrib('size', '8'); $startdate->setAttrib('class', ''); $startdate->setRequired(true)->addValidators(array(array('Date', true), array('Between', false, array($recurringBeginDate, $recurringClosedDate, 'messages' => array('notBetween' => 'date should be between ' . $recurringBeginDate . ' to (Closed date) ' . $recurringClosedDate))))); $recurringamount = new Zend_Form_Element_Text('recurringamount'); $recurringamount->setRequired(true)->addValidators(array(array('Digits'), array('GreaterThan', false, array($recurringMinAmount)), array('LessThan', false, array($recurringMaxAmount)), array('NotEmpty'))); $recurringamount->setAttrib('size', '8'); $recurringperiod = new Zend_Form_Element_Text('recurringperiod'); $recurringperiod->setAttrib('id', 'recurringperiod'); $recurringperiod->setAttrib('class', 'NormalBtn'); $memberfirstname = new Zend_Form_Element_MultiCheckbox('memberfirstname'); $memberfirstname->setAttrib('class', 'textfield'); $freequencyofdeposit = new Zend_Form_Element_Select('frequencyofdeposit'); $freequencyofdeposit->addMultiOption('', 'Select...'); $freequencyofdeposit->setAttrib('class', 'NormalBtn'); $freequencyofdeposit->setAttrib('id', 'freequencyofdeposit'); $perioddescription = new Zend_Form_Element_Select('perioddescription'); $perioddescription->addMultiOption('', 'Select..'); $perioddescription->setAttrib('class', 'NormalBtn'); $perioddescription->setAttrib('id', 'perioddescription'); $perioddescription->setRequired(true); $perioddescription->setAttrib('onchange', 'getInterests(this.value,"' . $app . '")'); $periodinterest = new Zend_Form_Element_Select('periodinterest'); $periodinterest->addMultiOption('', 'Select...'); $periodinterest->setAttrib('class', 'NormalBtn'); $periodinterest->setAttrib('id', 'periodinterest'); $periodinterest->setAttrib('size', '5'); $accountId = new Zend_Form_Element_Hidden('accountId'); $productIdss = new Zend_Form_Element_Hidden('productId'); $recurringindex = new Zend_Form_Element_Text('recurringinterest'); $recurringindex->setAttrib('id', 'recurringinterest'); $recurringindex->setAttrib('size', '8'); $recurringindex->setAttrib('class', 'NormalBtn'); $recurringindex->setAttrib('readonly', 'true'); $recurringindex->setAttrib('class', 'NormalBtn'); $recurringindex->setAttrib('readonly', 'true'); $memberTypeId = new Zend_Form_Element_Hidden('memberTypeId'); $memberId = new Zend_Form_Element_Hidden('member_id'); $productId = new Zend_Form_Element_Hidden('product_id'); $offerproductId = new Zend_Form_Element_Hidden('offerproduct_id'); $groupId = new Zend_Form_Element_Hidden('groupId'); $this->addElements(array($memberfirstname, $recurringindex, $freequencyofdeposit, $recurringperiod, $recurringamount, $startdate, $perioddescription, $periodinterest, $memberId, $productId, $offerproductId, $groupId, $memberTypeId, $accountId, $productIdss)); $period_id = new Zend_Form_Element_Hidden('period_id'); $period_id->setAttrib('id', 'period_id'); $startdate1 = new Zend_Form_Element_Hidden('startdate1'); $recurringamount1 = new Zend_Form_Element_Hidden('recurringamount1'); $perioddescription1 = new Zend_Form_Element_Hidden('perioddescription1'); $interest1 = new Zend_Form_Element_Hidden('interest1'); $Confirm = new Zend_Form_Element_Submit('Confirm'); $Confirm->setLabel('Confirm'); $Confirm->setAttrib('class', 'recurring'); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setLabel('submit'); $submit->setAttrib('class', 'recurring'); $this->addElements(array($submit, $period_id, $Confirm, $startdate1, $recurringamount1, $perioddescription1, $interest1)); }
public function init() { $this->setName(strtolower(get_class())); $this->setMethod("post"); $oFormName = new Zend_Form_Element_Hidden("form_name"); $oFormName->setValue(get_class()); $oFormName->setIgnore(FALSE)->removeDecorator("Label"); $this->addElement($oFormName); $oRealEditMode = new Zend_Form_Element_Select("real_edit_mode"); $oRealEditMode->setLabel("Edycja w czasie rzeczywistym:"); $oRealEditMode->setRequired(TRUE); $oRealEditMode->addMultiOptions(array("1" => "Włącz", "0" => "Wyłącz")); $this->addElement($oRealEditMode); $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200)); $this->getElement("csrf_token")->removeDecorator("Label"); $oSubmit = $this->createElement("submit", "choose_site_submit"); $oSubmit->setLabel("Zapisz"); $this->addElement($oSubmit); $oViewScript = new Zend_Form_Decorator_ViewScript(); $oViewScript->setViewModule("admin"); $oViewScript->setViewScript("_forms/_defaultform.phtml"); $this->clearDecorators(); $this->setDecorators(array(array($oViewScript))); $oElements = $this->getElements(); foreach ($oElements as $oElement) { $oElement->setFilters($this->_aFilters); $oElement->removeDecorator("Errors"); } }
public function init() { $this->setName('f3')->setMethod('post'); $mauOptions = array("multiOptions" => Default_Model_Constraints::report()); $mau = new Zend_Form_Element_Select('mau', $mauOptions); $mau->setRequired(true)->setLabel('Mẫu báo cáo (*)')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width : 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mau')); $namOptions = array("multiOptions" => Default_Model_Constraints::nam()); $nam = new Zend_Form_Element_Select('nam', $namOptions); $nam->setRequired(true)->setLabel('Năm (*)')->setValue(date('Y'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'nam')); $quyet_dinh = new Zend_Form_Element_Text('quyet_dinh'); $quyet_dinh->setLabel('Quyết định')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input'); $loai_lv = new Default_Model_LoaiLinhVuc(); $llvOptions = array("multiOptions" => $loai_lv->getMultiOptions()); $ma_loai = new Zend_Form_Element_Select('ma_loai', $llvOptions); $ma_loai->setLabel('Loại')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'ma_loai-wrapper')))); $options = array("multiOptions" => array('1' => 'Có', '0' => 'Không')); $thong_bao = new Zend_Form_Element_Radio('thong_bao', $options); $thong_bao->setRequired(true)->setLabel('Tạo thông báo mới')->setValue('0')->setSeparator('')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'thong_bao')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'thong_bao-wrapper'))))->setAttribs(array('id' => 'thong_bao')); $fileTypeOptions = array("multiOptions" => array('excel' => 'Excel', 'pdf' => 'Pdf')); $file_type = new Zend_Form_Element_Select('file_type', $fileTypeOptions); $file_type->setRequired(true)->setLabel('Xuất Thành File')->setSeparator('')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'file_type')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'file_type-wrapper'))))->setAttribs(array('id' => 'file_type')); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Xuất')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'filter_btn_l'))))->setAttribs(array('class' => 'button', 'id' => 'submit')); $this->addElements(array($mau, $nam, $quyet_dinh, $ma_loai, $thong_bao, $file_type, $submit)); $this->addDisplayGroup(array('submit'), 'report', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'report'))))); $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'report_dt')), 'Form')); }
public function init() { $this->setMethod('post'); $this->setAttrib('action', DOMAIN . 'monthslist/edit'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'monthslist'); $id = new Zend_Form_Element_Hidden('id'); $monthname = new Zend_Form_Element_Select('month_id'); $monthname->setAttrib('class', 'selectoption'); $monthname->setRegisterInArrayValidator(false); $monthname->setRequired(true); $monthname->addValidator('NotEmpty', false, array('messages' => 'Please select month name.')); $monthcode = new Zend_Form_Element_Text('monthcode'); $monthcode->setAttrib('maxLength', 20); $monthcode->addFilter(new Zend_Filter_StringTrim()); $monthcode->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_monthslist', 'field' => 'monthcode', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive=1'))); $monthcode->getValidator('Db_NoRecordExists')->setMessage('Month code already exists.'); $description = new Zend_Form_Element_Textarea('description'); $description->setAttrib('rows', 10); $description->setAttrib('cols', 50); $description->setAttrib('maxlength', '200'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $submit->setLabel('Save'); $url = "'monthslist/saveupdate/format/json'"; $dialogMsg = "''"; $toggleDivId = "''"; $jsFunction = "'redirecttocontroller(\\'monthslist\\');'"; $this->addElements(array($id, $monthname, $monthcode, $description, $submit)); $this->setElementDecorators(array('ViewHelper')); }
public function __construct($options = null) { parent::__construct($options); parent::__construct(); $account_id = new Zend_Form_Element_Hidden('accountId'); $product_id = new Zend_Form_Element_Hidden('productId'); $newStatus = new Zend_Form_Element_Select('newStatus'); $newStatus->setAttrib('class', 'NormalBtn'); $newStatus->setRequired(true); $newStatus->addMultiOption('', 'Select...'); $description = new Zend_Form_Element_Textarea('description'); $description->setAttrib('class', 'textfield'); $description->setAttrib('rows', '2'); $description->setAttrib('cols', '20'); $description->setRequired(true); $newStatus1 = new Zend_Form_Element_Hidden('newStatus1'); $description1 = new Zend_Form_Element_Hidden('description1'); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setLabel('submit'); $submit->setAttrib('class', 'recurring'); $Confirm = new Zend_Form_Element_Submit('Confirm'); $Confirm->setLabel('Confirm'); $Confirm->setAttrib('class', 'recurring'); $this->addElements(array($submit, $description, $newStatus, $account_id, $product_id, $Confirm, $newStatus1, $description1)); }
public function init() { $this->setName('f2')->setMethod('post'); $nams = Default_Model_Constraints::nam(); $namOption = array("multiOptions" => $nams); $nam = new Zend_Form_Element_Select('nam', $namOption); $nam->setValue(date('Y'))->setLabel('Năm (*)')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'nam')); $bizHDD = new Default_Model_Hdd(); $hdds = $bizHDD->getDSHDByNam(date('Y')); if ($hdds == null) { $hdsOptions = array("multiOptions" => array('-1' => '== Chưa thành lập ==')); } else { $hdds = array('0' => '== Tất cả ==') + $hdds; $hddsOptions = array("multiOptions" => $hdds); } $noi_nhan = new Zend_Form_Element_Select('noi_nhan', $hddsOptions); $noi_nhan->setRequired(true)->setLabel('Hội đồng')->setValue('0')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_nhan'))->setRegisterInArrayValidator(false); $tieu_de = new Zend_Form_Element_Text('tieu_de'); $tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input'); $noi_dung = new Zend_Form_Element_Textarea('noi_dung'); $noi_dung->setLabel('Nội dung (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_dung', 'class' => 'text-input textarea')); $submit = new Zend_Form_Element_Submit('submit'); $submit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button')); $url = new Zend_View_Helper_Url(); $link = $url->url(array('module' => 'admin', 'controller' => 'hoi-dong', 'action' => 'ds-mail-tb'), null, true); $cancel = new Zend_Form_Element_Button('cancel'); $cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"')); $this->addElements(array($nam, $noi_nhan, $tieu_de, $noi_dung, $submit, $cancel)); $this->addDisplayGroup(array('submit', 'cancel'), 'btn_submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))); $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form')); }
public function init() { // Set form options $this->setName('productBasicInfo')->setAction(SITE_ROOT . '/productlisting/' . $this->postAction)->setMethod('post'); //name $name = new Zend_Form_Element_Text('name'); $name->setRequired(true)->addValidator('Alnum')->addvalidator('StringLength', false, array(4, 150)); //brand $brand = new Zend_Form_Element_Select('brand'); $brand->setRequired(true)->addValidator('Alnum'); //social_usage $socialUsage = new Zend_Form_Element_Checkbox('socialUsage'); $competativeUsage = new Zend_Form_Element_Checkbox('competativeUsage'); $price = new Zend_form_Element_Text('price'); $price->setRequired(true)->addValidator(new Zend_Validate_Float(), true); //domestic shipping rate $domesticShippingRate = new Zend_Form_Element_Text('domesticShippingRate'); $domesticShippingRate->setRequired(true)->addValidator(new Zend_Validate_Float(), true); //international shipping rate $internationalShippingRate = new Zend_Form_Element_Text('internationalShippingRate'); $internationalShippingRate->setRequired(true)->addValidator(new Custom_Validators_Price(), true); //backordertime $backorderTime = new Zend_Form_Element_Text('backorderTime'); //returnable $return = new Zend_Form_Element_Radio('return'); $return->setLabel('Return:')->addMultiOptions(array('returnable' => 'Returnable', 'Unreturnable' => 'Not returnable'))->setSeparator(" ")->setAttrib("checked", "checked"); //videos $video = new Zend_Form_Element_Text('videoYoutube'); // Add all the elements to the form $this->addElement($name)->addElement($brand)->addElement($socialUsage)->addElement($competativeUsage)->addElement($price)->addElement($domesticShippingRate)->addElement($internationalShippingRate)->addElement($backorderTime)->addElement($return)->addElement($video); }
public function init() { $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/preferences_soundcloud.phtml')))); //enable soundcloud uploads $this->addElement('checkbox', 'UseSoundCloud', array('label' => 'Upload Recorded Shows To SoundCloud', 'required' => false, 'value' => Application_Model_Preference::GetDoSoundCloudUpload(), 'decorators' => array('ViewHelper'))); //SoundCloud Username $this->addElement('text', 'SoundCloudUser', array('class' => 'input_text', 'label' => 'SoundCloud Email:', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetSoundCloudUser(), 'decorators' => array('ViewHelper'))); //SoundCloud Password $this->addElement('password', 'SoundCloudPassword', array('class' => 'input_text', 'label' => 'SoundCloud Password:'******'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetSoundCloudPassword(), 'decorators' => array('ViewHelper'))); // Add the description element $this->addElement('textarea', 'SoundCloudTags', array('label' => 'SoundCloud Tags: (separate tags with spaces)', 'required' => false, 'class' => 'input_text_area', 'value' => Application_Model_Preference::GetSoundCloudTags(), 'decorators' => array('ViewHelper'))); //SoundCloud default genre $this->addElement('text', 'SoundCloudGenre', array('class' => 'input_text', 'label' => 'Default Genre:', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetSoundCloudGenre(), 'decorators' => array('ViewHelper'))); $select = new Zend_Form_Element_Select('SoundCloudTrackType'); $select->setLabel('Default Track Type:'); $select->setAttrib('class', 'input_select'); $select->setMultiOptions(array("" => "", "original" => "Original", "remix" => "Remix", "live" => "Live", "recording" => "Recording", "spoken" => "Spoken", "podcast" => "Podcast", "demo" => "Demo", "in progress" => "Work in progress", "stem" => "Stem", "loop" => "Loop", "sound effect" => "Sound Effect", "sample" => "One Shot Sample", "other" => "Other")); $select->setRequired(false); $select->setValue(Application_Model_Preference::GetSoundCloudTrackType()); $select->setDecorators(array('ViewHelper')); $this->addElement($select); $select = new Zend_Form_Element_Select('SoundCloudLicense'); $select->setLabel('Default License:'); $select->setAttrib('class', 'input_select'); $select->setMultiOptions(array("" => "", "no-rights-reserved" => "The work is in the public domain", "all-rights-reserved" => "All rights are reserved", "cc-by" => "Creative Commons Attribution", "cc-by-nc" => "Creative Commons Attribution Noncommercial", "cc-by-nd" => "Creative Commons Attribution No Derivative Works", "cc-by-sa" => "Creative Commons Attribution Share Alike", "cc-by-nc-nd" => "Creative Commons Attribution Noncommercial Non Derivate Works", "cc-by-nc-sa" => "Creative Commons Attribution Noncommercial Share Alike")); $select->setRequired(false); $select->setValue(Application_Model_Preference::GetSoundCloudLicense()); $select->setDecorators(array('ViewHelper')); $this->addElement($select); }
public function init() { $this->setMethod('post'); $this->setAttrib('action', DOMAIN . 'employmentstatus/edit'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'employmentstatus'); $id = new Zend_Form_Element_Hidden('id'); $workcode = new Zend_Form_Element_Text('workcode'); $workcode->setAttrib('maxLength', 20); $workcode->setRequired(true); $workcode->addValidator('NotEmpty', false, array('messages' => 'Please enter work short code.')); $workcode->addValidator("regex", true, array('pattern' => '/^(?=.*[a-zA-Z])([^ ][a-zA-Z0-9 ]*)$/', 'messages' => array('regexNotMatch' => 'Please enter valid work short code.'))); $workcodename = new Zend_Form_Element_Select('workcodename'); $workcodename->setAttrib('class', 'selectoption'); $workcodename->setRegisterInArrayValidator(false); $workcodename->setRequired(true); $workcodename->addValidator('NotEmpty', false, array('messages' => 'Please select work code.')); $description = new Zend_Form_Element_Textarea('description'); $description->setAttrib('rows', 10); $description->setAttrib('cols', 50); $description->setAttrib('maxlength', '200'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $submit->setLabel('Save'); $this->addElements(array($id, $workcode, $workcodename, $description, $submit)); $this->setElementDecorators(array('ViewHelper')); }
public function init() { $this->setMethod('post'); $this->setAttrib('id', 'formid'); $this->setAttrib('name', 'positions'); $id = new Zend_Form_Element_Hidden('id'); $emptyflag = new Zend_Form_Element_Hidden('emptyFlag'); $positionname = new Zend_Form_Element_Text('positionname'); $positionname->setAttrib('maxLength', 50); $positionname->setRequired(true); $positionname->addValidator('NotEmpty', false, array('messages' => 'Please enter position.')); $positionname->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[a-zA-Z][a-zA-Z0-9\\-\\s]*$/i', 'messages' => array('regexNotMatch' => 'Please enter valid position.'))))); $positionname->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_positions', 'field' => 'positionname', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive=1'))); $positionname->getValidator('Db_NoRecordExists')->setMessage('Position already exists.'); $jobtitleid = new Zend_Form_Element_Select('jobtitleid'); $jobtitleid->setAttrib('class', 'selectoption'); $jobtitleid->setRegisterInArrayValidator(false); $jobtitleid->addMultiOption('', 'Select Job Title'); $jobtitleid->setRequired(true); $jobtitleid->addValidator('NotEmpty', false, array('messages' => 'Please select job title.')); $description = new Zend_Form_Element_Textarea('description'); $description->setAttrib('rows', 10); $description->setAttrib('cols', 50); $description->setAttrib('maxlength', '200'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $submit->setLabel('Save'); $this->addElements(array($id, $positionname, $jobtitleid, $description, $emptyflag, $submit)); $this->setElementDecorators(array('ViewHelper')); }
public function __construct(array $dataBusinessId, $options = null) { parent::__construct($options); $this->setName('frmEmployee'); $this->setMethod('post'); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Employee name'); $name->setAttrib('maxlength', 80); $name->setRequired(true); $name->addValidator(new Zend_Validate_NotEmpty()); $this->addElement($name); $age = new Zend_Form_Element_Text('age'); $age->setLabel('Employee age'); $age->addValidator(new Zend_Validate_Int()); $this->addElement($age); $businessId = new Zend_Form_Element_Select('business_id'); $businessId->setLabel('Business'); $businessId->setRequired(true); $businessId->addValidator(new Zend_Validate_NotEmpty()); $businessId->addValidator(new Zend_Validate_Int()); $businessId->addMultiOptions($dataBusinessId); $this->addElement($businessId); $submit = new Zend_Form_Element_Submit('bt_submit'); $submit->setLabel('Save'); $this->addElement($submit); }
public function init() { $this->setName('dept_report')->setMethod('post'); $nams = array(); for ($i = 2005; $i < 2030; $i++) { $nams[$i] = $i; } $namOption = array("multiOptions" => $nams); $from = new Zend_Form_Element_Select('dept_from', $namOption); $from->setLabel('Từ : ')->setValue(date('Y'))->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'from', 'style' => 'margin-left : 23px'))))->setAttribs(array('style' => 'width:10%')); $to = new Zend_Form_Element_Select('dept_to', $namOption); $to->setLabel('Đến : ')->setValue(date('Y') + 1)->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'to'))))->setAttribs(array('style' => 'width:10%')); $don_vi = new Default_Model_DonVi(); $dv = $don_vi->getDSDVSGU(); unset($dv['1']); $dvOptions = array("multiOptions" => $dv); $ma_don_vi = new Zend_Form_Element_Select('dept_don_vi', $dvOptions); $ma_don_vi->setRequired(true)->setLabel('Đơn vị : ')->setValue('0')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'style' => 'margin-bottom: 10px;'))))->setAttribs(array('id' => 'dept_don_vi', 'style' => 'width : 50%')); $amounts = array(); for ($i = 1; $i <= 10; $i++) { $amounts[$i * 10] = $i * 10; } $amountOptions = array("multiOptions" => $amounts); $amount = new Zend_Form_Element_Select('dept_amount', $amountOptions); $amount->setLabel('Số lượng GV : ')->setValue(10)->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'amount')))); $submit = new Zend_Form_Element_Button('dept_submit'); $submit->setLabel('Xem'); $submit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span', 'align' => 'left')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'style' => 'margin-left : 10px')))); $this->addElements(array($ma_don_vi, $from, $to, $amount, $submit)); $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'dept_report')), 'Form')); }