public function init()
 {
     // profissional_beleza_nome
     $profissional_beleza_nome = new Zend_Form_Element_Text("profissional_beleza_nome");
     $profissional_beleza_nome->setLabel("Nome: ");
     $profissional_beleza_nome->setAttribs(array('class' => 'form-control'));
     $profissional_beleza_nome->setRequired();
     $profissional_beleza_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // profissional_beleza_email
     $profissional_beleza_email = new Zend_Form_Element_Text("profissional_beleza_email");
     $profissional_beleza_email->setLabel("E-mail: ");
     $profissional_beleza_email->setValidators(array('EmailAddress'));
     $profissional_beleza_email->addValidator(new App_Validate_ProfissionalBeleza());
     $profissional_beleza_email->setAttribs(array('class' => 'form-control'));
     $profissional_beleza_email->setRequired();
     $profissional_beleza_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     /**
      * profisional_beleza_sexo
      */
     $profissional_beleza_sexo = new Zend_Form_Element_Radio("profissional_beleza_sexo");
     $profissional_beleza_sexo->setLabel("Sexo:");
     $profissional_beleza_sexo->setRequired();
     $profissional_beleza_sexo->setDecorators(App_Forms_Decorators::$checkboxElementDecorators);
     $profissional_beleza_sexo->setMultiOptions(array('M' => ' Masculino', 'F' => ' Feminino'));
     // profissional_beleza_avatar
     $profissional_beleza_avatar = new Zend_Form_Element_File("profissional_beleza_avatar");
     $profissional_beleza_avatar->setLabel(" \n            Foto: \n        ");
     $profissional_beleza_avatar->addDecorators(App_Forms_Decorators::$ElementDecoratorFile);
     $profissional_beleza_avatar->setAttribs(array('class' => 'filestyle', 'data-buttonText' => 'Selecione a foto', 'data-iconName' => 'fa fa-user'));
     $profissional_beleza_avatar->setRequired();
     $profissional_beleza_avatar->setDestination(Zend_Registry::get('config')->profissional->avatar->path);
     $profissional_beleza_avatar->addValidators(array(array('Extension', false, 'jpg,jpeg,png')));
     $profissional_beleza_avatar->addFilter(new Skoch_Filter_File_Resize(array('width' => 160, 'keepRatio' => true)));
     // especialidade_id
     $especialidade_id = new Zend_Form_Element_MultiCheckbox("especialidade_id");
     $especialidade_id->setLabel("Selecione as especialidades: ");
     $especialidade_id->setAttribs(array('class' => ''));
     $especialidade_id->setRequired();
     $especialidade_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators);
     $especialidade_id->setSeparator(' ');
     $especialidade_id->setMultiOptions($this->getEspecialidades());
     // addElements
     $this->addElements(array($profissional_beleza_nome, $profissional_beleza_email, $profissional_beleza_sexo, $profissional_beleza_avatar, $especialidade_id));
     parent::init();
 }
 public function productDetailReport($data = null)
 {
     $db = new Application_Model_DbTable_DbGlobal();
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $tr = Application_Form_FrmLanguages::getCurrentlanguage();
     $location = $data["LocationId"];
     $brand = $data["branch_id"];
     $category = $data["category_id"];
     //     	$item = new report_Model_DbQuery();
     //     	$rs = $item->getItem($data);
     //     	$a= count($rs);
     //print_r($rs);exit();
     $rs = $db->getGlobalDb('SELECT pro_id, item_name,item_code FROM tb_product WHERE item_name!="" ORDER BY item_name ');
     $options = array('' => $tr->translate('Select_Products'));
     foreach ($rs as $read) {
         $options[$read['pro_id']] = $read['item_code'] . " " . $read['item_name'];
     }
     $pro_id = new Zend_Form_Element_Select('item');
     $pro_id->setMultiOptions($options);
     $proValue = $request->getParam('item');
     $pro_id->setAttribs(array('id' => 'item'));
     $pro_id->setValue($proValue);
     $this->addElement($pro_id);
     $reportTypeElement = new Zend_Form_Element_Select("report_type");
     $opt = array("" => $tr->translate('REPORT_TYPE'), 1 => "All Report", 2 => "Purchase Report", 3 => "Sales Report", 4 => "Transfer Report", 5 => "Poduct Information Report", 6 => "Customize Report");
     $reportTypeElement->setMultiOptions($opt);
     $reportTypeElement->setAttribs(array('onChange' => 'report()'));
     $reportTypeValue = $request->getParam('report_type');
     $reportTypeElement->setValue($reportTypeValue);
     $this->addElement($reportTypeElement);
     $check = new Zend_Form_Element_MultiCheckbox("report_num");
     $check->setAttribs(array("class" => "validate[required]"));
     $opt_check = array(1 => 'Purchase Report', 2 => 'Sales Report', 3 => 'Transfer Report', 4 => 'Poduct Information Report');
     $check->setMultiOptions($opt_check);
     $check_value = $request->getParam("report_num");
     $check->setValue($check_value);
     $this->addElement($check);
     $sql = 'SELECT DISTINCT Name,LocationId FROM tb_sublocation WHERE Name!="" AND status=1 ';
     $user = $this->GetuserInfo();
     if ($user["level"] != 1 and $user["level"] != 2) {
         $sql .= " AND LocationId= " . $user["location_id"];
     }
     $rs = $db->getGlobalDb($sql);
     $options = array('' => $tr->translate('Please_Select_Location'));
     $locationValue = $request->getParam('LocationId');
     foreach ($rs as $read) {
         $options[$read['LocationId']] = $read['Name'];
     }
     $location_id = new Zend_Form_Element_Select('LocationId');
     $location_id->setMultiOptions($options);
     $location_id->setAttribs(array('id' => 'LocationId', 'onchange' => 'getProductByLocation();'));
     $location_id->setValue($locationValue);
     $rs = $db->getGlobalDb('SELECT CategoryId, Name FROM tb_category WHERE Name!="" ORDER BY CategoryId');
     $options = array('' => $tr->translate('Please_Select'));
     $cateValue = $request->getParam('category_id');
     foreach ($rs as $read) {
         $options[$read['CategoryId']] = $read['Name'];
     }
     $cate_element = new Zend_Form_Element_Select('category_id');
     $cate_element->setMultiOptions($options);
     $cate_element->setAttribs(array('id' => 'category_id', 'onchange' => 'this.form.submit()'));
     $cate_element->setValue($cateValue);
     $this->addElement($cate_element);
     $rs = $db->getGlobalDb('SELECT branch_id, Name FROM tb_branch WHERE Name!="" ORDER BY branch_id ');
     $options = array('' => $tr->translate('Please_Select'));
     $branchValue = $request->getParam('branch_id');
     foreach ($rs as $read) {
         $options[$read['branch_id']] = $read['Name'];
     }
     $branch_element = new Zend_Form_Element_Select('branch_id');
     $branch_element->setMultiOptions($options);
     $branch_element->setAttribs(array('id' => 'branch_id', 'onchange' => 'getProductByBrand()'));
     $branch_element->setValue($branchValue);
     $this->addElement($branch_element);
     $date = new Zend_Date();
     $startDate = new Zend_Form_Element_Text("start_date");
     $startDatevalue = $request->getParam("start_date");
     //$startDate->setAttribs(array("class"=>"validate[required]"));
     $startDate->setValue($startDatevalue);
     $endDate = new Zend_Form_Element_Text("end_date");
     //$endDate->setValue($date->get("DD-MM-YY"));
     $endDatevalue = $request->getParam("end_date");
     //$endDate->setAttribs(array("class"=>"validate[required]"));
     $endDate->setValue($endDatevalue);
     $this->addElements(array($startDate, $endDate, $location_id));
     Application_Form_DateTimePicker::addDateField(array('start_date', 'end_date'));
     return $this;
 }