public function init() { /* Form Elements & Other Definitions Here ... */ $this->setName('nome'); $this->setAttrib('enctype', 'multipart/form-data'); $ID_OPERADOR = new Zend_Form_Element_Hidden('ID_OPERADOR'); $ID_OPERADOR->addFilter('Int'); $NM_OPERADOR = new Zend_Form_Element_Text('NM_OPERADOR'); $NM_OPERADOR->setLabel('NOME')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter nome'); $DS_TELEFONE_PESSOAL = new Zend_Form_Element_Text('DS_TELEFONE_PESSOAL'); $DS_TELEFONE_PESSOAL->setLabel('TELEFONE PESSOAL')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter telefone pessoal'); $DS_TELEFONE_BIOS = new Zend_Form_Element_Text('DS_TELEFONE_BIOS'); $DS_TELEFONE_BIOS->setLabel('TELEFONE BIOS')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter telefone bios'); $DS_EMAIL_PESSOAL = new Zend_Form_Element_Text('DS_EMAIL_PESSOAL'); $DS_EMAIL_PESSOAL->setLabel('E-MAIL PESSOAL')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter e-mail pessoal'); $DS_EMAIL_BIOS = new Zend_Form_Element_Text('DS_EMAIL_BIOS'); $DS_EMAIL_BIOS->setLabel('E-MAIL BIOS')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter e-mail bios'); $DS_ENDERECO = new Zend_Form_Element_Text('DS_ENDERECO'); $DS_ENDERECO->setLabel('ENDEREÇO')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter endereco'); $DS_BAIRRO = new Zend_Form_Element_Text('DS_BAIRRO'); $DS_BAIRRO->setLabel('BAIRRO')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter bairro'); $NR_CEP = new Zend_Form_Element_Text('NR_CEP'); $NR_CEP->setLabel('CEP')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter cep'); $NR_CPF = new Zend_Form_Element_Text('NR_CPF'); $NR_CPF->setLabel('CPF')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter cpf'); $NR_IDENTIDADE = new Zend_Form_Element_Text('NR_IDENTIDADE'); $NR_IDENTIDADE->setLabel('Nº IDENTIDADE')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter nº identidade'); $DT_NASCIMENTO = new Zend_Form_Element_Text('DT_NASCIMENTO'); $DT_NASCIMENTO->setLabel('DATA NASCIMENTO')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter data nascimento'); $DS_REGISTRO_PROFISSIONAL = new Zend_Form_Element_Text('DS_REGISTRO_PROFISSIONAL'); $DS_REGISTRO_PROFISSIONAL->setLabel('REGISTRO PROFISSIONAL')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter data registro profissional'); $DS_CTF_IBAM = new Zend_Form_Element_Text('DS_CTF_IBAM'); $DS_CTF_IBAM->setLabel('CTF IBAMA')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter ctf ibama'); $DS_SKYPE = new Zend_Form_Element_Text('DS_SKYPE'); $DS_SKYPE->setLabel('SKYPE')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter skype'); $DS_LOGIN = new Zend_Form_Element_Text('DS_LOGIN'); $DS_LOGIN->setLabel('LOGIN')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter skype'); $DS_SENHA = new Zend_Form_Element_Password('DS_SENHA'); $DS_SENHA->setLabel('SENHA')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter senha'); $REPETIR_SENHA = new Zend_Form_Element_Password('REPETIR_SENHA'); $REPETIR_SENHA->setLabel('REPETIR SENHA')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter repetir senha'); $NM_CONTATO_FAMILIAR = new Zend_Form_Element_Text('NM_CONTATO_FAMILIAR'); $NM_CONTATO_FAMILIAR->setLabel('NOME CONTATO FAMILIAR')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter nome contato familiar'); $NR_TELEFONE_CONTATO_FAMILIAR = new Zend_Form_Element_Text('NR_TELEFONE_CONTATO_FAMILIAR'); $NR_TELEFONE_CONTATO_FAMILIAR->setLabel('Nº TELEFONE CONTATO FAMILIAR')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter n� telefone contato familiar'); $FK_PERFIL = new Zend_Form_Element_Select('FK_PERFIL'); $perfil = new Application_Model_DbTable_Perfil(); $FK_PERFIL->setLabel('Perfil'); $FK_PERFIL->setMultiOptions($perfil->getPerfil())->setRequired(true)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control select2'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel("Adiconar"); $submit->setAttrib('id', 'submitbutton'); $submit->removeDecorator('DtDdWrapper')->setAttrib('class', 'btn btn-primary button')->removeDecorator('HtmlTag')->removeDecorator('Label'); $this->addElements(array($ID_OPERADOR, $NM_OPERADOR, $DS_TELEFONE_PESSOAL, $DS_TELEFONE_BIOS, $DS_EMAIL_PESSOAL, $DS_EMAIL_BIOS, $DS_ENDERECO, $DS_BAIRRO, $NR_CEP, $NR_CPF, $NR_IDENTIDADE, $DT_NASCIMENTO, $DS_REGISTRO_PROFISSIONAL, $DS_CTF_IBAM, $DS_SKYPE, $DS_LOGIN, $DS_SENHA, $REPETIR_SENHA, $NM_CONTATO_FAMILIAR, $NR_TELEFONE_CONTATO_FAMILIAR, $FK_PERFIL, $submit)); // $this->addElements(array($id, $nome, $email,$senha, $submit)); $this->setDecorators(array(array('ViewScript', array('viewScript' => '/forms/formularioOperador.phtml')))); }
public function init() { $this->setName('usuario')->setAttrib('class', 'form-horizontal'); $usu_id_usuario = new Zend_Form_Element_Hidden('usu_id_usuario'); $usu_id_usuario->addFilter('Int'); $usu_nombre = new Zend_Form_Element_Text('usu_nombre'); $usu_nombre->setAttrib('placeholder', 'Nombres')->setLabel('Nombres:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $usu_apellido_1 = new Zend_Form_Element_Text('usu_apellido_1'); $usu_apellido_1->setAttrib('placeholder', 'Apellido Paterno')->setLabel('Apellido Paterno:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $usu_apellido_2 = new Zend_Form_Element_Text('usu_apellido_2'); $usu_apellido_2->setAttrib('placeholder', 'Apellido Materno')->setLabel('Apellido Materno:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $usu_rut = new Zend_Form_Element_Text('usu_rut'); $usu_rut->setAttrib('placeholder', 'RUT')->setLabel('RUT:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $usu_fono_1 = new Zend_Form_Element_Text('usu_fono_1'); $usu_fono_1->setAttrib('placeholder', 'Teléfono Móvil')->setLabel('Teléfono Móvil:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $usu_fono_2 = new Zend_Form_Element_Text('usu_fono_2'); $usu_fono_2->setAttrib('placeholder', 'Teléfono Fijo')->setLabel('Teléfono Fijo:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $usu_direccion = new Zend_Form_Element_Text('usu_direccion'); $usu_direccion->setAttrib('placeholder', 'Dirección')->setLabel('Dirección:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $usu_ciudad = new Zend_Form_Element_Text('usu_ciudad'); $usu_ciudad->setAttrib('placeholder', 'Ciudad')->setLabel('Ciudad:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $usu_porcentaje_comision = new Zend_Form_Element_Select('usu_porcentaje_comision'); $usu_porcentaje_comision->setLabel('Pctje. de comisión:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $usu_porcentaje_comision->addMultiOption("0", "0%"); $usu_porcentaje_comision->addMultiOption("3", "3%"); $usu_porcentaje_comision->addMultiOption("5", "5%"); $per_id_perfil = new Zend_Form_Element_Multiselect('per_id_perfil'); $per_id_perfil->setLabel('Perfil(es) de usuario:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('multiple', 'multiple'); $filaPerfil = new Application_Model_DbTable_Perfil(); foreach ($filaPerfil->fetchAll() as $per) { $per_id_perfil->addMultiOption($per->per_id_perfil, $per->per_nombre); } $usu_password = new Zend_Form_Element_Password('usu_password'); $usu_password->setAttrib('placeholder', 'Password')->setLabel('Password:'******'StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $usu_password_2 = new Zend_Form_Element_Password('usu_password_2'); $usu_password_2->setAttrib('placeholder', 'Reingrese el Password')->setLabel('Password (2):')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); $usu_password_2->addValidator('Identical', false, array('token' => 'usu_password')); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $this->addElements(array($usu_id_usuario, $usu_rut, $usu_nombre, $usu_apellido_1, $usu_apellido_2, $usu_fono_1, $usu_fono_2, $usu_direccion, $usu_ciudad, $usu_password, $usu_password_2, $per_id_perfil, $usu_porcentaje_comision, $submit)); //************* contacto $this->addDisplayGroup(array('usu_nombre', 'usu_apellido_1', 'usu_apellido_2', 'usu_fono_1', 'usu_fono_2', 'usu_direccion', 'usu_ciudad'), 'personal'); $personal = $this->getDisplayGroup('personal'); $personal->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'div', 'class' => 'span4')))); //************* sistema $this->addDisplayGroup(array('usu_rut', 'usu_password', 'usu_password_2', 'per_id_perfil', 'usu_porcentaje_comision'), 'sistema'); $sistema = $this->getDisplayGroup('sistema'); $sistema->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'div', 'class' => 'span4')))); }
public function init() { /* Form Elements & Other Definitions Here ... */ $this->setName('nome'); $this->setAttrib('enctype', 'multipart/form-data'); $id = new Zend_Form_Element_Hidden('id_usuario'); $id->addFilter('Int'); $jobrole = new Zend_Form_Element_Text('jobrole'); $jobrole->setLabel('Jobrole')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addFilter('StripTags')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Jobrole')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label'); $cellphone = new Zend_Form_Element_Text('cellphone'); $cellphone->setLabel('Cellphone')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Cellphone')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label'); $nome = new Zend_Form_Element_Text('nome'); $nome->setLabel('Nome')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Nome')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label'); $email = new Zend_Form_Element_Text('email'); $email->setLabel('Email')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('EmailAddress')->addValidator('NotEmpty')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Email')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label'); $login = new Zend_Form_Element_Text('login'); $login->setLabel('Login')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Login')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label'); $senha = new Zend_Form_Element_Password('senha'); $senha->setLabel('Senha')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Senha')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label'); $repetirSenha = new Zend_Form_Element_Password('repetirSenha'); $repetirSenha->setLabel('Repetir senha')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Repetir senha')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label'); $fk_perfil = new Zend_Form_Element_Select('fk_perfil'); $perfil = new Application_Model_DbTable_Perfil(); $fk_perfil->setLabel('Perfil'); $fk_perfil->setMultiOptions($perfil->getPerfil())->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control select2'); /* $fk_arquivo= new Zend_Form_Element_File('fk_arquivo'); $fk_arquivo->setLabel('Arquivo') ->addValidator('Extension', false, array('jpg', 'png', 'gif')) ->addValidator('Size', false, 102400) ->setDestination(BASE_PATH . '/upload'); Zend_Registry::get('logger')->log(BASE_PATH . '/upload', Zend_Log::INFO); */ $element = new Zend_Form_Element_File('fileUpload'); $element->setLabel('Arquivo')->addValidator('Extension', false, array('jpg', 'png', 'gif'))->addValidator('Size', false, 102400)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel("Adiconar"); $submit->setAttrib('id', 'submitbutton'); $submit->removeDecorator('DtDdWrapper')->setAttrib('class', 'btn btn-primary button')->removeDecorator('HtmlTag')->removeDecorator('Label'); $this->addElements(array($id, $nome, $email, $login, $senha, $repetirSenha, $fk_perfil, $element, $submit)); // $this->addElements(array($id, $nome, $email,$senha, $submit)); $this->setDecorators(array(array('ViewScript', array('viewScript' => '/forms/formularioUsuario.phtml')))); }
public function getPerfil() { $perfil = new Application_Model_DbTable_Perfil(); return $perfil->getAdapter()->fetchPairs($perfil->select()->from('perfil', array('id_perfil', 'nome'))->order('nome')); }