120 lines
5 KiB
PHP
120 lines
5 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);
|
|
|
|
if ($_GET['tag']>0) { $rtag=$_GET['tag']; } else { $rtag = (int)date('Y'); }
|
|
if ($_GET['monat']>0) { $rmonat=$_GET['monat']; } else { $rmonat = (int)date('Y'); }
|
|
if ($_GET['jahr']>0) { $rjahr=$_GET['jahr']; } else { $rjahr = (int)date('Y'); }
|
|
$vdatum=$rtag.".".$rmonat.".".$rjahr;
|
|
|
|
echo "<pre>"; print_r($_POST); echo "</pre>";
|
|
|
|
echo "<pre>"; print_r($_GET); echo "</pre>";
|
|
|
|
|
|
require('lib/fpdf.php');
|
|
class PDF extends FPDF {
|
|
function Footer() {
|
|
$this->SetTextColor(255,255,255);
|
|
$this->SetFillColor(100,100,100);
|
|
$this->SetY(-15);
|
|
$this->SetFont('Helvetica','I',6);
|
|
$this->Cell(190,3,'JB-Transport.de - Bautzner Str. 67 - 04347 Leipzig ***** Interne Liste - NON Public ***** F. Teichert 2011-2014','1','0','C','1');
|
|
}
|
|
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.gif', 125, 7);
|
|
$this->Write(16,"\n");
|
|
}
|
|
}
|
|
$pdf = new PDF('P','mm','A4');
|
|
$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="Einsatzplan für den ".$vdatum;
|
|
$pdf->Cell(80,6,'Leipzig Post "AG-Tour"','0','0','L','0');
|
|
$pdf->SetTextColor(0,0,0);
|
|
$pdf->SetFont('Helvetica','BI',16); $pdf->Cell(110,5,utf8_decode($infodatum),'0','1','R','0');
|
|
|
|
//----------------------------------------------------------------------------------------------------------------
|
|
$zahl=0; $key=0;
|
|
$pin_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE tag='".$rtag."' and monat='".$rmonat."' and jahr='".$rjahr."' and typ=5");
|
|
while($row = $pin_tour->fetch_assoc()) {
|
|
$row_touren = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
|
|
//------------------- Tourinfo
|
|
$pdf->Write(5,"\n");
|
|
$pdf->SetFillColor(100,100,100); $pdf->SetTextColor(100,100,100); $pdf->SetFont('Helvetica','B',16);
|
|
$pdf->Cell(194,7,utf8_decode($row_touren['tour']),'B','1','L','0'); $pdf->SetTextColor(255,255,255);
|
|
|
|
//------------------------------------- Tabellenbeschreibung
|
|
$pdf->SetTextColor(100,100,100);
|
|
$pdf->SetFont('Helvetica','BI',8);
|
|
$pdf->Cell(24,4,"Startzeit",'0','0','L','0');
|
|
$pdf->Cell(60,4,"Fahrer",'0','0','L','0');
|
|
$pdf->Cell(30,4,"Fahrzeug",'0','0','L','0');
|
|
$pdf->Cell(65,4,"Infotext",'0','0','L','0');
|
|
$pdf->Cell(15,4,"SMS",'0','1','L','0');
|
|
$pdf->SetTextColor(0,0,0); $pdf->SetFont('Helvetica','',14);
|
|
//-------------------------------------
|
|
|
|
$pdf->Cell(24,8,($row['zeit']." Uhr"),'0','0','R','0');
|
|
$stamma=$row_touren['s_auto']; $stammf=$row_touren['s_fahrer'];
|
|
$row_fahrerx = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$row['fahrer']."'");
|
|
if ($stammf != $row['fahrer']) $pdf->SetFont('Helvetica','BI',14);
|
|
$pdf->Cell(60,8,($row_fahrerx['name']),'0','0','L','0');
|
|
$pdf->SetFont('Helvetica','',14);
|
|
if ($row['gewicht']>1799) $pdf->SetFont('Helvetica','BI',14);
|
|
$pdf->SetFont('Helvetica','',14);
|
|
$row_autox = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['auto']."'");
|
|
if($stamma != $row['auto']) $pdf->SetFont('Helvetica','BI',14);
|
|
$pdf->Cell(30,6,($row_autox['kz']),'0','0','L','0');
|
|
$pdf->SetFont('Helvetica','BI',10);
|
|
$pdf->Cell(65,6,($row['infotext']),'0','0','L','0');
|
|
$pdf->Cell(15,6,($row['smsid']),'0','1','L','0');
|
|
$pdf->SetFont('');
|
|
$key++;
|
|
}
|
|
|
|
//---------------------------------------
|
|
|
|
if ($_GET['icon'] ==0) { $pdf->Output('PIN_AG_'.($vdatum).'.pdf','I'); }
|
|
if ($_GET['icon'] ==1) { $pdf->Output('PIN_AG_'.($vdatum).'.pdf','D'); }
|
|
if ($_GET['icon'] ==2) {
|
|
|
|
if (!class_exists("phpmailer")) {
|
|
require_once('lib/phpmailer/class.phpmailer.php');
|
|
}
|
|
$empfaenger = "dispo@jb-transport.de";
|
|
$betreff="PIN_AG-Einsatzplan ".($vdatum).".pdf";
|
|
$Dateiname = "PIN_AG_".($vdatum).".pdf";
|
|
$DateinameMail = "PIN_AG_".($vdatum).".pdf";
|
|
|
|
require_once('lib/phpmailer/class.phpmailer.php');
|
|
$mail = new PHPMailer();
|
|
$mail->SetLanguage('de', $mail->PluginDir . '/language/');
|
|
$mail->Body = "PIN_AG-Einsatzplan ".$vdatum.".kw";
|
|
$mail->From = "dispo@jb-transport.de";
|
|
$mail->FromName = "dispo@jb-transport.de";
|
|
$mail->AddAddress("dispo@jb-transport.de");
|
|
$mail->Subject = $betreff;
|
|
$doc = $pdf->Output('','S');
|
|
$mail->AddStringAttachment($doc,"PIN_AG_".$vdatum.".pdf", 'base64', 'application/pdf'); //$Dateiname
|
|
$mail->Send();
|
|
|
|
echo $Dateiname.' wurde versendet an: '.$empfaenger;
|
|
?><meta http-equiv="refresh" content="2; URL=https://edv.jb-transport.de/index.php?s=linfo&mailok=1"><?php
|
|
}
|
|
|
|
?>
|