require "database.php"; require_once "mc_table.php"; require_once "linegraph.php"; require_once "diagram.php"; require_once "/fpdf/fpdf.php"; //$picture = "D://xampp//htdocs//BroadcastSystem//images//abs_cbn logo.png"; $pdf = new PDF_MC_Table(); $pdf->Open(); $pdf->AddPage('L'); //$pdf->Image($picture,20,5,20,20); $pdf->SetFont("Arial", "B", "16"); $pdf->Cell(0, 10, "Broadcast System & Maintenance", 0, 1, "C"); $pdf->SetFont("Arial", "", "12"); $pdf->Cell(0, 10, "Technical Operation Division", 0, 1, "C"); $pdf->SetFont("Arial", "B", "14"); $pdf->SetXY(10, 35); $pdf->SetTextColor(255, 255, 255); $pdf->SetFillColor(64, 64, 64); $pdf->Cell(0, 10, "List of All Reports", 0, 1, "C", 1); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont("Arial", "B", "12"); $pdf->SetXY(10, 50); $pdf->Write(5, "Rep#"); $pdf->SetXY(30, 50); $pdf->Write(5, "Date"); $pdf->SetXY(50, 50); $pdf->Write(5, "Location"); $pdf->SetXY(75, 50); $pdf->Write(5, "Machine"); $pdf->SetXY(105, 50); $pdf->Write(5, "Serial #");
die("Server MySQL tidak terhubung karena " . mysql_error()); } //akhir koneksi //get query dan variabel $area = $_GET['area']; //instansiasi fpdf $pdf = new PDF_MC_Table('L', 'cm', 'Legal'); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetMargins(0.25, 1, 0.7); #tampilkan judul laporan $pdf->SetFont('Arial', 'B', '16'); $pdf->Cell(0, 0, "CIPAGANTI RENTAL CAR & TRAVEL", 0, 1, 'C'); $pdf->Cell(34.5, 2, "STOK KENDARAAN CABANG", 0, 1, 'C'); $pdf->SetFont('Arial', 'B', '12'); $pdf->SetXY(0.8, 3); $sql = "SELECT area FROM gl_area WHERE id = '{$area}' "; $cekdata = mysql_query($sql) or die(mysql_error()); $row_data = mysql_fetch_array($cekdata); $pdf->Cell(8, 3, "Area : " . $row_data['area'], 0, 0, 'L'); //membuat kop tabel list($namaarea) = mysql_fetch_row(mysql_query("select area from gl_area where id='{$area}'")); $pdf->SetFont('Arial', 'B', 11); $pdf->SetXY(0.25, 5); $pdf->Cell(1, 2.3, "No", 1, 0, 'C'); $pdf->Cell(6, 2.3, "JENIS KENDARAAN", 1, 0, 'C'); $str = "select id, area from gl_area "; if ($area != '') { $str .= " where id='{$area}' "; } $str .= "order by area asc ";
/** * Init function */ function __construct($json) { require 'mc_table.php'; parent::__construct($json); // Get Config $conf = isset($_SESSION['pluginsConfig']) && isset($_SESSION['pluginsConfig']['export']) && isset($_SESSION['pluginsConfig']['export']['PDF']) ? $_SESSION['pluginsConfig']['export'] : array('PDF' => array()); $defaultFont = isset($conf['PDF']['defaultFont']) ? $conf['PDF']['defaultFont'] : 'FreeSans'; $defaultFontSize = isset($conf['PDF']['defaultFontSize']) ? $conf['PDF']['defaultFontSize'] : 9; $headerFont = isset($conf['PDF']['headerFont']) ? $conf['PDF']['headerFont'] : $defaultFont; $headerFontSize = isset($conf['PDF']['headerFontSize']) ? $conf['PDF']['headerFontSize'] : $defaultFontSize; $headerFontStyle = isset($conf['PDF']['headerFontStyle']) ? $conf['PDF']['headerFontStyle'] : ''; $layerFont = isset($conf['PDF']['layerFont']) ? $conf['PDF']['layerFont'] : $defaultFont; $layerFontSize = isset($conf['PDF']['layerFontSize']) ? $conf['PDF']['layerFontSize'] : $defaultFontSize; $layerFontStyle = isset($conf['PDF']['layerFontStyle']) ? $conf['PDF']['layerFontStyle'] : ''; // Write to table $pdf = new PDF_MC_Table(); // only for tcpdf version >= 3 // - font not well defined --> errors // - header and footer printed = lines on top and bottom $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); $pdf->Open(); $groups = (array) $this->jsonList[0]; foreach ($groups as $grp) { $ret = $this->prepareData4PDF($grp); $colsPerc = $ret[0]; $data = $ret[1]; $header = $data['header']; $records = $data['records']; $pdfW = 180; // orientation detection $orientation = 'P'; $colsum = $ret[2]; $maxSize = max($headerFontSize, $defaultFontSize); $widthTmp = $colsum * $maxSize / 4; if ($widthTmp > 1.5 * $pdfW) { $pdfW = 270; $orientation = 'L'; } $pdf->AddPage($orientation); $cols = array(); foreach ($colsPerc as $cp) { $cols[] = $cp * $pdfW; } // add group name: $pdf->SetFont($layerFont, $layerFontStyle, $layerFontSize); $x = $pdf->GetX(); $y = $pdf->GetY(); $pdf->Cell(0, 0, $grp->description); $pdf->SetXY($x, $y + 9); // Calculate column widths $pdf->SetWidths($cols); // Add header $pdf->SetFont($headerFont, $headerFontStyle, $headerFontSize); $pdf->Row($header); // Add records $pdf->SetFont($defaultFont, '', $defaultFontSize); foreach ($records as $row) { $pdf->Row($row); } } $pdfFilePath = $this->tempFilePath . '.pdf'; $this->tempFileLocation .= '.pdf'; $pdf->Output($pdfFilePath, 'F'); }
$diagnosis = $data['diagnosis']; $work_done = $data['work_done']; $remarks = $data['remarks']; $system_engineer = $data['system_engineer']; } } $pdf = new PDF_MC_Table(); $pdf->Open(); $pdf->AddPage(); //$pdf->Image($picture,20,5,20,20); $pdf->SetFont("Arial", "B", "16"); $pdf->Cell(0, 10, "Broadcast System & Maintenance", 0, 1, "C"); $pdf->SetFont("Arial", "", "12"); $pdf->Cell(0, 10, "Technical Operation Division", 0, 1, "C"); $pdf->SetFont("Arial", "", "14"); $pdf->SetXY(10, 40); $pdf->Cell(0, 10, "Date: ", 0, 1); $pdf->SetFont("Arial", "B", "14"); $pdf->SetXY(25, 40); $pdf->Cell(0, 10, $report_date, 0, 1); $pdf->SetFont("Arial", "", "14"); $pdf->SetXY(10, 60); $pdf->Cell(0, 10, "Location: ", 0, 1); $pdf->SetFont("Arial", "U", "14"); $pdf->SetXY(40, 60); $pdf->Cell(0, 10, " " . $report_location . " ", 0, 1); $pdf->SetFont("Arial", "", "14"); $pdf->SetXY(10, 70); $pdf->Cell(0, 10, "Program: ", 0, 1); $pdf->SetFont("Arial", "U", "14"); $pdf->SetXY(40, 70);
die("Server MySQL tidak terhubung karena " . mysql_error()); } //akhir koneksi //get query dan variabel $area = $_GET['area']; //instansiasi fpdf $pdf = new PDF_MC_Table('P', 'cm', 'A4'); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetMargins(0.7, 0.7, 0.7); #tampilkan judul laporan $pdf->SetFont('Arial', 'B', '16'); $pdf->Cell(0, 0, "CIPAGANTI RENTAL CAR & TRAVEL", 0, 1, 'C'); $pdf->Cell(20, 2, "STATUS KENDARAAN UNIT TLI", 0, 1, 'C'); $pdf->SetFont('Arial', 'B', '12'); $pdf->SetXY(1.5, 3); $sql = "SELECT area FROM gl_area WHERE id = '{$area}' "; $cekdata = mysql_query($sql) or die(mysql_error()); $row_data = mysql_fetch_array($cekdata); $pdf->Cell(8, 3, "Area : " . $row_data['area'], 0, 0, 'L'); //membuat kop tabel list($namaarea) = mysql_fetch_row(mysql_query("select area from gl_area where id='{$area}'")); $pdf->SetFont('Arial', 'B', 11); $pdf->SetXY(1.5, 5); $pdf->Cell(2, 0.7, "No", 1, 0, 'C'); $pdf->Cell(6, 0.7, "STOK STATUS", 1, 0, 'C'); $str = "select id, area from gl_area "; if ($area != '') { $str .= " where id='{$area}' "; } $str .= " order by area asc ";
function afficherPDF($vpdf) { require 'fpdf/mc_table.php'; $pdf = ob_get_clean(); $pdf = new PDF_MC_Table(); $pdf->AddPage(); $pdf->SetFont('Times', '', 12); $pdf->Image("images/logo.png", 7, 5, 50.9); $pdf->SetXY(9, 15); $pdf->RoundedRect(95, 54, 110, 35, 2, 'D'); $pdf->SetXY(9, 40); $pdf->MultiCell(80, 5, utf8_decode("Siège social : GSB\nPhiladelphie, \nPennsylvanie, Etats-Unis\ngsb_galaxybourdin@gmail.com "), 0, "L", 0); $pdf->SetXY(100, 57); $pdf->MultiCell(100, 7, utf8_decode("Client : " . $vpdf['nom'] . " " . $vpdf['prenom'] . "\nAdresse : " . $vpdf['adresse'] . "\nCode postal : " . $vpdf['cp'] . "\nVille : " . $vpdf['ville']), 0, "L", 0); $pdf->SetXY(9, 100); $pdf->MultiCell(80, 5, utf8_decode("Remboursement du : " . $vpdf['numMois'] . " / " . $vpdf['numAnnee']), 0, "L", 0); $pdf->SetWidths(array(47.5, 47.5, 47.5, 47.5)); srand(microtime() * 1000000); $pdf->SetXY(10, 110); $pdf->MultiCell(190, 7, utf8_decode('Eléments forfaitisés'), 1, "L", 0); $pdf->Row2(array('Frais forfaitaires', utf8_decode('Quantité'), 'Montant unitaire', 'Montant total')); $pdf->Row2(array($vpdf['libelle'][0], utf8_decode($vpdf['quantite'][0]), $vpdf['montant'][0], $vpdf['montantT'][0] . " " . html_entity_decode($vpdf['euros']))); $pdf->Row2(array(utf8_decode($vpdf['libelle'][1]), utf8_decode($vpdf['quantite'][1]), $vpdf['montant'][1], $vpdf['montantT'][1] . " " . html_entity_decode($vpdf['euros']))); $pdf->Row2(array(utf8_decode($vpdf['libelle'][2]), utf8_decode($vpdf['quantite'][2]), $vpdf['montant'][2], $vpdf['montantT'][2] . " " . html_entity_decode($vpdf['euros']))); $pdf->Row2(array(utf8_decode($vpdf['libelle'][3]), utf8_decode($vpdf['quantite'][3]), $vpdf['montant'][3], $vpdf['montantT'][3] . " " . html_entity_decode($vpdf['euros']))); $pdf->SetXY(10, 157); mysql_connect('localhost', 'root', ''); mysql_select_db('gsbv2'); //First table: put all columns automatically $pdf->MultiCell(190, 7, utf8_decode('Eléments hors forfait'), 1, "L", 0); $prop = array('HeaderColor' => array(205, 216, 211), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 250), 'padding' => 2); $pdf->AddCol('date', 35, '', 'Date'); $pdf->AddCol('libelle', 105, 'Libelle'); $pdf->AddCol('montant', 50, 'Montant', 'R'); $pdf->Table("select date,libelle,montant from lignefraishorsforfait lf where lf.mois='" . $vpdf['mois'] . "' and lf.idVisiteur='" . $vpdf['id'] . "' " . "UNION ALL (select date,libelle,montant as idlfr from lignefraishorsforfaitrefuse lfr where lfr.mois='" . $vpdf['mois'] . "' and lfr.idVisiteur='" . $vpdf['id'] . "')", $prop); $pdf->SetXY(10, 200); $pdf->SetXY(130, 230); $pdf->MultiCell(70, 7, "Total du " . $vpdf['numMois'] . " / " . $vpdf['numAnnee'] . " : " . $vpdf['montVal'] . " " . html_entity_decode($vpdf['euros']) . "\nNombre de justificatifs : " . $vpdf['nbJust'] . " fiche(s)" . utf8_decode("\nMontant refusé : ") . $vpdf['montRefuse'] . " " . html_entity_decode($vpdf['euros']) . "\nFait le : " . $vpdf['dateNow'] . "", 1, "R", 0); $pdf->Output(); }
$pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetLeftMargin(25); //---------------------------------------------- $pdf->SetFont('GillSans', '', 10); $pdf->SetFillColor(249, 250, 252); $pdf->Cell(70, 4, ' Estructura Programática ', 0, 0, 'L', 0); $pdf->Cell(70, 4, 'Ejercicio: 2015 ', 0, 0, 'L', 0); $pdf->Ln(5); $pdf->SetFont('GillSans', 'B', 10); $pdf->Cell(240, 4, 'Catálogo de Programas', 1, 1, 'C', 1); $pdf->SetFont('GillSans', '', 10); $y = $pdf->GetY(); $x = $pdf->GetX(); $pdf->MultiCell(20, 8, 'ID', 1, 'C', 1); $pdf->SetXY($x + 20, $y); $pdf->MultiCell(40, 8, 'Clave', 1, 'C', 1); $pdf->SetXY($x + 60, $y); $pdf->MultiCell(150, 8, 'Descripción', 1, 'C', 1); $pdf->SetXY($x + 210, $y); $pdf->Cell(30, 8, 'Tipo', 1, 0, 'C', 1); $pdf->Cell(0, 4, '', 0, 1, 'C', 0); $pdf->Ln(4); //ciclo $pdf->SetFont('GillSans', 'L', 12); $pdf->SetWidths(array(20, 40, 150, 30)); foreach ($avPrg as $key => $value) { $c1 = $key; $c2 = $value['cve']; $c3 = $value['dsc']; $c4 = $value['tpo'];
$pdf->Row(array(sav2_convert("Номер \nдокумента:"), sav2_convert($applyData->{'delegate-priv-doc-num'}), sav2_convert("Дата выдачи:"), sav2_convert($applyData->{'delegate-priv-doc-givendate'}))); $pdf->SetWidths(array(60, 115)); $pdf->Row(array(sav2_convert("Кем \nвыдан:"), sav2_convert($applyData->{'delegate-priv-doc-givenbywhom'}))); $pdf->Ln(); $pdf->AddPage(); $pdf->MultiCell($width, 5, sav2_convert("Прошу признать меня, мою семью малоимущим(щей) и предоставить мне (моей семье) государственную социальную помощь в виде (выбрать один или несколько пунктов, пометив нужный квадрат):"), 0, 'L'); $pdf->Ln(); $pdf->SetTextColor(0, 0, 255); $pdf->Cell(6, 5, sav2_convert($applyData->{'benefit1'} ? 'X' : ''), 1, 0, 'C'); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(80, 5, sav2_convert("социального пособия;"), 0, 0, 'L'); $pdf->SetTextColor(0, 0, 255); $pdf->Cell(6, 5, sav2_convert($applyData->{'benefit2'} ? 'X' : ''), 1, 0, 'C'); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(80, 5, sav2_convert("материальной помощи;"), 0, 1, 'L'); $pdf->SetXY(25, 40); $pdf->SetTextColor(0, 0, 255); $pdf->Cell(6, 5, sav2_convert($applyData->{'benefit3'} ? 'X' : ''), 1, 0, 'C'); $pdf->SetTextColor(0, 0, 0); $pdf->MultiCell(80, 5, sav2_convert("пособия на оплату проезда в общественном транспорте гражданам пожилого возраста;"), 0, 'L'); $pdf->SetXY(111, 40); $pdf->SetTextColor(0, 0, 255); $pdf->Cell(6, 5, sav2_convert($applyData->{'benefit4'} ? 'X' : ''), 1, 0, 'C'); $pdf->SetTextColor(0, 0, 0); $pdf->MultiCell(80, 5, sav2_convert("компенсации понесенных затрат на приобретение бытового сжиженного газа;"), 0, 'L'); $pdf->SetXY(25, 60); $pdf->SetTextColor(0, 0, 255); $pdf->Cell(6, 5, sav2_convert($applyData->{'benefit5'} ? 'X' : ''), 1, 0, 'C'); $pdf->SetTextColor(0, 0, 0); $pdf->MultiCell(80, 5, sav2_convert("пособия на оплату проезда в общественном транспорте гражданам пожилого возраста;"), 0, 'L'); $pdf->SetXY(111, 60);
*/ //QUERY PARA EL PERIDO ACTIVO $queryPer = "SELECT tipo, anio FROM periodo WHERE activo = TRUE"; $recoPer = pg_query($queryPer); $rowPer = pg_fetch_array($recoPer); $pdf->SetFont('Arial', 'B', 12); $pdf->MultiCell(0, 5, utf8_decode("\nRepública Bolivariana de Venezuela\nUniversidad del Zulia\nFacultad Experimental de Ciencias\nDivisión de Programas Especiales\nSistema de Pasantías\n"), 0, "C", 0); $pdf->MultiCell(165, 5, utf8_decode("\n\nReporte General"), 0, "C", 0); $pdf->MultiCell(165, 5, utf8_decode("\n{$rowPer['tipo']} - {$rowPer['anio']}"), 0, "C", 0); $pdf->Ln(); $inscritos = contar("SELECT COUNT(*) FROM pasantia INNER JOIN periodo ON periodo.id = pasantia.periodo_id AND periodo.activo = TRUE WHERE pasantia.m01_registrada IS NOT NULL"); $aprobados = contar("SELECT COUNT(*) FROM pasantia INNER JOIN periodo ON periodo.id = pasantia.periodo_id AND periodo.activo = TRUE WHERE pasantia.aprobada = TRUE"); $reprobados = contar("SELECT COUNT(*) FROM pasantia INNER JOIN periodo ON periodo.id = pasantia.periodo_id AND periodo.activo = TRUE WHERE pasantia.aprobada = FALSE"); $pdf->Image("logotipo.jpg", 20, 12, -280); //GENERAR LA TABLA $pdf->SetXY(57, 70); $pdf->SetFont('Arial', 'B', 12); $pdf->SetWidths(array(30, 30, 30)); $pdf->SetAligns(array('C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C')); $pdf->Row(array("Inscritos", "Aprobados", "Reprobados")); $pdf->SetX(57); $pdf->SetFont('Arial', '', 12); $pdf->SetWidths(array(30, 30, 30)); $pdf->SetAligns(array('C', 'C', 'C')); $pdf->Row(array("{$inscritos}", "{$aprobados}", "{$reprobados}")); //GENERAR LA GRAFICA $graph = new PieGraph(640, 480); $graph->SetShadow(); $graph->title->Set("APROBADOS / REPROBADOS"); $graph->title->SetFont(FF_FONT2, FS_BOLD); if ($aprobados != 0 || $reprobados != 0) {