Пример #1
0
 public function init()
 {
     parent::init();
     $this->addElement(new Zend_Form_Element_Text('Login', array('required' => true, 'label' => 'Usuario')));
     $this->addElement(new Zend_Form_Element_Password('Password', array('required' => true, 'label' => 'Password')));
     $this->addElement(new Zend_Form_Element_Submit('Ok'));
     $this->setAction('/login');
     $this->setMethod('Post');
 }
Пример #2
0
 public function init()
 {
     parent::init();
     $this->addElement(new Zend_Form_Element_Text('Login', array('required' => true)));
     $this->addElement(new Zend_Form_Element_Password('Password', array('required' => true)));
     $this->addElement(new Zend_Form_Element_Submit('Enviar'));
     $this->setAction('/admin/panel/');
     $this->setMethod('Post');
 }
Пример #3
0
 function init()
 {
     parent::init();
     $this->addElement(new Zend_Form_Element_Hidden('idSubCategoria'));
     $this->addElement(new Zend_Form_Element_Select('categoria', array('label' => 'categoria', 'multioptions' => CST_Utils::fetchPairs(Application_Entity_Categoria::listarCategorias()))));
     $this->addElement(new Zend_Form_Element_Text('nombreSubCategoria', array('label' => 'Nombre:', 'required' => true, 'maxlength' => '200', 'validators' => array('NoRecordExists' => new Zend_Validate_Db_NoRecordExists(array('table' => 'subcategoriaproducto', 'field' => 'NombreSubCategoriaProducto')), 'AlfaNum' => new Zend_Validate_Alnum(true)), 'size' => '40')));
     $this->addElement(new Zend_Form_Element_Radio('flagActivo', array('label' => 'Activar', 'value' => '1', 'multioptions' => array('1' => 'Activo', '0' => 'Desactivo'))));
     $this->addElement(new Zend_Form_Element_Submit('Enviar', array('attribs' => array('class' => 'submit-button'))));
 }
Пример #4
0
 function init()
 {
     parent::init();
     $this->setMethod('Post');
     $this->addElement(new Zend_Form_Element_Text('nombres', array('label' => '* Nombres: ', 'required' => true, 'validators' => array(new Zend_Validate_Alnum(true)), 'maxlength' => '200', 'size' => '40')));
     $this->addElement(new Zend_Form_Element_Text('apellidos', array('label' => '* Apellidos: ', 'required' => true, 'validators' => array(new Zend_Validate_Alnum(true)), 'maxlength' => '200', 'size' => '40')));
     $this->addElement(new Zend_Form_Element_Text('empresa', array('label' => '* Empresa: ', 'required' => true, 'maxlength' => '200', 'size' => '40')));
     $this->addElement(new Zend_Form_Element_Text('telefono', array('label' => '* Teléfono: ', 'maxlength' => '15', 'validators' => array(new Zend_Validate_Regex('/^[(0-9 *)]+$/')), 'required' => true)));
     $this->addElement(new Zend_Form_Element_Text('mail', array('label' => '* Email: ', 'required' => true, 'validators' => array(new Zend_Validate_EmailAddress()), 'maxlength' => '200', 'size' => '40')));
     $this->addElement(new Zend_Form_Element_Textarea('descripcion', array('label' => '* Descripción: ', 'attribs' => array('COLS' => '32', 'ROWS' => '4'), 'required' => true)));
     $this->addElement(new Zend_Form_Element_Submit('Enviar', array('attribs' => array('class' => 'submit-button'))));
 }
Пример #5
0
 function init()
 {
     parent::init();
     $this->addElement(new Zend_Form_Element_Hidden('idMarca'));
     $this->addElement(new Zend_Form_Element_Text('nombreMarca', array('label' => 'Nombre Marca:', 'required' => true, 'maxlength' => '100', 'validators' => array('NoRecordExists' => new Zend_Validate_Db_NoRecordExists(array('table' => 'marca', 'field' => 'NombreMarca')), 'AlfaNum' => new Zend_Validate_Alnum(true)), 'size' => '40')));
     $this->addElement(new Zend_Form_Element_Image('imagenUpload'));
     $element = new Zend_Form_Element_File('imagenMarca');
     $element->setLabel('Upload an image:')->setDestination(APPLICATION_PATH . '/../public/dinamic/img/marca/');
     $element->addValidator('Count', false, 1);
     $element->addValidator('Size', false, 1024000);
     $element->addValidator('Extension', false, 'jpg,png,gif');
     $this->addElement($element);
     $this->addElement(new Zend_Form_Element_Submit('Enviar', array('attribs' => array('class' => 'submit-button'))));
 }
Пример #6
0
 function init()
 {
     parent::init();
     $this->setMethod('Post');
     $this->setAttrib('enctype', 'multipart/form-data');
     $this->addElement(new Zend_Form_Element_Hidden('id'));
     $this->addElement(new Zend_Form_Element_Select('categoria', array('label' => 'categoria', 'multioptions' => CST_Utils::fetchPairs(Application_Entity_CategoriaSolucion::listarCategoriaSolucion()))));
     $this->addElement(new Zend_Form_Element_Text('nombre', array('label' => 'Nombre', 'required' => true, 'validators' => array(new Zend_Validate_Alnum(true)), 'maxlength' => '200', 'size' => '40')));
     $this->addElement(new Zend_Form_Element_Image('imagenUpload'));
     $element = new Zend_Form_Element_File('imagen');
     $element->setLabel('Upload an image:')->setDestination(APPLICATION_PATH . '/../public/dinamic/img/imagen-soluciones/');
     $element->addValidator('Count', false, 1);
     $element->addValidator('Size', false, 102400);
     $element->addValidator('Extension', false, 'jpg,png,gif');
     $this->addElement($element);
     $this->addElement(new Zend_Form_Element_Radio('flagActivo', array('label' => 'Activar', 'value' => '1', 'multioptions' => array('1' => 'Activo', '0' => 'Desactivo'))));
     $this->addElement(new Zend_Form_Element_Textarea('descripcioCorta', array('label' => 'Descripcion Corta', 'required' => true, 'rows' => '10')));
     $this->addElement(new Zend_Form_Element_Textarea('descripcioLarga', array('label' => 'Descripcion Larga', 'required' => true)));
     $this->addElement(new Zend_Form_Element_Submit('Enviar', array('attribs' => array('class' => 'submit-button'))));
 }
Пример #7
0
 public function isValid($data)
 {
     $passwordConfirm = $this->getElement('PasswordConfirm');
     $validator = $passwordConfirm->getValidator('Identical')->setToken($data['Password'])->setMessage('Debe ser igual a la contraseña ingresada', 'notSame');
     return parent::isValid($data);
 }