$pjefe = $row3["pjefe"]; $pdf->AddPage(); $aux = 10; $contador = 0; $pdf->Image($ruta, 10, 5, 18, 20); $pdf->SetFont('Arial', 'B', 15); $pdf->Cell(80); $pdf->Cell(30, 10, $nombre_colegio, 0, 0, 'C'); $pdf->Ln(); $pdf->SetFont('Times', '', 10); $pdf->Cell(180, 4, 'Año Escolar: ' . $_SESSION['base_datos']->anio, 0, 1, 'R'); $pdf->Cell(180, 4, 'Informe Semestral', 0, 1, 'R'); $pdf->Ln(); $pdf->Cell(0, 4, ' Reconocido Oficialmente por el Ministerio de Educación de la República de Chile según decreto Nº' . $_SESSION['colegio']->col_decreto . ' del año ' . $_SESSION['colegio']->col_anio . ' ', 0, 1, 'L'); $pdf->Cell(0, 4, ' Rol Base de Datos ' . $rbd, 0, 1, 'L'); $pdf->ln(); $apellidop = $row2["apellidop"]; $apellidom = $row2["apellidom"]; $nombres = $row2["nombres"]; $rut = $row2["rut"]; $fill = 1; $pdf->SetFillColor(210); $pdf->SetTextColor(0); $pdf->Cell(30, 4, 'Alumno(a): ', 1, 0, 'R'); $pdf->Cell(0, 4, $apellidop . " " . $apellidom . " " . $nombres, 1, 1, 'L'); $pdf->Cell(30, 4, 'R.U.T. :', 1, 0, 'R'); $pdf->Cell(0, 4, $rut, 1, 1, 'L'); $pdf->Cell(30, 4, 'Curso :', 1, 0, 'R'); $curso2 = mostrar_curso($curso, true); $pdf->Cell(0, 4, $curso2, 1, 1, 'L'); $pdf->Cell(30, 4, 'Profesor Jefe :', 1, 0, 'R');
$edtPedidoId = $_GET["PedidoId"]; //Imprime o logotipo da empresa $pdf->Image('../image/logo_consoli2.jpg', 10, 10, 34); //Ajusta a fonte $pdf->SetFont('Arial', 'B', 15); $pdf->Cell(0, 6, $empresaNome, 0, 0, 'R'); $pdf->SetFont('Arial', '', 9); $pdf->Ln(); $pdf->Cell(0, 4, 'Rua São Bento, 289 - Bairro Progresso - Rio do Sul - SC - CEP: 89160-000', 0, 0, 'R'); $pdf->Ln(); $pdf->Cell(0, 4, 'Fone: (47) 3520-1650 - consoli@consolieventos.com.br', 0, 0, 'R'); $pdf->Ln(14); $pdf->SetFont('Arial', 'B', 16); $pdf->SetFillColor(178, 178, 178); $pdf->Cell(0, 7, 'Pedido de Foto e Vídeo Nro ' . $dados_pedido["id"], 0, 0); $pdf->ln(); $pdf->SetFont('Arial', 'B', 11); $pdf->Cell(0, 5, 'Emissão: ' . DataMySQLRetornar($dados_pedido["data"]) . ' Por: ' . $dados_pedido["usuario_nome"], 0, 0); $pdf->ln(); $pdf->SetFont('Arial', 'B', 11); $pdf->Cell(0, 5, 'Data da Venda: ' . DataMySQLRetornar($dados_pedido["data_venda"]), 0, 0); $pdf->ln(8); $pdf->SetFont('Arial', 'B', 11); $pdf->Cell(0, 6, 'Formando:', 1, 0, 'L', 1); $pdf->ln(); $pdf->SetFont('Arial', '', 10); $pdf->Multicell(0, 5, '[' . $dados_pedido["formando_id"] . '] - ' . $dados_pedido["formando_nome"] . "\n[" . $dados_pedido["evento_id"] . '] - ' . $dados_pedido["evento_nome"], 1); $pdf->ln(3); $pdf->SetFont('Arial', 'B', 11); $pdf->Cell(0, 6, 'Observações do Pedido:', 1, 0, 'L', 1); $pdf->ln();
$city = "chennai"; $total_due = 1000; $taxs = 500; $total_due= "$".number_format($total_due, 2, '.', ','); $pdf->Ln(7); $pdf->SetX(5); $pdf->Write(8,"$name"); $pdf->Ln(7); $pdf->SetX(5); $pdf->Write(8,"$stnoname"); $pdf->Ln(7); $pdf->SetX(5); $pdf->Write(8,"$city $prov $postal"); $pdf->ln(15); $head_valur = array("Header","Amount"); $caption = array(); $caption1["header"][] = "Settlement Period \n".$_SESSION['startdate']." to ".$_SESSION['todate']; $caption["price"][] = "$909.34"; $pdf->SetFont('Helvetica','B',10); $settel2 = $_SESSION['startdate']." to ".$_SESSION['todate']; /* query for previous balance */ //$chk_prev_bal = mysql_query("SELECT billno,ROUND( (bill_amount-received_amount) , 1 ) as bal_amt FROM `ddc_bill_records` WHERE customer_id = ".$_POST['cus_already_bill']." and (bill_amount-received_amount) != 0 and (id <= '".$result_id['id']."' && id != '".$result_id['id']."')"); //echo "SELECT billno,ROUND( (bill_amount-received_amount) , 1 ) as bal_amt FROM `ddc_bill_records` WHERE customer_id = ".$_POST['cus_already_bill']." and (bill_amount-received_amount) != 0 and (id <= '".$result_id['id']."' && id != '".$result_id['id']."')";
} foreach ($alumnos as $rut => $alumno) { $pjefe = $datos_curso['pjefe']; $pdf->AddPage(); $pdf->Image($ruta, 10, 5, 18, 20); $pdf->SetFont('Arial', 'B', 15); $pdf->Cell(80); $pdf->Cell(30, 10, $nombre_colegio, 0, 0, 'C'); $pdf->Ln(); $pdf->SetFont('Times', '', 10); $pdf->Cell(180, 4, 'Año Escolar: ' . $_SESSION['base_datos']->anio, 0, 1, 'R'); $pdf->Cell(180, 4, 'Informe Anual', 0, 1, 'R'); $pdf->Ln(); $pdf->Cell(0, 4, ' Reconocido Oficialmente por el Ministerio de Educación de la República de Chile según decreto Nº' . $_SESSION['colegio']->col_decreto . ' del año ' . $_SESSION['colegio']->col_anio . ' ', 0, 1, 'L'); $pdf->Cell(0, 4, ' Rol Base de Datos ' . $rbd, 0, 1, 'L'); $pdf->ln(); $apellidop = $alumno['dato_alumno']['apellidop']; $apellidom = $alumno['dato_alumno']['apellidom']; $nombres = $alumno['dato_alumno']['nombres']; $fill = 1; $pdf->SetFillColor(210); $pdf->Cell(0, 5, 'Datos Alumno:', 1, 1, 1, $fill); $pdf->SetTextColor(0); $pdf->Cell(30, 4, 'Alumno(a): ', 1, 0, 'R'); $pdf->Cell(0, 4, $apellidop . " " . $apellidom . " " . $nombres, 1, 1, 'L'); $pdf->Cell(30, 4, 'R.U.T. :', 1, 0, 'R'); $pdf->Cell(0, 4, $rut, 1, 1, 'L'); $pdf->Cell(30, 4, 'Curso :', 1, 0, 'R'); $pdf->Cell(0, 4, mostrar_curso($curso, true), 1, 1, 'L'); $pdf->Cell(30, 4, 'Profesor Jefe :', 1, 0, 'R'); $pdf->Cell(0, 4, $pjefe, 1, 1, 'L');
$aux = 10; $contador = 0; $ruta = 'logo.jpg'; $pdf->Image($ruta, 10, 5, 18, 20); $pdf->SetFont('Arial', 'B', 15); $pdf->Cell(80); $pdf->Cell(30, 10, $x1, 0, 0, 'C'); $pdf->Ln(); $pdf->SetFont('Times', '', 10); $pdf->Cell(180, 4, 'Año Escolar: 2008', 0, 1, 'R'); //$pdf->Ln(); $pdf->Cell(180, 4, 'Informe Anual', 0, 1, 'R'); $pdf->Ln(); $pdf->Cell(0, 4, ' Reconocido Oficialmente por el Ministerio de Educación de la República de Chile según decreto Nº1052 del año 1997 ', 0, 1, 'L'); $pdf->Cell(0, 4, ' Rol Base de Datos 14416-9.-', 0, 1, 'L'); $pdf->ln(); $apellidop = $row2["apellidop"]; $apellidom = $row2["apellidom"]; $nombres = $row2["nombres"]; $rut = $row2["rut"]; $fill = 1; //$pdf->SetTextColor(255); $pdf->SetFillColor(210); $pdf->Cell(0, 5, 'Datos Alumno:', 1, 1, 1, $fill); $pdf->SetTextColor(0); $pdf->Cell(30, 4, 'Alumno(a): ', 1, 0, 'R'); $pdf->Cell(0, 4, $apellidop . " " . $apellidom . " " . $nombres, 1, 1, 'L'); $pdf->Cell(30, 4, 'R.U.T. :', 1, 0, 'R'); $pdf->Cell(0, 4, $rut, 1, 1, 'L'); $pdf->Cell(30, 4, 'Curso :', 1, 0, 'R'); $pdf->Cell(0, 4, mostrar_curso($curso), 1, 1, 'L');
$pdf->Image($maindir . 'assets/img/Encabezado de documentos.jpg', 0.4, 0.05, 20.96, 3.22, 'JPG'); $pdf->Image($maindir . "assets/img/Pie de documentos.jpg", 0.4, 19.1, 20.88, 13.7, 'JPG'); $pdf->SetRightMargin(1.0); $pdf->SetLeftMargin(1.0); $pdf->SetFont('Calibri', 'B', 11); $pdf->Cell(0, -0.45, utf8_decode("FACULTAD DE CIENCIAS JURÍDICAS "), 0, 0, 'R'); $pdf->Ln(0.2); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, 0, utf8_decode("Teléfono: 2232-2290 "), 0, 1, 'R'); $pdf->Ln(0.41); $pdf->Cell(0, 0, utf8_decode("Edificio A-2 "), 0, 1, 'R'); $pdf->Ln(0.41); $pdf->Cell(0, 0, utf8_decode("Ciudad Universitaria "), 0, 1, 'R'); $pdf->Ln(0.41); $pdf->Cell(0, 0, utf8_decode("Tegucigalpa, Honduras "), 0, 1, 'R'); $pdf->ln(3.5); $pdf->SetFont('Cambria', 'BI', 16); $pdf->Cell(0, 0, utf8_decode("CONSTANCIA DE HIMNO"), 0, 1, 'C'); $pdf->Ln(2.9); $pdf->SetFont('Cambria', 'I', 16); $pdf->SetLeftMargin(2.2); $pdf->SetRightMargin(2.2); $pdf->newFlowingBlock(17.0, 1.0, 0, 'J'); $pdf->SetFont('Cambria', 'I', 16); $pdf->WriteFlowingBlock(utf8_decode('El Suscrito, Secretario de la Facultad de Ciencias Jurídicas de la Universidad Nacional ' . 'Autónoma de Honduras, ')); $pdf->setFont('Cambria', 'BI', 16); $pdf->WriteFlowingBlock(utf8_decode('HACE CONSTAR: ')); $pdf->setFont('Cambria', 'I', 16); $pdf->WriteFlowingBlock(utf8_decode('Que ')); $pdf->setFont('Cambria', 'BI', 16); $pdf->WriteFlowingBlock(utf8_decode($nombreTemporal));
$no = 1; if ($varCek == 0) { $pdf->Cell(($cols + 23) / 100 * $width, $height, $_SESSION['lang']['dataempty'], TBRL, 1, 'C', 1); } else { foreach ($dtKodebarang as $dtKdbrg) { $nor++; $pdf->Cell(8 / 100 * $width, $height, $nor, TBRL, 0, 'C', 1); $pdf->Cell($wkiri / 100 * $width, $height, $nmUraian[$dtKdbrg], TBRL, 0, 'L', 1); $pdf->Cell(15 / 100 * $width, $height, $nmSatuan[$dtKdbrg], TBRL, 0, 'C', 1); $pdf->Cell($wlain / 100 * $width, $height, number_format($lstJumlah[$dtKdbrg], 0), 1, 0, 'R', 1); $pdf->Cell($wlain / 100 * $width, $height, number_format($lstRupiah[$dtKdbrg], 2), 1, 0, 'R', 1); $pdf->Cell($wlain / 100 * $width, $height, number_format($lstJumlahSbi[$dtKdbrg], 0), 1, 0, 'R', 1); $pdf->Cell($wlain / 100 * $width, $height, number_format($lstRupiahSbi[$dtKdbrg], 2), 1, 1, 'R', 1); } } $pdf->ln(20); if ($varCek2 == 0) { $pdf->Cell(($cols + 23) / 100 * $width, $height, $_SESSION['lang']['dataempty'], TBRL, 1, 'C', 1); } else { $height = 15; $height = 20; $pdf->SetFillColor(220, 220, 220); $pdf->SetFont('Arial', 'B', 12); $pdf->SetFont('Arial', 'B', 10); $pdf->Cell(8 / 100 * $width, $height, 'No.', TRL, 0, 'C', 1); $pdf->Cell($wkiri / 100 * $width, $height, 'Uraian', TRL, 0, 'C', 1); $pdf->Cell(15 / 100 * $width, $height, $_SESSION['lang']['satuan'], TRL, 0, 'C', 1); $pdf->Cell($wlain * 2 / 100 * $width, $height, $_SESSION['lang']['bulanini'], 1, 0, 'C', 1); $pdf->Cell($wlain * 2 / 100 * $width, $height, $_SESSION['lang']['sdbulanini'], 1, 1, 'C', 1); $pdf->Cell(8 / 100 * $width, $height, ' ', BRL, 0, 'C', 1); $pdf->Cell($wkiri / 100 * $width, $height, '', BRL, 0, 'C', 1);
$pdf->Image($maindir . 'assets/img/Encabezado de documentos.jpg', 0.4, 0.05, 20.96, 3.22, 'JPG'); $pdf->Image($maindir . "assets/img/Pie de documentos.jpg", 0.4, 21.6, 20.88, 13.7, 'JPG'); $pdf->SetRightMargin(1.0); $pdf->SetLeftMargin(1.0); $pdf->SetFont('Calibri', 'B', 11); $pdf->Cell(0, -0.45, utf8_decode("FACULTAD DE CIENCIAS JURÍDICAS "), 0, 0, 'R'); $pdf->Ln(0.2); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, 0, utf8_decode("Teléfono: 2232-2290 "), 0, 1, 'R'); $pdf->Ln(0.41); $pdf->Cell(0, 0, utf8_decode("Edificio A-2 "), 0, 1, 'R'); $pdf->Ln(0.41); $pdf->Cell(0, 0, utf8_decode("Ciudad Universitaria "), 0, 1, 'R'); $pdf->Ln(0.41); $pdf->Cell(0, 0, utf8_decode("Tegucigalpa, Honduras "), 0, 1, 'R'); $pdf->ln(4); $pdf->SetFont('Cambria', 'BI', 18); $pdf->Cell(0, 0, utf8_decode("C E R T I F I C A C I O N"), 0, 1, 'C'); $pdf->Ln(1.9); $pdf->SetFont('Cambria', 'I', 14); $pdf->SetLeftMargin(2.2); $pdf->SetRightMargin(2.2); $pdf->newFlowingBlock(17.0, 1.0, 0, 'J'); $pdf->SetFont('Cambria', 'I', 14); $pdf->WriteFlowingBlock(utf8_decode('El Suscrito, Secretario de la Facultad de Ciencias Jurídicas de la Universidad Nacional ' . 'Autónoma de Honduras, ')); $pdf->SetFont('Cambria', 'BI', 14); $pdf->WriteFlowingBlock(utf8_decode('CERTIFICA: ')); $pdf->SetFont('Cambria', 'I', 14); $pdf->WriteFlowingBlock(utf8_decode('Que la firma de la Abogada ')); $pdf->SetFont('Cambria', 'BI', 14); $pdf->WriteFlowingBlock(utf8_decode($abogado));
$this->SetY(-15); $this->SetFont('Arial', 'I', 8); $this->Cell(376, 0, "", 1, 1); $anio = date("Y"); $this->Cell(376, 4, utf8_decode("Sistema de Control de Alquiler " . $anio . " © Todos los derechos reservados | Desarrollado por Ronald Nina Layme "), 0, 1, "C"); } } $pdf = new PDF("L", "mm", array(220, 396)); //$pdf=new FPDF("L","mm",array(306,396)); $borde = 0; $pdf->SetAutoPageBreak(true, 15); $pdf->AddPage(); $pdf->SetFont("Arial", "BU", 29); $pdf->SetFillColor(234, 234, 234); $pdf->Cell(376, 10, "RECIBO DE ALQUILER", $borde, 0, "C"); $pdf->ln(25); $pdf->SetFont("Arial", "B", 12); $pdf->Cell(100, 10, "Nombre", 1, 0, "C"); $pdf->Cell(30, 10, "C.I.:", 1, 0, "C"); $pdf->Cell(30, 10, "", $borde, 0, "C"); $pdf->Cell(45, 10, utf8_decode("Fecha de Emisión"), 1, 0, "C"); $pdf->Cell(30, 10, "", $borde, 0, "C"); $pdf->Cell(50, 10, "Codigo de Control", 1, 0, "C"); $pdf->Cell(30, 10, "", $borde, 0, "C"); $pdf->Cell(50, 10, utf8_decode("Fecha Próximo Pago"), 1, 0, "C"); $pdf->ln(10); $pdf->SetFont("Arial", "", 12); $pdf->Cell(100, 10, mb_strtoupper($arren['NombreEsposo']), "LR", 0, "L"); $pdf->Cell(30, 10, mb_strtoupper($arren['CiEsposo']), "LR", 0, "C"); $pdf->Cell(30, 10, "", $borde, 0, "C"); $pdf->Cell(45, 10, date("d/m/Y H:i:s"), 1, 0, "C");
function savePdf() { $meeting =& $this->meeting; $meetingAttendanceDao =& DAORegistry::getDAO("MeetingAttendanceDAO"); $meetingAttendances =& $meetingAttendanceDao->getMeetingAttendancesByMeetingId($meeting->getId()); $suppGuestNames = $this->getData("suppGuestName"); $suppGuestAffiliations = $this->getData("suppGuestAffiliation"); $meetingDateTime = date("d F Y g:ia", strtotime($meeting->getDate())); $meetingDate = date("d F Y", strtotime($meeting->getDate())); $details = Locale::translate('editor.meeting.attendanceReport.intro1') . ' ' . $this->getData("venue") . ' ' . Locale::translate('common.date.on') . ' ' . $meetingDateTime . ' ' . Locale::translate('editor.meeting.attendanceReport.intro2') . ' ' . $this->quorum . ' ' . Locale::translate('editor.meeting.attendanceReport.intro3') . ' ' . $this->getData('adjourned') . "."; $journal = Request::getJournal(); $user = Request::getUser(); import('classes.lib.tcpdf.pdf'); $pdf = new PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor($user->getFullName()); $pdf->SetTitle($journal->getJournalTitle()); $pdf->SetSubject($meeting->getPublicId() . ' - ' . Locale::translate('editor.minutes.attendance')); // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 020', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, 58, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->AddPage(); $pdf->SetFont('dejavusans', 'B', 13); $sectionDao =& DAORegistry::getDAO("SectionDAO"); $erc =& $sectionDao->getSection($meeting->getUploader()); $pdf->SetFont('dejavusans', 'I', 13); $pdf->MultiCell(0, 6, $erc->getSectionTitle(), 0, 'C'); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.meetingDate') . ' ' . $meetingDate, 0, 'C'); $pdf->ln(); $memberCount = 0; $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.membersPresent'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); foreach ($meetingAttendances as $meetingAttendance) { if ($meetingAttendance->getWasPresent() == 1) { $member =& $meetingAttendance->getUser(); $pdf->MultiCell(0, 6, $member->getFullName(), 0, 'L'); $memberCount++; } } if ($memberCount == 0) { $pdf->MultiCell(0, 6, Locale::translate('common.none'), 0, 'L'); } $pdf->ln(); $memberCount = 0; $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.membersAbsent'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); foreach ($meetingAttendances as $meetingAttendance) { if ($meetingAttendance->getWasPresent() == 2) { $member =& $meetingAttendance->getUser(); $pdf->MultiCell(0, 6, $member->getFullName() . ' (' . Locale::translate('editor.meeting.attendanceReport.reasonForAbsence') . ' ' . $meetingAttendance->getReasonForAbsence() . ')', 0, 'L'); $memberCount++; } } if ($memberCount == 0) { $pdf->MultiCell(0, 6, Locale::translate('common.none'), 0, 'L'); } $pdf->ln(); if (count($suppGuestNames) > 0) { $suppGuestCount = 0; foreach ($suppGuestNames as $key => $guest) { if ($guest != "" && $guest != null) { if ($suppGuestCount == 0) { $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.suppGuest'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); } $pdf->MultiCell(0, 6, $guest . ' (' . $suppGuestAffiliations[$key] . ')', 0, 'L'); $suppGuestCount++; } } $pdf->ln(); } $pdf->MultiCell(0, 6, $details, 0, 'L'); $pdf->ln(); if ($this->getData("announcements")) { $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.announcements'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); $pdf->MultiCell(0, 6, $this->getData("announcements"), 0, 'L'); $pdf->ln(); } $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.submittedBy'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); $pdf->MultiCell(0, 6, $user->getFullName(), 0, 'L'); $pdf->ln(); import('classes.file.MinutesFileManager'); $minutesFileManager = new MinutesFileManager($meeting->getId()); $minutesFileManager->handleWrite($pdf, MINUTES_FILE_ATTENDANCE); }
/** * Internal function to return the cover for publishing a research * @param $sectionEditorSubmission SectionEditorSubmission * @return string path to cover created */ function &_generateCover($sectionEditorSubmission) { $journal =& Request::getJournal(); import('classes.lib.tcpdf.pdf'); import('classes.lib.tcpdf.tcpdf'); Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_OJS_EDITOR, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER)); $pdf = new PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // No header and footer for this document $pdf->SetPrintHeader(false); $pdf->SetPrintFooter(false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor($journal->getJournalTitle()); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, 20, PDF_MARGIN_RIGHT); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // Right now this cover page is only in english, but the english translation keys are ready $pdf->AddPage(); $pdf->SetFont('dejavusans', 'B', 14); $pdf->MultiCell(0, 6, 'Final Technical Report', 0, 'C'); // Locale::translate('editor.finalReport') $pdf->ln(); $pdf->ln(); $pdf->MultiCell(0, 6, 'for', 0, 'C'); // Locale::translate('editor.finalReport.for') $pdf->ln(); $pdf->ln(); $pdf->MultiCell(0, 6, 'Research Project', 0, 'C'); // Locale::translate('editor.finalReport.researchProject') $pdf->ln(); $pdf->ln(); $pdf->ln(); $pdf->ln(); $abstract = $sectionEditorSubmission->getAbstractByLocale('en_US'); // Right now, considering only the english language $pdf->SetFont('dejavusans', 'B', 16); $pdf->MultiCell(0, 6, $abstract->getScientificTitle(), 0, 'C'); $pdf->ln(); $authors = $sectionEditorSubmission->getAuthors(); $coInvestigatorsString = (string) ''; $pInvestigatorsString = (string) ''; foreach ($authors as $author) { if (!$author->getPrimaryContact()) { if ($coInvestigatorsString == '') { $coInvestigatorsString = $author->getFullName() . ' (' . $author->getAffiliation() . ')'; } else { $coInvestigatorsString = $coInvestigatorsString . ', ' . $author->getFullName() . ' (' . $author->getAffiliation() . ')'; } } else { $pInvestigatorsString = $author->getFullName() . ' (' . $author->getAffiliation() . ')'; } } $pdf->SetFont('dejavusans', '', 16); $pdf->MultiCell(0, 6, 'Principal Investigator: ' . $pInvestigatorsString, 0, 'C'); // Locale::translate('user.role.primaryInvestigator') if ($coInvestigatorsString != '') { $pdf->MultiCell(0, 6, 'Co-Investigator(s): ' . $coInvestigatorsString, 0, 'C'); // Locale::translate('user.role.coinvestigator') } $pdf->ln(); $pdf->ln(); $pdf->ln(); $pdf->ln(); $pdf->SetFont('dejavusans', 'B', 16); $pdf->MultiCell(0, 6, $sectionEditorSubmission->getProposalId(), 0, 'C'); $pdf->ln(); $pdf->ln(); $decision = $sectionEditorSubmission->getLastSectionDecision(); $pdf->MultiCell(0, 0, date("F Y", strtotime($decision->getDateDecided())), 0, 'L', 0, 1, '', 250, true); $pdf->Image("public/site/images/mainlogo.png", 'C', 230, 40, '', '', false, 'C', false, 300, 'R', false, false, 0, false, false, false); $pdf->AddPage(); $pdf->SetFont('dejavusans', 'B', 14); $pdf->MultiCell(0, 6, 'Final Technical Report', 0, 'C'); // Locale::translate('editor.finalReport') $pdf->ln(); $pdf->ln(); $pdf->SetFont('dejavusans', 'B', 12); $pdf->MultiCell(0, 6, 'Disclaimer', 0, 'C'); // Locale::translate('editor.finalReport.disclaimer') $pdf->ln(); $pdf->ln(); $pdf->SetFont('dejavusans', '', 11); $pdf->writeHTMLCell(0, 6, '', '', $journal->getSetting('reportDisclaimer'), 0, 0, false, true, 'J'); $filePath = Config::getVar('files', 'files_dir') . '/articles/' . $sectionEditorSubmission->getArticleId() . '/public/'; if (!FileManager::fileExists($filePath, 'dir')) { FileManager::mkdirtree($filePath); } $pdf->Output($filePath . 'tempCover.pdf', 'F'); return $filePath; }
<?php $pdf = new PDF(); $pdf->FPDF('P', 'mm', 'Letter'); $pdf->AddPage(); $title = 'PAGARE '; $pdf->SetFont('Arial', 'B', 12); $pdf->CELL(0, 5, $title, 0, 1, 'C'); $pdf->ln(15); $pdf->SetFont('Arial', '', 10); $pdf->cell(20, 1, "DEUDOR:", 0, 0, 'L'); $pdf->cell(100, 1, $nombreapo, 0, 0, 'L'); $pdf->cell(20, 1, "R.U.N:", 0, 0, 'L'); $pdf->cell(0, 1, $rutapo, 0, 1, 'L'); $pdf->cell(20, 3, "", 0, 0); $pdf->cell(90, 3, "-----------------------------------------------------------------------------------", 0, 0, 'L'); $pdf->cell(20, 3, "", 0, 0); $pdf->cell(0, 3, "----------------------------------", 0, 1); $pdf->ln(); $pdf->cell(23, 1, "DIRECCION:", 0, 0); $pdf->cell(0, 1, $direccion, 0, 1); $pdf->cell(23, 5, "", 0, 0); $pdf->cell(0, 5, "--------------------------------------------------------------------------------------------------------------------------------", 0, 1); $pdf->ln(8); $firma = "NANCY JEANETTE ZAMORA MORENO"; $txt = "Debo y Pagaré a la orden del " . $_SESSION['colegio']->nombre . ", {$ciudad}, representante legal: NANCY JEANETTE ZAMORA MORENO R.U.T : 7.495.478 - 2, factor de comercio, ambos domiciliados para estos efectos en calle Portales Nº 1680, de la ciudad de La Ligua, la suma de \$" . $total . ", dicha cantidad la adeudo por concepto de las pertinentes mensualidades correspondientes al alumno(a):"; $pdf->MultiCell(0, 5, $txt); $pdf->ln(15); $pdf->cell(15, 1, "Don(ña):", 0, 0, 'L'); $pdf->cell(110, 1, $nombrecompleto, 0, 0, 'L'); $pdf->cell(13, 1, 'Curso:', 0, 0, 'L');
$sql_formando = mysql_query("SELECT \n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.nome,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.cpf,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.endereco,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.complemento,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.bairro,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.uf,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.cep,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.observacoes,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tcid.nome as cidade_nome\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM eventos_formando form\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tLEFT OUTER JOIN cidades cid ON cid.id = form.cidade_id\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE form.id = {$PessoaId}"); //Verifica o numero de registros retornados $registros = mysql_num_rows($sql_formando); //Verifica a quantidade de registros if ($registros == 0) { //Exibe a mensagem que não foram encontrados registros $pdf->SetFont('Arial', 'B', 9); $pdf->Cell(0, 6, 'Não há formandos cadastrados para este evento !', 1, 0, 'L'); //Caso tiver } else { $dados_formando = mysql_fetch_array($sql_formando); $total_formando = 0; //Imprime os dados do formando $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(110, 6, $dados_formando['nome'], 'LTR', 0, 'L'); $pdf->ln(); $pdf->SetFont('Arial', 'B', 9); $pdf->Cell(110, 5, 'CPF: ' . $dados_formando['cpf'], 'LR', 0, 'L'); $pdf->ln(); $pdf->Cell(110, 5, $dados_formando['endereco'], 'LR', 0, 'L'); $pdf->ln(); $pdf->Cell(110, 5, $dados_formando['bairro'], 'LR', 0, 'L'); $pdf->ln(); $pdf->Cell(110, 5, $dados_formando['cidade_nome'] . ' - ' . $dados_formando['uf'], 'LR', 0, 'L'); $pdf->ln(); $pdf->Cell(110, 5, 'CEP: ' . $dados_formando['cep'], 'LBR', 0, 'L'); $pdf->ln(25); $pdf->SetX(50); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(76, 8, 'AVISO DE RECEBIMENTO', 1, 0, 'C'); $pdf->SetFont('Arial', 'B', 16);
/** * Show printable survey */ function index($surveyid, $lang = null) { $surveyid = sanitize_int($surveyid); //echo '<pre>'.print_r($_SESSION,true).'</pre>'; // PRESENT SURVEY DATAENTRY SCREEN if (isset($_POST['printableexport'])) { Yii::import("application.libraries.admin.pdf"); $pdf = new PDF($pdforientation, 'mm', 'A4'); $pdf->SetFont($pdfdefaultfont, '', $pdffontsize); $pdf->AddPage(); } // Set the language of the survey, either from GET parameter of session var if (isset($lang)) { $lang = preg_replace("/[^a-zA-Z0-9-]/", "", $lang); if ($lang) { $surveyprintlang = $lang; } } else { $surveyprintlang = getBaseLanguageFromSurveyID((int) $surveyid); } $_POST['surveyprintlang'] = $surveyprintlang; // Setting the selected language for printout $clang = new limesurvey_lang($surveyprintlang); $desrow = Survey::model()->with(array('languagesettings' => array('condition' => 'surveyls_language=:language', 'params' => array(':language' => $surveyprintlang))))->findByAttributes(array('sid' => $surveyid)); if (is_null($desrow)) { $this->getController()->error('Invalid survey ID'); } $desrow = array_merge($desrow->attributes, $desrow->languagesettings[0]->attributes); //echo '<pre>'.print_r($desrow,true).'</pre>'; $template = $desrow['template']; $welcome = $desrow['surveyls_welcometext']; $end = $desrow['surveyls_endtext']; $surveyname = $desrow['surveyls_title']; $surveydesc = $desrow['surveyls_description']; $surveyactive = $desrow['active']; $surveytable = "{{survey_" . $desrow['sid'] . "}}"; $surveyexpirydate = $desrow['expires']; $surveystartdate = $desrow['startdate']; $surveyfaxto = $desrow['faxto']; $dateformattype = $desrow['surveyls_dateformat']; if (isset($_POST['printableexport'])) { $pdf->titleintopdf($surveyname, $surveydesc); } Yii::app()->loadHelper('surveytranslator'); $dformat = getDateFormatData($dateformattype); $dformat = $dformat['phpdate']; $expirytimestamp = strtotime($surveyexpirydate); $expirytimeofday_h = date('H', $expirytimestamp); $expirytimeofday_m = date('i', $expirytimestamp); $surveyexpirydate = date($dformat, $expirytimestamp); if (!empty($expirytimeofday_h) || !empty($expirytimeofday_m)) { $surveyexpirydate .= ' – ' . $expirytimeofday_h . ':' . $expirytimeofday_m; } //define('PRINT_TEMPLATE' , '/templates/print/' , true); if (is_file(Yii::app()->getConfig('usertemplaterootdir') . DIRECTORY_SEPARATOR . $template . DIRECTORY_SEPARATOR . 'print_survey.pstpl')) { define('PRINT_TEMPLATE_DIR', Yii::app()->getConfig('usertemplaterootdir') . DIRECTORY_SEPARATOR . $template . DIRECTORY_SEPARATOR, true); define('PRINT_TEMPLATE_URL', Yii::app()->getConfig('usertemplaterooturl') . '/' . $template . '/', true); } elseif (is_file(Yii::app()->getConfig('usertemplaterootdir') . '/' . $template . '/print_survey.pstpl')) { define('PRINT_TEMPLATE_DIR', Yii::app()->getConfig('standardtemplaterootdir') . DIRECTORY_SEPARATOR . $template . DIRECTORY_SEPARATOR, true); define('PRINT_TEMPLATE_URL', Yii::app()->getConfig('standardtemplaterooturl') . '/' . $template . '/', true); } else { define('PRINT_TEMPLATE_DIR', Yii::app()->getConfig('standardtemplaterootdir') . DIRECTORY_SEPARATOR . 'default' . DIRECTORY_SEPARATOR, true); define('PRINT_TEMPLATE_URL', Yii::app()->getConfig('standardtemplaterooturl') . '/default/', true); } LimeExpressionManager::StartSurvey($surveyid, 'survey', NULL, false, LEM_PRETTY_PRINT_ALL_SYNTAX); $moveResult = LimeExpressionManager::NavigateForwards(); $condition = "sid = '{$surveyid}' AND language = '{$surveyprintlang}'"; $degresult = Groups::model()->getAllGroups($condition, array('group_order')); //xiao, if (!isset($surveyfaxto) || !$surveyfaxto and isset($surveyfaxnumber)) { $surveyfaxto = $surveyfaxnumber; //Use system fax number if none is set in survey. } $headelements = getPrintableHeader(); //if $showsgqacode is enabled at config.php show table name for reference $showsgqacode = Yii::app()->getConfig("showsgqacode"); if (isset($showsgqacode) && $showsgqacode == true) { $surveyname = $surveyname . "<br />[" . $clang->gT('Database') . " " . $clang->gT('table') . ": {$surveytable}]"; } else { $surveyname = $surveyname; } $survey_output = array('SITENAME' => Yii::app()->getConfig("sitename"), 'SURVEYNAME' => $surveyname, 'SURVEYDESCRIPTION' => $surveydesc, 'WELCOME' => $welcome, 'END' => $end, 'THEREAREXQUESTIONS' => 0, 'SUBMIT_TEXT' => $clang->gT("Submit Your Survey."), 'SUBMIT_BY' => $surveyexpirydate, 'THANKS' => $clang->gT("Thank you for completing this survey."), 'HEADELEMENTS' => $headelements, 'TEMPLATEURL' => PRINT_TEMPLATE_URL, 'FAXTO' => $surveyfaxto, 'PRIVACY' => '', 'GROUPS' => ''); $survey_output['FAX_TO'] = ''; if (!empty($surveyfaxto) && $surveyfaxto != '000-00000000') { $survey_output['FAX_TO'] = $clang->gT("Please fax your completed survey to:") . " {$surveyfaxto}"; } if ($surveystartdate != '') { $survey_output['SUBMIT_BY'] = sprintf($clang->gT("Please submit by %s"), $surveyexpirydate); } /** * Output arrays: * $survey_output = final vaiables for whole survey * $survey_output['SITENAME'] = * $survey_output['SURVEYNAME'] = * $survey_output['SURVEY_DESCRIPTION'] = * $survey_output['WELCOME'] = * $survey_output['THEREAREXQUESTIONS'] = * $survey_output['PDF_FORM'] = * $survey_output['HEADELEMENTS'] = * $survey_output['TEMPLATEURL'] = * $survey_output['SUBMIT_TEXT'] = * $survey_output['SUBMIT_BY'] = * $survey_output['THANKS'] = * $survey_output['FAX_TO'] = * $survey_output['SURVEY'] = contains an array of all the group arrays * * $groups[] = an array of all the groups output * $group['GROUPNAME'] = * $group['GROUPDESCRIPTION'] = * $group['QUESTIONS'] = templated formatted content if $question is appended to this at the end of processing each question. * $group['ODD_EVEN'] = class to differentiate alternate groups * $group['SCENARIO'] = * * $questions[] = contains an array of all the questions within a group * $question['QUESTION_CODE'] = content of the question code field * $question['QUESTION_TEXT'] = content of the question field * $question['QUESTION_SCENARIO'] = if there are conditions on a question, list the conditions. * $question['QUESTION_MANDATORY'] = translated 'mandatory' identifier * $question['QUESTION_CLASS'] = classes to be added to wrapping question div * $question['QUESTION_TYPE_HELP'] = instructions on how to complete the question * $question['QUESTION_MAN_MESSAGE'] = (not sure if this is used) mandatory error * $question['QUESTION_VALID_MESSAGE'] = (not sure if this is used) validation error * $question['ANSWER'] = contains formatted HTML answer * $question['QUESTIONHELP'] = content of the question help field. * */ $total_questions = 0; $mapquestionsNumbers = array(); $answertext = ''; // otherwise can throw an error on line 1617 // ========================================================= // START doin the business: $pdfoutput = ''; foreach ($degresult->readAll() as $degrow) { // --------------------------------------------------- // START doing groups $deqresult = Questions::model()->getQuestions($surveyid, $degrow['gid'], $surveyprintlang, 0, '"I"'); $deqrows = array(); //Create an empty array in case FetchRow does not return any rows foreach ($deqresult->readAll() as $deqrow) { $deqrows[] = $deqrow; } // Get table output into array // Perform a case insensitive natural sort on group name then question title of a multidimensional array usort($deqrows, 'groupOrderThenQuestionOrder'); if ($degrow['description']) { $group_desc = $degrow['description']; } else { $group_desc = ''; } $group = array('GROUPNAME' => $degrow['group_name'], 'GROUPDESCRIPTION' => $group_desc, 'QUESTIONS' => ''); // A group can have only hidden questions. In that case you don't want to see the group's header/description either. $bGroupHasVisibleQuestions = false; if (isset($_POST['printableexport'])) { $pdf->titleintopdf($degrow['group_name'], $degrow['description']); } $gid = $degrow['gid']; //Alternate bgcolor for different groups if (!isset($group['ODD_EVEN']) || $group['ODD_EVEN'] == ' g-row-even') { $group['ODD_EVEN'] = ' g-row-odd'; } else { $group['ODD_EVEN'] = ' g-row-even'; } //Loop through questions foreach ($deqrows as $deqrow) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // START doing questions $qidattributes = getQuestionAttributeValues($deqrow['qid'], $deqrow['type']); if ($qidattributes['hidden'] == 1 && $deqrow['type'] != '*') { continue; } $bGroupHasVisibleQuestions = true; //GET ANY CONDITIONS THAT APPLY TO THIS QUESTION $printablesurveyoutput = ''; $explanation = ''; //reset conditions explanation $s = 0; // // TMSW Conditions->Relevance: show relevance instead of this whole section to create $explanation // // // $scenarioresult=Conditions::model()->getScenarios($deqrow['qid']); // $scenarioresult = $scenarioresult->readAll(); // //Loop through distinct scenarios, thus grouping them together. // foreach ($scenarioresult as $scenariorow) // { // if( $s == 0 && count($scenarioresult) > 1) // { // $explanation .= '<p class="scenario">'.self::_try_debug(__LINE__)." -------- Scenario {$scenariorow['scenario']} --------</p>\n\n"; // } // if($s > 0) // { // $explanation .= '<p class="scenario">'.self::_try_debug(__LINE__).' -------- '.$clang->gT("or")." Scenario {$scenariorow['scenario']} --------</p>\n\n"; // } // // $x=0; // // $conditions1="qid={$deqrow['qid']} AND scenario={$scenariorow['scenario']}"; // $distinctresult=Conditions::model()->getSomeConditions(array('cqid','method', 'cfieldname', 'value'), $conditions1, array('cqid'),array('cqid', 'method')); // // //Loop through each condition for a particular scenario. // foreach ($distinctresult->readAll() as $distinctrow) // { // $condition = "qid = '{$distinctrow['cqid']}' AND parent_qid = 0 AND language = '{$surveyprintlang}'"; // $subresult=Questions::model()->find($condition); // // if($x > 0) // { // $explanation .= ' <em class="scenario-and-seperator">'.$clang->gT('and').'</em> '; // } // if(trim($distinctrow['method'])=='') //If there is no method chosen assume "equals" // { // $distinctrow['method']='=='; // } // // if($distinctrow['cqid']){ // cqid != 0 ==> previous answer match // if($distinctrow['method']=='==') // { // $explanation .= $clang->gT("Answer was")." "; // } // elseif($distinctrow['method']=='!=') // { // $explanation .= $clang->gT("Answer was NOT")." "; // } // elseif($distinctrow['method']=='<') // { // $explanation .= $clang->gT("Answer was less than")." "; // } // elseif($distinctrow['method']=='<=') // { // $explanation .= $clang->gT("Answer was less than or equal to")." "; // } // elseif($distinctrow['method']=='>=') // { // $explanation .= $clang->gT("Answer was greater than or equal to")." "; // } // elseif($distinctrow['method']=='>') // { // $explanation .= $clang->gT("Answer was greater than")." "; // } // elseif($distinctrow['method']=='RX') // { // $explanation .= $clang->gT("Answer matched (regexp)")." "; // } // else // { // $explanation .= $clang->gT("Answer was")." "; // } // if($distinctrow['value'] == '') { // $explanation .= ' '.$clang->gT("Not selected").' '; // } // //If question type is numerical or multi-numerical, show the actual value - otherwise, don't. // if($subresult['type'] == 'N' || $subresult['type'] == 'K') { // $explanation .= ' '.$distinctrow['value']. ' '; // } // } // if(!$distinctrow['cqid']) { // cqid == 0 ==> token attribute match // $tokenData = getTokenFieldsAndNames($surveyid); // preg_match('/^{TOKEN:([^}]*)}$/',$distinctrow['cfieldname'],$extractedTokenAttr); // $explanation .= "Your ".$tokenData[strtolower($extractedTokenAttr[1])]." "; // if($distinctrow['method']=='==') // { // $explanation .= $clang->gT("is")." "; // } // elseif($distinctrow['method']=='!=') // { // $explanation .= $clang->gT("is NOT")." "; // } // elseif($distinctrow['method']=='<') // { // $explanation .= $clang->gT("is less than")." "; // } // elseif($distinctrow['method']=='<=') // { // $explanation .= $clang->gT("is less than or equal to")." "; // } // elseif($distinctrow['method']=='>=') // { // $explanation .= $clang->gT("is greater than or equal to")." "; // } // elseif($distinctrow['method']=='>') // { // $explanation .= $clang->gT("is greater than")." "; // } // elseif($distinctrow['method']=='RX') // { // $explanation .= $clang->gT("is matched (regexp)")." "; // } // else // { // $explanation .= $clang->gT("is")." "; // } // $answer_section = ' '.$distinctrow['value'].' '; // } // // $conresult=Conditions::model()->getConditionsQuestions($distinctrow['cqid'],$deqrow['qid'],$scenariorow['scenario'],$surveyprintlang); // // $conditions=array(); // foreach ($conresult->readAll() as $conrow) // { // // $postans=""; // $value=$conrow['value']; // switch($conrow['type']) // { // case "Y": // switch ($conrow['value']) // { // case "Y": $conditions[]=$clang->gT("Yes"); break; // case "N": $conditions[]=$clang->gT("No"); break; // } // break; // case "G": // switch($conrow['value']) // { // case "M": $conditions[]=$clang->gT("Male"); break; // case "F": $conditions[]=$clang->gT("Female"); break; // } // switch // break; // case "A": // case "B": // case ":": // case ";": // $conditions[]=$conrow['value']; // break; // case "C": // switch($conrow['value']) // { // case "Y": $conditions[]=$clang->gT("Yes"); break; // case "U": $conditions[]=$clang->gT("Uncertain"); break; // case "N": $conditions[]=$clang->gT("No"); break; // } // switch // break; // case "E": // switch($conrow['value']) // { // case "I": $conditions[]=$clang->gT("Increase"); break; // case "D": $conditions[]=$clang->gT("Decrease"); break; // case "S": $conditions[]=$clang->gT("Same"); break; // } // case "1": // $labelIndex=preg_match("/^[^#]+#([01]{1})$/",$conrow['cfieldname']); // if ($labelIndex == 0) // { // TIBO // // $condition="qid='{$conrow['cqid']}' AND code='{$conrow['value']}' AND scale_id=0 AND language='{$surveyprintlang}'"; // $fresult=Answers::model()->getAllRecords($condition); // // foreach($fresult->readAll() as $frow) // { // $postans=$frow['answer']; // $conditions[]=$frow['answer']; // } // while // } // elseif ($labelIndex == 1) // { // // $condition="qid='{$conrow['cqid']}' AND code='{$conrow['value']}' AND scale_id=1 AND language='{$surveyprintlang}'"; // $fresult=Answers::model()->getAllRecords($condition); // foreach($fresult->readAll() as $frow) // { // $postans=$frow['answer']; // $conditions[]=$frow['answer']; // } // while // } // break; // case "L": // case "!": // case "O": // case "R": // $condition="qid='{$conrow['cqid']}' AND code='{$conrow['value']}' AND language='{$surveyprintlang}'"; // $ansresult=Answers::model()->findAll($condition); // // foreach ($ansresult as $ansrow) // { // $conditions[]=$ansrow['answer']; // } // if($conrow['value'] == "-oth-") { // $conditions[]=$clang->gT("Other"); // } // $conditions = array_unique($conditions); // break; // case "M": // case "P": // $condition=" parent_qid='{$conrow['cqid']}' AND title='{$conrow['value']}' AND language='{$surveyprintlang}'"; // $ansresult=Questions::model()->findAll($condition); // foreach ($ansresult as $ansrow) // { // $conditions[]=$ansrow['question']; // } // $conditions = array_unique($conditions); // break; // case "N": // $conditions[]=$value; // break; // case "F": // case "H": // default: // $value=substr($conrow['cfieldname'], strpos($conrow['cfieldname'], "X".$conrow['cqid'])+strlen("X".$conrow['cqid']), strlen($conrow['cfieldname'])); // // $condition=" qid='{$conrow['cqid']}' AND code='{$conrow['value']}' AND language='{$surveyprintlang}'"; // // $fresult=Answers::model()->getAllRecords($condition); // foreach ($fresult->readAll() as $frow) // { // $postans=$frow['answer']; // $conditions[]=$frow['answer']; // } // while // break; // } // switch // // // Now let's complete the answer text with the answer_section // $answer_section=""; // switch($conrow['type']) // { // case "A": // case "B": // case "C": // case "E": // case "F": // case "H": // case "K": // $thiscquestion=$fieldmap[$conrow['cfieldname']]; // $condition="parent_qid='{$conrow['cqid']}' AND title='{$thiscquestion['aid']}' AND language='{$surveyprintlang}'"; // $ansresult= Questions::model()->findAll($condition); // // foreach ($ansresult as $ansrow) // { // $answer_section=" (".$ansrow['question'].")"; // } // break; // // case "1": // dual: (Label 1), (Label 2) // $labelIndex=substr($conrow['cfieldname'],-1); // $thiscquestion=$fieldmap[$conrow['cfieldname']]; // $condition="parent_qid='{$conrow['cqid']}' AND title='{$thiscquestion['aid']}' AND language='{$surveyprintlang}'"; // $ansresult= Questions::model()->findAll($condition); // $cqidattributes = getQuestionAttributeValues($conrow['cqid'], $conrow['type']); // if ($labelIndex == 0) // { // if (trim($cqidattributes['dualscale_headerA']) != '') { // $header = $clang->gT($cqidattributes['dualscale_headerA']); // } else { // $header = '1'; // } // } // elseif ($labelIndex == 1) // { // if (trim($cqidattributes['dualscale_headerB']) != '') { // $header = $clang->gT($cqidattributes['dualscale_headerB']); // } else { // $header = '2'; // } // } // foreach ($ansresult->readAll() as $ansrow) // { // $answer_section=" (".$ansrow['question']." ".sprintf($clang->gT("Label %s"),$header).")"; // } // break; // case ":": // case ";": //multi flexi: ( answer [label] ) // $thiscquestion=$fieldmap[$conrow['cfieldname']]; // $condition="parent_qid='{$conrow['cqid']}' AND title='{$thiscquestion['aid']}' AND language='{$surveyprintlang}'"; // $ansresult= Questions::model()->findAll($condition); // foreach ($ansresult as $ansrow) // { // // $condition = "qid = '{$conrow['cqid']}' AND code = '{$conrow['value']}' AND language= '{$surveyprintlang}'"; // $fresult= Answers::model()->findAll($condition); // foreach ($fresult as $frow) // { // //$conditions[]=$frow['title']; // $answer_section=" (".$ansrow['question']."[".$frow['answer']."])"; // } // while // } // break; // case "R": // (Rank 1), (Rank 2)... TIBO // $thiscquestion=$fieldmap[$conrow['cfieldname']]; // $rankid=$thiscquestion['aid']; // $answer_section=" (".$clang->gT("RANK")." $rankid)"; // break; // default: // nothing to add // break; // } // } // // if (count($conditions) > 1) // { // $explanation .= "'".implode("' <em class='scenario-or-seperator'>".$clang->gT("or")."</em> '", $conditions)."'"; // } // elseif (count($conditions) == 1) // { // $explanation .= "'".$conditions[0]."'"; // } // unset($conditions); // // Following line commented out because answer_section was lost, but is required for some question types // //$explanation .= " ".$clang->gT("to question")." '".$mapquestionsNumbers[$distinctrow['cqid']]."' $answer_section "; // if($distinctrow['cqid']){ // $explanation .= " <span class='scenario-at-seperator'>".$clang->gT("at question")."</span> '".$mapquestionsNumbers[$distinctrow['cqid']]." [".$subresult['title']."]' (".strip_tags($subresult['question'])."$answer_section)" ; // } // else{ // $explanation .= " ".$distinctrow['value'] ; // } // //$distinctrow // $x++; // } // $s++; // } $qinfo = LimeExpressionManager::GetQuestionStatus($deqrow['qid']); $relevance = trim($qinfo['info']['relevance']); $explanation = $qinfo['relEqn']; if (trim($relevance) != '' && trim($relevance) != '1') { $explanation = "<b>" . $clang->gT('Only answer this question if the following conditions are met:') . "</b>" . "<br/> ° " . $explanation; } else { $explanation = ''; } ++$total_questions; //TIBO map question qid to their q number $mapquestionsNumbers[$deqrow['qid']] = $total_questions; //END OF GETTING CONDITIONS $qid = $deqrow['qid']; $fieldname = "{$surveyid}" . "X" . "{$gid}" . "X" . "{$qid}"; if (isset($showsgqacode) && $showsgqacode == true) { $deqrow['question'] = $deqrow['question'] . "<br />" . $clang->gT("ID:") . " {$fieldname} <br />" . $clang->gT("Question code:") . " " . $deqrow['title']; } $question = array('QUESTION_NUMBER' => $total_questions, 'QUESTION_CODE' => $deqrow['title'], 'QUESTION_TEXT' => preg_replace('/(?:<br ?\\/?>|<\\/(?:p|h[1-6])>)$/is', '', $deqrow['question']), 'QUESTION_SCENARIO' => $explanation, 'QUESTION_MANDATORY' => '', 'QUESTION_ID' => $deqrow['qid'], 'QUESTION_CLASS' => getQuestionClass($deqrow['type']), 'QUESTION_TYPE_HELP' => $qinfo['validTip'], 'QUESTION_MAN_MESSAGE' => '', 'QUESTION_VALID_MESSAGE' => '', 'QUESTION_FILE_VALID_MESSAGE' => '', 'QUESTIONHELP' => '', 'ANSWER' => ''); if ($question['QUESTION_TYPE_HELP'] != "") { $question['QUESTION_TYPE_HELP'] .= "<br />\n"; } if ($deqrow['mandatory'] == 'Y') { $question['QUESTION_MANDATORY'] = $clang->gT('*'); $question['QUESTION_CLASS'] .= ' mandatory'; $pdfoutput .= $clang->gT("*"); } $pdfoutput = ''; //DIFFERENT TYPES OF DATA FIELD HERE if (isset($_POST['printableexport'])) { $pdf->intopdf($deqrow['title'] . " " . $deqrow['question']); } if ($deqrow['help']) { $hh = $deqrow['help']; $question['QUESTIONHELP'] = $hh; if (isset($_POST['printableexport'])) { $pdf->helptextintopdf($hh); } } if (!empty($qidattributes['page_break'])) { $question['QUESTION_CLASS'] .= ' breakbefore '; } if (isset($qidattributes['maximum_chars']) && $qidattributes['maximum_chars'] != '') { $question['QUESTION_CLASS'] = "max-chars-{$qidattributes['maximum_chars']} " . $question['QUESTION_CLASS']; } switch ($deqrow['type']) { // ================================================================== case "5": //5 POINT CHOICE $question['QUESTION_TYPE_HELP'] .= $clang->gT('Please choose *only one* of the following:'); if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please choose *only one* of the following:"), "U"); } $pdfoutput = ''; $question['ANSWER'] .= "\n\t<ul>\n"; for ($i = 1; $i <= 5; $i++) { $pdfoutput .= " o " . $i . " "; // $printablesurveyoutput .="\t\t\t<input type='checkbox' name='$fieldname' value='$i' readonly='readonly' />$i \n"; $question['ANSWER'] .= "\t\t<li>\n\t\t\t" . self::_input_type_image('radio', $i) . "\n\t\t\t{$i} " . self::_addsgqacode("({$i})") . "\n\t\t</li>\n"; } if (isset($_POST['printableexport'])) { $pdf->intopdf($pdfoutput); } $question['ANSWER'] .= "\t</ul>\n"; break; // ================================================================== // ================================================================== case "D": //DATE $question['QUESTION_TYPE_HELP'] .= $clang->gT('Please enter a date:'); $question['ANSWER'] .= "\t" . self::_input_type_image('text', $question['QUESTION_TYPE_HELP'], 30, 1); if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please enter a date:") . " ___________"); } break; // ================================================================== // ================================================================== case "G": //GENDER $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please choose *only one* of the following:"); $question['ANSWER'] .= "\n\t<ul>\n"; $question['ANSWER'] .= "\t\t<li>\n\t\t\t" . self::_input_type_image('radio', $clang->gT("Female")) . "\n\t\t\t" . $clang->gT("Female") . " " . self::_addsgqacode("(F)") . "\n\t\t</li>\n"; $question['ANSWER'] .= "\t\t<li>\n\t\t\t" . self::_input_type_image('radio', $clang->gT("Male")) . "\n\t\t\t" . $clang->gT("Male") . " " . self::_addsgqacode("(M)") . "\n\t\t</li>\n"; $question['ANSWER'] .= "\t</ul>\n"; if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please choose *only one* of the following:")); } if (isset($_POST['printableexport'])) { $pdf->intopdf(" o " . $clang->gT("Female") . " | o " . $clang->gT("Male")); } break; // ================================================================== // ================================================================== case "L": //LIST drop-down/radio-button list // ================================================================== //LIST drop-down/radio-button list // ================================================================== case "!": //List - dropdown if (isset($qidattributes['display_columns']) && trim($qidattributes['display_columns']) != '') { $dcols = $qidattributes['display_columns']; } else { $dcols = 0; } if (isset($qidattributes['category_separator']) && trim($qidattributes['category_separator']) != '') { $optCategorySeparator = $qidattributes['category_separator']; } else { unset($optCategorySeparator); } $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please choose *only one* of the following:"); $question['QUESTION_TYPE_HELP'] .= self::_array_filter_help($qidattributes, $surveyprintlang, $surveyid); if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please choose *only one* of the following:")); } $dearesult = Answers::model()->getAllRecords(" qid='{$deqrow['qid']}' AND language='{$surveyprintlang}' ", array('sortorder', 'answer')); $dearesult = $dearesult->readAll(); $deacount = count($dearesult); if ($deqrow['other'] == "Y") { $deacount++; } $wrapper = setupColumns(0, $deacount); $question['ANSWER'] = $wrapper['whole-start']; $rowcounter = 0; $colcounter = 1; foreach ($dearesult as $dearow) { if (isset($optCategorySeparator)) { list($category, $answer) = explode($optCategorySeparator, $dearow['answer']); if ($category != '') { $dearow['answer'] = "({$category}) {$answer} " . self::_addsgqacode("(" . $dearow['code'] . ")"); } else { $dearow['answer'] = $answer . self::_addsgqacode(" (" . $dearow['code'] . ")"); } $question['ANSWER'] .= "\t" . $wrapper['item-start'] . "\t\t" . self::_input_type_image('radio', $dearow['answer']) . "\n\t\t\t" . $dearow['answer'] . "\n" . $wrapper['item-end']; } else { $question['ANSWER'] .= "\t" . $wrapper['item-start'] . "\t\t" . self::_input_type_image('radio', $dearow['answer']) . "\n\t\t\t" . $dearow['answer'] . self::_addsgqacode(" (" . $dearow['code'] . ")") . "\n" . $wrapper['item-end']; } if (isset($_POST['printableexport'])) { $pdf->intopdf(" o " . $dearow['answer']); } ++$rowcounter; if ($rowcounter == $wrapper['maxrows'] && $colcounter < $wrapper['cols']) { if ($colcounter == $wrapper['cols'] - 1) { $question['ANSWER'] .= $wrapper['col-devide-last']; } else { $question['ANSWER'] .= $wrapper['col-devide']; } $rowcounter = 0; ++$colcounter; } } if ($deqrow['other'] == 'Y') { if (trim($qidattributes["other_replace_text"][$surveyprintlang]) == '') { $qidattributes["other_replace_text"][$surveyprintlang] = "Other"; } // $printablesurveyoutput .="\t".$wrapper['item-start']."\t\t".self::_input_type_image('radio' , $clang->gT("Other"))."\n\t\t\t".$clang->gT("Other")."\n\t\t\t<input type='text' size='30' readonly='readonly' />\n".$wrapper['item-end']; $question['ANSWER'] .= $wrapper['item-start-other'] . self::_input_type_image('radio', $clang->gT($qidattributes["other_replace_text"][$surveyprintlang])) . ' ' . $clang->gT($qidattributes["other_replace_text"][$surveyprintlang]) . self::_addsgqacode(" (-oth-)") . "\n\t\t\t" . self::_input_type_image('other') . self::_addsgqacode(" (" . $deqrow['sid'] . "X" . $deqrow['gid'] . "X" . $deqrow['qid'] . "other)") . "\n" . $wrapper['item-end']; if (isset($_POST['printableexport'])) { $pdf->intopdf(" o " . $clang->gT($qidattributes["other_replace_text"][$surveyprintlang]) . ": ________"); } } $question['ANSWER'] .= $wrapper['whole-end']; //Let's break the presentation into columns. break; // ================================================================== // ================================================================== case "O": //LIST WITH COMMENT $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please choose *only one* of the following:"); if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please choose *only one* of the following:"), "U"); } $dearesult = Answers::model()->getAllRecords(" qid='{$deqrow['qid']}' AND language='{$surveyprintlang}'", array('sortorder', 'answer')); $question['ANSWER'] = "\t<ul>\n"; foreach ($dearesult->readAll() as $dearow) { $question['ANSWER'] .= "\t\t<li>\n\t\t\t" . self::_input_type_image('radio', $dearow['answer']) . "\n\t\t\t" . $dearow['answer'] . self::_addsgqacode(" (" . $dearow['code'] . ")") . "\n\t\t</li>\n"; if (isset($_POST['printableexport'])) { $pdf->intopdf($dearow['answer']); } } $question['ANSWER'] .= "\t</ul>\n"; $question['ANSWER'] .= "\t<p class=\"comment\">\n\t\t" . $clang->gT("Make a comment on your choice here:") . "\n"; if (isset($_POST['printableexport'])) { $pdf->intopdf("Make a comment on your choice here:"); } $question['ANSWER'] .= "\t\t" . self::_input_type_image('textarea', $clang->gT("Make a comment on your choice here:"), 50, 8) . self::_addsgqacode(" (" . $deqrow['sid'] . "X" . $deqrow['gid'] . "X" . $deqrow['qid'] . "comment)") . "\n\t</p>\n"; for ($i = 0; $i < 9; $i++) { if (isset($_POST['printableexport'])) { $pdf->intopdf("____________________"); } } break; // ================================================================== // ================================================================== case "R": //RANKING Type Question $rearesult = Answers::model()->getAllRecords(" qid='{$deqrow['qid']}' AND language='{$surveyprintlang}'", array('sortorder', 'answer')); $rearesult = $rearesult->readAll(); $reacount = count($rearesult); $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please number each box in order of preference from 1 to") . " {$reacount}"; $question['QUESTION_TYPE_HELP'] .= self::_min_max_answers_help($qidattributes, $surveyprintlang, $surveyid); if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please number each box in order of preference from 1 to ") . $reacount, "U"); } $question['ANSWER'] = "\n<ul>\n"; foreach ($rearesult as $rearow) { $question['ANSWER'] .= "\t<li>\n\t" . self::_input_type_image('rank', '', 4, 1) . "\n\t\t " . $rearow['answer'] . self::_addsgqacode(" (" . $fieldname . $rearow['code'] . ")") . "\n\t</li>\n"; if (isset($_POST['printableexport'])) { $pdf->intopdf("__ " . $rearow['answer']); } } $question['ANSWER'] .= "\n</ul>\n"; break; // ================================================================== // ================================================================== case "M": //Multiple choice (Quite tricky really!) if (trim($qidattributes['display_columns']) != '') { $dcols = $qidattributes['display_columns']; } else { $dcols = 0; } $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please choose *all* that apply:"); if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please choose *all* that apply:"), "U"); } $question['QUESTION_TYPE_HELP'] .= self::_array_filter_help($qidattributes, $surveyprintlang, $surveyid); $mearesult = Questions::model()->getAllRecords(" parent_qid='{$deqrow['qid']}' AND language='{$surveyprintlang}' ", array('question_order')); $mearesult = $mearesult->readAll(); $meacount = count($mearesult); if ($deqrow['other'] == 'Y') { $meacount++; } $wrapper = setupColumns($dcols, $meacount); $question['ANSWER'] = $wrapper['whole-start']; $rowcounter = 0; $colcounter = 1; foreach ($mearesult as $mearow) { $question['ANSWER'] .= $wrapper['item-start'] . self::_input_type_image('checkbox', $mearow['question']) . "\n\t\t" . $mearow['question'] . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . ") ") . $wrapper['item-end']; if (isset($_POST['printableexport'])) { $pdf->intopdf(" o " . $mearow['answer']); } // $upto++; ++$rowcounter; if ($rowcounter == $wrapper['maxrows'] && $colcounter < $wrapper['cols']) { if ($colcounter == $wrapper['cols'] - 1) { $question['ANSWER'] .= $wrapper['col-devide-last']; } else { $question['ANSWER'] .= $wrapper['col-devide']; } $rowcounter = 0; ++$colcounter; } } if ($deqrow['other'] == "Y") { if (trim($qidattributes['other_replace_text'][$surveyprintlang]) == '') { $qidattributes["other_replace_text"][$surveyprintlang] = "Other"; } if (!isset($mearow['answer'])) { $mearow['answer'] = ""; } $question['ANSWER'] .= $wrapper['item-start-other'] . self::_input_type_image('checkbox', $mearow['answer']) . $clang->gT($qidattributes["other_replace_text"][$surveyprintlang]) . ":\n\t\t" . self::_input_type_image('other') . self::_addsgqacode(" (" . $fieldname . "other) ") . $wrapper['item-end']; if (isset($_POST['printableexport'])) { $pdf->intopdf(" o " . $clang->gT($qidattributes["other_replace_text"][$surveyprintlang]) . ": ________"); } } $question['ANSWER'] .= $wrapper['whole-end']; // } break; // ================================================================== // ================================================================== case "P": //Multiple choice with comments $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please choose all that apply and provide a comment:"); if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please choose all that apply and provide a comment:"), "U"); } $question['QUESTION_TYPE_HELP'] .= self::_array_filter_help($qidattributes, $surveyprintlang, $surveyid); $mearesult = Questions::model()->getAllRecords("parent_qid='{$deqrow['qid']}' AND language='{$surveyprintlang}'", array('question_order')); // $printablesurveyoutput .="\t\t\t<u>".$clang->gT("Please choose all that apply and provide a comment:")."</u><br />\n"; $pdfoutput = array(); $j = 0; $longest_string = 0; foreach ($mearesult->readAll() as $mearow) { $longest_string = longestString($mearow['question'], $longest_string); $question['ANSWER'] .= "\t<li><span>\n\t\t" . self::_input_type_image('checkbox', $mearow['question']) . $mearow['question'] . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . ") ") . "</span>\n\t\t" . self::_input_type_image('text', 'comment box', 60) . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . "comment) ") . "\n\t</li>\n"; $pdfoutput[$j] = array(" o " . $mearow['title'], " __________"); $j++; } if ($deqrow['other'] == "Y") { $question['ANSWER'] .= "\t<li class=\"other\">\n\t\t<div class=\"other-replacetext\">" . $clang->gT('Other:') . self::_input_type_image('other', '', 1) . "</div>" . self::_input_type_image('othercomment', 'comment box', 50) . self::_addsgqacode(" (" . $fieldname . "other) ") . "\n\t</li>\n"; // lemeur: PDFOUTPUT HAS NOT BEEN IMPLEMENTED for these fields // not sure who did implement this. $pdfoutput[$j][0] = array(" o " . "Other", " __________"); $pdfoutput[$j][1] = array(" o " . "OtherComment", " __________"); $j++; } $question['ANSWER'] = "\n<ul>\n" . $question['ANSWER'] . "</ul>\n"; if (isset($_POST['printableexport'])) { $pdf->tableintopdf($pdfoutput); } break; // ================================================================== // ================================================================== case "Q": //MULTIPLE SHORT TEXT $width = 60; // ================================================================== // ================================================================== case "K": //MULTIPLE NUMERICAL $question['QUESTION_TYPE_HELP'] = ""; $width = isset($width) ? $width : 16; if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please write your answer(s) here:"), "U"); } // if (!empty($qidattributes['equals_num_value'])) // { // $question['QUESTION_TYPE_HELP'] .= "* ".sprintf($clang->gT('Total of all entries must equal %d'),$qidattributes['equals_num_value'])."<br />\n"; // } // if (!empty($qidattributes['max_num_value'])) // { // $question['QUESTION_TYPE_HELP'] .= sprintf($clang->gT('Total of all entries must not exceed %d'), $qidattributes['max_num_value'])."<br />\n"; // } // if (!empty($qidattributes['min_num_value'])) // { // $question['QUESTION_TYPE_HELP'] .= sprintf($clang->gT('Total of all entries must be at least %s'),$qidattributes['min_num_value'])."<br />\n"; // } $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please write your answer(s) here:"); $mearesult = Questions::model()->getAllRecords("parent_qid='{$deqrow['qid']}' AND language='{$surveyprintlang}'", array('question_order')); $longest_string = 0; foreach ($mearesult->readAll() as $mearow) { $longest_string = longestString($mearow['question'], $longest_string); if (isset($qidattributes['slider_layout']) && $qidattributes['slider_layout'] == 1) { $mearow['question'] = explode(':', $mearow['question']); $mearow['question'] = $mearow['question'][0]; } $question['ANSWER'] .= "\t<li>\n\t\t<span>" . $mearow['question'] . "</span>\n\t\t" . self::_input_type_image('text', $mearow['question'], $width) . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . ") ") . "\n\t</li>\n"; if (isset($_POST['printableexport'])) { $pdf->intopdf($mearow['question'] . ": ____________________"); } } $question['ANSWER'] = "\n<ul>\n" . $question['ANSWER'] . "</ul>\n"; break; // ================================================================== // ================================================================== case "S": //SHORT TEXT $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please write your answer here:"); $question['ANSWER'] = self::_input_type_image('text', $question['QUESTION_TYPE_HELP'], 50); if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please write your answer here:"), "U"); } if (isset($_POST['printableexport'])) { $pdf->intopdf("____________________"); } break; // ================================================================== // ================================================================== case "T": //LONG TEXT $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please write your answer here:"); $question['ANSWER'] = self::_input_type_image('textarea', $question['QUESTION_TYPE_HELP'], '100%', 8); if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please write your answer here:"), "U"); } for ($i = 0; $i < 9; $i++) { if (isset($_POST['printableexport'])) { $pdf->intopdf("____________________"); } } break; // ================================================================== // ================================================================== case "U": //HUGE TEXT $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please write your answer here:"); $question['ANSWER'] = self::_input_type_image('textarea', $question['QUESTION_TYPE_HELP'], '100%', 30); if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please write your answer here:"), "U"); } for ($i = 0; $i < 20; $i++) { if (isset($_POST['printableexport'])) { $pdf->intopdf("____________________"); } } break; // ================================================================== // ================================================================== case "N": //NUMERICAL $prefix = ""; $suffix = ""; if ($qidattributes['prefix'][$surveyprintlang] != "") { $prefix = $qidattributes['prefix'][$surveyprintlang]; print_r($prefix); } if ($qidattributes['suffix'][$surveyprintlang] != "") { $suffix = $qidattributes['suffix'][$surveyprintlang]; } $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please write your answer here:"); $question['ANSWER'] = "<ul>\n\t<li>\n\t\t<span>{$prefix}</span>\n\t\t" . self::_input_type_image('text', $question['QUESTION_TYPE_HELP'], 20) . "\n\t\t<span>{$suffix}</span>\n\t\t</li>\n\t</ul>"; if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please write your answer here:"), "U"); } if (isset($_POST['printableexport'])) { $pdf->intopdf("____________________"); } break; // ================================================================== // ================================================================== case "Y": //YES/NO $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please choose *only one* of the following:"); $question['ANSWER'] = "\n<ul>\n\t<li>\n\t\t" . self::_input_type_image('radio', $clang->gT('Yes')) . "\n\t\t" . $clang->gT('Yes') . self::_addsgqacode(" (Y)") . "\n\t</li>\n"; $question['ANSWER'] .= "\n\t<li>\n\t\t" . self::_input_type_image('radio', $clang->gT('No')) . "\n\t\t" . $clang->gT('No') . self::_addsgqacode(" (N)") . "\n\t</li>\n</ul>\n"; if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please choose *only one* of the following:"), "U"); } if (isset($_POST['printableexport'])) { $pdf->intopdf(" o " . $clang->gT("Yes")); } if (isset($_POST['printableexport'])) { $pdf->intopdf(" o " . $clang->gT("No")); } break; // ================================================================== // ================================================================== case "A": //ARRAY (5 POINT CHOICE) $condition = "parent_qid = '{$deqrow['qid']}' AND language= '{$surveyprintlang}'"; $mearesult = Questions::model()->getAllRecords($condition, array('question_order')); $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please choose the appropriate response for each item:"); $question['QUESTION_TYPE_HELP'] .= self::_array_filter_help($qidattributes, $surveyprintlang, $surveyid); $question['ANSWER'] = "\n <table>\n <thead>\n <tr>\n <td> </td>\n <th style='font-family:Arial,helvetica,sans-serif;font-weight:normal;'>1 " . self::_addsgqacode(" (1)") . "</th>\n <th style='font-family:Arial,helvetica,sans-serif;font-weight:normal;'>2 " . self::_addsgqacode(" (2)") . "</th>\n <th style='font-family:Arial,helvetica,sans-serif;font-weight:normal;'>3 " . self::_addsgqacode(" (3)") . "</th>\n <th style='font-family:Arial,helvetica,sans-serif;font-weight:normal;'>4 " . self::_addsgqacode(" (4)") . "</th>\n <th style='font-family:Arial,helvetica,sans-serif;font-weight:normal;'>5" . self::_addsgqacode(" (5)") . "</th>\n </tr>\n </thead>\n <tbody>"; if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please choose the appropriate response for each item:"), "U"); } $pdfoutput = array(); $j = 0; $rowclass = 'array1'; foreach ($mearesult->readAll() as $mearow) { $question['ANSWER'] .= "\t\t<tr class=\"{$rowclass}\">\n"; $rowclass = alternation($rowclass, 'row'); //semantic differential question type? if (strpos($mearow['question'], '|')) { $answertext = substr($mearow['question'], 0, strpos($mearow['question'], '|')) . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . ")") . " "; } else { $answertext = $mearow['question'] . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . ")"); } $question['ANSWER'] .= "\t\t\t<th class=\"answertext\">{$answertext}</th>\n"; $pdfoutput[$j][0] = $answertext; for ($i = 1; $i <= 5; $i++) { $question['ANSWER'] .= "\t\t\t<td>" . self::_input_type_image('radio', $i) . "</td>\n"; $pdfoutput[$j][$i] = " o " . $i; } $answertext .= $mearow['question']; //semantic differential question type? if (strpos($mearow['question'], '|')) { $answertext2 = substr($mearow['question'], strpos($mearow['question'], '|') + 1); $question['ANSWER'] .= "\t\t\t<th class=\"answertextright\">{$answertext2}</td>\n"; } $question['ANSWER'] .= "\t\t</tr>\n"; $j++; } $question['ANSWER'] .= "\t</tbody>\n</table>\n"; if (isset($_POST['printableexport'])) { $pdf->tableintopdf($pdfoutput); } break; // ================================================================== // ================================================================== case "B": //ARRAY (10 POINT CHOICE) $mearesult = Questions::model()->getAllRecords(" parent_qid='{$deqrow['qid']}' AND language='{$surveyprintlang}' ", array('question_order')); $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please choose the appropriate response for each item:"); $question['QUESTION_TYPE_HELP'] .= self::_array_filter_help($qidattributes, $surveyprintlang, $surveyid); $question['ANSWER'] .= "\n<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<td> </td>\n"; for ($i = 1; $i <= 10; $i++) { $question['ANSWER'] .= "\t\t\t<th>{$i}" . self::_addsgqacode(" ({$i})") . "</th>\n"; } $question['ANSWER'] .= "\t</thead>\n\n\t<tbody>\n"; if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please choose the appropriate response for each item:"), "U"); } $pdfoutput = array(); $j = 0; $rowclass = 'array1'; foreach ($mearesult->readAll() as $mearow) { $question['ANSWER'] .= "\t\t<tr class=\"{$rowclass}\">\n\t\t\t<th class=\"answertext\">{$mearow['question']}" . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . ")") . "</th>\n"; $rowclass = alternation($rowclass, 'row'); $pdfoutput[$j][0] = $mearow['question']; for ($i = 1; $i <= 10; $i++) { $question['ANSWER'] .= "\t\t\t<td>" . self::_input_type_image('radio', $i) . "</td>\n"; $pdfoutput[$j][$i] = " o " . $i; } $question['ANSWER'] .= "\t\t</tr>\n"; $j++; } $question['ANSWER'] .= "\t</tbody>\n</table>\n"; if (isset($_POST['printableexport'])) { $pdf->tableintopdf($pdfoutput); } break; // ================================================================== // ================================================================== case "C": //ARRAY (YES/UNCERTAIN/NO) $mearesult = Questions::model()->getAllRecords(" parent_qid='{$deqrow['qid']}' AND language='{$surveyprintlang}' ", array('question_order')); $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please choose the appropriate response for each item:"); $question['QUESTION_TYPE_HELP'] .= self::_array_filter_help($qidattributes, $surveyprintlang, $surveyid); $question['ANSWER'] = ' <table> <thead> <tr> <td> </td> <th>' . $clang->gT("Yes") . self::_addsgqacode(" (Y)") . '</th> <th>' . $clang->gT("Uncertain") . self::_addsgqacode(" (U)") . '</th> <th>' . $clang->gT("No") . self::_addsgqacode(" (N)") . '</th> </tr> </thead> <tbody> '; if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please choose the appropriate response for each item:"), "U"); } $pdfoutput = array(); $j = 0; $rowclass = 'array1'; foreach ($mearesult->readAll() as $mearow) { $question['ANSWER'] .= "\t\t<tr class=\"{$rowclass}\">\n"; $question['ANSWER'] .= "\t\t\t<th class=\"answertext\">{$mearow['question']}" . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . ")") . "</th>\n"; $question['ANSWER'] .= "\t\t\t<td>" . self::_input_type_image('radio', $clang->gT("Yes")) . "</td>\n"; $question['ANSWER'] .= "\t\t\t<td>" . self::_input_type_image('radio', $clang->gT("Uncertain")) . "</td>\n"; $question['ANSWER'] .= "\t\t\t<td>" . self::_input_type_image('radio', $clang->gT("No")) . "</td>\n"; $question['ANSWER'] .= "\t\t</tr>\n"; $pdfoutput[$j] = array($mearow['question'], " o " . $clang->gT("Yes"), " o " . $clang->gT("Uncertain"), " o " . $clang->gT("No")); $j++; $rowclass = alternation($rowclass, 'row'); } $question['ANSWER'] .= "\t</tbody>\n</table>\n"; if (isset($_POST['printableexport'])) { $pdf->tableintopdf($pdfoutput); } break; case "E": //ARRAY (Increase/Same/Decrease) $mearesult = Questions::model()->getAllRecords(" parent_qid='{$deqrow['qid']}' AND language='{$surveyprintlang}' ", array('question_order')); $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please choose the appropriate response for each item:"); $question['QUESTION_TYPE_HELP'] .= self::_array_filter_help($qidattributes, $surveyprintlang, $surveyid); $question['ANSWER'] = ' <table> <thead> <tr> <td> </td> <th>' . $clang->gT("Increase") . self::_addsgqacode(" (I)") . '</th> <th>' . $clang->gT("Same") . self::_addsgqacode(" (S)") . '</th> <th>' . $clang->gT("Decrease") . self::_addsgqacode(" (D)") . '</th> </tr> </thead> <tbody> '; if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please choose the appropriate response for each item:"), "U"); } $pdfoutput = array(); $j = 0; $rowclass = 'array1'; foreach ($mearesult->readAll() as $mearow) { $question['ANSWER'] .= "\t\t<tr class=\"{$rowclass}\">\n"; $question['ANSWER'] .= "\t\t\t<th class=\"answertext\">{$mearow['question']}" . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . ")") . "</th>\n"; $question['ANSWER'] .= "\t\t\t<td>" . self::_input_type_image('radio', $clang->gT("Increase")) . "</td>\n"; $question['ANSWER'] .= "\t\t\t<td>" . self::_input_type_image('radio', $clang->gT("Same")) . "</td>\n"; $question['ANSWER'] .= "\t\t\t<td>" . self::_input_type_image('radio', $clang->gT("Decrease")) . "</td>\n"; $question['ANSWER'] .= "\t\t</tr>\n"; $pdfoutput[$j] = array($mearow['question'] . ":", " o " . $clang->gT("Increase"), " o " . $clang->gT("Same"), " o " . $clang->gT("Decrease")); $j++; $rowclass = alternation($rowclass, 'row'); } $question['ANSWER'] .= "\t</tbody>\n</table>\n"; if (isset($_POST['printableexport'])) { $pdf->tableintopdf($pdfoutput); } break; // ================================================================== // ================================================================== case ":": //ARRAY (Multi Flexible) (Numbers) $headstyle = "style='padding-left: 20px; padding-right: 7px'"; if (trim($qidattributes['multiflexible_max']) != '' && trim($qidattributes['multiflexible_min']) == '') { $maxvalue = $qidattributes['multiflexible_max']; $minvalue = 1; } if (trim($qidattributes['multiflexible_min']) != '' && trim($qidattributes['multiflexible_max']) == '') { $minvalue = $qidattributes['multiflexible_min']; $maxvalue = $qidattributes['multiflexible_min'] + 10; } if (trim($qidattributes['multiflexible_min']) == '' && trim($qidattributes['multiflexible_max']) == '') { $minvalue = 1; $maxvalue = 10; } if (trim($qidattributes['multiflexible_min']) != '' && trim($qidattributes['multiflexible_max']) != '') { if ($qidattributes['multiflexible_min'] < $qidattributes['multiflexible_max']) { $minvalue = $qidattributes['multiflexible_min']; $maxvalue = $qidattributes['multiflexible_max']; } } if (trim($qidattributes['multiflexible_step']) != '') { $stepvalue = $qidattributes['multiflexible_step']; } else { $stepvalue = 1; } if ($qidattributes['multiflexible_checkbox'] != 0) { $checkboxlayout = true; } else { $checkboxlayout = false; } $mearesult = Questions::model()->getAllRecords(" parent_qid='{$deqrow['qid']}' and scale_id=0 AND language='{$surveyprintlang}' ", array('question_order')); // if ($checkboxlayout === false) // { // if ($stepvalue > 1) // { // $question['QUESTION_TYPE_HELP'] = sprintf($clang->gT("Please write a multiple of %d between (%s) and (%s) for each item:"),$stepvalue,$minvalue,$maxvalue); // if(isset($_POST['printableexport'])){$pdf->intopdf(sprintf($clang->gT("Please write a multiple of %d between (%s) and (%s) for each item:"),$stepvalue,$minvalue,$maxvalue),"U");} // } // else { // $question['QUESTION_TYPE_HELP'] = sprintf($clang->gT("Please enter a number between (%s) and (%s) for each item:"),$minvalue,$maxvalue); // if(isset($_POST['printableexport'])){$pdf->intopdf(sprintf($clang->gT("Please enter a number between (%s) and (%s) for each item:"),$minvalue,$maxvalue),"U");} // } // } // else // { // $question['QUESTION_TYPE_HELP'] .= $clang->gT("Check any that apply").":"; // if(isset($_POST['printableexport'])){$pdf->intopdf($clang->gT("Check any that apply"),"U");} // } $question['QUESTION_TYPE_HELP'] .= self::_array_filter_help($qidattributes, $surveyprintlang, $surveyid); $question['ANSWER'] .= "\n<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<td> </td>\n"; $fresult = Questions::model()->getAllRecords(" parent_qid='{$deqrow['qid']}' and scale_id=1 AND language='{$surveyprintlang}' ", array('question_order')); $fresult = $fresult->readAll(); $fcount = count($fresult); $fwidth = "120"; $i = 0; $pdfoutput = array(); $pdfoutput[0][0] = ' '; //array to temporary store X axis question codes $xaxisarray = array(); foreach ($fresult as $frow) { $question['ANSWER'] .= "\t\t\t<th>{$frow['question']}</th>\n"; $i++; $pdfoutput[0][$i] = $frow['question']; //add current question code $xaxisarray[$i] = $frow['title']; } $question['ANSWER'] .= "\t\t</tr>\n\t</thead>\n\n\t<tbody>\n"; $a = 1; //Counter for pdfoutput $rowclass = 'array1'; $result = $mearesult->readAll(); foreach ($result as $frow) { $question['ANSWER'] .= "\t<tr class=\"{$rowclass}\">\n"; $rowclass = alternation($rowclass, 'row'); $answertext = $frow['question']; if (strpos($answertext, '|')) { $answertext = substr($answertext, 0, strpos($answertext, '|')); } $question['ANSWER'] .= "\t\t\t\t\t<th class=\"answertext\">{$answertext}</th>\n"; //$printablesurveyoutput .="\t\t\t\t\t<td>"; $pdfoutput[$a][0] = $answertext; for ($i = 1; $i <= $fcount; $i++) { $question['ANSWER'] .= "\t\t\t<td>\n"; if ($checkboxlayout === false) { $question['ANSWER'] .= "\t\t\t\t" . self::_input_type_image('text', '', 4) . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . "_" . $xaxisarray[$i] . ") ") . "\n"; $pdfoutput[$a][$i] = "__"; } else { $question['ANSWER'] .= "\t\t\t\t" . self::_input_type_image('checkbox') . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . "_" . $xaxisarray[$i] . ") ") . "\n"; $pdfoutput[$a][$i] = "o"; } $question['ANSWER'] .= "\t\t\t</td>\n"; } $answertext = $mearow['question']; if (strpos($answertext, '|')) { $answertext = substr($answertext, strpos($answertext, '|') + 1); $question['ANSWER'] .= "\t\t\t<th class=\"answertextright\">{$answertext}</th>\n"; //$pdfoutput[$a][$i]=$answertext; } $question['ANSWER'] .= "\t\t</tr>\n"; $a++; } $question['ANSWER'] .= "\t</tbody>\n</table>\n"; if (isset($_POST['printableexport'])) { $pdf->tableintopdf($pdfoutput); } break; // ================================================================== // ================================================================== case ";": //ARRAY (Multi Flexible) (text) $headstyle = "style='padding-left: 20px; padding-right: 7px'"; $mearesult = Questions::model()->getAllRecords(" parent_qid='{$deqrow['qid']}' AND scale_id=0 AND language='{$surveyprintlang}' ", array('question_order')); $question['QUESTION_TYPE_HELP'] .= self::_array_filter_help($qidattributes, $surveyprintlang, $surveyid); $question['ANSWER'] .= "\n<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<td> </td>\n"; $fresult = Questions::model()->getAllRecords(" parent_qid='{$deqrow['qid']}' AND scale_id=1 AND language='{$surveyprintlang}' ", array('question_order')); $fresult = $fresult->readAll(); $fcount = count($fresult); $fwidth = "120"; $i = 0; $pdfoutput = array(); $pdfoutput[0][0] = ''; //array to temporary store X axis question codes $xaxisarray = array(); foreach ($fresult as $frow) { $question['ANSWER'] .= "\t\t\t<th>{$frow['question']}</th>\n"; $i++; $pdfoutput[0][$i] = $frow['question']; //add current question code $xaxisarray[$i] = $frow['title']; } $question['ANSWER'] .= "\t\t</tr>\n\t</thead>\n\n<tbody>\n"; $a = 1; $rowclass = 'array1'; foreach ($mearesult->readAll() as $mearow) { $question['ANSWER'] .= "\t\t<tr class=\"{$rowclass}\">\n"; $rowclass = alternation($rowclass, 'row'); $answertext = $mearow['question']; if (strpos($answertext, '|')) { $answertext = substr($answertext, 0, strpos($answertext, '|')); } $question['ANSWER'] .= "\t\t\t<th class=\"answertext\">{$answertext}</th>\n"; $pdfoutput[$a][0] = $answertext; //$printablesurveyoutput .="\t\t\t\t\t<td>"; for ($i = 1; $i <= $fcount; $i++) { $question['ANSWER'] .= "\t\t\t<td>\n"; $question['ANSWER'] .= "\t\t\t\t" . self::_input_type_image('text', '', 23) . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . "_" . $xaxisarray[$i] . ") ") . "\n"; $question['ANSWER'] .= "\t\t\t</td>\n"; $pdfoutput[$a][$i] = "_____________"; } $answertext = $mearow['question']; if (strpos($answertext, '|')) { $answertext = substr($answertext, strpos($answertext, '|') + 1); $question['ANSWER'] .= "\t\t\t\t<th class=\"answertextright\">{$answertext}</th>\n"; } $question['ANSWER'] .= "\t\t</tr>\n"; $a++; } $question['ANSWER'] .= "\t</tbody>\n</table>\n"; if (isset($_POST['printableexport'])) { $pdf->tableintopdf($pdfoutput); } break; // ================================================================== // ================================================================== case "F": //ARRAY (Flexible Labels) $mearesult = Questions::model()->getAllRecords(" parent_qid='{$deqrow['qid']}' AND language='{$surveyprintlang}' ", array('question_order')); $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please choose the appropriate response for each item:"); $question['QUESTION_TYPE_HELP'] .= self::_array_filter_help($qidattributes, $surveyprintlang, $surveyid); $fresult = Answers::model()->getAllRecords(" scale_id=0 AND qid='{$deqrow['qid']}' AND language='{$surveyprintlang}'", array('sortorder', 'code')); $fresult = $fresult->readAll(); $fcount = count($fresult); $fwidth = "120"; $i = 1; $pdfoutput = array(); $pdfoutput[0][0] = ''; if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please choose the appropriate response for each item:"), "U"); } $column_headings = array(); foreach ($fresult as $frow) { $column_headings[] = $frow['answer'] . self::_addsgqacode(" (" . $frow['code'] . ")"); } if (trim($qidattributes['answer_width']) != '') { $iAnswerWidth = 100 - $qidattributes['answer_width']; } else { $iAnswerWidth = 80; } if (count($column_headings) > 0) { $col_width = round($iAnswerWidth / count($column_headings)); } else { $heading = ''; } $question['ANSWER'] .= "\n<table>\n\t<thead>\n\t\t<tr>\n"; $question['ANSWER'] .= "\t\t\t<td> </td>\n"; foreach ($column_headings as $heading) { $question['ANSWER'] .= "\t\t\t<th style=\"width:{$col_width}%;\">{$heading}</th>\n"; } $pdfoutput[0][$i] = $heading; $i++; $question['ANSWER'] .= "\t\t</tr>\n\t</thead>\n\n\t<tbody>\n"; $counter = 1; $rowclass = 'array1'; foreach ($mearesult->readAll() as $mearow) { $question['ANSWER'] .= "\t\t<tr class=\"{$rowclass}\">\n"; $rowclass = alternation($rowclass, 'row'); if (trim($answertext) == '') { $answertext = ' '; } //semantic differential question type? if (strpos($mearow['question'], '|')) { $answertext = substr($mearow['question'], 0, strpos($mearow['question'], '|')) . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . ")") . " "; } else { $answertext = $mearow['question'] . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . ")"); } if (trim($qidattributes['answer_width']) != '') { $sInsertStyle = ' style="width:' . $qidattributes['answer_width'] . '%" '; } else { $sInsertStyle = ''; } $question['ANSWER'] .= "\t\t\t<th {$sInsertStyle} class=\"answertext\">{$answertext}</th>\n"; $pdfoutput[$counter][0] = $answertext; for ($i = 1; $i <= $fcount; $i++) { $question['ANSWER'] .= "\t\t\t<td>" . self::_input_type_image('radio') . "</td>\n"; $pdfoutput[$counter][$i] = "o"; } $counter++; $answertext = $mearow['question']; //semantic differential question type? if (strpos($mearow['question'], '|')) { $answertext2 = substr($mearow['question'], strpos($mearow['question'], '|') + 1); $question['ANSWER'] .= "\t\t\t<th class=\"answertextright\">{$answertext2}</th>\n"; } $question['ANSWER'] .= "\t\t</tr>\n"; } $question['ANSWER'] .= "\t</tbody>\n</table>\n"; if (isset($_POST['printableexport'])) { $pdf->tableintopdf($pdfoutput); } break; // ================================================================== // ================================================================== case "1": //ARRAY (Flexible Labels) multi scale $leftheader = $qidattributes['dualscale_headerA'][$surveyprintlang]; $rightheader = $qidattributes['dualscale_headerB'][$surveyprintlang]; $headstyle = 'style="padding-left: 20px; padding-right: 7px"'; //$meaquery = "SELECT * FROM {{questions}} WHERE parent_qid={$deqrow['qid']} AND language='{$surveyprintlang}' ORDER BY question_order"; //$mearesult = Yii::app()->db->createCommand($meaquery)->query(); $mearesult = Questions::model()->getAllRecords(" parent_qid={$deqrow['qid']} AND language='{$surveyprintlang}' ", array('question_order')); $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please choose the appropriate response for each item:"); $question['QUESTION_TYPE_HELP'] .= self::_array_filter_help($qidattributes, $surveyprintlang, $surveyid); if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please choose the appropriate response for each item:"), "U"); } $question['ANSWER'] .= "\n<table>\n\t<thead>\n"; $condition = "qid= '{$deqrow['qid']}' AND language= '{$surveyprintlang}' AND scale_id=0"; $fresult = Answers::model()->getAllRecords($condition, array('sortorder', 'code')); $fresult = $fresult->readAll(); $fcount = count($fresult); $fwidth = "120"; $l1 = 0; $printablesurveyoutput2 = "\t\t\t<td> </td>\n"; $myheader2 = ''; $pdfoutput = array(); $pdfoutput[0][0] = ''; foreach ($fresult as $frow) { $printablesurveyoutput2 .= "\t\t\t<th>{$frow['answer']}" . self::_addsgqacode(" (" . $frow['code'] . ")") . "</th>\n"; $myheader2 .= "<td></td>"; $pdfoutput[0][$l1 + 1] = $frow['answer']; $l1++; } // second scale $printablesurveyoutput2 .= "\t\t\t<td> </td>\n"; //$fquery1 = "SELECT * FROM {{answers}} WHERE qid='{$deqrow['qid']}' AND language='{$surveyprintlang}' AND scale_id=1 ORDER BY sortorder, code"; // $fresult1 = Yii::app()->db->createCommand($fquery1)->query(); $fresult1 = Answers::model()->getAllRecords(" qid='{$deqrow['qid']}' AND language='{$surveyprintlang}' AND scale_id=1 ", array('sortorder', 'code')); $fresult1 = $fresult1->readAll(); $fcount1 = count($fresult1); $fwidth = "120"; $l2 = 0; //array to temporary store second scale question codes $scale2array = array(); foreach ($fresult1 as $frow1) { $printablesurveyoutput2 .= "\t\t\t<th>{$frow1['answer']}" . self::_addsgqacode(" (" . $frow1['code'] . ")") . "</th>\n"; $pdfoutput[1][$l2] = $frow['answer']; //add current question code $scale2array[$l2] = $frow1['code']; $l2++; } // build header if needed if ($leftheader != '' || $rightheader != '') { $myheader = "\t\t\t<td> </td>"; $myheader .= "\t\t\t<th colspan=\"" . $l1 . "\">{$leftheader}</th>\n"; if ($rightheader != '') { // $myheader .= "\t\t\t\t\t" .$myheader2; $myheader .= "\t\t\t<td> </td>"; $myheader .= "\t\t\t<th colspan=\"" . $l2 . "\">{$rightheader}</td>\n"; } $myheader .= "\t\t\t\t</tr>\n"; } else { $myheader = ''; } $question['ANSWER'] .= $myheader . "\t\t</tr>\n\n\t\t<tr>\n"; $question['ANSWER'] .= $printablesurveyoutput2; $question['ANSWER'] .= "\t\t</tr>\n\t</thead>\n\n\t<tbody>\n"; $rowclass = 'array1'; //counter for each subquestion $sqcounter = 0; foreach ($mearesult->readAll() as $mearow) { $question['ANSWER'] .= "\t\t<tr class=\"{$rowclass}\">\n"; $rowclass = alternation($rowclass, 'row'); $answertext = $mearow['question'] . self::_addsgqacode(" (" . $fieldname . $mearow['title'] . "#0) / (" . $fieldname . $mearow['title'] . "#1)"); if (strpos($answertext, '|')) { $answertext = substr($answertext, 0, strpos($answertext, '|')); } $question['ANSWER'] .= "\t\t\t<th class=\"answertext\">{$answertext}</th>\n"; for ($i = 1; $i <= $fcount; $i++) { $question['ANSWER'] .= "\t\t\t<td>" . self::_input_type_image('radio') . "</td>\n"; } $question['ANSWER'] .= "\t\t\t<td> </td>\n"; for ($i = 1; $i <= $fcount1; $i++) { $question['ANSWER'] .= "\t\t\t<td>" . self::_input_type_image('radio') . "</td>\n"; } $answertext = $mearow['question']; if (strpos($answertext, '|')) { $answertext = substr($answertext, strpos($answertext, '|') + 1); $question['ANSWER'] .= "\t\t\t<th class=\"answertextright\">{$answertext}</th>\n"; } $question['ANSWER'] .= "\t\t</tr>\n"; //increase subquestion counter $sqcounter++; } $question['ANSWER'] .= "\t</tbody>\n</table>\n"; if (isset($_POST['printableexport'])) { $pdf->tableintopdf($pdfoutput); } break; // ================================================================== // ================================================================== case "H": //ARRAY (Flexible Labels) by Column //$headstyle="style='border-left-style: solid; border-left-width: 1px; border-left-color: #AAAAAA'"; $headstyle = "style='padding-left: 20px; padding-right: 7px'"; $condition = "parent_qid= '{$deqrow['qid']}' AND language= '{$surveyprintlang}'"; $fresult = Questions::model()->getAllRecords($condition, array('question_order', 'title')); $fresult = $fresult->readAll(); $question['QUESTION_TYPE_HELP'] .= $clang->gT("Please choose the appropriate response for each item:"); if (isset($_POST['printableexport'])) { $pdf->intopdf($clang->gT("Please choose the appropriate response for each item:"), "U"); } $question['ANSWER'] .= "\n<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<td> </td>\n"; $mearesult = Answers::model()->getAllRecords(" qid='{$deqrow['qid']}' AND scale_id=0 AND language='{$surveyprintlang}' ", array('sortorder', 'code')); $fcount = count($fresult); $fwidth = "120"; $i = 0; $pdfoutput = array(); $pdfoutput[0][0] = ''; foreach ($fresult as $frow) { $question['ANSWER'] .= "\t\t\t<th>{$frow['question']}" . self::_addsgqacode(" (" . $fieldname . $frow['title'] . ")") . "</th>\n"; $i++; $pdfoutput[0][$i] = $frow['question']; } $question['ANSWER'] .= "\t\t</tr>\n\t</thead>\n\n\t<tbody>\n"; $a = 1; $rowclass = 'array1'; foreach ($mearesult->readAll() as $mearow) { //$_POST['type']=$type; $question['ANSWER'] .= "\t\t<tr class=\"{$rowclass}\">\n"; $rowclass = alternation($rowclass, 'row'); $question['ANSWER'] .= "\t\t\t<th class=\"answertext\">{$mearow['answer']}" . self::_addsgqacode(" (" . $mearow['code'] . ")") . "</th>\n"; //$printablesurveyoutput .="\t\t\t\t\t<td>"; $pdfoutput[$a][0] = $mearow['answer']; for ($i = 1; $i <= $fcount; $i++) { $question['ANSWER'] .= "\t\t\t<td>" . self::_input_type_image('radio') . "</td>\n"; $pdfoutput[$a][$i] = "o"; } //$printablesurveyoutput .="\t\t\t\t\t</tr></table></td>\n"; $question['ANSWER'] .= "\t\t</tr>\n"; $a++; } $question['ANSWER'] .= "\t</tbody>\n</table>\n"; if (isset($_POST['printableexport'])) { $pdf->tableintopdf($pdfoutput); } break; case "|": // File Upload $question['QUESTION_TYPE_HELP'] .= "Kindly attach the aforementioned documents along with the survey"; break; // === END SWITCH =================================================== } if (isset($_POST['printableexport'])) { $pdf->ln(5); } $question['QUESTION_TYPE_HELP'] = self::_star_replace($question['QUESTION_TYPE_HELP']); $group['QUESTIONS'] .= self::_populate_template('question', $question); } if ($bGroupHasVisibleQuestions) { $survey_output['GROUPS'] .= self::_populate_template('group', $group); } } $survey_output['THEREAREXQUESTIONS'] = str_replace('{NUMBEROFQUESTIONS}', $total_questions, $clang->gT('There are {NUMBEROFQUESTIONS} questions in this survey')); // START recursive tag stripping. // PHP 5.1.0 introduced the count parameter for preg_replace() and thus allows this procedure to run with only one regular expression. // Previous version of PHP needs two regular expressions to do the same thing and thus will run a bit slower. $server_is_newer = version_compare(PHP_VERSION, '5.1.0', '>'); $rounds = 0; while ($rounds < 1) { $replace_count = 0; if ($server_is_newer) { $survey_output['GROUPS'] = preg_replace(array('/<td>(?: | | )?<\\/td>/isU', '/<th[^>]*>(?: | | )?<\\/th>/isU', '/<([^ >]+)[^>]*>(?: | |\\r\\n|\\n\\r|\\n|\\r|\\t| )*<\\/\\1>/isU'), array('[[EMPTY-TABLE-CELL]]', '[[EMPTY-TABLE-CELL-HEADER]]', ''), $survey_output['GROUPS'], -1, $replace_count); } else { $survey_output['GROUPS'] = preg_replace(array('/<td>(?: | | )?<\\/td>/isU', '/<th[^>]*>(?: | | )?<\\/th>/isU', '/<([^ >]+)[^>]*>(?: | |\\r\\n|\\n\\r|\\n|\\r|\\t| )*<\\/\\1>/isU'), array('[[EMPTY-TABLE-CELL]]', '[[EMPTY-TABLE-CELL-HEADER]]', ''), $survey_output['GROUPS']); $replace_count = preg_match('/<([^ >]+)[^>]*>(?: | |\\r\\n|\\n\\r|\\n|\\r|\\t| )*<\\/\\1>/isU', $survey_output['GROUPS']); } if ($replace_count == 0) { ++$rounds; $survey_output['GROUPS'] = preg_replace(array('/\\[\\[EMPTY-TABLE-CELL\\]\\]/', '/\\[\\[EMPTY-TABLE-CELL-HEADER\\]\\]/', '/\\n(?:\\t*\\n)+/'), array('<td> </td>', '<th> </th>', "\n"), $survey_output['GROUPS']); } } $survey_output['GROUPS'] = preg_replace('/(<div[^>]*>){NOTEMPTY}(<\\/div>)/', '\\1 \\2', $survey_output['GROUPS']); // END recursive empty tag stripping. if (isset($_POST['printableexport'])) { if ($surveystartdate != '') { if (isset($_POST['printableexport'])) { $pdf->intopdf(sprintf($clang->gT("Please submit by %s"), $surveyexpirydate)); } } if (!empty($surveyfaxto) && $surveyfaxto != '000-00000000') { if (isset($_POST['printableexport'])) { $pdf->intopdf(sprintf($clang->gT("Please fax your completed survey to: %s"), $surveyfaxto), 'B'); } } $pdf->titleintopdf($clang->gT("Submit Your Survey."), $clang->gT("Thank you for completing this survey.")); $pdf->write_out($clang->gT($surveyname) . " " . $surveyid . ".pdf"); } else { echo self::_populate_template('survey', $survey_output); } }
$pdf->SetFont('Arial', 'B', 12); $pdf->Cell($width, $height, strtoupper($_SESSION['lang']['penggunaanhk']), 0, 1, 'C'); $pdf->Ln(); $pdf->SetFillColor(255, 255, 255); $pdf->Cell($width, $height, $_SESSION['lang']['unit'] . ' : ' . $optNm[$kodeOrg], 0, 1, 'C'); $pdf->SetFont('Arial', '', 8); $pdf->Cell(650, $height, $_SESSION['lang']['tanggal'], 0, 0, 'R'); $pdf->Cell(10, $height, ':', '', 0, 0, 'R'); $pdf->Cell(70, $height, date('d-m-Y H:i'), 0, 1, 'R'); // $pdf->Cell(650,$height,$_SESSION['lang']['page'],0,0,'R'); // $pdf->Cell(10,$height,':','',0,0,'R'); // $pdf->Cell(70,$height,$pdf->PageNo(),0,1,'R'); $pdf->Cell(650, $height, 'User', 0, 0, 'R'); $pdf->Cell(10, $height, ':', '', 0, 0, 'R'); $pdf->Cell(70, $height, $_SESSION['standard']['username'], 0, 1, 'R'); $pdf->ln(18); $pdf->SetFont('Arial', 'B', 6); $pdf->Cell(85, $height, "HK Perawatan", 0, 1, 'L', 1); $pdf->SetFillColor(220, 220, 220); $pdf->Cell(65, $height, $_SESSION['lang']['kodekegiatan'], 'TLR', 0, 'C', 1); $pdf->Cell(165, $height, $_SESSION['lang']['kegiatan'], 'TLR', 0, 'C', 1); $pdf->Cell(55, $height, $_SESSION['lang']['blok'], 'TLR', 0, 'C', 1); $pdf->Cell(260, $height, $_SESSION['lang']['blnini'], 'TLR', 0, 'C', 1); $pdf->Cell(260, $height, $_SESSION['lang']['blnlalu'], 'TLR', 1, 'C', 1); $pdf->Cell(65, $height, " ", 'LR', 0, 'C', 1); $pdf->Cell(165, $height, " ", 'LR', 0, 'C', 1); $pdf->Cell(55, $height, " ", 'LR', 0, 'C', 1); $pdf->Cell(70, $height, $_SESSION['lang']['hasilkerjajumlah'], 'TLR', 0, 'C', 1); $pdf->Cell(145, $height, $_SESSION['lang']['jumlahhk'], 'TLR', 0, 'C', 1); $pdf->Cell(45, $height, $_SESSION['lang']['jumlahhk'] . "/" . $_SESSION['lang']['satuan'], 'TLR', 0, 'C', 1); $pdf->Cell(70, $height, $_SESSION['lang']['hasilkerjajumlah'], 'TLR', 0, 'C', 1);
} } //Instancia a classe gerador de pdf $pdf = new PDF(); //Define os atributos de propriedade do arquivo PDF $pdf->SetCreator('Work Eventos - CopyRight(c) - Work Labs Tecnologia - www.worklabs.com.br'); $pdf->SetAuthor($usuarioNome . ' - ' . $empresaNome); $pdf->SetTitle('Detalhamento do Evento'); $pdf->SetSubject('Relatório gerado automaticamente pelo sistema'); $pdf->AliasNbPages(); //Cria a página do relatório $pdf->AddPage(); //Nova linha $pdf->SetFont('Arial', 'B', 14); $pdf->Cell(0, 7, $dados_evento['nome'], 1, 0, 'C'); $pdf->ln(4); //Nova linha $pdf->ln(); $pdf->SetFont('Arial', 'B', 10); $pdf->SetFillColor(178, 178, 178); $pdf->Cell(0, 6, 'Detalhamento do Evento', 1, 0, 'C', 1); $pdf->SetFont('Arial', 'I', 9); $pdf->ln(); $pdf->MultiCell(0, 4, $dados_evento['descricao'], 1); $pdf->SetFont('Arial', 'B', 9); $pdf->Cell(0, 4, 'Tipo:', 1, 0, 'L'); $pdf->SetFont('Arial', 'B', 9); $pdf->SetX(35); $pdf->Cell(0, 4, $desc_tipo, 0, 0, 'L'); $pdf->ln(); //Nova linha
include_once 'bookingclass.inc.php'; $booking = new Booking(); $bookid = $request->GetVar('bookid', 'get'); $bookdata = $booking->getMeldedata($bookid); define('FPDF_FONTPATH', $fontpath); include_once 'fpdf.php'; include_once 'pdf.php'; $fonttype = 'times'; $pdf = new PDF(); $pdf->Open(); $pdf->SetTitle('ZVS Meldeschein'); $pdf->SetAuthor($request->GetVar('hotel_name', 'session')); $pdf->SetCreator('ZVS'); $pdf->AliasNbPages(); $pdf->AddPage(P); $pdf->ln(5); $y = $pdf->GetY(); // Address $pdf->SetFont($fonttype, 'B', 10); $pdf->Write(5, $request->GetVar('hotel_name', 'session')); $pdf->ln(4); $pdf->SetFont($fonttype, '', 10); $pdf->Write(5, $request->GetVar('hotel_street', 'session')); $pdf->ln(4); $pdf->SetFont($fonttype, '', 10); $pdf->Write(5, $request->GetVar('hotel_zip', 'session') . " " . $request->GetVar('hotel_city', 'session')); // Headline $pdf->SetXY(120, $y); $pdf->SetFont($fonttype, 'B', 12); $pdf->Write(5, "Meldeschein für Beherbergungsstätten"); $pdf->SetXY(120, $y + 5);
$soma_fechado = 0; $quebra = 0; while ($dados = mysql_fetch_array($sql)) { switch ($dados[status]) { case 0: $desc_status = "Em Aberto"; $soma_aberto++; break; case 1: $desc_status = "Concluído"; $soma_fechado++; break; } //Verifica a quebra if ($quebra != $dados["evento_id"]) { $pdf->ln(8); $pdf->SetFont("Arial", "B", 14); $pdf->Cell(0, 7, '(' . $dados["evento_id"] . ') - ' . $dados["evento_nome"], 'T'); $pdf->SetFont("Arial", "", 10); $pdf->ln(4); } $pdf->ln(); $pdf->Cell(26, 5, $desc_status); $pdf->SetFont("Arial", "B", 10); $pdf->Cell(80, 5, $dados["atividade_nome"]); $pdf->SetFont("Arial", "", 10); $pdf->Cell(14, 5, $dados["atividade_dias"], 0, 'C'); $pdf->Cell(30, 5, DataMySQLRetornar($dados["data_prazo"])); if ($dados["data_execucao"] != '0000-00-00') { $pdf->Cell(30, 5, DataMySQLRetornar($dados["data_execucao"])); } else {
$pdf->Cell(80, 5, $namabarang, 1, 0, 'L', 1); $pdf->Cell(15, 5, $satuan, 1, 0, 'L', 1); $pdf->Cell(18, 5, number_format($jumlah, 2, '.', ','), 1, 1, 'R', 1); } //footer================================ // $dtpenerima=namakaryawan($dbname,$conn,$penerima); // $dtpengetahui=namakaryawan($dbname,$conn,$pengetahui); $dptinY = $pdf->GetY(); $dptinX = $pdf->GetX(); $pdf->SetY($dptinY + 25); $pdf->SetX($dptinX); $pdf->SetFillColor(255, 255, 255); $pdf->SetFont('Arial', 'B', 8); if (substr($expend, 0, 1) == 'S') { $dert = $_SESSION['lang']['expeditor']; $duer = $optSupplier[$expend]; } else { $dert = $_SESSION['lang']['dibawa']; $duer = $optKary[$expend]; } $pdf->Cell(50, $height, $_SESSION['lang']['penerima'] . ",", 0, 0, 'C', 0); $pdf->Cell(70, $height, $dert . ",", 0, 0, 'C', 0); $pdf->Cell(65, $height, $_SESSION['lang']['pengirim'] . ",", 0, 1, 'C', 0); $pdf->ln(25); $pdf->SetFont('Arial', 'U', 8); $pdf->Cell(50, $height, $penerima, 0, 0, 'C', 0); $pdf->SetFont('Arial', 'U', 8); $pdf->Cell(70, $height, $duer, 0, 0, 'C', 0); $pdf->SetFont('Arial', 'U', 8); $pdf->Cell(65, $height, $optNmoRg[$pengirim], 0, 1, 'C', 0); $pdf->Output();
$this->SetFont('Arial', '', 10); $this->MultiCell(0, 5, $this->pie, 0, C); } } $db = new ConnectionHandler("{$ruta_raiz}"); $db->conn->SetFetchMode(ADODB_FETCH_ASSOC); $pdf = new PDF('p', 'mm', 'letter'); $pdf->pie = $pie; $pdf->AddPage(); $pdf->SetTitle("Departamento Nacional de Planeacion"); $pdf->SetLeftMargin(25); $pdf->SetRightMargin(25); $pdf->SetFont('Arial', 'B', 12); $pdf->Cell(50, 5, $numradicado, 0, 1, L); $pdf->Cell(105, 5, $lugar . "., " . $fecha, 0, 1, L); $pdf->ln(18); $pdf->SetFont('Arial', '', 12); $pdf->write(5, $asu); $pdf->ln(25); $pdf->Cell(60, 5, $mensaje, 0, 1, L); $pdf->ln(5); $pdf->MultiCell(0, 5, $reseptor, 0, L); $primerno = substr($numRadicadoPadre, 0, 4); $segundono = substr($numRadicadoPadre, 4, 3); $ruta = "/" . $primerno . "/" . $segundono . "/docs/" . $numradicado; $adjuntos = BODEGAPATH . $ruta; $pdf->Output($adjuntos . '.pdf', 'f'); $enlace = "../bodega" . $ruta . '.pdf'; radi_paht($db, $ruta, $numradicado); return $numradicado . '.pdf'; }
//$pdf->AliasNbPages(); $pdf->setAutoPageBreak(TRUE, 45); $pdf->AddPage('P', 'A4'); $pdf->SetFont('helvetica', 'B', 13); $pdf->SetY(56); $pdf->Cell(125, 8, $supp->getName(), 0, 0, 'L'); $pdf->SetFont('helvetica', 'B', 14); $pdf->Cell(100, 8, "DC NO: {$dcno}", 0, 1, 'L'); $pdf->SetFont('helvetica', '', 13); $pdf->Cell(125, 8, $supp->getAddressl1(), 0, 0, 'L'); $pdf->Cell(100, 8, "Date: {$dcdate}", 0, 1, 'L'); $pdf->Cell(125, 8, $supp->getAddressl2(), 0, 0, 'L'); $pdf->Cell(100, 8, "Your Ref: {$cref}", 0, 1, 'L'); $pdf->Cell(125, 8, "Phone No: " . $supp->getPhoneNo(), 0, 0, 'L'); $pdf->Cell(100, 8, "Date: {$crefdate}", 0, 1, 'L'); $pdf->ln(); $pdf->line(0, 87, 220, 87); //line before mode of dispatch $pdf->setY(86); $pdf->MultiCell(125, 16, "Please receive the following materials and acknowledge the receipt", 0, 'L', 0, 0, '', '', true, 0, false, true, 16, 'M', true); $pdf->Cell(100, 8, "Mode Of Dispatch: {$dmode}", 0, 1, 'L'); $pdf->Cell(125, 8, "", 0, 0, 'L'); $pdf->Cell(100, 8, "Status: {$dctype}", 0, 1, 'L'); $pdf->SetFont('helvetica', '', 10); $pdf->Cell(150, 8, '', 0, 1, 'L'); $pdf->line(0, 101, 220, 101); //line after mode of dispatch $pdf->line(135, 55, 135, 101); //vertical line b/w address and dc no $pdf->line(135, 72, 220, 72); //horizontal line b/w dc no and cust ref
} } class PDF extends PPDF { } $pdf = new PDF("L", "mm", array(140, 216)); $pdf->OrientacionObligada = "L"; //$pdf=new PDF("P","mm","letter"); //$pdf->SetProtection(array('print')); //array('print' => 4, 'modify' => 8, 'copy' => 16, 'annot-forms' => 32 ); $pdf->AddPage(); $pdf->SetAutoPageBreak(true, 0); //$pdf->Cell(196,80,"",1); $pdf->CuadroCuerpoPersonalizado(100, $idioma["DatosPersonales"], 1, "", 0, "B"); $pdf->CuadroCuerpoPersonalizado(76, $idioma["NumerosContacto"], 1, "", 0, "B"); $pdf->ln(); $pdf->CuadroCuerpoPersonalizado(40, $idioma["Paterno"] . ": ", 0, "L", $borde, "B"); $pdf->CuadroCuerpo(60, capitalizar($al['Paterno'])); $pdf->CuadroCuerpoPersonalizado(50, $idioma["TelefonoCasa"] . ": ", 0, "L", $borde, "B"); $pdf->CuadroCuerpo(60, capitalizar($al['TelefonoCasa']), 0, "", $borde); $pdf->ln(); $pdf->CuadroCuerpoPersonalizado(40, $idioma["Materno"] . ": ", 0, "L", $borde, "B"); $pdf->CuadroCuerpo(60, capitalizar($al['Materno'])); $pdf->CuadroCuerpoPersonalizado(50, $idioma["CelularPadre"] . ": ", 0, "L", $borde, "B"); $pdf->CuadroCuerpo(60, capitalizar($al['CelularP']), 0, "", $borde); $pdf->ln(); $pdf->CuadroCuerpoPersonalizado(40, $idioma["Nombre"] . ": ", 0, "L", $borde, "B"); $pdf->CuadroCuerpo(60, capitalizar($al['Nombres'])); $pdf->CuadroCuerpoPersonalizado(50, $idioma["CelularMadre"] . ": ", 0, "L", $borde, "B"); $pdf->CuadroCuerpo(60, capitalizar($al['CelularM']), 0, "", $borde); $pdf->ln();
$pdf = new PDF(); //Define os atributos de propriedade do arquivo PDF $pdf->SetCreator('work | eventos'); $pdf->SetAuthor($usuarioNome . ' - ' . $empresaNome); $pdf->SetTitle('Relação de Retornos por Data'); $pdf->SetSubject('Relatório gerado automaticamente pelo sistema'); $pdf->AliasNbPages(); $pdf->AddPage('L'); //Verifica se existem registros if ($registros > 0) { //Define o status zero para fazer a quebra if ($edtTipoConsulta == "0") { $status_atual = 1; $pdf->SetFont('Arial', 'B', 14); $pdf->Cell(0, 5, "Títulos Processados"); $pdf->ln(); } else { $status_atual = $edtTipoConsulta; switch ($status_atual) { case 1: $desc_situacao = "Títulos Processados"; break; case 2: $desc_situacao = "Titulos Não Processados - Juros"; break; case 3: $desc_situacao = "Títulos Não Encontrados"; break; } $pdf->SetFont('Arial', 'B', 14); $pdf->Cell(0, 5, $desc_situacao);
$pdf->SetTextColor(0, 0, 0); $pdf->SetFillColor(255, 255, 255); while ($row = mysql_fetch_assoc($res)) { $cont++; $string = array($cont, $row["itinerario"], $row["concepto"], $row["total"], strip_tags($row["mensaje"]), $row["excedente"], $row["politica"], $row["tipoExcepcion"]); $heigthCell = 4; $pdf->createTable($string, $widthLimitString, $factor, $pixelLength, $heigthCell, $setX = 10); $totalConcepto += floatval(preg_replace("/,/", "", $string[3])); } $pdf->SetFont('consola', 'B', 7); $pdf->SetTextColor(0, 0, 0); $pdf->SetX(220); $pdf->Cell(18, 4, "Total Anticipo(s): ", "", 'L'); $pdf->SetX(248); $pdf->Cell(18, 4, number_format($totalConcepto, 2, '.', ',') . " MXN", 0, 0, 'R'); $pdf->ln(15); } else { $pdf->Ln(5); $pdf->SetFont('consola', 'B', 7); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(0, 5, 'El empleado no solicitó ningún anticipo', 0, 1, 'C'); } //TOTAL SOLICITUD $sql = "SELECT sv_total FROM solicitud_viaje WHERE sv_tramite = {$idTramite}"; $res = mysql_query($sql); $totalSolicitud = mysql_result($res, 0, "sv_total"); $pdf->SetFont('consola', 'B', 7); $pdf->SetTextColor(0, 0, 0); $pdf->SetX(222); $pdf->Cell(18, 4, "Total solicitud: ", "", 'R'); $pdf->SetX(249);
while ($row2 = $prep_state->fetch(PDO::FETCH_ASSOC)) { $nombre = $row2['nombre'] . " " . $row2['apaterno'] . " " . $row2['amaterno']; $lugartrabajo = $row2['lugartrabajo']; $fechanacimiento = $row2['fechanacimiento']; $edad = $row2['edad']; $estadocivil = $row2['estadocivil']; $escolaridad = $row2['escolaridad']; $domicilio = $row2['domicilio']; $telefono = $row2['telefono']; $correo = $row2['correo']; $fechaelaboracion = $row2['fechaelaboracion']; $pdf->SetFont('Arial', '', 10); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 14); $pdf->Cell(0, 10, 'FICHA DE IDENTIFICACION DEL ALUMNO', 0, 0, 'C'); $pdf->ln(15); $pdf->Cell(0, 10, 'DATOS GENERALES', 0, 0, 'C'); $pdf->ln(15); $pdf->SetFont('Arial', 'B', 11); $pdf->ln(10); $pdf->SetFont('Arial', 'B', '11'); $pdf->Cell(0, 0, " NOMBRE COMPLETO: {$nombre} ", 0, 'L'); $pdf->ln(13); $pdf->Cell(0, 0, " LUGAR DE TRABAJO: {$lugartrabajo} ", 5, 'L'); $pdf->ln(13); $pdf->Cell(0, 0, " FECHA DE NACIMIENTO: {$fechanacimiento} ", 5, 'L'); $pdf->ln(13); $pdf->Cell(0, 0, " EDAD: {$edad} ", 5, 'L'); $pdf->ln(13); $pdf->Cell(0, 0, " ESTADO CIVIL: {$estadocivil} ESCOLARIDAD: {$escolaridad} ", 5, 'L'); $pdf->ln(13);
$pdf = new PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); //$pdf->AliasNbPages(); $pdf->setAutoPageBreak(TRUE, 45); $pdf->AddPage('P', 'A4'); $pdf->SetFont('helvetica', 'B', 13); $pdf->SetY(56); $pdf->SetFont('helvetica', 'B', 11); $pdf->setY(100); $pdf->Cell(20, 8, "SL NO", 0, 0, 'L'); $pdf->Cell(80, 8, "Description", 0, 0, 'L'); $pdf->Cell(20, 8, "Qty", 0, 0, 'C'); $pdf->Cell(30, 8, "Unit Price " . $currency, 0, 0, 'C'); $pdf->Cell(30, 8, "Discount", 0, 0, 'C'); $pdf->line(0, 110, 220, 110); //line after slno, desc and remarks $pdf->ln(6); $j = 0; while ($j < count($description)) { if ($description[$j] != '') { $pdf->ln(8); $pdf->Cell(10, 8, $j + 1, 0, 0, 'C'); $pdf->MultiCell(95, 8, $description[$j], 0, 'L', 0, 0, '', '', true, 0, false, true, 8, 'M', true); $pdf->Cell(15, 8, $itemqty[$j], 0, 0, 'C'); $pdf->Cell(30, 8, $price[$j], 0, 0, 'R'); $pdf->MultiCell(30, 8, $discount[$j], 0, '', 0, 0, '', '', true, 0, false, true, 8, 'M', true); if ($pdf->getY() > $pdf->getPageHeight() - 56.5) { $pdf->rollbackTransaction(true); $pdf->AddPage(); $pdf->setY(100); } }
$question['ANSWER'] .= "\t\t</tr>\n"; $a++; } $question['ANSWER'] .= "\t</tbody>\n</table>\n"; if (isset($_POST['printableexport'])) { $pdf->tableintopdf($pdfoutput); } break; case "|": // File Upload $question['QUESTION_TYPE_HELP'] .= "Kindly attach the aforementioned documents along with the survey"; break; // === END SWITCH =================================================== } if (isset($_POST['printableexport'])) { $pdf->ln(5); } $question['QUESTION_TYPE_HELP'] = star_replace($question['QUESTION_TYPE_HELP']); $group['QUESTIONS'] .= populate_template('question', $question); } if ($bGroupHasVisibleQuestions) { $survey_output['GROUPS'] .= populate_template('group', $group); } } $survey_output['THEREAREXQUESTIONS'] = str_replace('{NUMBEROFQUESTIONS}', $total_questions, $clang->gT('There are {NUMBEROFQUESTIONS} questions in this survey')); // START recursive tag stripping. // PHP 5.1.0 introduced the count parameter for preg_replace() and thus allows this procedure to run with only one regular expression. // Previous version of PHP needs two regular expressions to do the same thing and thus will run a bit slower. $server_is_newer = version_compare(PHP_VERSION, '5.1.0', '>'); $rounds = 0; while ($rounds < 1) {
<?php require 'mc_indent.php'; $InterLigne = 7; $pdf = new PDF(); $pdf->AddPage(); $pdf->SetMargins(30, 10, 30); $pdf->SetFont('Arial', '', 12); $txt = "Cher Pierre"; $txtLen = $pdf->GetStringWidth($txt); $milieu = (210 - $txtLen) / 2; $pdf->SetX($milieu); $pdf->Write(5, $txt); $pdf->ln(30); $txt = "Voici venu le temps pour toi de renouveler ta licence-assurance, en effet celle-ci expire le 28/9 prochain. Tu trouveras joint à ce document le certificat d'aptitude à faire remplir par le médecin."; $pdf->MultiCell(0, $InterLigne, $txt, 0, 'J', 0, 15); $pdf->ln(10); $txt = "Je me permets de te rappeler que cette licence est obligatoire et nécessaire à la pratique de notre sport favori, tant à l'occasion de nos entraînements qu'à toutes autres manifestations auxquelles tu peux participer telles que compétitions, cours fédéraux ou visites amicales dans un autre club."; $pdf->MultiCell(0, $InterLigne, $txt, 0, 'J', 0, 15); $pdf->ln(10); $txt = "Dès lors, je te saurais gré de bien vouloir me retourner le certificat d'aptitude dûment complété par le médecin accompagné de ton paiement de 31 € ou de la preuve de celui-ci par virement bancaire. Le tout dans les plus brefs délais afin de ne pas interrompre la couverture de ladite assurance et par la même occasion de t'empêcher de participer à nos cours le temps de la régularisation. Il y va de ta sécurité."; $pdf->MultiCell(0, $InterLigne, $txt, 0, 'J', 0, 15); $pdf->ln(10); $txt = "Merci de la confiance que tu mets en notre club pour ton épanouissement sportif."; $pdf->MultiCell(0, $InterLigne, $txt, 0, 'J', 0, 15); $pdf->ln(10); $txt = "Le comité"; $pdf->MultiCell(0, $InterLigne, $txt, 0, 'R', 0); $pdf->Output();
$pdf->AliasNbPages(); $pdf->AddPage(); //Títulos das colunas $pdf->SetFont('Arial', 'B', 10); //Define a cor RGB do fundo da celula $pdf->SetFillColor(178, 178, 178); //Faz a célula ser preenchida. Isso é feito setando 1 após a expressao de alinhamento $pdf->Cell(0, 6, 'Descrição do Momento de Repertório', 1, 0, 'L', 1); $pdf->SetX(170); $pdf->Cell(0, 6, 'Ativo'); //Monta as linhas com os dados da query $pdf->SetFont('Arial', '', 10); while ($dados = mysql_fetch_array($sql)) { switch ($dados[ativo]) { case 0: $ativo = "Inativo"; break; case 1: $ativo = "Ativo"; break; } $pdf->ln(); $pdf->Cell(0, 5, $dados['nome']); $pdf->SetX(170); $pdf->Cell(0, 5, $ativo); } $pdf->SetFont('Arial', 'B', 8); $pdf->ln(); $pdf->Cell(0, 6, 'Total de registros listados: ' . $registros, 'T'); //Gera o PDF $pdf->Output();
$numCuentaTemporal = $fila['CUENTA']; $planEstudio = $fila['PLANESTUDIO']; $orientacion = $fila['ORIENTACION']; } $cadenaOrientacion = ", con orientación en " . $orientacion . ""; $cadenaPlanEstudio = "(" . $planEstudio . ")"; $fechaPalabras = $_POST["cadena"]; $statement->nextRowSet(); $statement->closeCursor(); $statement = $db->prepare('UPDATE sa_solicitudes SET fecha_exportacion = "' . $fechaExp . '" WHERE codigo = ' . $codsConstancias[$i] . ''); $statement->execute(); $statement->nextRowSet(); $statement->closeCursor(); $pdf->AddPage(); $pdf->Image($maindir . 'assets/img/Encabezado constancias.jpg', 20.0, 7, 176, 33.2, 'JPG'); $pdf->ln(65); $pdf->SetFont('Cambria', 'BI', 16); $pdf->SetLeftMargin(22); $pdf->SetRightMargin(22); $pdf->Cell(0, 0, utf8_decode("C O N S T A N C I A"), 0, 1, 'C'); //Definir la siguente cadena //$cadenaOrientacion = ""; $pdf->Ln(19); $pdf->SetFont('Cambria', 'I', 16); $pdf->SetLeftMargin(22); $pdf->SetRightMargin(22); $pdf->newFlowingBlock(170, 10, 0, 'J'); $pdf->SetFont('Cambria', 'I', 14); $pdf->WriteFlowingBlock(utf8_decode('El Suscrito, Secretario de la Facultad de Ciencias Jurídicas de la Universidad Nacional ' . 'Autónoma de Honduras, por medio de la presente HACE CONSTAR: ')); $pdf->SetFont('Cambria', 'I', 14); $pdf->WriteFlowingBlock(utf8_decode('Que el(la) alumno(a)'));