public function __construct() { parent::__construct(); $covenantModel = new CovenantModel(); $covenantData = $covenantModel->getAllCovenant(); $examinationModel = new ExaminationModel(); $examinationData = $examinationModel->fetchAll(); $this->_cdexamination = new Zend_Form_Element_Select('cdexamination'); $this->_cdexamination->setAttrib("id", "pricing_cdexamination"); $this->_cdexamination->setLabel("Exame"); $this->_cdexamination->setDecorators($this->_decoratorsDefault); $this->_cdexamination->setRequired(false); $this->_cdexamination->setRegisterInArrayValidator(false); $this->_cdexamination->addMultiOption("", 'Selecione um convênio'); $this->_nrdeadline = new Zend_Form_Element_Text('nrdeadline'); $this->_nrdeadline->setAttrib("id", "pricing_nrdeadline"); $this->_nrdeadline->setAttrib("size", "15"); $this->_nrdeadline->setLabel("Prazo Novo Exame (Mês)"); $this->_nrdeadline->setDecorators($this->_decoratorsDefault); $this->_nrdeadline->setRequired(false); $this->_cdcovenant = new Zend_Form_Element_Select('cdcovenant'); $this->_cdcovenant->setAttrib("id", "pricing_cdcovenant"); $this->_cdcovenant->setLabel("Convênio"); $this->_cdcovenant->setDecorators($this->_decoratorsDefault); $this->_cdcovenant->setRequired(false); $this->_cdcovenant->setRegisterInArrayValidator(false); $this->_cdcovenant->addMultiOption("Selecione", '000 - Selecione'); foreach ($covenantData as $covenant) { $this->_cdcovenant->addMultiOption($covenant->cdcovenant, $covenant->idcovenant . ' - ' . $covenant->nmcovenant); } $this->_vlexamination = new Zend_Form_Element_Text('vlexamination'); $this->_vlexamination->setAttrib("id", "pricing_vlexamination"); $this->_vlexamination->setAttrib("maxlength", "22"); $this->_vlexamination->setAttrib("size", "10"); $this->_vlexamination->setLabel("Valor"); $this->_vlexamination->setDecorators($this->_decoratorsDefault); $this->_vlexamination->setRequired(false); $this->_vlch = new Zend_Form_Element_Hidden('vlch'); $this->_vlch->setAttrib("id", "pricing_vlch"); $this->_fgbasevalexamination = new Zend_Form_Element_Select('fgbasevalexamination'); $this->_fgbasevalexamination->setAttrib("id", "pricing_basevalexamination"); $this->_fgbasevalexamination->setLabel("Un. Valor"); $this->_fgbasevalexamination->addMultiOptions(array("1" => "CH", "2" => "R\$")); $this->_fgbasevalexamination->setDecorators($this->_decoratorsDefault); $this->_fgbasevalexamination->setRequired(false); $this->_fgauthrequired = new Zend_Form_Element_Checkbox('fgauthrequired'); $this->_fgauthrequired->setAttrib("id", "pricing_fgauthrequired"); $this->_fgauthrequired->setAttrib("value", "1"); $this->_fgauthrequired->setLabel("Solic. Autorização"); $this->_fgauthrequired->setDecorators($this->_decoratorsDefault); $this->_submitservice = new Zend_Form_Element_Button('submitservice'); $this->_submitservice->setLabel("Adicionar"); $this->_submitservice->setAttrib("id", "pricing_submitservice"); $this->_submitservice->setAttrib("onClick", "save_covenantpricing();"); }
private function getFormData($cdrequest = "0") { /* Usado para a edição de uma requisição * Remover quando criar a tela de controle de requisição * Maikon.Deletar * if($cdrequest > 0) { $requestModel = new RequestModel(); $requestData = $requestModel->fetchRow($requestModel->getRequestByCdRequest($cdrequest)); $this->view->cdrequest = $requestData->cdrequest; $this->view->cdclient = $requestData->cdclient; $this->view->cdcovenant = $requestData->cdcovenant; $this->view->cdforward = $requestData->cdforward; $this->view->idcovenantcard = $requestData->idcovenantcard; $this->view->fgpriority = $requestData->fgpriority; //$this->view->fgcollection = $requestData->fgcollection; // Completar aqui com as novas colunas da tabela 'request' // Tratar variável de data vinda do banco para colocar no formulário $dtrequestdb = $requestData->dtrequest; $date = new Zend_Date($dtrequestdb, 'YYYY-MM-dd HH:mm:ss'); $dtrequest = $date->toString('dd-MM-YYYY'); $hrrequest = $date->toString('HH:mm:ss'); $this->view->dtrequest = $dtrequest; $this->view->hrrequest = $hrrequest; //die("feshow, cdrequest: " . $cdrequest .", cdclient: ". $requestData->cdclient .", dtbirth: ". $requestData->dtbirth .", nrage: ". $this->view->nrage); } * * * public function getPatientSituationCdRequest($cdrequest) { /////// $select = $this->select() ->from("request") ->join("client", "request.cdclient = client.cdclient") //faz a união das tabelas ->where("client.cdclient = ?", $cdrequest) //apresenta os parametros ->setIntegrityCheck(false); echo $select;die; return $select; } */ // Busca todos os Clientes/Pacientes, Ativos e Inativos. $clientModel = new ClientModel(); $this->view->clientData = $clientModel->fetchAll(null, array('client.cdclient', 'client.nmclient')); // Busca todas as empresas, Ativas e Inativas. $companyModel = new CompanyModel(); $this->view->companyData = $companyModel->fetchAll(null, 'company.nmcompany'); // Busca apenas Exames Ativos(fgactive = 1) $examinationModel = new ExaminationModel(); $this->view->examinationData = $examinationModel->fetchAll('examination.fgactive = 1', 'examination.nmexamination'); }
public function selectedpricingAction() { $this->_helper->layout->disableLayout(); $covenantModel = new CovenantpricingModel(); $examinationModel = new ExaminationModel(); $cdcovenant = $this->_request->getParam('cdcovenant'); $examinationDados = $covenantModel->fetchAll($covenantModel->getCovenantExamination($cdcovenant)); $examinationDadosNN = $examinationModel->fetchAll($examinationModel->getCovenantExaminationNN($cdcovenant)); $opt = ''; $i = 0; $response = new stdClass(); if ($examinationDadosNN->count() > 0) { foreach ($examinationDadosNN as $examination) { $opt .= "<option value='" . $examination['cdexamination'] . "'>" . $examination['nmexamination'] . "</option>"; } foreach ($examinationDados as $row) { if ($row['fgauthrequired'] == '2') { $fg = '0'; } else { $fg = '1'; } $response->rows[$i]['cell'] = array($row['cdcovenant'], $row['cdexamination'], $row['idcovenant'] . " - " . $row['nmcovenant'], $row['nmexamination'], $row['vlexamination'], $row['vlchdefault'], $row['fgbasevalexamination'], $row['nrdeadline'], $fg); $i++; $response->chvalue = $row['vlchvalue']; } $response->options = $opt; $result = json_encode($response); print_r($result); return $result; } else { $response = new stdClass(); $response->options = "empty"; $response->rows = "empty"; $result = json_encode($response); print_r($result); return $result; } }
public function dadosexaminationsynonymAction() { $this->_helper->layout->disableLayout(); $page = $this->_request->getParam("page", 1); $limit = $this->_request->getParam("rows"); $cdexamination = $this->_request->getParam("cdexamination"); $examinationModel = new ExaminationModel(); $examinationData = $examinationModel->fetchAll($examinationModel->getByExaminationSynonym($cdexamination)); $count = count($examinationData); if ($count > 0 && $limit != 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0; } if ($page > $total_pages) { $page = $total_pages; } //$examinationData = $examinationRevisionModel->fetchAll(null, "$sidx $sord", $limit, ($page*$limit-$limit)); $responce = new stdClass(); $responce->page = $page; $responce->total = $total_pages; $responce->records = $count; $i = 0; foreach ($examinationData as $row) { $responce->rows[$i]['cdexamination'] = $row->cdexamination; $responce->rows[$i]['cell'] = array($row->nmsynonym, $row->cdsynonym); $i++; } $this->view->examinationsynonym = $responce; }