Example #1
0
 function loadPage()
 {
     // create new PDF document
     $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     $pdf->titulo = $this->getPlan();
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Red de Universidades Anahuac');
     $pdf->SetTitle('Plan Estrategico');
     $pdf->SetSubject($this->getPlan());
     $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     // set default header data
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, 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, PDF_MARGIN_TOP, 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);
     //set some language-dependent strings
     //$pdf->setLanguageArray($l);
     // ---------------------------------------------------------
     // set font
     $pdf->SetFont('helvetica', 'N', 11);
     // add a page
     $pdf->AddPage();
     $pdf->SetY(5);
     $html = "\n<!-- EXAMPLE OF CSS STYLE -->\n<style>  \n\ttd{\n\tborder:1px solid #666;\n\t}\n\t\n\ttd.title{\n\tbackground:#E5E5E5;\n\tpadding:10px;\n\t}\n   \n</style> <br />";
     $html .= $this->Model->getLineas();
     // output the HTML content
     $pdf->writeHTML($html, true, false, true, false, '');
     //Close and output PDF document
     $pdf->Output('plan_operativo.pdf', 'I');
 }
Example #2
0
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
////////////////////////////////////////////////////////////////////////////////
$datos = filter_input_array(INPUT_POST);

global $db, $smarty;
$log =  new Log($db);

$registros = $log->ver_log($datos["hidden_usr"], $datos["hidden_desde"], $datos["hidden_hasta"], $datos["hidden_accion"], $datos["hidden_clase"]);

$smarty->assign("log", $registros);

////////////////////////////////////////////////////////////////////////////////
$html = $smarty->fetch("templates/admin/print_log.html");

$pdf->AddPage('L');
$pdf->SetFont('helvetica', '', 8);

$pdf->writeHTML($html, true, 0, 0, 0);
$pdf->Output('print_log_'.date("d/m/Y g:i a").'.pdf', 'D');


?>
function pdfGen($group_name, $mode = NULL, $start_date, $end_date, $stats, $l, $title, $path_www)
{
    global $centreon_path;
    // create new PDF document
    $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    // set document information
    $pdf->SetCreator("PDF Reports Module");
    $pdf->SetAuthor(getGeneralOptInfo("pdfreports_report_author"));
    //$pdf->SetAuthor('Fully Automated Nagios');
    $pdfTitle = $title . " " . $group_name;
    //$pdfTitle = "Rapport de supervision du hostgroup ".$group_name;
    $pdf->SetTitle($pdfTitle);
    //$pdf->SetSubject('TCPDF Tutorial');
    //$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
    // define default header data
    $header = $title . " " . $group_name;
    //$header = "Rapport de supervision du hostgroup ".$group_name;
    //$ip = $_SERVER['HOSTNAME'];
    $startDate = date("d/m/Y", $start_date);
    $time = time();
    $endDate = date("d/m/Y", $time);
    $string = _("From") . " " . strftime("%A", $start_date) . " " . $startDate . " " . _("to") . " " . strftime("%A", $time) . " " . $endDate . "\n";
    // set default header data
    $pdf->SetHeaderData('../../../img/headers/' . getGeneralOptInfo("pdfreports_report_header_logo"), PDF_HEADER_LOGO_WIDTH, $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, PDF_MARGIN_TOP, 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);
    //set some language-dependent strings
    $pdf->setLanguageArray($l);
    // ---------------------------------------------------------
    // set font
    $pdf->SetFont('helvetica', '', 12);
    // add a page
    $pdf->AddPage();
    //Column titles
    $header = array('Status', 'Time', 'Total Time', 'Mean Time', 'Alert');
    // Pie chart Generation
    $piechart_img = pieGen($stats, $mode);
    //Data loading
    $data = $pdf->LoadData($stats);
    // print colored table
    //$pdf->ColoredTable($header, $data,$chart_img);
    if ($mode == "hgs") {
        // Hostgroup
        $pdf->ColoredTable($header, $data, $piechart_img, $path_www);
    } else {
        if ($mode == "sgs") {
            // Servicegroup
            $pdf->ServicesColoredTable($header, $data, $piechart_img, $path_www);
        }
    }
    // ---------------------------------------------------------
    //génération d'un nom de pdf
    $endDay = date("d", $time);
    $endYear = date("Y", $time);
    $endMonth = date("m", $time);
    $pdfDirName = getGeneralOptInfo("pdfreports_path_gen") . $endYear . $endMonth . $endDay . "/";
    $pdfFileName = $pdfDirName . $endYear . "-" . $endMonth . "-" . $endDay . "_" . $group_name . ".pdf";
    if (!is_dir($pdfDirName)) {
        mkdir($pdfDirName);
    }
    //Close and output PDF document
    $pdf->Output($pdfFileName, 'F');
    return $pdfFileName;
}
Example #4
0
        $pdf->MultiCell(10, 7, $i, 0, 'C', false, 0, '', '', false, 0, false, false, 7, 'TB');
        $pdf->MultiCell(20, 6, $grid1['no_so'], 0, 'C', false, 0, '', '', false, 0, false, false, '', 'M');
        $pdf->MultiCell(20, 6, $grid1['no_seri_produk'], 0, 'C', false, 0, '', '', false, 0, false, false, '', 'M');
        $pdf->MultiCell(40, 6, $grid1['nama_produk'], 0, 'C', false, 0, '', '', false, 0, false, false, '', 'M');
        $pdf->MultiCell(22, 6, number_format($grid1['harga'], 2, ',', '.'), 0, 'C', false, 0, '', '', false, 0, false, false, '', 'M');
        $pdf->MultiCell(5, 6, "x", 0, 'C', false, 0, '', '', false, 0, false, false, '', 'M');
        $pdf->MultiCell(17, 6, $grid1['persentase'], 0, 'C', false, 0, '', '', false, 0, false, false, '', 'M');
        $pdf->MultiCell(5, 6, "x", 0, 'C', false, 0, '', '', false, 0, false, false, '', 'M');
        $pdf->MultiCell(7, 6, $grid1['quantity'], 0, 'C', false, 0, '', '', false, 0, false, false, '', 'M');
        $pdf->MultiCell(5, 6, "=", 0, 'C', false, 0, '', '', false, 0, false, false, '', 'M');
        $pdf->MultiCell(25, 6, number_format($grid1['komisi'], 2, ',', '.'), 0, 'C', false, 1, '', '', false, 0, false, false, '', 'M');
        $i++;
    }
    $stmt2 = "select sum(komisi) as total from komisi where no_nis_sales = '{$nis}' AND cabang = '{$cabang}' AND tanggal_so BETWEEN '{$begin}' AND '{$end}'";
    foreach (tampilData($stmt2) as $total) {
    }
    $pdf->SetFont('helvetica', 'BI', 7);
    $pdf->MultiCell(151, 7, "Total Komisi", 'TB', 'C', false, 0, '', '', false, 0, false, false, 7, 'TB');
    $pdf->MultiCell(25, 6, number_format($total['total'], 2, ',', '.'), 'TB', 'C', false, 1, '', '', false, 0, false, false, '', 'M');
    $pdf->MultiCell(15, 7, "Terbilang", 0, 'L', false, 0, '', '', false, 0, false, false, 7, 'T');
    $pdf->MultiCell(175, 7, ": " . terbilang($total['total'], 4) . " rupiah", 0, 'L', false, 0, '', '', false, 0, false, false, '', 'M');
    $pdf->setXY($pdf->getX(), $pdf->getY() + 10);
    $pdf->Line(0, $pdf->getY(), 215, $pdf->getY());
    $pdf->setXY($pdf->getX(), $pdf->getY() + 10);
    $y = 297 - $pdf->getY();
    if ($y <= 40) {
        $pdf->AddPage();
    }
}
$pdf->Output($cabang . " - " . $dataCabang['nama_cabang'] . " (" . $begin . " s.d " . $end . ")-KOMISI.pdf", 'I');
Example #5
0
						<td width="30%">
						</td>
						<td width="60%">
							<table align="center">
								<tr>
									<td style="font-size:30px; border-top-width:1px;" width="30%"><strong>Firma Cajero Recaudación </strong></td>
									<td>&nbsp;</td>
									<td style="font-size:30px; border-top-width:1px;" width="30%"><strong>Firma Cajero Contabilidad</strong></td>
								</tr>
							</table>
						</td>
					</tr>
				</table>				
	';
$pdf->writeHTML($html, true, false, true, false, '');
$pdf->Output($nombreUser . '_' . 'arqueoEspontaneo_' . $arq_id . '.pdf', $tipoDoc);
DEFINE('FTP_USER', 'recaudacion');
DEFINE('FTP_PASS', 'recaudacion');
$path = date('Y') . "/boleta/";
$path = explode("/", $path);
$conn_id = @ftp_connect("10.2.21.108", 21, 1);
if (!$conn_id) {
    return false;
}
if (@ftp_login($conn_id, FTP_USER, FTP_PASS)) {
    foreach ($path as $dir) {
        if (!$dir) {
            continue;
        }
        $currPath .= "/" . trim($dir);
        if (!@ftp_chdir($conn_id, $currPath)) {
$pdf->SetTitle($_SESSION['__classe__']->to_string());
// set default header data
$pdf->SetHeaderData("", 0, "Scuola Media Statale \"Arborea - Lamarmora\" - secondaria di primo grado", "Via Isonzo, 5 - Iglesias (CI)");
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', 8.0));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', 8.0));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, 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);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 12);
// add a page
$pdf->AddPage("L");
//Column titles
$header = array('Ora', 'Lun', 'Mar', 'Mer');
// print colored table
$pdf->ColoredTable($header, $orario_classe, $materie, $classe, $_SESSION['__classe__']->isFullTime());
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('orario.pdf', 'D');
Example #7
0
  <td width="50">Hora In</td><td width="50">HoraSal</td><td width="80">Dia Semana</td><td width="30">Fest</td>
 </tr>
 </table>
EOD;
        $pdf->writeHTML($tbl, false, false, false, false, '');
        while (list($ID, $Identificacion, $Fecha, $ExtrasDiurnas, $ExtrasNocturnas, $ExtrasDiurnasFest, $ExtrasNocturnasFest, $Errores, $HoraIn, $HoraOut, $DiaSem, $Festivo) = mysql_fetch_array($r)) {
            $tbl = <<<EOD

<table border="1" cellpadding="1" cellspacing="1" align="center" style="border-left: 1px solid #000099;
\t\tborder-right: 1px solid #000099;
\t\tborder-top: 1px solid #000099;
\t\tborder-bottom: 1px solid #000099;">
 <tr>
  <td width="20">{$ID}</td><td width="80">{$Identificacion}</td><td width="80">{$Fecha}</td><td  width="30">{$ExtrasDiurnas}</td><td  width="30">{$ExtrasNocturnas}</td><td  width="30">{$ExtrasDiurnasFest}</td><td  width="30">{$ExtrasNocturnasFest}</td><td width="20">{$Errores}</td>
  <td  width="50">{$HoraIn}</td><td  width="50">{$HoraOut}</td><td width="80">{$DiaSem}</td><td  width="30">{$Festivo}</td>
 </tr>
 </table>
EOD;
            $pdf->writeHTML($tbl, false, false, false, false, '');
        }
        $pdf->AddPage();
    } else {
        $pdf->writeHTML(" <br> No se encontraron registros <br>", false, false, false, false, '');
        $pdf->AddPage();
    }
}
//Close and output PDF document
$pdf->Output($nombre_file . '.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
Example #8
0
$pdf->setLanguageArray($l);
$pdf->SetFont('times', '', 10, '', true);
$pdf->AddPage();
$spacing = -0.01;
$stretching = 75;
$pdf->setFontStretching($stretching);
$pdf->setFontSpacing($spacing);
$titling = <<<EOD
<strong> <font style="font-size:11">Pharmacy Sys</font> </strong> <br> <strong>Official Receipt</strong><br>
Student Center Ground Floor,<br> P.O. Box Private Bag Kabarak, Kenya <br> Tel: +254 702 937 925 <br> E-mail: pharmacysys@yahoo.com 
<br>-----------------------------------------
EOD;
$header = array('Drug', 'Price.', 'Qtty', 'Cost(Kshs.)');
$ddt = <<<EOD
{$time}   
EOD;
$html = <<<EOD
<br>-----------------------------------------
EOD;
$data = $pdf->LoadData('receipts/docs/' . $recNo . '.txt');
$pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $titling, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'C', $autopadding = true);
$pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $ddt, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'L', $autopadding = true);
$pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
$pdf->ColoredTable($header, $data);
$pdf->SetY(-10);
$pdf->Cell(0, 0, 'You were served by: ' . strtoupper($user), 0, false, 'L', 0, '', 0, false, 'T', 'M');
$pdf->Output('receipts/printouts/' . $details1['customer_name'] . '-receipt.pdf', 'F');
unlink('receipts/docs/' . $recNo . '.txt');
unset($_SESSION['custId'], $_SESSION['custName'], $_SESSION['age'], $_SESSION['sex'], $_SESSION['postal_address'], $_SESSION['phone']);
header('Location: payment.php');
exit;
$html = $html . '<tr><td>Total Agency Fee</td><td align="right">£' . $LocationVAT . '</td></tr>';
$html = $html . '<tr><td>Agency VAT</td><td align="right">£' . $AgencyVAT . '</td></tr>';
$html = $html . '</table><br><br>';
$html = $html . '<table width="250">';
$html = $html . '<tr><td>OT/Damage Deposit</td><td align="right">£' . $Deposit . '</td></tr>';
$html = $html . '</table><br><br>';
$html = $html . '<br><br><h3>Booked Date(s)</h3><br>';
$query = "select BookingID, BookingDate, StartTime, EndTime, NoCrew, AgreedDayRate, Notes from BookingDates where BookingID = '" . $BookingID . "' order by BookingDate asc;";
$result = mysqli_query($link, $query);
$html = $html . '<table>';
$html = $html . '<tr><th>Date</th><th>Start Time</th><th>Finish Time</th><th>No Cast & Crew</th><th align="right">Day Rate (£\'s)</th></tr>';
while ($row = mysqli_fetch_row($result)) {
    $BookingID = $row[0];
    $BookingDate = new DateTime($row[1]);
    $StartTime = $row[2];
    $EndTime = $row[3];
    $NoCrew = $row[4];
    $AgreedDayRate = $row[5];
    $Notes = $row[6];
    $html = $html . '<tr><td>' . $BookingDate->format('d-m-Y') . '</td><td>' . $StartTime . '</td><td>' . $EndTime . '</td><td>' . $NoCrew . '</td><td align="right">' . $AgreedDayRate . '</td></tr>';
    $html = $html . '<tr><td colspan="5"><i>' . $Notes . '</i></td></tr>';
}
$html = $html . '</table>';
$pdf->writeHTML($html, true, false, true, false, '');
$pdf->Ln();
// reset pointer to the last page
$pdf->lastPage();
//Close and output PDF document
$pdf->Output('Booking From (J' . $JobRef . '-' . $BookingID . ').pdf', 'I');
// Closing connection
mysqli_close($link);
Example #10
0
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
//initialize document
$pdf->AliasNbPages();
// add a page
$pdf->AddPage();
// ---------------------------------------------------------
// set font
$pdf->SetFont("times", "", 9);
//$pdf->SetCellPadding(0);
//$pdf->SetLineWidth(2);
$text = "Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis. Cras nulla nulla, hendrerit et, porttitor eu, adipiscing et, lorem. Pellentesque sit amet augue. Nam lobortis sollicitudin turpis. Sed velit est, mollis non, elementum ac, tempor quis, arcu. Aliquam a pede. Quisque arcu magna, nonummy eget, hendrerit a, lacinia egestas, enim. Donec bibendum. In a ipsum. Sed gravida facilisis sem. Nam tempus, tellus ut tincidunt elementum, augue tellus fermentum quam, sit amet lobortis sem ipsum sed elit.In accumsan ligula nonummy libero. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed vel risus. Vestibulum ut lacus. Proin fermentum, erat a commodo lacinia, lacus dui hendrerit nulla, et pellentesque neque diam at elit. Fusce blandit, dolor pharetra bibendum lacinia, augue sem scelerisque sem, bibendum sodales orci justo et sapien. Etiam nec eros ac turpis lobortis interdum. Integer volutpat nibh a lacus. Duis erat est, rhoncus nec, rhoncus viverra, pulvinar sit amet, leo. Duis blandit. Nunc convallis nisi ac ante. Cras nunc massa, molestie quis, porttitor a, volutpat accumsan, quam. Nullam a erat vitae orci bibendum viverra. Donec tristique leo eget nisl adipiscing pellentesque. Nam vehicula, enim quis aliquet euismod, dolor sem pellentesque libero, nec blandit nisi erat sit amet dui. Integer sapien. Donec molestie metus in neque. Suspendisse porttitor enim a nisl.Maecenas lacinia dolor ornare ligula. Maecenas eu eros. Curabitur non leo non nulla fringilla auctor. Etiam porttitor diam vel quam. Maecenas sed ligula nec massa venenatis faucibus. Curabitur aliquet accumsan tellus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse vitae eros ac purus fermentum suscipit. Curabitur interdum orci a mi. Nunc placerat diam in elit.Nunc elit. Maecenas vulputate, sem sit amet condimentum lacinia, ipsum eros porta dolor, sed luctus magna ante eu nisl. Proin non nisi. Vivamus sed quam et est lobortis porttitor. Cras sit amet urna sit amet elit ultricies consequat. Praesent blandit elit ut urna. Cras hendrerit rhoncus sapien. Fusce ullamcorper lobortis ipsum. Pellentesque vel velit at sem blandit facilisis. Nulla aliquet orci id metus.";
// print some rows just as example
for ($i = 0; $i < 5; $i++) {
    $pdf->MultiRow("Row " . ($i + 1), $text . "\n");
}
// reset pointer to the last page
$pdf->lastPage();
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output("example_020.pdf", "I");
//============================================================+
// END OF FILE
//============================================================+
?>
 
Example #11
0
					
					if (!file_exists($filename)) {
				
				
							mkdir('Pdf_Uploads',0777);
				
						//mkdir('$path',0777);		
					}
					
						//$unique = rand();
						
						$unique = $_SESSION['person_id'];
							
				       $pdfname = $clientsresult['first_name'].'_myfuneral_At_need_plan_'.$unique.'.pdf';
					
						$pdfdoc=$pdf->Output('Pdf_Uploads'.'/'.$pdfname, 'F');
					
					
					//$pdf->Output($path.'/'.$pdfname, 'F');
		
		
		/*----------- End of PDF Formation -------------- */
		
		
		// Load the SwiftMailer files
		//require_once($dir.'/swift/swift_required.php');
		
		//$email = '*****@*****.**';
		
		$email = $clientsresult['email'];
		
Example #12
0
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor($author);
$pdf->SetTitle("Elenco ritardi di " . $alunno['cognome'] . " " . $alunno['nome']);
// set default header data
$pdf->SetHeaderData("", 0, "Scuola Media Statale \"Arborea - Lamarmora\" - secondaria di primo grado", "Via Isonzo, 5 - Iglesias (CI)");
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', 8.0));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', 8.0));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, 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);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 10);
$pdf->SetLineWidth(0.1);
// add a page
$pdf->AddPage("P");
$pdf->pageBody($ritardi, $author, $alunno, $mesi, $num_ritardi, $somma_ritardi);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('ritardi.pdf', 'D');
Example #13
0
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
//GET DATA FROM URL
$id = $_GET['id'];
$data_i = $_GET['data_i'];
$data_f = $_GET['data_f'];
// SQL Query
$result = mysqli_query($con, "SELECT data, operatore, (ore_std + ore_extra + ore_fest + ore_sabato) as total FROM co_ore  WHERE id_commessa='{$id}' AND data BETWEEN '{$data_i}' AND '{$data_f}'");
while ($row = mysqli_fetch_array($result)) {
    $orderdate = explode('-', $row['data']);
    $data = $orderdate[2] . "/" . $orderdate[1] . "/" . $orderdate[0];
    $operatore = $row['operatore'];
    $total = $row['total'];
    if ($i % 2 == 0) {
        $color_row = "aliceblue";
        $i++;
    } else {
        $color_row = "white";
        $i++;
    }
    $tbl .= '<tr style="background-color:' . $color_row . '"><td>' . $data . '</td><td>' . $operatore . '</td><td>' . $total . '</td></tr>';
}
// Print text using writeHTMLCell()
$pdf->writeHTML($tbl_header . $tbl . $tbl_footer, true, false, false, false, '');
// ---------------------------------------------------------
// Close and output PDF document
// This method has several options, check the source code documentation for more information.
$pdf->Output('report.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
    }
    $chart = new VerticalBarChart(800, 400);
    $chart->setDataSet($dataSet);
    $chart->setTitle(gettext("assignment") . " " . $i);
    $chart->render(EXAM_ORGANIZATION_TEMP_DIR . $key . "assignment" . $i . ".png");
}
for ($i = 1; $i <= $assignments; $i++) {
    switch (($i - 1) % 3) {
        case 0:
            $pdf->AddPage();
            $y = 30;
            break;
        case 1:
            $y = 110;
            break;
        case 2:
            $y = 190;
            break;
    }
    $pdf->Image(EXAM_ORGANIZATION_TEMP_DIR . $key . 'assignment' . $i . '.png', 30, $y, 150, 75, '', '', '', false, 300);
}
//generate filename without umlaute
$umlaute = array("/Š/", "/š/", "/Ÿ/", "/€/", "/…/", "/†/", "/§/");
$replace = array("ae", "oe", "ue", "Ae", "Oe", "Ue", "ss");
$filenameUmlaute = gettext("exam statistics") . ' ' . $exam_name . '.pdf';
$filename = preg_replace($umlaute, $replace, $filenameUmlaute);
$pdf->Output($filename, 'D');
for ($i = 1; $i <= $assignments; $i++) {
    unlink(EXAM_ORGANIZATION_TEMP_DIR . $key . "assignment" . $i . ".png");
}
unlink(EXAM_ORGANIZATION_TEMP_DIR . $key . "notenspiegel.png");
Example #15
0
EOD;
$pdf->writeHTML($html, true, false, false, false, '');
$pdf->Ln(5);
$row_responsable = "";
$row_responsable .= "\r\n                <tr nobr=\"true\">\r\n                   <td></td>\r\n                   <td align=\"center\"><FONT SIZE=\"9\">Nombre y Firma del Responsable</font></td>\r\n                   <td></td>\r\n                </tr>";
$responsable = <<<EOD
    <table border="0" class="general">
        <tr>        
            <th width="150"></th>
            <th width="325"><hr color="black" size=2></th>
            <th width="150"></th>
        </tr>
        {$row_responsable}
    </table>
        {$estilo_tabla}
EOD;
$pdf->writeHTML($responsable, true, false, false, false, '');
$pdf->Ln(3);
$row_datosRes = "";
$row_datosRes .= "\r\n                <tr>\r\n                   <td align=\"right\" rowspan=\"2\"><FONT SIZE=\"8\"><br>Cargo del Responsable: </font></td>\r\n                   <td class=\"celdaTablaFicha\" rowspan=\"2\"></td>\r\n                </tr>\r\n                <tr>\r\n                   <td align=\"right\"><FONT SIZE=\"8\"></font></td>\r\n                   <td class=\"celdaTablaFicha\"></td>\r\n                </tr>\r\n                <tr>\r\n                   <td align=\"right\" rowspan=\"2\"><FONT SIZE=\"8\"><br>Tel&eacute;fono del Responsable: </font></td>\r\n                   <td class=\"celdaTablaFicha\" rowspan=\"2\"></td>\r\n                </tr>\r\n                <tr>\r\n                   <td align=\"right\"><FONT SIZE=\"8\"></font></td>\r\n                   <td class=\"celdaTablaFicha\"></td>\r\n                </tr>\r\n                <tr>\r\n                   <td align=\"right\" rowspan=\"2\"><FONT SIZE=\"8\"><br>Correo electr&oacute;nico del Responsable: </font></td>\r\n                   <td class=\"celdaTablaFicha\" rowspan=\"2\"></td>\r\n                </tr>\r\n                <tr>\r\n                   <td align=\"right\"><FONT SIZE=\"8\"></font></td>\r\n                   <td class=\"celdaTablaFicha\"></td>\r\n                </tr>";
$datosRes = <<<EOD
    <table class=\\"tablaFicha\\" cellpadding=\\"5\\">
        {$row_datosRes}
    </table>
        {$estilo_tabla}
EOD;
$pdf->writeHTML($datosRes, true, false, false, false, '');
$pdf->lastPage();
# visualizamos el documento
$pdf->Output('FichaIngresoBco' . $infoBcoPDF['IdBco'] . '.pdf', 'I');
Example #16
0
                $pdf->MultiCell(4, 5, $z_neu, 'TR', 'C', 0, 0, '', '', false);
            }
        }
        //Spalte fuer Einschaetzung der Eltern
        //$pdf->MultiCell(0,0,' ', 'LTR','C',0,1,'','',false);//dient nur als Umbruch
        $pdf->Ln();
        //Setzen der Kompetenzen
        //	$pdf->SetX(20);
        $pdf->SetFont('helvetica', 'b', '9');
        if ($k == $komp1 - 1) {
            $pdf->MultiCell($kompBreite, 5, 'Methodenkompetenz', 'LRT', 'L', 0, 1, '', '', true);
        }
        if ($k == $komp1 + $komp2 - 1) {
            $pdf->MultiCell($kompBreite, 5, 'Selbstkompetenz', 'LRT', 'L', 0, 1, '', '', true);
        }
        if ($k == $komp1 + $komp2 + $komp3 - 1) {
            $pdf->MultiCell($kompBreite, 5, 'Sozialkompetenz', 'LRT', 'L', 0, 1, '', '', true);
        }
        $pdf->SetFont('times', '', '9');
    }
    $breiteLegende = 103 + ($fachAnzahl + 1) * 8;
    //	$pdf->SetX(20);
    $pdf->MultiCell($breiteLegende, 5, '1 = stimme voll zu, 2 = stimme zu, 3 = stimme weniger zu, 4 = stimme nicht zu', 'LTR', 'C', 0, 1, '', '', false);
    //	$pdf->SetX(20);
    $pdf->MultiCell($breiteLegende, 5, 'Der linke Wert ist jeweils die Bewertung aus dem 1. Halbjahr, der rechte aus dem 2. Halbjahr.', 'LR', 'C', 0, 1, '', '', false);
    //	$pdf->SetX(20);
    $pdf->MultiCell($breiteLegende, 5, 'Grüne Felder bedeuten eine Verbesserung, rote eine Verschlechterung gegenüber dem 1. Halbjahr. ', 'LRB', 'C', 0, 0, '', '', false);
}
//Close and output PDF document
$pdf->Output('lernentwicklung_2013_14_2_' . $kl . '.pdf', 'I');
mysql_close($verbindung);
Example #17
0
$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);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('times', '', 9);
// add a page
$pdf->AddPage();
//$pdf->SetCellPadding(0);
//$pdf->SetLineWidth(2);
$text = 'Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis. Cras nulla nulla, hendrerit et, porttitor eu, adipiscing et, lorem. Pellentesque sit amet augue. Nam lobortis sollicitudin turpis. Sed velit est, mollis non, elementum ac, tempor quis, arcu. Aliquam a pede. Quisque arcu magna, nonummy eget, hendrerit a, lacinia egestas, enim. Donec bibendum. In a ipsum. Sed gravida facilisis sem. Nam tempus, tellus ut tincidunt elementum, augue tellus fermentum quam, sit amet lobortis sem ipsum sed elit.In accumsan ligula nonummy libero. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed vel risus. Vestibulum ut lacus. Proin fermentum, erat a commodo lacinia, lacus dui hendrerit nulla, et pellentesque neque diam at elit. Fusce blandit, dolor pharetra bibendum lacinia, augue sem scelerisque sem, bibendum sodales orci justo et sapien. Etiam nec eros ac turpis lobortis interdum. Integer volutpat nibh a lacus. Duis erat est, rhoncus nec, rhoncus viverra, pulvinar sit amet, leo. Duis blandit. Nunc convallis nisi ac ante. Cras nunc massa, molestie quis, porttitor a, volutpat accumsan, quam. Nullam a erat vitae orci bibendum viverra. Donec tristique leo eget nisl adipiscing pellentesque. Nam vehicula, enim quis aliquet euismod, dolor sem pellentesque libero, nec blandit nisi erat sit amet dui. Integer sapien. Donec molestie metus in neque. Suspendisse porttitor enim a nisl.Maecenas lacinia dolor ornare ligula. Maecenas eu eros. Curabitur non leo non nulla fringilla auctor. Etiam porttitor diam vel quam. Maecenas sed ligula nec massa venenatis faucibus. Curabitur aliquet accumsan tellus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse vitae eros ac purus fermentum suscipit. Curabitur interdum orci a mi. Nunc placerat diam in elit.Nunc elit. Maecenas vulputate, sem sit amet condimentum lacinia, ipsum eros porta dolor, sed luctus magna ante eu nisl. Proin non nisi. Vivamus sed quam et est lobortis porttitor. Cras sit amet urna sit amet elit ultricies consequat. Praesent blandit elit ut urna. Cras hendrerit rhoncus sapien. Fusce ullamcorper lobortis ipsum. Pellentesque vel velit at sem blandit facilisis. Nulla aliquet orci id metus.';
// print some rows just as example
for ($i = 0; $i < 5; $i++) {
    $pdf->MultiRow('Row ' . ($i + 1), $text . "\n");
}
// reset pointer to the last page
$pdf->lastPage();
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_020.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
?>
 
$pdf->MultiCell(45, 20, 'Total redocumentacion', 0, 'R', false, 0, 250, 45, true, 0, true, true, 0, 'M', false);
$consultaResumen = "SELECT idSindicato, nombreSind, TotalImportePrestamo  ,TotalRedocumentacion FROM subRep_Altas_y_Redocumentados";
$consultaR = mysql_query($consultaResumen);
$Cont = 1;
$i = 56;
$pdf->SetAutoPageBreak(false, 0);
while ($resultadoT = mysql_fetch_array($consultaR)) {
    $pdf->MultiCell(10, 8.5, $Cont, 1, 'C', false, 1, 12, $i, true, 0, true, true, 0, 'M', false);
    $pdf->MultiCell(25, 8.5, $resultadoT['idSindicato'], 0, 'C', false, 1, 19, $i, true, 0, true, true, 0, 'M', false);
    $pdf->MultiCell(60, 8.5, $resultadoT['nombreSind'], 0, 'R', false, 1, 30, $i, true, 0, true, true, 0, 'M', false);
    $pdf->MultiCell(140, 8.5, '$' . number_format($resultadoT['TotalImportePrestamo'], 2, '.', ','), 0, 'R', false, 1, 50, $i, true, 0, true, true, 0, 'M', false);
    $pdf->MultiCell(220, 8.5, '$' . number_format($resultadoT['TotalRedocumentacion'], 2, '.', ','), 0, 'R', false, 1, 70, $i, true, 0, true, true, 0, 'M', false);
    $i = $i + 8.5;
    $Cont = $Cont + 1;
}
$pdf->MultiCell(160, 8.5, '_____________________________', 0, 'R', false, 1, 30, $i, true, 0, true, true, 0, 'M', false);
$pdf->MultiCell(260, 8.5, '_____________________________', 0, 'R', false, 1, 30, $i, true, 0, true, true, 0, 'M', false);
$consultaRtotal = "SELECT idSindicato, nombreSind, sum(TotalImportePrestamo) as TotalImportePrestamo  , sum(TotalRedocumentacion) as TotalRedocumentacion FROM subRep_Altas_y_Redocumentados";
$consultaRt = mysql_query($consultaRtotal);
$row = mysql_fetch_assoc($consultaRt);
$pdf->MultiCell(160, 8.5, '$' . number_format($row['TotalImportePrestamo'], 2, '.', ','), 0, 'R', false, 1, 30, $i + 5, true, 0, true, true, 0, 'M', false);
$pdf->MultiCell(260, 8.5, '$' . number_format($row['TotalRedocumentacion'], 2, '.', ','), 0, 'R', false, 1, 30, $i + 5, true, 0, true, true, 0, 'M', false);
$pdf->Output('ResumenAltasRedocumentacion.pdf', 'I');
/*
					<com:TBoundColumn HeaderText="Contrato" DataField="idContrato" />
			<com:TBoundColumn HeaderText="Fecha Autorización" DataField="fecha" />
			<com:TBoundColumn HeaderText="Titular" DataField="titular" />
			<com:TBoundColumn HeaderText="Nombre" DataField="nombre" />
			<com:TBoundColumn HeaderText="Importe Prestamos" DataField="importePrestamo" />
			<com:TBoundColumn HeaderText="Monto Redocumentación" DataField="MontoRedocumentacion" />
*/
Example #19
0
				</tr>';
for ($i = 0; $i < count($bonos); $i++) {
    $html .= '
					<tr>
						<td>' . $bonos[$i][bonId] . '</td>
						<td>' . $bonos[$i][tipBonId] . '</td>
						<td>' . $bonos[$i][bonMonto] . '</td>
					</tr>';
}
$html .= '</table>
			</td>
			</tr>';
//TERMINA LA MUESTRA DE BOLETAS
$html .= '</table>';
$pdf->writeHTML($html, true, false, true, false, '');
$pdf->Output('PSS_' . $pss_id . '.pdf', 'FI');
DEFINE('FTP_USER', 'recaudacion');
DEFINE('FTP_PASS', 'recaudacion');
$path = date('Y') . "/PSS/";
$path = explode("/", $path);
$conn_id = @ftp_connect("10.2.21.108", 21, 1);
if (!$conn_id) {
    return false;
}
if (@ftp_login($conn_id, FTP_USER, FTP_PASS)) {
    foreach ($path as $dir) {
        if (!$dir) {
            continue;
        }
        $currPath .= "/" . trim($dir);
        if (!@ftp_chdir($conn_id, $currPath)) {
Example #20
0
 function generatePdfReport($pdfData, $mode, $params, $fileName)
 {
     $countries = CJFunctions::get_country_names();
     $responses = array();
     $include_email_in_reports = $params->get('include_email_in_reports', 0);
     foreach ($pdfData->responses as $response) {
         $responses[$response->id] = new stdClass();
         $responses[$response->id]->created_by = $response->created_by;
         $responses[$response->id]->created = $response->created;
         $responses[$response->id]->username = $response->username;
         $responses[$response->id]->name = $response->name;
         if ($include_email_in_reports == 1) {
             $responses[$response->id]->email = $response->email;
         }
         $responses[$response->id]->questions = array();
         foreach ($pdfData->questions as $question) {
             $responses[$response->id]->questions[$question->id] = new stdClass();
             $responses[$response->id]->questions[$question->id]->answer = '';
             $responses[$response->id]->questions[$question->id]->question_type = $question->question_type;
         }
     }
     if (!empty($pdfData->entries)) {
         foreach ($pdfData->entries as $entry) {
             if (isset($responses[$entry->response_id]) && isset($responses[$entry->response_id]->questions[$entry->question_id])) {
                 if (!empty($entry->answer)) {
                     if (empty($responses[$entry->response_id]->questions[$entry->question_id]->answer)) {
                         $responses[$entry->response_id]->questions[$entry->question_id]->answer = $entry->answer;
                     } else {
                         $responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $entry->answer;
                     }
                     if (!empty($entry->answer_image) && JFile::exists(S_IMAGES_UPLOAD_DIR . '/' . $entry->answer_image)) {
                         //$image = JHtml::image(JURI::root(true).'/media/communitysurveys/images/'.$entry->answer_image, $entry->answer);
                         $image = '<img src="' . JURI::root(true) . '/media/communitysurveys/images/' . $entry->answer_image . '">';
                         $responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $image;
                     }
                 }
                 if (!empty($entry->answer2)) {
                     if (empty($responses[$entry->response_id]->questions[$entry->question_id]->answer)) {
                         $responses[$entry->response_id]->questions[$entry->question_id]->answer = $entry->answer2;
                     } else {
                         $responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $entry->answer2;
                     }
                 }
                 if (!empty($entry->free_text)) {
                     // do special types formatting //
                     if ($responses[$entry->response_id]->questions[$entry->question_id]->question_type == S_SPECIAL_NAME) {
                         $names = explode('|', $entry->free_text);
                         if (!empty($names)) {
                             $entry->free_text = $names[0] . '. ' . $names[1] . ' ' . $names[2];
                         } else {
                             $entry->free_text = '';
                         }
                     } else {
                         if ($responses[$entry->response_id]->questions[$entry->question_id]->question_type == S_SPECIAL_ADDRESS) {
                             $parts = explode('|||', $entry->free_text);
                             if (count($parts) == 7) {
                                 $entry->free_text = '<address><strong>' . CJFunctions::escape($parts[0]) . '</strong><br>';
                                 $entry->free_text .= CJFunctions::escape($parts[1]) . '<br>';
                                 if (!empty($parts[2])) {
                                     $entry->free_text .= CJFunctions::escape($parts[2]) . '<br>';
                                 }
                                 $entry->free_text .= CJFunctions::escape($parts[3]) . ', ' . CJFunctions::escape($parts[4]) . ', ' . CJFunctions::escape($parts[6]) . '<br>';
                                 $entry->free_text .= !empty($countries[$parts[5]]) ? $countries[$parts[5]]->country_name : CJFunctions::escape($parts[5]);
                             } else {
                                 $entry->free_text = '';
                             }
                         }
                     }
                     // do special types formatting //
                     if (empty($responses[$entry->response_id]->questions[$entry->question_id]->answer)) {
                         $responses[$entry->response_id]->questions[$entry->question_id]->answer = $entry->free_text;
                     } else {
                         $responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $entry->free_text;
                     }
                 }
             }
         }
     }
     $response_rows = array();
     foreach ($responses as $id => $response) {
         $string = '<table class="table table-striped" width="100%">';
         $string = $string . '<tr><th width="30%"><strong>Response ID:</strong></th><td width="70%">' . $id . '</td></tr>';
         $string = $string . '<tr><th><strong>Response Date:</strong></th><td>' . $response->created . '</td></tr>';
         $string = $string . '<tr><th><strong>User ID:</strong></th><td>' . $response->created_by . '</td></tr>';
         $string = $string . '<tr><th><strong>Username:</strong></th><td>' . $response->username . '</td></tr>';
         $string = $string . '<tr><th><strong>User Display Name:</strong></th><td>' . $response->name . '</td></tr>';
         if ($include_email_in_reports == 1) {
             $string = $string . '<tr><td><strong>Email:</strong></td><td>' . $response->email . '</td></tr>';
         }
         foreach ($pdfData->questions as $question) {
             $string = $string . '<tr><td colspan="2">&nbsp;<hr></td></tr>';
             $string = $string . '<tr><th colspan="2"><h3>' . $question->title . '</h3></th></tr>';
             if (!empty($question->description)) {
                 $string = $string . '<tr><td colspan="2">' . $question->description . '</td></tr>';
             }
             $string = $string . '<tr><td colspan="2">&nbsp;</td></tr>';
             $string = $string . '<tr><td colspan="2">' . $response->questions[$question->id]->answer . '</td></tr>';
         }
         $string = $string . '</table>';
         array_push($response_rows, $string);
     }
     // create new PDF document
     require_once JPATH_COMPONENT_SITE . '/helpers/tcpdf.php';
     $pdf = new MYPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set default header data
     $pdf->SetHeaderData('logo.png', PDF_HEADER_LOGO_WIDTH, $pdfData->title, '');
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('corejoomla.com');
     $pdf->SetTitle('Survey Report');
     $pdf->SetSubject('Survey Responses Report');
     $pdf->SetKeywords('survey, report');
     // 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, PDF_MARGIN_TOP, 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);
     // ---------------------------------------------------------
     // set font
     $pdf->SetFont('freesans');
     foreach ($response_rows as $i => $response) {
         $pdf->AddPage();
         $pdf->writeHTML($response, true, false, true, false, '');
         $pdf->lastPage();
     }
     $pdf->Output($fileName, $mode);
 }
Example #21
0
 $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
 //set some language-dependent strings
 $pdf->setLanguageArray($l);
 //initialize document
 $pdf->AliasNbPages();
 //in reference to body.php -> if a new page must be added if the space available for summary is too small
 $new_page_started = false;
 $pdf->AddPage();
 $pdf->setImageScale(1.5);
 //$pdf->SetY(PDF_MARGIN_HEADER);
 include "modules/SalesOrder/pdf_templates/header.php";
 $pdf->SetFont($default_font, " ", $font_size_body);
 include "modules/SalesOrder/pdf_templates/body.php";
 // issue pdf
 if ($purpose == 'print') {
     $pdf->Output($pdf_strings['FACTURE'] . '_' . $date_issued . '.pdf', 'D');
 } elseif ($purpose == 'send') {
     // send pdf with mail
     switch ($language) {
         case "EN":
             $pdf->Output('storage/SalesOrder_' . $_REQUEST['record'] . '.pdf', 'F');
             //added file name to make it work in IE, also forces the download giving the user the option to save
             break;
         case "DE":
             $pdf->Output('storage/Bestellung_' . $_REQUEST['record'] . '.pdf', 'F');
             //added file name to make it work in IE, also forces the download giving the user the option to save
             break;
     }
     return;
 }
 exit;
Example #22
0
 $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
 //set some language-dependent strings
 $pdf->setLanguageArray($l);
 //initialize document
 $pdf->AliasNbPages();
 //in reference to body.php -> if a new page must be added if the space available for summary is too small
 $new_page_started = false;
 $pdf->AddPage();
 $pdf->setImageScale(1.5);
 //$pdf->SetY(PDF_MARGIN_HEADER);
 include "modules/Quotes/pdf_templates/header.php";
 $pdf->SetFont($default_font, " ", $font_size_body);
 include "modules/Quotes/pdf_templates/body.php";
 // issue pdf
 if ($purpose == 'print') {
     $pdf->Output($pdf_strings['FACTURE'] . '_' . $date_issued . '.pdf', 'D');
     exit;
 } elseif ($purpose == 'send') {
     // send pdf with mail
     switch ($language) {
         case "EN":
             $pdf->Output('storage/Quote_' . $_REQUEST['record'] . '.pdf', 'F');
             //added file name to make it work in IE, also forces the download giving the user the option to save
             break;
         case "DE":
             $pdf->Output('storage/Angebot_' . $_REQUEST['record'] . '.pdf', 'F');
             //added file name to make it work in IE, also forces the download giving the user the option to save
             break;
     }
     return;
     exit;
Example #23
0
    $cuerpo .= "<tr>";
    $cuerpo .= "<td>" . $_POST['idSol'][$i] . "</td><td>" . $_POST['ue'][$i] . "</td><td>" . $_POST['tipo'][$i] . "</td>";
    $cuerpo .= "</tr>";
}
$cuerpo = utf8_encode($cuerpo);
//echo $cuerpo;
// -----------------------------------------------------------------------------
$tbl = <<<EOD
<table border="0" cellpadding="2" cellspacing="2" align="center" width= "100%">

<tr>
  <th colspan="3">TURNADO A DIRECCIONES DE ÁREA</th>
 </tr>
        <tr>
  <th colspan="3">TURNO:<span class="text">{$turno}</span></th>
 </tr>
<tr><td colspan="1"><span class="head">Turnado a: </span><span class="text">{$area}</span></td><td colspan="2"><span class="head">Fecha: </span><span class="text">{$fechaTurno}</span><br><span class="head">Turnada por: </span><span class="text">Ventanilla</span></td></tr>
     
 <tr>
  <td width= "25%">NUM. SOLICITUD</td>
  <td width= "45%">UNIDAD EJECUTORA</td>
  <td width= "30%">TIPO DE SOLICITUD</td>
 </tr>
    {$cuerpo}
</table>
EOD;
$pdf->writeHTML($tbl, true, false, false, false, '');
// -----------------------------------------------------------------------------
//Close and output PDF document
$pdf->Output('turnoExpedientes' . $turno . '.pdf', 'I');
Example #24
0
    public function cetak($idquotationsales = null, $idrefstore = null)
    {
        if ($idquotationsales == null) {
            exit('Data Tidak Tersedia');
        }
        $data = $this->orm->quotationsales->where('idquotationsales', $idquotationsales)->fetch();
        if (count($this->orm->quotationsales->where('idquotationsales', $idquotationsales)) == 0) {
            echo "<h3>Data Tidak Tersedia</h3>";
            exit;
        }
        //check from web
        if ($idrefstore == null) {
            $email = $_SESSION['user']['email'];
            $idrefstore = $_SESSION['user']['idrefstore'];
        } else {
            //from mobile
            $email = $this->input->post('email');
        }
        ini_set('memory_limit', '512M');
        $this->load->library('TCPDF');
        // create new PDF document
        $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'A4', true, 'UTF-8', false);
        // set document information
        $pdf->SetCreator(WEB_TITLE);
        $pdf->SetAuthor($email);
        $pdf->SetTitle("Quotation - " . $data['nomor']);
        $pdf->SetSubject($data['nomor']);
        $pdf->nomor = $data['nomor'];
        $pdf->tanggal = $data['tanggal'];
        $pdf->namaPelanggan = $data->pelanggan['namapelanggan'];
        $pdf->dibuat_oleh = $data['dibuat_oleh'];
        $pdf->oleh = $email;
        $pdf->store = $this->orm->refstore->where('idrefstore', $idrefstore)->fetch();
        // set default monospaced font
        $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
        //set margins
        $pdf->SetMargins(5, 63, 5);
        $pdf->SetHeaderMargin(14);
        $pdf->SetFooterMargin(80);
        //set auto page breaks
        $pdf->SetAutoPageBreak(TRUE, 80);
        //set auto page breaks
        $pdf->SetAutoPageBreak(TRUE, 80);
        //set image scale factor
        $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
        // ---------------------------------------------------------
        // set default font subsetting mode
        $pdf->setFontSubsetting(true);
        // Set font
        // dejavusans is a UTF-8 Unicode font, if you only need to
        // print standard ASCII chars, you can use core fonts like
        // helvetica or times to reduce file size.
        // use the font
        $pdf->SetFont('times', '', 10, '', false);
        // Add a page
        // This method has several options, check the source code documentation for more information.
        $resolution = array(310, 210);
        $pdf->AddPage('L', $resolution);
        // Set some content to print
        $html = '
            
            <style>
            body {
            letter-spacing:5px;
            }      
            </style> 
            	<style type="text/css">
            .rotate-text
             {

            /* Safari */
            -webkit-transform: rotate(-90deg);

            /* Firefox */
            -moz-transform: rotate(-90deg);

            /* IE */
            -ms-transform: rotate(-90deg);

            /* Opera */
            -o-transform: rotate(-90deg);

            /* Internet Explorer */
            filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);

            }
            .border-table{
            	border:0.5px solid #000;
            		
            }

            table {
            padding-top:2px;
            }

            </style>
            	
            <body>
              <table border="1">
             <tr><th style="text-align: center;" width="60"> No </th><th width="180" style="text-align: center;"> Nama Barang </th><th style="text-align: center;" width="100"> Jumlah Barang </th><th style="text-align: center;" width="300"> Harga Satuan </th><td style="text-align: center; "width="300"> Keterangan </td></tr>
            ';
        $no = 1;
        foreach ($this->orm->quotationsalesdetail->where('idquotationsales', $idquotationsales) as $row) {
            $html .= "<tr><td>" . $no . "</td><td>" . $row->refbarang['namabarang'] . "</td><td style=\"text-align: right;\">" . $row['jumlahbarang'] . "</td><td style=\"text-align: right;\">" . number_format($row['hargasatuan'], 0, ',', '.') . "</td><td>" . $row['keterangan'] . "</td></tr>";
            $no++;
        }
        $html .= '</table>
</body>';
        //print_r($html); exit;
        // Print text using writeHTMLCell()
        $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
        //$pdf->writeHTML($html, true, 0, true, true);
        // ---------------------------------------------------------
        // Close and output PDF document
        // This method has several options, check the source code documentation for more information.
        $pdf->Output("Quotation - " . $data['nomor'], 'I');
        //============================================================+
        // END OF FILE
        //============================================================+
    }
Example #25
0
$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, PDF_MARGIN_TOP, 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);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 12);
// add a page
$pdf->AddPage();
//Column titles
$header = array('Country', 'Capital', 'Area (sq km)', 'Pop. (thousands)');
//Data loading
$data = $pdf->LoadData('../cache/table_data_demo.txt');
// print colored table
$pdf->ColoredTable($header, $data);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_011.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
Example #26
0
 function checkStoreInvoice($orderDetails = 0)
 {
     JRequest::setVar('task', 'checkStoreInvoice');
     $force = true;
     //	@ini_set( 'max_execution_time', 5 );
     $path = VmConfig::get('forSale_path', 0);
     if ($path === 0) {
         vmError('No path set to store invoices');
         return false;
     } else {
         $path .= 'invoices' . DS;
         if (!file_exists($path)) {
             vmError('Path wrong to store invoices, folder invoices does not exist ' . $path);
             return false;
         } else {
             if (!is_writable($path)) {
                 vmError('Cannot store pdf, directory not writeable ' . $path);
                 return false;
             }
         }
     }
     $orderModel = VmModel::getModel('orders');
     $invoiceNumberDate = array();
     if (!$orderModel->createInvoiceNumber($orderDetails['details']['BT'], $invoiceNumberDate)) {
         return 0;
     }
     if (!empty($invoiceNumberDate[0])) {
         $invoiceNumber = $invoiceNumberDate[0];
     } else {
         $invoiceNumber = FALSE;
     }
     if (!$invoiceNumber or empty($invoiceNumber)) {
         vmError('Cant create pdf, createInvoiceNumber failed');
         return 0;
     }
     if (shopFunctions::InvoiceNumberReserved($invoiceNumber)) {
         return 0;
     }
     $path .= 'vminvoice_' . $invoiceNumber . '.pdf';
     if (file_exists($path) and !$force) {
         return $path;
     }
     // 			$app = JFactory::getApplication('site');
     //We come from the be, so we need to load the FE langauge
     $jlang = JFactory::getLanguage();
     $jlang->load('com_virtuemart', JPATH_SITE, 'en-GB', true);
     $jlang->load('com_virtuemart', JPATH_SITE, $jlang->getDefault(), true);
     $jlang->load('com_virtuemart', JPATH_SITE, null, true);
     $this->addViewPath(JPATH_VM_SITE . DS . 'views');
     $format = 'html';
     $viewName = 'invoice';
     $view = $this->getView($viewName, $format);
     $view->addTemplatePath(JPATH_VM_SITE . DS . 'views' . DS . 'invoice' . DS . 'tmpl');
     $view->invoiceNumber = $invoiceNumberDate[0];
     $view->invoiceDate = $invoiceNumberDate[1];
     $view->orderDetails = $orderDetails;
     $view->uselayout = 'invoice';
     ob_start();
     $view->display();
     $html = ob_get_contents();
     ob_end_clean();
     // create new PDF document
     $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator('Invoice by VirtueMart 2, used library tcpdf');
     $pdf->SetAuthor($view->vendor->vendor_name);
     $pdf->SetTitle(JText::_('COM_VIRTUEMART_INVOICE_TITLE'));
     $pdf->SetSubject(JText::sprintf('COM_VIRTUEMART_INVOICE_SUBJ', $view->vendor->vendor_store_name));
     $pdf->SetKeywords('Invoice by VirtueMart 2');
     //virtuemart.cloudaccess.net/index.php?option=com_virtuemart&view=invoice&layout=details&virtuemart_order_id=18&order_number=6e074d9b&order_pass=p_9cb9e2&task=checkStoreInvoice
     if (empty($view->vendor->images[0])) {
         vmError('Vendor image given path empty ');
     } else {
         if (empty($view->vendor->images[0]->file_url_folder) or empty($view->vendor->images[0]->file_name) or empty($view->vendor->images[0]->file_extension)) {
             vmError('Vendor image given image is not complete ' . $view->vendor->images[0]->file_url_folder . $view->vendor->images[0]->file_name . '.' . $view->vendor->images[0]->file_extension);
             vmdebug('Vendor image given image is not complete, the given media', $view->vendor->images[0]);
         } else {
             if (!empty($view->vendor->images[0]->file_extension) and strtolower($view->vendor->images[0]->file_extension) == 'png') {
                 vmError('Warning extension of the image is a png, tpcdf has problems with that in the header, choose a jpg or gif');
             } else {
                 $imagePath = DS . str_replace('/', DS, $view->vendor->images[0]->file_url_folder . $view->vendor->images[0]->file_name . '.' . $view->vendor->images[0]->file_extension);
                 if (!file_exists(JPATH_ROOT . $imagePath)) {
                     vmError('Vendor image missing ' . $imagePath);
                 } else {
                     $pdf->SetHeaderData($imagePath, 60, $view->vendor->vendor_store_name, $view->vendorAddress);
                 }
             }
         }
     }
     // set header and footer fonts
     $pdf->setHeaderFont(array('helvetica', '', 8));
     $pdf->setFooterFont(array('helvetica', '', 10));
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     //set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, 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);
     //TODO include the right file (in libraries/tcpdf/config/lang set some language-dependent strings
     $l = '';
     $pdf->setLanguageArray($l);
     // set default font subsetting mode
     $pdf->setFontSubsetting(true);
     // Set font
     // dejavusans is a UTF-8 Unicode font, if you only need to
     // print standard ASCII chars, you can use core fonts like
     // helvetica or times to reduce file size.
     $pdf->SetFont('helvetica', '', 8, '', true);
     // Add a page
     // This method has several options, check the source code documentation for more information.
     $pdf->AddPage();
     // Set some content to print
     // $html =
     // Print text using writeHTMLCell()
     $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
     // Close and output PDF document
     // This method has several options, check the source code documentation for more information.
     $pdf->Output($path, 'F');
     return $path;
 }
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, 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);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('times', 'BI', 12);
// add a page
$pdf->AddPage();
$pdf->AddPage();
// set some text to print
$txt = <<<EOD
TCPDF Example 003

Custom page header and footer are defined by extending the TCPDF class and overriding the Header() and Footer() methods.
EOD;
// print a block of text using Write()
$pdf->Write($h = 0, $txt, $link = '', $fill = 0, $align = 'C', $ln = true, $stretch = 0, $firstline = false, $firstblock = false, $maxh = 0);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_003.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
Example #28
0
$law = $invoice->law;
//$usuario = "usuario";
$datosFactura = '
<table border="0" style="line-height: 160%">
	<tr><td style="line-height: ' . $line . '%"> </td></tr>
    <tr><td> </td></tr>
    <tr><td> </td></tr>
    <tr>
        <td width="262" align="center" style="font-size:9px"><b>Recibi Conforme</b></td>
        <td width="262" align="center" style="font-size:9px"><b>Entregue Conforme</b></td>
    </tr>
    <tr>
        <td width="262" align="center" style="font-size:9px"><b> </b></td>
        <td width="262" align="center" style="font-size:9px">' . $nombreUsuario . '</td>
    </tr>

</table>
';
if ($pdf->GetY() >= '226.6375') {
    $pdf->AddPage('P', 'LETTER');
    if (!empty($nota) && !empty($terminos)) {
        $restoQr = $restoQr - 18;
    }
}
$subtotal = number_format((double) $invoice->importe_total, 2, '.', '');
$descuento = number_format((double) ($invoice->importe_total - $invoice->importe_neto), 2, '.', '');
$total = number_format((double) $invoice->importe_neto, 2, '.', '');
$pdf->writeHTMLCell($w = 0, $h = 0, '', '', $datosFactura, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'left', $autopadding = true);
//Close and output PDF document
$pdf->Output('factura.pdf', 'I');
die;
}
$pdf->SetFont('helvetica', '', 8);
$pdf->ln();
$pdf->Cell(0, 0, $SPECIAL_NOTE, 0, 1);
$pdf->ln();
// ---------------------------------------------------------
$pdf->SetY(90);
$pdf->SetFont('helvetica', '', 12);
$pdf->Image($HEADER_IMG, $pdf->GetX(), $pdf->GetY(), $W, '', 'png', '', 'T', true, 300, '', false, false, 0, true, false, false);
$pdf->SetY(120);
$pdf->SetFont('helvetica', 'B', 14);
$pdf->Cell(0, 0, "Letter of Attendance", 0, 1);
$pdf->SetY(140);
$pdf->SetFont('helvetica', '', 12);
$pdf->writeHTML($HTML, true, false, true, false, '');
$SIGPOS = 200;
$SIGOFF = 20;
$pdf->SetY($SIGPOS);
$pdf->SetFont('helvetica', '', 12);
$pdf->Cell(0, 0, "Sincerely,", 0, 1);
$pdf->SetY($SIGPOS + 30);
$pdf->Cell(0, 0, $SIGNATURE_IMGPERS[0], 0, 1);
$pdf->SetFont('helvetica', '', 8);
$pdf->Cell(0, 0, $SIGNATURE_IMGPERS[1], 0, 1);
$pdf->Image($SIGNATURE_IMG, $LM - 5, $SIGPOS + 30 - $SIGOFF, "", $SIGOFF, 'png', '', 'T', true, 300, '', false, false, 0, true, false, false);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output($FILENAME, 'I');
//============================================================+
// END OF FILE
//============================================================+
    }
    $pdf->SetFont('freesans', 'B', 10, '', true);
    $pdf->Cell(25, 5, $training->sportText, $border, 0, 'L', $fill, '', 1);
    $pdf->Cell(25, 5, $training->sortText, $border, 0, 'L', $fill, '', 1);
    $pdf->Cell(35, 5, $training->time, $border, 0, 'L', $fill, '', 1);
    $pdf->Cell(25, 5, $training->distance, $border, 0, 'L', $fill, '', 1);
    $pdf->Cell(130, 5, $training->description, $border, 0, 'L', $fill, '', 1);
    $pdf->Cell(0, 5, $training->datetraining, $border, 0, 'L', $fill, '', 1);
    $pdf->Ln(10);
}
// reset style
$pdf->SetFont('freesans', '', 9, '', true);
$pdf->Cell(5, 5, $td_feasible, $border, 0, 'C', $fill, '', 1);
// set style
$pdf->SetFont('freesans', $style, 9, '', true);
$pdf->Cell(20, 5, $card->card, $border, 0, 'L', $fill, '', 1);
// reset style
$pdf->SetFont('freesans', '', 9, '', true);
$pdf->Cell(0, 5, $card->note, $border, 0, 'L', $fill, '', 1);
$pdf->Ln();
$pdf->Ln(6);
// page styles
$pdf->SetTextColor(0);
$pdf->SetFillColor(245);
$fill = FALSE;
// close and output pdf document
if (strlen($file_path) > 0) {
    $pdf->Output($file_path, 'F');
} else {
    $pdf->Output("module-diary_training_" . $training->datetraining . ".pdf", 'I');
}