public function dadosAction() { $this->_helper->layout->disableLayout(); $page = $this->_request->getParam("page", 1); $limit = $this->_request->getParam("rows"); $sidx = $this->_request->getParam("sidx", 1); $sord = $this->_request->getParam("sord"); $roleModel = new RoleModel(); $role = $roleModel->fetchAll(); $count = count($role); if ($count > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0; } if ($page > $total_pages) { $page = $total_pages; } //$role = $roleModel->fetchAll(null, "$sidx $sord", $limit, ($page*$limit-$limit)); $responce = new stdClass(); $responce->page = $page; $responce->total = $total_pages; $responce->records = $count; $i = 0; foreach ($role as $row) { $responce->rows[$i]['cell'] = array($row->cdrole, $row->nmrole); $i++; } $this->view->dados = $responce; }
public function getFormCadastre() { $departmentModel = new DepartmentModel(); $departmentData = $departmentModel->fetchAll($departmentModel->getAllActiveDepartment()); $roleModel = new RoleModel(); $roleData = $roleModel->fetchAll($roleModel->select()); $departmentSupervisorModel = new DepartmentsupervisorModel(); $departmentSupervisorData = $departmentSupervisorModel->fetchAll($departmentSupervisorModel->getAllSupervisor()); $companyModel = new CompanyModel(); $companyData = $companyModel->fetchAll(); $Arraycompany = array(); $Arraycompany['0'] = 'Selecione'; foreach ($companyData as $company) { $Arraycompany[$company->cdcompany] = $company->nmfantasyname; } $this->_nmagenda = new Zend_Form_Element_Text('nmagenda'); $this->_nmagenda->setLabel("Nome da Agenda"); $this->_nmagenda->setRequired(true); $this->_nmagenda->setDecorators($this->_decoratorsRequired); $this->_nmagenda->setAttrib("id", "agenda_nmagendas"); $this->_nmagenda->setAttrib("class", "alpha nameagenda"); $this->_nmagenda->setRequired(true); $this->_cdcompany = new Zend_Form_Element_Select('cdcompany'); $this->_cdcompany->setRegisterInArrayValidator(false); $this->_cdcompany->addMultiOptions($Arraycompany); $this->_cdcompany->setLabel("Empresa"); $this->_cdcompany->setDecorators($this->_decoratorsRequired); $this->_cdcompany->setAttrib("id", "user_cdcompany"); $this->_cdcompany->setAttrib("class", "alpha"); $this->_cdcompany->setRequired(true); $this->_cdphysicallocation = new Zend_Form_Element_Select('cdphysicallocation'); $this->_cdphysicallocation->setRegisterInArrayValidator(false); $this->_cdphysicallocation->setLabel("Localização Física"); $this->_cdphysicallocation->addMultiOptions(array('0' => 'Selecione')); $this->_cdphysicallocation->setDecorators($this->_decoratorsRequired); $this->_cdphysicallocation->setAttrib("id", "company_physicallocation"); $this->_cdphysicallocation->setAttrib("class", "alpha"); $this->_cdphysicallocation->setRequired(true); $this->_gridhours = new Zend_Form_Element_Select('gridhours'); $this->_gridhours->setRegisterInArrayValidator(false); $this->_gridhours->addMultiOptions(array('1' => 'Sim', '2' => 'Não')); $this->_gridhours->setLabel("Grade de Horário"); $this->_gridhours->setDecorators($this->_decoratorsDefault); $this->_gridhours->setAttrib("id", "user_gridhours"); $this->_gridhours->setRequired(false); }
public function __construct() { parent::__construct(); $departmentModel = new DepartmentModel(); $departmentData = $departmentModel->fetchAll($departmentModel->getAllActiveDepartment()); $roleModel = new RoleModel(); $roleData = $roleModel->fetchAll($roleModel->select()); // $departmentSupervisorModel = new DepartmentsupervisorModel(); // $userData = $departmentSupervisorModel->fetchAll($departmentSupervisorModel->getAllSupervisor()); $this->_nmuserimage = new Zend_Form_Element_Hidden('nmuserimage'); $this->_nmuserimage->setDecorators($this->_decoratorsDefaultRight); $this->_nmuserimage->setAttrib("id", "user_nmuserimage"); $this->_cdusergslab = new Zend_Form_Element_Hidden('cdusergslab'); $this->_cdusergslab->setDecorators($this->_decoratorsDefault); $this->_cdusergslab->setAttrib("id", "user_cdusergslab"); $this->_idusergslab = new Zend_Form_Element_Text('idusergslab'); $this->_idusergslab->setLabel("Login"); $this->_idusergslab->setRequired(true); $this->_idusergslab->setDecorators($this->_decoratorsRequired); $this->_idusergslab->setAttrib("id", "user_idusergslab"); $this->_idusergslab->setAttrib("class", "alpha"); $this->_nmpassword = new Zend_Form_Element_Password('nmpassword'); $this->_nmpassword->setLabel("Senha"); $this->_nmpassword->setRequired(true); $this->_nmpassword->setAttrib("id", "user_nmpassword"); $this->_nmpassword->setDecorators($this->_decoratorsRequired); $this->_confirmpassword = new Zend_Form_Element_Password('confirmpassword'); $this->_confirmpassword->setLabel("Confirmar Senha"); $this->_confirmpassword->setRequired(true); $this->_confirmpassword->setAttrib("id", "user_confirmpassword"); $this->_confirmpassword->setDecorators($this->_decoratorsRequired); $this->_idemployeeregister = new Zend_Form_Element_Text('idemployeeregister'); $this->_idemployeeregister->setLabel("Matrícula"); $this->_idemployeeregister->setDecorators($this->_decoratorsDefault); $this->_idemployeeregister->setAttrib("id", "user_idemployeeregister"); $this->_idemployeeregister->setAttrib("class", "numeric"); $this->_nmusergslab = new Zend_Form_Element_Text('nmusergslab'); $this->_nmusergslab->setLabel("Nome Completo"); $this->_nmusergslab->setDecorators($this->_decoratorsRequired); $this->_nmusergslab->setAttrib("id", "user_nmusergslab"); $this->_nmusergslab->setAttrib("class", "alpha"); $this->_nmusergslab->setRequired(true); $this->_nmmail = new Zend_Form_Element_Text('nmmail'); $this->_nmmail->setLabel("E-mail"); $this->_nmmail->setDecorators($this->_decoratorsDefault); $this->_nmmail->setAttrib("id", "user_nmmail"); $this->_nmmail->setAttrib("class", "required_email"); $this->_nmmail->setRequired(false); $this->_idcep = new Zend_Form_Element_Text('idcep'); $this->_idcep->setLabel("CEP"); $this->_idcep->setDecorators($this->_decoratorsDefault); $this->_idcep->setAttrib("id", "user_idcep"); $this->_idcep->setAttrib("class", "numeric"); $this->_idrg = new Zend_Form_Element_Text('idrg'); $this->_idrg->setLabel("RG"); $this->_idrg->setDecorators($this->_decoratorsDefault); $this->_idrg->setAttrib("id", "user_idrg"); $this->_idrg->setAttrib("class", "numeric"); $this->_idrg->setRequired(false); $this->_idcpf = new Zend_Form_Element_Text('idcpf'); $this->_idcpf->setLabel("CPF"); $this->_idcpf->setDecorators($this->_decoratorsDefault); $this->_idcpf->setAttrib("id", "user_idcpf"); $this->_idcpf->setAttrib("class", "mask_cpf"); $this->_idcpf->setRequired(false); $this->_nmstreet = new Zend_Form_Element_Text('nmstreet'); $this->_nmstreet->setLabel("Rua"); $this->_nmstreet->setDecorators($this->_decoratorsRequired); $this->_nmstreet->setAttrib("id", "user_nmstreet"); $this->_nmstreet->setRequired(true); $this->_nrnumber = new Zend_Form_Element_Text('nrnumber'); $this->_nrnumber->setLabel("Número"); $this->_nrnumber->setRequired(true); $this->_nrnumber->setDecorators($this->_decoratorsRequired); $this->_nrnumber->setAttrib("id", "user_nrnumber"); $this->_nrnumber->setAttrib("class", "numeric"); $this->_idcity = new Zend_Form_Element_Text('idcity'); $this->_idcity->setLabel("Cidade"); $this->_idcity->setRequired(true); $this->_idcity->setDecorators($this->_decoratorsRequired); $this->_idcity->setAttrib("id", "user_idcity"); $this->_idcity->setAttrib("class", "alpha"); $this->_idstate = new Zend_Form_Element_Select('idstate'); $this->_idstate->setRegisterInArrayValidator(false); $this->_idstate->addMultiOption("", "UF"); $this->_idstate->addMultiOption("AC", "AC"); $this->_idstate->addMultiOption("AL", "AL"); $this->_idstate->addMultiOption("AP", "AP"); $this->_idstate->addMultiOption("AM", "AM"); $this->_idstate->addMultiOption("BA", "BA"); $this->_idstate->addMultiOption("CE", "CE"); $this->_idstate->addMultiOption("SP", "SP"); $this->_idstate->addMultiOption("DF", "DF"); $this->_idstate->addMultiOption("ES", "ES"); $this->_idstate->addMultiOption("GO", "GO"); $this->_idstate->addMultiOption("MA", "MA"); $this->_idstate->addMultiOption("MT", "MT"); $this->_idstate->addMultiOption("MS", "MS"); $this->_idstate->addMultiOption("MG", "MG"); $this->_idstate->addMultiOption("PA", "PA"); $this->_idstate->addMultiOption("PB", "PB"); $this->_idstate->addMultiOption("PR", "PR"); $this->_idstate->addMultiOption("PE", "PE"); $this->_idstate->addMultiOption("PI", "PI"); $this->_idstate->addMultiOption("RJ", "RJ"); $this->_idstate->addMultiOption("RN", "RN"); $this->_idstate->addMultiOption("RS", "RS"); $this->_idstate->addMultiOption("RO", "RO"); $this->_idstate->addMultiOption("RR", "RR"); $this->_idstate->addMultiOption("SC", "SC"); $this->_idstate->addMultiOption("SP", "SP"); $this->_idstate->addMultiOption("SE", "SE"); $this->_idstate->addMultiOption("TO", "TO"); $this->_idstate->setLabel("Estado"); $this->_idstate->setRequired(true); $this->_idstate->setDecorators($this->_decoratorsRequired); $this->_idstate->setAttrib("id", "user_idstate"); $this->_cddepartment = new Zend_Form_Element_Select('cddepartment'); $this->_cddepartment->setRegisterInArrayValidator(false); foreach ($departmentData as $department) { $this->_cddepartment->addMultiOption($department->cddepartment, $department->nmdepartment); } $this->_cddepartment->setLabel("Setor"); $this->_cddepartment->setDecorators($this->_decoratorsRequired); $this->_cddepartment->setAttrib("id", "user_cddepartment"); $this->_cddepartment->setAttrib("class", "alpha"); $this->_cddepartment->setRequired(true); $this->_cdrole = new Zend_Form_Element_Select('cdrole'); $this->_cdrole->setRegisterInArrayValidator(false); foreach ($roleData as $role) { $this->_cdrole->addMultiOption($role->cdrole, $role->nmrole); } $this->_cdrole->setLabel("Função"); $this->_cdrole->setDecorators($this->_decoratorsRequired); $this->_cdrole->setAttrib("id", "user_cdrole"); $this->_cdrole->setRequired(true); $this->_cddepartmentsupervisor = new Zend_Form_Element_Select('cddepartmentsupervisor'); $this->_cddepartmentsupervisor->setRegisterInArrayValidator(false); // foreach ($userData as $departmentSupervisor) { // $this->_cddepartmentsupervisor->addMultiOption($departmentSupervisor->cdusergslab, $departmentSupervisor->nmusergslab); // } $this->_cddepartmentsupervisor->setLabel("Superior"); $this->_cddepartmentsupervisor->setRequired(false); $this->_cddepartmentsupervisor->setDecorators($this->_decoratorsDefault); $this->_cddepartmentsupervisor->setAttrib("id", "user_cddepartmentsupervisor"); $this->_qtactive = new Zend_Form_Element_Text('qtactive'); $this->_qtactive->setLabel("Validade"); $this->_qtactive->setDecorators($this->_decoratorsDefault); $this->_qtactive->setAttrib("id", "user_qtactive"); $this->_qtactive->setAttrib("class", "numeric"); $this->_qtactive->setRequired(false); $this->_fgactiveformat = new Zend_Form_Element_Select('fgactiveformat'); $this->_fgactiveformat->setRegisterInArrayValidator(false); $this->_fgactiveformat->addMultiOptions(array('1' => 'Dia', '2' => 'Mês', '3' => 'Ano')); $this->_fgactiveformat->setLabel("Formato da Validade"); $this->_fgactiveformat->setDecorators($this->_decoratorsDefault); $this->_fgactiveformat->setAttrib("id", "user_fgactiveformat"); $this->_fgactiveformat->setRequired(false); $this->_fgactive = new Zend_Form_Element_Select('fgactive'); $this->_fgactive->setRegisterInArrayValidator(false); $this->_fgactive->addMultiOptions(array('1' => 'Ativo', '2' => 'Inativo')); $this->_fgactive->setLabel("Status"); $this->_fgactive->setDecorators($this->_decoratorsDefault); $this->_fgactive->setAttrib("id", "user_fgactive"); $this->_fgactive->setRequired(false); }