public function init()
 {
     //$this->setAction('/administrador/confirmarventa');
     $this->clearDecorators();
     $this->addDecorator('FormElements')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => ''))->addDecorator('Form');
     $this->setElementDecorators(array(array('ViewHelper'), array('Errors'), array('Label', array('separator' => ' ')), array('HtmlTag', array('tag' => 'p', 'class' => 'element-group'))));
     $clientes = new Application_Model_DbTable_Usuarios();
     $this->addElement('select', 'cliente', array());
     $this->cliente->addmultiOptions($clientes->select_clientes());
     $this->addElement('text', 'puntos', array('readonly' => 'Readonly'));
     $cliente = $clientes->traerdatosclientes();
     foreach ($cliente as $valor) {
         $id_primer_cliente = $valor->id_usuario;
         break;
     }
     $modeloModel = new Application_Model_DbTable_Usuarios();
     $rowset = $modeloModel->getAsKeyValue($id_primer_cliente);
     $this->puntos->setValue($rowset);
     $descuento = new Zend_form_element_text('descuento');
     $this->addElement($descuento);
     $validatorDigit = new Zend_Validate_Digits();
     $this->descuento->addValidator($validatorDigit);
     $this->descuento->setErrorMessages(array('messages' => 'El campo nombre solo puede contener Numeros'));
     $this->addElement('textarea', 'observacion', array());
     $this->addElement('text', 'mesa', array('required' => true, 'filters' => array('StringToLower')));
     $this->mesa->addValidator($validatorDigit);
     $this->mesa->setErrorMessages(array('messages' => 'El campo nombre solo puede contener Numeros'));
     $this->addElement('submit', 'Agregar', array('ignore' => true, 'decorators' => array(array('ViewHelper'), array('HtmlTag', array('tag' => 'div')))));
 }
 public function init()
 {
     $this->setAction('/administrador/clienteventa');
     $this->setMethod('POST');
     $this->clearDecorators();
     $this->addDecorator('FormElements')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'div_form'))->addDecorator('Form');
     $this->setElementDecorators(array(array('ViewHelper'), array('Errors'), array('Label', array('separator' => ' ')), array('HtmlTag', array('tag' => 'p', 'class' => 'element-group'))));
     $clientes = new Application_Model_DbTable_Usuarios();
     $this->addElement('select', 'cliente', array('Label' => 'Seleccione Cliente'));
     $this->cliente->addmultiOptions($clientes->select_clientes());
     $this->addElement('submit', 'Buscar', array('ignore' => true, 'decorators' => array(array('ViewHelper'), array('HtmlTag', array('tag' => 'div')))));
 }
 public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     $this->clearDecorators();
     $this->addDecorator('FormElements')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'div_form'))->addDecorator('Form');
     $this->setElementDecorators(array(array('ViewHelper'), array('Errors'), array('Label', array('separator' => ' ')), array('HtmlTag', array('tag' => 'p', 'class' => 'element-group'))));
     $reportes = array('Clientes' => array('1' => 'Ventas por Cliente', '2' => 'Usuario mas Activo Ventas', '6' => 'Usuario mas Activo Publicaciones'), 'Productos' => array('3' => '10 Prod. mas Vendidos', '4' => '10 Prod. menos Vendidos'), 'Publicaciones' => array('5' => 'Publicaciones mas Comentadas'));
     $this->addElement('select', 'tipo', array('required' => true, 'multioptions' => $reportes));
     $clientes = new Application_Model_DbTable_Usuarios();
     $this->addElement('select', 'cliente', array('multiOptions' => array('0' => 'Todos')));
     $this->cliente->addmultiOptions($clientes->select_clientes());
     $this->addElement('text', 'from');
     $this->addElement('text', 'to');
     $this->addElement('submit', 'Ejecutar', array('ignore' => true, 'decorators' => array(array('ViewHelper'), array('HtmlTag', array('tag' => 'p', 'class' => 'submit-group')))));
 }