Initial commit
This commit is contained in:
@@ -0,0 +1,188 @@
|
||||
<?php session_start();
|
||||
//============================================================+
|
||||
// File name : example_006.php
|
||||
// Begin : 2008-03-04
|
||||
// Last Update : 2013-05-14
|
||||
//
|
||||
// Description : Example 006 for TCPDF class
|
||||
// WriteHTML and RTL support
|
||||
//
|
||||
// Author: Nicola Asuni
|
||||
//
|
||||
// (c) Copyright:
|
||||
// Nicola Asuni
|
||||
// Tecnick.com LTD
|
||||
// www.tecnick.com
|
||||
// info@tecnick.com
|
||||
//============================================================+
|
||||
|
||||
/**
|
||||
* Creates an example PDF TEST document using TCPDF
|
||||
* @package com.tecnick.tcpdf
|
||||
* @abstract TCPDF - Example: WriteHTML and RTL support
|
||||
* @author Nicola Asuni
|
||||
* @since 2008-03-04
|
||||
*/
|
||||
|
||||
// Include the main TCPDF library (search for installation path).
|
||||
require_once('../tcpdf/tcpdf.php');
|
||||
|
||||
// create new PDF document
|
||||
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||
|
||||
// set document information
|
||||
$pdf->SetCreator(PDF_CREATOR);
|
||||
$pdf->SetAuthor('SoftSPM');
|
||||
$pdf->SetTitle('Historia pomiarów');
|
||||
$pdf->SetSubject('Historia pomiarów');
|
||||
$pdf->SetKeywords('Historia pomiarów');
|
||||
|
||||
// set default header data
|
||||
//$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 006', PDF_HEADER_STRING);
|
||||
$pdf->SetHeaderData
|
||||
( '',
|
||||
0,
|
||||
$_SESSION['site401ahis_devName'].' - historia pomiarów',
|
||||
'Od: '.$_SESSION['site401ahis_from'].' do: '.$_SESSION['site401ahis_to'],
|
||||
array(0,0,250),
|
||||
array(0,0,0)
|
||||
);
|
||||
|
||||
// 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 (optional)
|
||||
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||
$pdf->setLanguageArray($l);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
// set font
|
||||
$pdf->SetFont('dejavusans', '', 10);
|
||||
|
||||
// add a page
|
||||
$pdf->AddPage();
|
||||
|
||||
|
||||
$tbl_header = '<table style="width: 640px;" cellspacing="0">';
|
||||
$tbl_footer = '</table>';
|
||||
$tbl = '
|
||||
<tr style="background-color: #ffff00">
|
||||
<td style="border: 1px solid #eaeaea; width: 30px; height: 10px; font-size: 7px;">Lp.</td>
|
||||
<td style="border: 1px solid #eaeaea; width: 90px; height: 10px; font-size: 7px; text-align: center;">Data</td>
|
||||
<td style="border: 1px solid #eaeaea; width: 40px; height: 10px; font-size: 7px; text-align: center;">H<sub>ST</sub> [m]</td>
|
||||
|
||||
<td style="border: 1px solid #eaeaea; width: 40px; height: 10px; font-size: 7px; text-align: center;">H<sub>D</sub> [m]</td>
|
||||
<td style="border: 1px solid #eaeaea; width: 60px; height: 10px; font-size: 7px; text-align: center;">Q [m<sup>3</sup>/min]</td>
|
||||
<td style="border: 1px solid #eaeaea; width: 40px; height: 10px; font-size: 7px; text-align: center;">p<sub>1</sub> [m]</td>
|
||||
<td style="border: 1px solid #eaeaea; width: 40px; height: 10px; font-size: 7px; text-align: center;">p<sub>2</sub> [m]</td>
|
||||
<td style="border: 1px solid #eaeaea; width: 40px; height: 10px; font-size: 7px; text-align: center;">I [A]</td>
|
||||
<td style="border: 1px solid #eaeaea; width: 40px; height: 10px; font-size: 7px; text-align: center;">U [V]</td>
|
||||
<td style="border: 1px solid #eaeaea; width: 40px; height: 10px; font-size: 7px; text-align: center;">P<sub>e</sub> [kW]</td>
|
||||
<td style="border: 1px solid #eaeaea; width: 40px; height: 10px; font-size: 7px; text-align: center;">cos(φ)</td>
|
||||
<td style="border: 1px solid #eaeaea; width: 100px; height: 10px; font-size: 7px; text-align: center;">Czas pracy [h]</td>
|
||||
</tr>
|
||||
';
|
||||
|
||||
|
||||
|
||||
require_once('../fpdf/fpdf.php');
|
||||
|
||||
class PDF extends FPDF
|
||||
{
|
||||
// Page header
|
||||
function Header()
|
||||
{
|
||||
// Arial bold 15
|
||||
$this -> SetFont('arial_ce', 'B', 15);
|
||||
// Title
|
||||
$title = iconv('utf-8','windows-1250',$_SESSION['well_details']['wellName'].' - historia pomiarów');
|
||||
$this->Cell(0,8,$title,0,1,'L');
|
||||
|
||||
$this -> SetFont('arial_ce', 'I', 10);
|
||||
|
||||
$title = iconv('utf-8','windows-1250','Od: '.$_SESSION['site401ahis_from'].' do: '.$_SESSION['site401ahis_to']);
|
||||
$this->Cell(0,8,$title,0,0,'L');
|
||||
// Line break
|
||||
$this->Ln();
|
||||
}
|
||||
|
||||
// Page footer
|
||||
function Footer()
|
||||
{
|
||||
// Position at 1.5 cm from bottom
|
||||
$this->SetY(-15);
|
||||
// Arial italic 8
|
||||
$this->SetFont('Arial','I',8);
|
||||
// Page number
|
||||
$this->Cell(0,10,'Strona '.$this->PageNo().'/{nb}',0,0,'R');
|
||||
}
|
||||
}
|
||||
|
||||
// Instanciation of inherited class
|
||||
$pdf = new PDF();
|
||||
$pdf->AddFont('arial_ce','','arial_ce.php');
|
||||
$pdf->AddFont('arial_ce','I','arial_ce_i.php');
|
||||
$pdf->AddFont('arial_ce','B','arial_ce_b.php');
|
||||
$pdf->AddFont('arial_ce','BI','arial_ce_bi.php');
|
||||
|
||||
$pdf->AliasNbPages();
|
||||
$pdf->AddPage();
|
||||
|
||||
$pdf->SetLineWidth(.1);
|
||||
$pdf -> SetFont('arial_ce', 'B', 7);
|
||||
$pdf->Cell(10,6,iconv('utf-8','windows-1250','Lp.'),1,0,'C');
|
||||
$pdf->Cell(25,6,iconv('utf-8','windows-1250','Data'),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250','HST [m]'),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250','HD [m]'),1,0,'C');
|
||||
$pdf->Cell(20,6,iconv('utf-8','windows-1250','Q [m3/min]'),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250','p1 [m]'),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250','p2 [m]'),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250','I [A]'),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250','U [V]'),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250','Pe [kW]'),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250','cos(fi)'),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250','Tp [h]'),1,0,'C');
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf -> SetFont('arial_ce', '', 6);
|
||||
|
||||
for($i=0;$i<count($_SESSION['site401ahis_array']);$i++)
|
||||
{
|
||||
$pdf->Cell(10,6,iconv('utf-8','windows-1250',$i+1),1,0,'C');
|
||||
$pdf->Cell(25,6,iconv('utf-8','windows-1250',$_SESSION['site401ahis_array'][$i]['his_date']),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250',$_SESSION['site401ahis_array'][$i]['his_hst']),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250',$_SESSION['site401ahis_array'][$i]['his_hd']),1,0,'C');
|
||||
$pdf->Cell(20,6,iconv('utf-8','windows-1250',$_SESSION['site401ahis_array'][$i]['his_q']),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250',$_SESSION['site401ahis_array'][$i]['his_p1']),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250',$_SESSION['site401ahis_array'][$i]['his_p2']),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250',$_SESSION['site401ahis_array'][$i]['his_I']),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250',$_SESSION['site401ahis_array'][$i]['his_U']),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250',$_SESSION['site401ahis_array'][$i]['his_PE']),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250',$_SESSION['site401ahis_array'][$i]['his_cos']),1,0,'C');
|
||||
$pdf->Cell(15,6,iconv('utf-8','windows-1250',$_SESSION['site401ahis_array'][$i]['his_work_time']),1,0,'C');
|
||||
$pdf->Ln();
|
||||
|
||||
}
|
||||
|
||||
$pdf->Output();
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user