public function dadosforwardAction() { $cdclient = $_GET["cdcliente"]; $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"); $forwardModel = new ForwardModel(); $forwardData = $forwardModel->fetchAll(); $count = count($forwardData); if ($count > 0 && $limit > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0; } if ($page > $total_pages) { $page = $total_pages; } $forwardData = $forwardModel->fetchAll($forwardModel->getForwardByClient($cdclient, $sidx, $sord, $limit, $page)); $responce = new stdClass(); $responce->page = $page; $responce->total = $total_pages; $responce->records = $count; $i = 0; foreach ($forwardData as $row) { $responce->rows[$i]['cdclient'] = $row->cdclient; $responce->rows[$i]['cell'] = array($row->nmforward, substr($row->dtrequest, 8, 2) . '/' . substr($row->dtrequest, 5, 2) . '/' . substr($row->dtrequest, 0, 4)); $i++; } $this->view->dadosforward = $responce; }
public function dadosindexAction() { $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"); $forwardModel = new ForwardModel(); $forward = $forwardModel->fetchAll(); $count = count($forward); if ($count > 0 && $limit > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0; } if ($page > $total_pages) { $page = $total_pages; } $forward = $forwardModel->fetchAll(null, "{$sidx} {$sord}", $limit, $page * $limit - $limit); $responce = new stdClass(); $responce->page = $page; $responce->total = $total_pages; $responce->records = $count; $i = 0; foreach ($forward as $rows) { switch ($rows->fgactive) { case '1': $fgactive = 'Ativo'; break; case '2': $fgactive = 'Inativo'; break; } switch ($rows->fgcovenantrestriction) { case '1': $fgcovenantrestriction = '1'; break; case '2': $fgcovenantrestriction = '2'; break; } $responce->rows[$i]['cell'] = array($rows->cdforward, $rows->nmforward, $rows->nmmail, $rows->idmaincrm, $rows->idmaincrmstate, $rows->idalternativecrm, $rows->idalternativecrmstate, $rows->idcnes, $rows->nrcellphone, $rows->nrphone, $rows->nmstreet, $rows->nrnumber, $rows->nmneighborhood, $rows->idcity, $rows->idstate, $rows->idcep, $fgcovenantrestriction, $fgactive); $i++; } // print_r($responce); die; $this->view->dados = $responce; }
public function generateprotocolAction($cdrequest = 1) { require_once 'fpdf/pdf_protocol.php'; $gslabSession = Zend_Session::namespaceGet('Gslab_Session'); $cdcompany = $gslabSession['user']->cdcompany; $companyModel = new CompanyModel(); $requestModel = new RequestModel(); $sampleModel = new RequestexaminationsampleModel(); $clientModel = new ClientModel(); $covenantModel = new CovenantModel(); $forwardModel = new ForwardModel(); $examinationModel = new RequestexaminationModel(); $companyData = $companyModel->fetchRow('cdcompany = ' . $cdcompany); $requestData = $requestModel->fetchRow('cdrequest = ' . $cdrequest); $sampleData = $sampleModel->fetchRow('cdrequest = ' . $cdrequest); $clientData = $clientModel->fetchRow('cdclient = ' . $requestData->cdclient); $covenantData = $covenantModel->fetchRow('cdcovenant = ' . $requestData->cdcovenant); $forwardData = $forwardModel->fetchRow('cdforward = ' . $requestData->cdforward); $dtbirth = new Zend_Date($clientData->dtbirth, 'dd-MM-YYYY'); $dtrequest = new Zend_Date($requestData->dtrequest, 'dd-MM-YYYY HH:mm'); $dtdeadline = new Zend_Date($requestData->dtdeadline, 'dd-MM-YYYY HH:mm'); $year = $dtbirth->toString('YYYY'); $month = $dtbirth->toString('MM'); $day = $dtbirth->toString('dd'); $today = new Zend_Date(); $tdYear = $today->toString('YYYY'); $tdMonth = $today->toString('MM'); $tdDay = $today->toString('dd'); $nrage = 0; $nrage = GslabUtils::calcAgeDifferenceShort($clientData->dtbirth); $idade = GslabUtils::calcula_idade($clientData->dtbirth); if ($clientData->fgsex == 1) { $sexo = 'M'; } else { $sexo = 'F'; } if ($tdMonth < $month || $tdMonth == $month && $tdDay < $day) { $nrage--; } $pdf = new PDF_PROTOCOL(); $pdf->AddPage(); $pdf->SetFont('Courier', 'B', 11); $pdf->ln(55); $pdf->Cell(0, 0, utf8_decode(strtoupper($companyData->nmcompany)), 0, 1, 'C'); $pdf->Cell(0, 8, utf8_decode('LABORATÓRIO DE ANÁLISES CLÍNICAS'), 0, 2, 'C'); $pdf->Cell(0, -5, str_repeat('_', 81), 0, 1, 'L'); $pdf->ln(8); $pdf->SetFont('Helvetica', '', 9); $pdf->Cell(0, 0, utf8_decode(strtoupper($companyData->nmstreet) . ', ' . $companyData->nrnumber), 0, 1, 'L'); $pdf->ln(4); $pdf->Cell(0, 0, 'COMPROVANTE DE COLETA', 0, 1, 'L'); $pdf->Cell(0, 0, utf8_decode(strtoupper($companyData->nmneighborhood)) . ' - Fone: (47) 3427-3668', 0, 1, 'R'); //ADICIONAR TELEFONE NA BASE $pdf->ln(4); $pdf->Cell(0, 0, utf8_decode('Ficha: ') . $requestData->cdcompany . "-" . $requestData->cdrequest, 0, 1, 'L'); $pdf->Cell(0, 0, 'Senha: 2301', 0, 1, 'R'); $pdf->ln(8); $pdf->Cell(0, 0, utf8_decode('PRONTUÁRIO'), 0, 1, 'L'); $pdf->ln(4); $pdf->SetFont('Helvetica', '', 10); $pdf->Cell(15, 5, utf8_decode('Amostra: '), 0, 0, 'L'); $pdf->Cell(0, 5, $pdf->SetFont('Helvetica', 'BU', 10) . $sampleData->nmbarcodesample, 0, 1, 'L'); $pdf->ln(4); $pdf->SetFont('Helvetica', 'BU', 10); $pdf->Write(0, utf8_decode(strtoupper($clientData->nmclient))); $pdf->SetFont('Helvetica', '', 10); $pdf->ln(8); $pdf->Write(0, utf8_decode('Idade: ' . $nrage)); $pdf->Write(0, utf8_decode(' Sexo: ' . $sexo)); $pdf->ln(6); $pdf->Write(0, utf8_decode('Convênio: ' . $covenantData->nmcovenant)); $pdf->ln(6); $pdf->Write(0, utf8_decode('Médico: ' . $forwardData->idmaincrm . ' - ' . $forwardData->nmforward)); $pdf->ln(6); $pdf->Write(0, utf8_decode('Coleta: ' . strtoupper($companyData->cdcompany . ' - ' . $companyData->nmfantasyname))); $pdf->ln(6); $pdf->Write(0, utf8_decode('Data e Hora: ') . $dtrequest); $pdf->ln(4); $pdf->SetFont('Courier', 'B', 11); $pdf->Cell(0, 0, str_repeat('_', 81), 0, 1, 'L'); /* CAIXA LATERAL */ $pdf->SetFont('Helvetica', '', 10); $pdf->SetY(89); $pdf->SetX(90); $pdf->drawTextBox(utf8_decode('Provável local e data da entrega: Local: ' . strtoupper($companyData->nmfantasyname) . ' Data: ' . $dtdeadline . ' Salvo quando ocorrer: 1- Imprevistos técnicos 2- Bloqueio de resultado pelo controle de qualidade 3- Atraso no fornecimento de reagentes Autorizo a coleta do(s) exame(s) acima citado(s) e declaro estar ciente dos riscos quanto ao surgimento de possíveis hematomas no local da punção. Assinatura do cliente e/ou responsável:__________________________________________'), 109, 50, 'L', 'M'); /* doze exames */ $Exames = $examinationModel->fetchAll($examinationModel->getExaminationProtocol($cdrequest)); $pdf->ln(13); // Exames $pdf->SetFont('Helvetica', 'B', 9); $pdf->SetWidths(array(50, 23, 18)); $pdf->SetX(10); $pdf->Row(array(utf8_decode('Exames'), utf8_decode('Material'), utf8_decode('Status'))); $pdf->SetFont('Helvetica', '', 9); $i = 0; foreach ($Exames as $examination) { if ($examination['nmmaterial'] == 2) { $status = 'Faltante'; } else { $status = 'OK'; } if ($i == 11) { $pdf->SetY(148); } $pdf->SetX(10); $pdf->Row(array(utf8_decode($examination['nmexamination']), utf8_decode($examination['nmmaterial']), $status)); $i++; } $pdf->ln(5); /* -------------------------------------------------------------- */ /* PESQUISA DE SATISFAÇÃO */ $pdf->SetFont('Helvetica', '', 7); $pdf->SetY(205); $pdf->Cell(0, 0, str_repeat(' -', 125), 0, 1, 'L'); $pdf->SetX(10); $pdf->Write(5, utf8_decode('Prezado cliente: com o objetivo de melhorarmos cada vez mais a')); $pdf->ln(3); $pdf->SetX(10); $pdf->Write(5, utf8_decode('qualidade dos nossos serviços e o atendimento à você, solicitamos')); $pdf->ln(3); $pdf->SetX(10); $pdf->Write(5, utf8_decode('a sua gentileza preenchendo o formulário abaixo.')); $pdf->ln(5); $pdf->SetFont('Helvetica', 'B', 7); $pdf->SetWidths(array(30, 13, 13, 13, 13)); $pdf->SetX(10); $pdf->Row(array(utf8_decode('Assinale sua opinião'), utf8_decode('Ótimo'), 'Bom', 'Regular', 'Ruim')); $pdf->SetFont('Helvetica', '', 7); $pdf->SetX(10); $pdf->Row(array(utf8_decode('1. Como foi o atendimento ao telefone?'), '', '', '', '')); $pdf->SetX(10); $pdf->Row(array(utf8_decode('2. Como foi o atendimento da recepção?'), '', '', '', '')); $pdf->SetX(10); $pdf->Row(array(utf8_decode('3. Quanto ao conforto e bem estar na sala de espera?'), '', '', '', '')); $pdf->SetX(10); $pdf->Row(array(utf8_decode('4. Quanto à coleta do material para o exame?'), '', '', '', '')); $pdf->SetX(10); $pdf->Row(array(utf8_decode('5. Quanto ao prazo e entrega dos resultados?'), '', '', '', '')); $pdf->SetY(215); $pdf->SetX(117); $pdf->Write(5, utf8_decode('6. Como conheceu o Laboratório? _______________________________')); $pdf->ln(7); $pdf->SetX(117); $pdf->Write(5, utf8_decode('7. Você indicaria o laboratório para outras pessoas? ( ) Sim ( ) Não')); $pdf->ln(7); $pdf->SetX(117); $pdf->Write(5, utf8_decode('Se NÃO, por quê?____________________________________________')); $pdf->ln(7); $pdf->SetX(117); $pdf->Write(5, utf8_decode('8. Conhece nosso ')); $pdf->SetFont('Helvetica', 'BU', 7); $pdf->Write(5, utf8_decode('Programa de Coleta Domiciliar')); $pdf->SetFont('Helvetica', '', 7); $pdf->Write(5, utf8_decode(' (tel: 3433-2127)?')); $pdf->ln(7); $pdf->SetX(117); $pdf->Write(5, utf8_decode('( ) Sim ( ) Não')); $pdf->ln(7); $pdf->SetX(117); $pdf->Write(5, utf8_decode('9. Sugestões e críticas:_______________________________________')); $pdf->ln(7); $pdf->SetX(117); $pdf->Write(5, utf8_decode('__________________________________________________________')); $pdf->ln(7); $pdf->SetX(117); $pdf->Write(5, utf8_decode('__________________________________________________________')); $pdf->Output(); //IMPRIME O PDF NA TELA $pdf->Output('teste_pro.pdf', "D"); //IMPRIME O PDF NO ARQUIVO }