public function AllAction($data = null) { $tr = Application_Form_FrmLanguages::getCurrentlanguage(); $newElement = new Zend_Form_Element_Submit('New'); $newElement->setLabel($tr->translate("NEW")); $this->addElement($newElement); $saveElement = new Zend_Form_Element_Submit('Save'); $saveElement->setAttribs(array('class' => 'save')); $saveElement->setLabel($tr->translate("SAVE_CLOSE")); $this->addElement($saveElement); $saveNewElement = new Zend_Form_Element_Submit('SaveNew'); $saveNewElement->setAttribs(array('class' => 'savenew')); $saveNewElement->setLabel($tr->translate("SAVE_NEW")); $this->addElement($saveNewElement); $updateElement = new Zend_Form_Element_Submit('Update'); $updateElement->setAttribs(array('class' => 'update')); $updateElement->setLabel($tr->translate("UPDATE")); $this->addElement($updateElement); $deactiveElement = new Zend_Form_Element_Submit('Deactive'); $deactiveElement->setAttribs(array('class' => 'deactive')); $deactiveElement->setLabel($tr->translate("DEACTIVE")); $this->addElement($deactiveElement); $activeElement = new Zend_Form_Element_Submit('Active'); $activeElement->setAttribs(array('class' => 'activate')); $activeElement->setLabel($tr->translate("ACTIVE")); $this->addElement($activeElement); $CancelElement = new Zend_Form_Element_Submit('Cancel'); $CancelElement->setAttribs(array('class' => 'cancel')); $this->addElement($CancelElement); return $this; }
function editUserPassword() { $this->setMethod('post'); $this->addAttribs(array('id' => 'formAccountEditPassword', 'class' => '')); $filters = array(new Zend_Filter_StringTrim(), new Zend_Filter_StripTags()); $control = new Zend_Form_Element_Hidden('control'); $control->setValue('editPassword'); $this->addElement($control); $oldPassword = new Zend_Form_Element_Password('oldPassword'); $oldPassword->setLabel('Old password'); $oldPassword->addValidator(new Zend_Validate_StringLength(6, 32)); $oldPassword->setAttribs(array('class' => 'text validate[required,minSize[6],maxSize[32]] rightAdd', 'minlenght' => '6', 'maxlenght' => '32', 'autocomplete' => 'off', 'oncontextmenu' => 'return false', 'data-prompt-position' => 'topLeft:0')); $oldPassword->setRequired(true); $this->addElement($oldPassword); $password = new Zend_Form_Element_Password('password'); $password->setLabel(Zend_Registry::get('translate')->_('admin_administrators_new_password')); $password->addValidator(new Zend_Validate_StringLength(6, 32)); $password->setAttribs(array('class' => 'text validate[required] rightAdd', 'maxlenght' => '32', 'autocomplete' => 'off', 'oncontextmenu' => 'return false', 'ondrop' => 'return false', 'onpaste' => 'return false')); $password->setRequired(true); $this->addElement($password); $retypePassword = new Zend_Form_Element_Password('retypePassword'); $retypePassword->setLabel(Zend_Registry::get('translate')->_('admin_administrators_retype_new_password')); $retypePassword->addValidator(new Zend_Validate_Identical('password')); $retypePassword->addValidator(new Zend_Validate_StringLength(6, 32)); $retypePassword->setAttribs(array('class' => 'text validate[required] rightAdd', 'maxlenght' => '32', 'autocomplete' => 'off', 'oncontextmenu' => 'return false', 'ondrop' => 'return false', 'onpaste' => 'return false')); $retypePassword->setRequired(true); $retypePassword->setIgnore(true); $this->addElement($retypePassword); $submit = new Zend_Form_Element_Submit('savePassword'); $submit->setValue(Zend_Registry::get('translate')->_('apply_password')); $submit->setAttribs(array('class' => 'submit tsSubmitLogin fL')); $submit->setIgnore(true); $this->addElement($submit); $this->setElementFilters($filters); }
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 init() { // submit default $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel("Enviar"); $submit->setAttribs(array('class' => 'btn btn-success btn-group-justified')); $this->addElement($submit); }
public function init() { parent::init(); // add submit $submit = new Zend_Form_Element_Submit("submit"); $submit->setLabel("Enviar"); $submit->setAttribs(array('class' => 'btn btn-primary form-control')); $this->addElement($submit); $this->setElementsDefaultAttribs(); }
public function init() { //servico_tag $servico_tag = new Zend_Form_Element_Text("servico_tag"); $servico_tag->setLabel("Serviço"); $servico_tag->setRequired(); $servico_tag->setAttribs(array('class' => 'form-control')); // submit $submit = new Zend_Form_Element_Submit("submit"); $submit->setLabel("Enviar"); $submit->setAttribs(array('class' => 'form-control btn btn-sm btn-success')); $this->addElements(array($servico_tag, $submit)); }
public function init() { $this->name = new Zend_Form_Element_Text('name'); $this->new_password = new Zend_Form_Element_Password('new_password'); $this->confirm_password = new Zend_Form_Element_Password('confirm_password'); $this->email = new Zend_Form_Element_Text('email'); $this->biography = new Zend_Form_Element_Textarea('biography'); $this->submit = new Zend_Form_Element_Submit('submit'); $email_validator = new Zend_Validate_EmailAddress(); $email_validator->setDeepMxCheck(false); $email_validator->setDomainCheck(false); $email_validator->setMessages(array(Zend_Validate_EmailAddress::INVALID_FORMAT => "Format Email Salah")); $confirm_password_validator = new Zend_Validate_Identical(); $confirm_password_validator->setMessage("Kata sandi tidak cocok."); $this->biography->setAttribs(array('style' => 'width:100%;height:240px')); $this->name->setAttribs(array('class' => 'span6', 'placeholder' => 'Nama lengkap anda')); $this->email->addValidator($email_validator)->setAttribs(array('class' => 'span4', 'placeholder' => '*****@*****.**')); $this->submit->setAttribs(array('class' => 'btn btn-success'))->setLabel('Simpan'); $this->confirm_password->addValidator($confirm_password_validator); $this->addElements(array($this->name, $this->new_password, $this->confirm_password, $this->email, $this->biography, $this->submit)); $this->setElementDecorators(array('ViewHelper', 'Errors')); }
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); }
function init() { // Set the method for the display form to POST $this->setMethod('post'); $this->setAction(WEBROOT . 'logs'); $this->addAttribs(array('id' => 'searchLogs', 'class' => '')); $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART); //BEGIN:Module $id = new Zend_Form_Element_Select('modul'); $options = array('' => 'Selectati modulul'); $module = new Default_Model_Logs(); $select = $module->getMapper()->getDbTable()->select()->group('modul')->order('created DESC'); $result = $module->fetchAll($select); if (NULL != $result) { foreach ($result as $value) { $options[$value->getModul()] = $value->getModul(); } } $id->addMultiOptions($options); $this->addElement($id); //END:Module //BEGIN:ActionType $id = new Zend_Form_Element_Select('actionType'); $options = array('' => 'Selectati tipul actiunii'); $module = new Default_Model_Logs(); $select = $module->getMapper()->getDbTable()->select()->group('actionType')->order('created DESC'); $result = $module->fetchAll($select); if (NULL != $result) { foreach ($result as $value) { $options[$value->getActionType()] = $value->getActionType(); } } $id->addMultiOptions($options); $this->addElement($id); //END:ActionType // BEGIN: data $data_inceput = new Zend_Form_Element_Text('data_inceput'); $data_inceput->setAttribs(array('class' => 'data_inceput', 'placeholder' => 'Data inceput')); $this->addElement($data_inceput); $data_sfarsit = new Zend_Form_Element_Text('data_sfarsit'); $data_sfarsit->setAttribs(array('class' => 'data_sfarsit', 'placeholder' => 'Data sfarsit')); $this->addElement($data_sfarsit); // END: data $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Cauta'); $submit->setAttribs(array('class' => 'submit')); $submit->setIgnore(true); $this->addElement($submit); }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'comments_form', 'class' => '')); $description = new Zend_Form_Element_Textarea('description'); $description->setLabel('Comment text'); $description->setAttribs(array('class' => 'mess_textarea validate[required]', 'placeholder' => trim(Zend_Registry::get('translate')->_('Comment text')), 'data-prompt-position' => 'topLeft:6')); $description->setRequired(true); $this->addElement($description); $button = new Zend_Form_Element_Submit('button'); $button->setValue(trim(Zend_Registry::get('translate')->_('Send Comment'))); $button->setAttribs(array('class' => 'comments_submit')); $button->setIgnore(true); $this->addElement($button); }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'intrebare_form', 'class' => '')); $nume = new Zend_Form_Element_Text('tabel'); $nume->setLabel('Nume Tabel'); $nume->setAttribs(array('class' => 'text_input validate[required]', 'placeholder' => trim(Zend_Registry::get('translate')->_('Nume Tabel')), 'data-prompt-position' => 'topRight:-187')); $nume->setRequired(true); $this->addElement($nume); $button = new Zend_Form_Element_Submit('button'); $button->setValue(trim(Zend_Registry::get('translate')->_('Generate Model'))); $button->setAttribs(array('class' => 'question_submit')); $button->setIgnore(true); $this->addElement($button); }
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); }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'file-manager', 'class' => '')); $action = new Zend_Form_Element_Hidden('action'); $action->setValue('add'); $this->addElement($action); $description = new Zend_Form_Element_Textarea('description'); $description->setLabel('Description'); $description->setAttribs(array('class' => 'mess_textarea validate[required]', 'placeholder' => 'Description', 'style' => 'width:272px')); $this->addElement($description); $button = new Zend_Form_Element_Submit('rightSubmit'); $button->setValue('UPLOAD FILE'); $button->setAttribs(array('class' => 'comments_submit')); $button->setIgnore(true); $this->addElement($button); }
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); }
public function init() { // administrador_email $administrador_email = new Zend_Form_Element_Text("administrador_email"); $administrador_email->setLabel("E-mail"); $administrador_email->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o email')); $administrador_email->setRequired(); // administrador_senha $administrador_senha = new Zend_Form_Element_Password("administrador_senha"); $administrador_senha->setLabel("Senha"); $administrador_senha->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe a senha')); $administrador_senha->setRequired(); // submit $submit = new Zend_Form_Element_Submit("submit"); $submit->setLabel("Enviar"); $submit->setAttribs(array('class' => 'form-control btn btn-sm btn-success')); $this->addElements(array($administrador_email, $administrador_senha, $submit)); }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'filterForm', 'class' => '')); $action = new Zend_Form_Element_Hidden('action'); $action->setValue('search'); $this->addElement($action); $searchTxt = new Zend_Form_Element_Text('searchTxt'); $searchTxt->setLabel('Search text'); $searchTxt->setAttribs(array('class' => 'rightAdd validate[required]', 'placeholder' => 'File Name', 'style' => 'width:200px;')); $searchTxt->setRequired(true); $this->addElement($searchTxt); $search = new Zend_Form_Element_Submit('search'); $search->setValue('Filter'); $search->setAttribs(array('class' => 'submit', 'id' => '')); $search->setIgnore(true); $this->addElement($search); }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'filterForm', 'class' => '')); $this->setAction(WEBROOT . 'groups'); $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART); // BEGIN: nume text $nameSearch = new Zend_Form_Element_Text('nameSearch'); $nameSearch->setAttribs(array('class' => 'text large', 'placeholder' => 'Name')); $nameSearch->setRequired(false); $this->addElement($nameSearch); // END: nume text $search = new Zend_Form_Element_Submit('searchGroup'); $search->setValue('Search'); $search->setAttribs(array('class' => 'submit')); $search->setIgnore(true); $this->addElement($search); }
public function __construct($options = null) { parent::__construct($options); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'class' => 'leftalign')), array('HtmlTag', array('tag' => 'div'))); $this->setAttrib('accept-charset', 'UTF-8'); $this->setName('TypeToRuler'); $type = new Zend_Form_Element_Select('type'); $type->setLabel('Medieval coin type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'textInput'))->setDecorators($decorators); $ruler_id = new Zend_Form_Element_Hidden('ruler_id'); $ruler_id->removeDecorator('DtDdWrapper')->setRequired(true)->addValidator('Int')->removeDecorator('HtmlTag')->removeDecorator('Label'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60); $this->addElement($hash); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttribs(array('class' => 'large')); $this->addElements(array($type, $ruler_id, $submit))->setLegend('Add a new type')->setMethod('post')->addDecorators(array('FieldSet', 'form', array('HtmlTag', array('tag' => 'div')))); }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'share-file', 'class' => '')); $action = new Zend_Form_Element_Hidden('action'); $action->setValue('sharefile'); $this->addElement($action); $idFile = new Zend_Form_Element_Hidden('idFile'); $idFile->setValue(Zend_Controller_Front::getInstance()->getRequest()->getParam('id')); $this->addElement($idFile); //BEGIN:Users $idUserTo = new Zend_Form_Element_Select('idUserTo'); $idUserTo->setLabel('To: '); $options = array('' => 'Select user'); $shops = new Default_Model_Users(); $select = $shops->getMapper()->getDbTable()->select()->where('id != ?', Zend_Registry::get('user')->getId())->where('NOT deleted')->order('name DESC'); $result = $shops->fetchAll($select); if (NULL != $result) { foreach ($result as $value) { $options[$value->getId()] = $value->getName(); } } $idUserTo->addMultiOptions($options); $idUserTo->addValidator(new Zend_Validate_InArray(array_keys($options))); $idUserTo->setAttribs(array('class' => 'validate[required] form_selector_fm', 'id' => 'idUserTo')); $idUserTo->setRequired(true); $this->addElement($idUserTo); //END:Users $subject = new Zend_Form_Element_Text('subject'); $subject->setLabel('Subject'); $subject->setAttribs(array('class' => 'form_subject w_424 validate[required]', 'placeholder' => 'Subject')); $subject->setRequired(true); $this->addElement($subject); $message = new Zend_Form_Element_Textarea('message'); $message->setLabel('Observations'); $message->setAttribs(array('class' => 'form_textarea w_424 h_97 validate[required]', 'placeholder' => 'Observations', 'style' => 'width:290px')); $message->setRequired(true); $this->addElement($message); $button = new Zend_Form_Element_Submit('rightSubmit'); $button->setValue('SEND'); $button->setAttribs(array('class' => 'comments_submit')); $button->setIgnore(true); $this->addElement($button); }
public function init() { // cliente_id $cliente_id = new Zend_Form_Element_Select('cliente_id'); $cliente_id->setLabel('Cliente: '); $cliente_id->setMultiOptions($this->getClientes()); $cliente_id->addDecorators(Form_Decorators::$simpleElementDecorators); $cliente_id->setRequired(); // senha_tipo_id $senha_tipo_id = new Zend_Form_Element_Select('senha_tipo_id'); $senha_tipo_id->setLabel('Tipo Senha: '); $senha_tipo_id->setMultiOptions($this->getSenhasTipo()); $senha_tipo_id->setRequired(); $senha_tipo_id->addDecorators(Form_Decorators::$simpleElementDecorators); // senha_host $senha_host = new Zend_Form_Element_Text('senha_host'); $senha_host->setLabel('Host: '); $senha_host->setRequired(); $senha_host->addDecorators(Form_Decorators::$simpleElementDecorators); // senha_usuario $senha_usuario = new Zend_Form_Element_Text('senha_usuario'); $senha_usuario->setLabel('Usuário: '); $senha_usuario->setRequired(); $senha_usuario->addDecorators(Form_Decorators::$simpleElementDecorators); // senha_senha $senha_senha = new Zend_Form_Element_Text('senha_senha'); $senha_senha->setLabel('Senha: '); $senha_senha->setRequired(); $senha_senha->addDecorators(Form_Decorators::$simpleElementDecorators); // senha_observacao $senha_observacao = new Zend_Form_Element_Textarea('senha_observacao'); $senha_observacao->setLabel('Observações: '); $senha_observacao->setAttrib('rows', 10); // submit $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Cadastrar'); $submit->setAttribs(array('id' => 'btn-nova-senha', 'class' => 'btn btn-sm btn-info form-control')); // add elements $this->addElements(array($cliente_id, $senha_tipo_id, $senha_host, $senha_usuario, $senha_senha, $senha_observacao, $submit)); // set defaults form attribs $this->setDefaultAttribs(); }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'formDepartamentAdd', 'class' => '')); $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART); $parentName = new Zend_Form_Element_Text('parentName'); $parentName->setLabel('Rol Parinte'); $parentName->setAttribs(array('class' => 'text large required', 'readonly' => 'readonly')); $this->addElement($parentName); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Nume'); $name->setAttribs(array('class' => 'validate[required] text large required')); $name->setRequired(true); $this->addElement($name); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue('Adaugare'); $submit->setAttribs(array('class' => 'submit')); $submit->setIgnore(true); $this->addElement($submit); }
function init() { // Set the method for the display form to POST $this->setMethod('post'); $this->setAction(WEBROOT . 'statistics'); $this->addAttribs(array('id' => 'filterForm', 'class' => '')); $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART); // BEGIN: data $dataStart = new Zend_Form_Element_Text('dataStart'); $dataStart->setAttribs(array('class' => 'data_inceput', 'placeholder' => Zend_Registry::get('translate')->_('admin_from_date'))); $this->addElement($dataStart); $dataEnd = new Zend_Form_Element_Text('dataEnd'); $dataEnd->setAttribs(array('class' => 'data_sfarsit', 'placeholder' => Zend_Registry::get('translate')->_('admin_to_date'))); $this->addElement($dataEnd); // END: data $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue(Zend_Registry::get('translate')->_('admin_menu_form_search')); $submit->setAttribs(array('class' => 'submit')); $submit->setIgnore(true); $this->addElement($submit); }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'formNotificationsAddSearch', 'class' => '')); $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART); // BEGIN: nume text $subject = new Zend_Form_Element_Text('subject'); $subject->setAttribs(array('class' => 'text large', 'placeholder' => 'Subiect')); $subject->setRequired(false); $this->addElement($subject); // END: nume text // BEGIN: nume text $message = new Zend_Form_Element_Text('message'); $message->setAttribs(array('class' => 'text large', 'placeholder' => 'Mesaj')); $message->setRequired(false); $this->addElement($message); // END: nume text $search = new Zend_Form_Element_Submit('searchNotifications'); $search->setValue('Cauta'); $search->setAttribs(array('class' => 'submit')); $search->setIgnore(true); $this->addElement($search); }
function init() { $this->setMethod('post'); $this->addAttribs(array('id' => 'formTemplateAdd', 'class' => '')); $formNumber = new Zend_Form_Element_Hidden('formNumber'); $this->addElement($formNumber); $const = new Zend_Form_Element_Hidden('const'); $this->addElement($const); $subject = new Zend_Form_Element_Text('subject'); $subject->setLabel(Zend_Registry::get('translate')->_('admin_email_templates_subject')); $subject->setAttribs(array('class' => 'text large validate[required]')); $subject->setRequired(true); $this->addElement($subject); $content = new Zend_Form_Element_Textarea('content'); $content->setLabel(Zend_Registry::get('translate')->_('admin_email_templates_content')); $content->setAttribs(array('class' => 'text large validate[required]')); $content->setRequired(true); $this->addElement($content); $submit = new Zend_Form_Element_Submit('submit'); $submit->setValue(''); $submit->setAttribs(array('class' => 'submit')); $submit->setIgnore(true); $this->addElement($submit); }
public function Search() { $nameElement = new Zend_Form_Element_Text('Name'); //$nameElement ->setAttribs(array('Name'=>'Name')); $this->addElement($nameElement); $contactElement = new Zend_Form_Element_Text('Contact'); //$contactElement->setAdttribs(array('Contact'=>'Contact')); $this->addElement($contactElement); $phoneElement = new Zend_Form_Element_Text('phone'); //$phoneElement->setAdttribs(array('phone'=>'phone')); $this->addElement($phoneElement); $refreshElement = new Zend_Form_Element_Submit('Refresh'); $refreshElement->setAttribs(array('Phone' => 'Phone')); $this->addElement($refreshElement); return $this; }
function init() { // Set the method for the display form to POST $this->setMethod('post'); $this->setAction(WEBROOT . 'statistics'); $this->addAttribs(array('id' => 'filterComplexForm', 'class' => '')); $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART); //BEGIN:Id Category Expenses $idCategoryE = new Zend_Form_Element_Multiselect('idCategoryE'); $options = array('1' => strtoupper(Zend_Registry::get('translate')->_('admin_expenses'))); $categories = new Default_Model_Groups(); $select = $categories->getMapper()->getDbTable()->select()->where('NOT deleted')->where('type=?', 0)->order('name ASC'); $result = $categories->fetchAll($select); if (NULL != $result) { foreach ($result as $value) { $options[$value->getId()] = $value->getName(); } } $idCategoryE->setMultiOptions($options); $idCategoryE->addValidator(new Zend_Validate_InArray(array_keys($options))); $idCategoryE->setAttribs(array('class' => 'rightAdd form_selector', 'id' => 'idCategoryE')); $idCategoryE->setRequired(false); $this->addElement($idCategoryE); //END:Id Category Expenses //BEGIN:Id Category Income $idCategoryI = new Zend_Form_Element_Multiselect('idCategoryI'); $options = array('2' => strtoupper(Zend_Registry::get('translate')->_('admin_income'))); $categories = new Default_Model_Groups(); $select = $categories->getMapper()->getDbTable()->select()->where('NOT deleted')->where('type=?', 1)->order('name ASC'); $result = $categories->fetchAll($select); if (NULL != $result) { foreach ($result as $value) { $options[$value->getId()] = " " . $value->getName(); } } $idCategoryI->setMultiOptions($options); $idCategoryI->addValidator(new Zend_Validate_InArray(array_keys($options))); $idCategoryI->setAttribs(array('class' => 'rightAdd form_selector', 'id' => 'idCategoryI')); $idCategoryI->setRequired(false); $this->addElement($idCategoryI); //END:Id Category Income //BEGIN:Timeframe $timeframe = new Zend_Form_Element_Select('timeframe'); $options = array('m' => Zend_Registry::get('translate')->_('admin_monthly'), 'w' => Zend_Registry::get('translate')->_('admin_weekly'), 'd' => Zend_Registry::get('translate')->_('admin_daily')); $timeframe->setMultiOptions($options); $timeframe->addValidator(new Zend_Validate_InArray(array_keys($options))); $timeframe->setAttribs(array('class' => 'rightAdd validate[required] form_selector', 'id' => 'timeframe')); $timeframe->setRequired(true); $timeframe->setValue('m'); $this->addElement($timeframe); //END:Timeframe // BEGIN: data $dataStart = new Zend_Form_Element_Text('dataStartC'); $dataStart->setAttribs(array('class' => 'data_inceput_c validate[required]', 'placeholder' => Zend_Registry::get('translate')->_('admin_from_date'))); $dataStart->setRequired(true); $this->addElement($dataStart); $dataEnd = new Zend_Form_Element_Text('dataEndC'); $dataEnd->setAttribs(array('class' => 'data_sfarsit_c validate[required]', 'placeholder' => Zend_Registry::get('translate')->_('admin_to_date'))); $this->addElement($dataEnd); // END: data $submit = new Zend_Form_Element_Submit('submitC'); $submit->setValue(Zend_Registry::get('translate')->_('admin_menu_form_search')); $submit->setAttribs(array('class' => 'submit')); $submit->setRequired(true); $this->addElement($submit); $submitReportE = new Zend_Form_Element_Submit('submitReportE'); $submitReportE->setAttribs(array('class' => 'submitReport')); $submitReportE->setRequired(true); $this->addElement($submitReportE); $submitReportI = new Zend_Form_Element_Submit('submitReportI'); $submitReportI->setAttribs(array('class' => 'submitReport')); $submitReportI->setRequired(true); $this->addElement($submitReportI); }
public function PurchaseOrder($data = null) { $tr = Application_Form_FrmLanguages::getCurrentlanguage(); $request = Zend_Controller_Front::getInstance()->getRequest(); $db = new Application_Model_DbTable_DbGlobal(); $paymentElement = new Zend_Form_Element_Submit('payment'); $paymentElement->setAttribs(array('Phone' => 'Phone')); $this->addElement($paymentElement); $rs = $db->getGlobalDb('SELECT customer_id, cust_name FROM tb_customer WHERE cust_name!="" AND is_active=1 '); $customerValue = $request->getParam('users'); $options = ""; $options = array('' => $tr->translate('Please_Select'), '-1' => $tr->translate('ADD_CUSTOMER_ORDER')); if (!empty($rs)) { foreach ($rs as $read) { $options[$read['customer_id']] = $read['cust_name']; } } $customerID = new Zend_Form_Element_Select('customer_id'); $customerID->setAttribs(array('id' => 'customer_id', 'Onchange' => 'getCustomerInfo()', 'class' => 'validate[required]')); $customerID->setMultiOptions($options); //$customerID->setattribs(array(id'=>'customer_id','onchange'=>'this.form.submit()',)); $customerID->setValue($customerValue); $this->addElement($customerID); $orderElement = new Zend_Form_Element_Text('order'); $orderElement->setAttribs(array('placeholder' => 'Optional')); $this->addElement($orderElement); $phoneElement = new Zend_Form_Element_Text('txt_phone'); $phoneElement->setAttribs(array('placeholder' => 'Enter Contact Number')); $this->addElement($phoneElement); $user = $this->GetuserInfo(); $options = ""; $sql = "SELECT LocationId, Name FROM tb_sublocation WHERE Name!='' AND status = 1 "; if ($user["level"] == 1 or $user["level"] == 2) { $options = array("1" => $tr->translate("Please_Select"), "-1" => $tr->translate("ADD_NEW_LOCATION")); } else { $sql .= " ANd LocationId = " . $user["location_id"]; } $sql .= " ORDER BY LocationId DESC"; $rs = $db->getGlobalDb($sql); $productValue = $request->getParam('LocationId'); if (!empty($rs)) { foreach ($rs as $read) { $options[$read['LocationId']] = $read['Name']; } } $locationID = new Zend_Form_Element_Select('LocationId'); $locationID->setAttribs(array('id' => 'LocationId', 'Onchange' => 'AddLocation()', 'class' => 'validate[required]')); $locationID->setMultiOptions($options); $locationID->setValue($productValue); $this->addElement($locationID); $rowsmethodpay = $db->getGlobalDb('SELECT * FROM tb_paymentmethod'); if ($rowsmethodpay) { foreach ($rowsmethodpay as $readCategory) { $option_method[$readCategory['payment_typeId']] = $readCategory['payment_name']; } } $paymentmethodElement = new Zend_Form_Element_Select('payment_name'); $paymentmethodElement->setMultiOptions($option_method); $this->addElement($paymentmethodElement); $rowsPayment = $db->getGlobalDb('SELECT CurrencyId, Description,Symbol FROM tb_currency'); if ($rowsPayment) { foreach ($rowsPayment as $readPayment) { $options_curr[$readPayment['CurrencyId']] = $readPayment['Description'] . $readPayment['Symbol']; } } $currencyElement = new Zend_Form_Element_Select('currency'); $currencyElement->setMultiOptions($options_curr); $this->addElement($currencyElement); $descriptionElement = new Zend_Form_Element_Textarea('remark'); $this->addElement($descriptionElement); $remarkaddElement = new Zend_Form_Element_Textarea('remark_add'); $this->addElement($remarkaddElement); $allTotalElement = new Zend_Form_Element_Text('all_total'); $allTotalElement->setAttribs(array('readonly' => 'readonly')); $this->addElement($allTotalElement); $discountTypeElement = new Zend_Form_Element_Radio('discount_type'); $discountTypeElement->setMultiOptions(array(1 => '%', 2 => 'Fix Value')); $discountTypeElement->setAttribs(array('checked' => 'checked')); $discountTypeElement->setAttribs(array('onChange' => 'doTotal()')); $this->addElement($discountTypeElement); $netTotalElement = new Zend_Form_Element_Text('net_total'); $netTotalElement->setAttribs(array('readonly' => 'readonly')); $this->addElement($netTotalElement); $discountValueElement = new Zend_Form_Element_Text('discount_value'); $discountValueElement->setAttribs(array('class' => 'input100px', 'onChange' => 'doTotal()')); $this->addElement($discountValueElement); $discountRealElement = new Zend_Form_Element_Text('discount_real'); $discountRealElement->setAttribs(array('readonly' => 'readonly', 'class' => 'input100px')); $this->addElement($discountRealElement); $discountValueElement = new Zend_Form_Element_Text('discount_value'); $discountValueElement->setAttribs(array('class' => 'input100px', 'onChange' => 'doTotal()')); $this->addElement($discountValueElement); $paidRealElement = new Zend_Form_Element_Text('paid'); $paidRealElement->setAttribs(array('class' => 'input100px', 'onChange' => 'Total1()')); $this->addElement($paidRealElement); $remainlElement = new Zend_Form_Element_Text('remain'); $remainlElement->setAttribs(array('readonly' => 'readonly')); $this->addElement($remainlElement); $statusElement = new Zend_Form_Element_Select('status'); //$statusElement->setAttribs(array('readonly'=>'readonly',)); //$statusElement->setValue("Open"); $opt = array("" => $tr->translate('Please_Select'), 1 => $tr->translate("Qoute"), 2 => $tr->translate("Open"), 3 => $tr->translate("In Progress"), 5 => $tr->translate("Paid"), 6 => $tr->translate("Cancell")); $statusElement->setMultiOptions($opt); $this->addElement($statusElement); $statusquoteElement = new Zend_Form_Element_Text('quote'); $statusquoteElement->setAttribs(array('readonly' => 'readonly')); $statusquoteElement->setValue("Quote"); $this->addElement($statusquoteElement); $date = new Zend_Date(); $dateOrderElement = new Zend_Form_Element_Text('order_date'); $dateOrderElement->setAttribs(array('placeholder' => 'Click To Choose Date', 'class' => 'validate[required]')); $dateOrderElement->setValue($date->get('YYYY-MM-dd')); $this->addElement($dateOrderElement); $contactElement = new Zend_Form_Element_Text('contact'); $contactElement->setAttribs(array('placeholder' => 'Enter Contace Name')); $this->addElement($contactElement); $addressElement = new Zend_Form_Element_Text('address'); $this->addElement($addressElement); $termElement = new Zend_Form_Element_Text('term'); $termElement->setAttribs(array('class' => 'validate[required]')); $this->addElement($termElement); $branchElement = new Zend_Form_Element_Text('branch'); $branchElement->setAttribs(array('class' => 'validate[required]')); $this->addElement($branchElement); $orderidElement = new Zend_Form_Element_Text('orderid'); $this->addElement($orderidElement); $dateElement = new Zend_Form_Element_Text('date'); $this->addElement($dateElement); // $salesElement = new Zend_Form_Element_Text('sales_ref'); // $this->addElement($salesElement); // $rowsagent= $db->getGlobalDb('SELECT agent_id,name FROM tb_sale_agent ORDER BY agent_id DESC'); // $option_agent=array(''=>'Please Select','-1'=>'Add New Sale Agent'); // if($rowsagent) { // foreach($rowsagent as $read_agent) $option_agent[$read_agent['agent_id']]=$read_agent['name']; // } // $sales_agentElement = new Zend_Form_Element_Select('sales_ref'); // $sales_agentElement->setMultiOptions($option_agent); // $sales_agentElement->setAttribs(array('Onchange'=>'showAgentPopup()')); // $this->addElement($sales_agentElement); $option = ""; $sql = "SELECT agent_id,name FROM tb_sale_agent WHERE name!='' "; $option = array("" => $tr->translate("Please_Select"), "-1" => $tr->translate("Add_New_Sale_Agent")); if ($user["level"] == 1 or $user["level"] == 2) { //$option=array(""=>"Please Select","-1"=>"Add New Sale Agent"); } else { //$option=array(""=>"Please Select"); //$sql.=" AND agent_id =".$user["location_id"]; } $sql .= " ORDER BY agent_id DESC"; $rs = $db->getGlobalDb($sql); $agent_value = $request->getParam('sales_ref'); if (!empty($rs)) { foreach ($rs as $read) { $option[$read['agent_id']] = $read['name']; } } $sales_agentId = new Zend_Form_Element_Select('sales_ref'); $sales_agentId->setAttribs(array('class' => 'validate[required]', 'id' => 'sales_ref', 'Onchange' => 'showAgentPopup()')); $sales_agentId->setMultiOptions($option); $sales_agentId->setValue($agent_value); $this->addElement($sales_agentId); $reqDateElement = new Zend_Form_Element_Text('rs-date'); $this->addElement($reqDateElement); $remarkElement = new Zend_Form_Element_Textarea('remark'); $this->addElement($remarkElement); $type_tax1Element = new Zend_Form_Element_Text('type-tax1'); $this->addElement($type_tax1Element); $type_tax2Element = new Zend_Form_Element_Text('type-tax2'); $this->addElement($type_tax2Element); $totalElement = new Zend_Form_Element_Text('total'); $this->addElement($totalElement); $paidElement = new Zend_Form_Element_Text('paid'); $paidElement->setAttribs(array('onChange' => 'doRemain()')); $this->addElement($paidElement); $historyElement = new Zend_Form_Element_Text('history_id'); $this->addElement($historyElement); Application_Form_DateTimePicker::addDateField(array('order_date', 'offer_date', 'paid_date')); if ($data != null) { $idElement = new Zend_Form_Element_Hidden('id'); $this->addElement($idElement); $idElement->setValue($data["order_id"]); $oldlocationIdElement = new Zend_Form_Element_Hidden('old_location'); $this->addElement($oldlocationIdElement); $oldStatusElement = new Zend_Form_Element_Hidden('oldStatus'); $this->addElement($oldStatusElement); $customerID->setValue($data["customer_id"]); $contactElement->setValue($data['contact_name']); $phoneElement->setValue($data['phone']); $remarkaddElement->setValue($data['add_name']); if ($data["status"] == 1) { $statusElement->setValue("Quote"); } elseif ($data["status"] == 2) { $statusElement->setValue("Open"); } elseif ($data["status"] == 3) { $statusElement->setValue("In Progress"); } elseif ($data["status"] == 4) { $statusElement->setValue("Paid"); } else { $statusElement->setValue("Cancel"); } //$idElement->setValue($data['id']); $oldStatusElement->setValue($data['status']); $sales_agentId->setValue($data['sales_ref']); $locationID->setvalue($data['LocationId']); $oldlocationIdElement->setvalue($data['LocationId']); $dateOrderElement->setValue($data["date_order"]); $orderElement->setAttribs(array("readonly" => "readonly")); $orderElement->setValue($data['order']); $paymentmethodElement->setValue($data['payment_method']); $currencyElement->setValue($data['currency_id']); $remarkElement->setValue($data["remark"]); $paidElement->setValue($data['paid']); $remainlElement->setvalue($data['balance']); $allTotalElement->setValue($data['all_total']); $discountValueElement->setValue($data['discount_value']); $netTotalElement->setValue($data['net_total']); } else { $discountTypeElement->setValue(1); } return $this; }