99 lines
3.8 KiB
PHP
99 lines
3.8 KiB
PHP
<?php
|
|
// UTF8 erzwingen
|
|
@setlocale(LC_CTYPE, 'de_DE.utf8', 'de_DE.UTF-8', 'en_US.utf8', 'en_US.UTF-8', 'en_GB.utf8', 'en_GB.UTF-8', 'de_AT.utf8', 'de_AT.UTF-8', 'de_CH.utf8', 'de_CH.UTF-8');
|
|
if( function_exists('mb_internal_encoding') )
|
|
{
|
|
mb_internal_encoding('utf-8');
|
|
}
|
|
header('Content-type: text/html; charset=utf-8');
|
|
error_reporting(E_ALL); ini_set('display_errors', 0);
|
|
|
|
$rtag = (int)$_GET['t'];
|
|
$rmonat = (int)$_GET['m'];
|
|
$rjahr = (int)$_GET['j'];
|
|
$vdatum=$rtag.".".$rmonat.".".$rjahr;
|
|
|
|
require('lib/fpdf.php');
|
|
require('lib/config.php');
|
|
require('lib/mysql.class.php');
|
|
// require('lib/email.class.php');
|
|
// require('lib/smarty/Smarty.class.php');
|
|
|
|
require('lib/core.class.php');
|
|
require('lib/function.php');
|
|
session_name(CONFIG_SESSION);
|
|
session_start();
|
|
$loginerror='';
|
|
$GLOBALS['core'] = new core;
|
|
|
|
$GLOBALS['mysql'] = new mysql(CONFIG_MYSQL_HOST,CONFIG_MYSQL_USER,CONFIG_MYSQL_PW,CONFIG_MYSQL_DB);
|
|
|
|
|
|
class PDF extends FPDF {
|
|
function Header() {
|
|
$this->SetFont('Helvetica','B',20);
|
|
// $pdf->SetTextColor(0,160,230);
|
|
// $this->Image('template/images/logo-lvz-post-2014.jpg', 10, 7);
|
|
|
|
$this->SetFont('Helvetica','BI',20);
|
|
$this->Image('template/images/jb_logo2.png', 210, 7);
|
|
}
|
|
}
|
|
$pdf = new PDF('L','mm','A4');
|
|
$pdf->SetAutoPageBreak(false);
|
|
$pdf->AddPage();
|
|
// blau (0,160,230)
|
|
// Orange (240,150, 0)
|
|
// grau (200,200,200)
|
|
|
|
$pdf->SetTextColor(0,0,140); $pdf->SetFont('Helvetica','B',16); $infodatum="Berichtsliste für den: ".$vdatum;
|
|
$pdf->SetTextColor(0,0,0);
|
|
$pdf->SetFont('Helvetica','BI',16); $pdf->Cell(110,5,utf8_decode($infodatum),'0','1','L','0');
|
|
$pdf->Write(3,"\n");
|
|
|
|
//----------------------------------------------------------------------------------------------------------------
|
|
// PKW
|
|
//----------------------------------------------------------------------------------------------------------------
|
|
$zahl=0; $key=0; $pdf->Write(1,"\n");
|
|
$pdf->SetFillColor(100,100,100); $pdf->SetTextColor(100,100,100); $pdf->SetFont('Helvetica','B',14);
|
|
$pdf->Cell(275,6,' ','B','1','L','0'); $pdf->SetTextColor(255,255,255);
|
|
//------------------------------------- Tabellenbeschreibung
|
|
$pdf->SetTextColor(100,100,100);
|
|
$pdf->SetFont('Helvetica','BI',6);
|
|
$pdf->Cell(30,3,"Kennzeichen",'0','0','L','0');
|
|
$pdf->Cell(45,3,"Bezeichnung",'0','0','L','0');
|
|
$pdf->Cell(55,3,"Fahrer",'0','0','L','0');
|
|
$pdf->Cell(20,3,"Ausgabe",'0','0','L','0');
|
|
$pdf->Cell(20,3,"Annahme",'0','0','L','0');
|
|
$pdf->Cell(105,3,"Informationen",'0','1','L','0');
|
|
|
|
$cars = $GLOBALS['mysql']->query("SELECT * FROM fahrzeuge WHERE typ>2 and aktiv>0 and besitz<3 ORDER BY kz");
|
|
$pdf->SetTextColor(0,0,0); $pdf->SetFont('Helvetica','B',8);
|
|
while($row = $cars->fetch_assoc()) {
|
|
$temptour = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE tag='".$_GET['t']."' and monat='".$_GET['m']."' and jahr='".$_GET['j']."' and auto='".$row['id']."' and typ<6 ");
|
|
if($temptour['num_rows']>0) {
|
|
$mad = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$temptour['fahrer']."'");
|
|
//-------------------------------------
|
|
$pdf->SetFont('Helvetica','B',12);
|
|
$pdf->Cell(30,6,($row['kz']),'B','0','L','0');
|
|
$pdf->SetFont('Helvetica','',8);
|
|
$pdf->Cell(45,6,($row['hersteller']." ".$row['name']),'B','0','L','0');
|
|
$pdf->SetFont('Helvetica','B',12);
|
|
$pdf->Cell(55,6,($mad['name']),'BL','0','L','0');
|
|
$pdf->Cell(20,6," ",'BLR','0','L','0');
|
|
$pdf->Cell(20,6," ",'BLR','0','L','0');
|
|
$pdf->Cell(105,6," ",'BLR','1','L','0');
|
|
$key++;
|
|
}
|
|
}
|
|
//----------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
// echo utf8_decode($row_touren['tour'])
|
|
//---------------------------------------
|
|
if ($_GET['icon'] ==1) { $pdf->Output('Berichtsliste_'.($vdatum).'.pdf','D');
|
|
} else {
|
|
$pdf->Output('Berichtsliste_'.($vdatum).'.pdf','I');
|
|
}
|
|
|
|
?>
|