jb-data.de/scripts/list_komplett.php
2025-08-11 22:23:30 +02:00

474 lines
20 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['kw'] > 0) { $kw_aktuell = $_GET['kw']; } else { $kw_aktuell = (int)date('W'); }
if ($_GET['jahr']>0) { $jahr_aktuell=$_GET['jahr']; } else { $jahr_aktuell = (int)date('Y'); }
require('lib/fpdf.php');
class PDF extends FPDF {
/* function Footer() {
$this->SetY(-15);
$this->SetFont('Helvetica','I',6);
$this->Cell(190,3,'JB-Transport.de - Bautzner Str. 67 - 04347 Leipzig ***** Interne Liste - NON Public ***** by. F. Teichert ©2012','1','0','C','1');
} */
}
$pdf = new PDF('P','mm','A4');
$pdf->AddPage();
// blau (0,160,230)
// Orange (240,150, 0)
// grau (200,200,200)
$pdf->SetFont('Helvetica','B',12);
$pdf->SetTextColor(0,0,140);
$pdf->SetFillColor(240,150,0);
$pdf->Cell(95,6,"Gesamtwerbeliste ".($kw_aktuell).".KW",'1','0','L','1');
$pdf->SetTextColor(240,150,0);
$pdf->SetFillColor(0,0,140);
$pdf->Cell(95,6,"JB-Transport.de",'1','0','R','1');
$pdf->Write(6,"\n");
$pdf->SetFont('Helvetica','BI',20);
$pdf->SetFillColor(0,0,140);
$pdf->SetTextColor(240,150,0);
//----------------------Rundschau / Marktplatz
$pdf->SetFont('Helvetica','B',10);
// $pdf->SetTextColor(0,160,230);
$pdf->SetFillColor(240,150,0);
$pdf->SetFillColor(0,0,140);
$pdf->SetTextColor(240,150,0);
$pdf->Cell(190,4,"Rundschau / Marktplatz",'1','0','l','1');
$pdf->Write(5,"\n");
$pdf->SetFillColor(100,100,100);
$pdf->SetFont('Helvetica','BI',8);
$pdf->SetTextColor(255,255,255);
$pdf->Cell(17,3.5,"Datum",'1','0','L','1');
$pdf->Cell(17,3.5,"Tour",'1','0','L','1');
$pdf->Cell(35,3.5,"Bezeichnung",'1','0','L','1');
$pdf->Cell(33,3.5,"Fahrer",'1','0','L','1');
$pdf->Cell(18,3.5,"Pakete",'1','0','L','1');
$pdf->Cell(14,3.5,"Gewicht",'1','0','L','1');
$pdf->Cell(15,3.5,"Norm",'1','0','L','1');
$pdf->Cell(15,3.5,"Stellzeit",'1','0','L','1');
$pdf->Cell(18,3.5,"Fahrzeug",'1','0','L','1');
$pdf->Cell(8,3.5,"SMS",'1','0','L','1');
$pdf->Write(4,"\n");
$pdf->SetFillColor(255,255,255);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('');
$key=0;
$rs_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr_aktuell."' and typ=7");
while($row = $rs_tour->fetch_assoc()) {
$datum=$row['tag'].".".$row['monat'].".".$row['jahr'];
$pdf->Cell(17,3.5,($datum),'1','0','R','1');
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
$stamma=$row_tour['s_auto']; $stammf=$row_tour['s_fahrer'];
$pdf->Cell(17,3.5,utf8_decode($row_tour['tour']),'1','0','L','1');
$pdf->Cell(35,3.5,utf8_decode($row_tour['infotitel']),'1','0','L','1');
$row_fahrerx = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$row['fahrer']."'");
if ($stammf != $row['fahrer']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(33,3.5,utf8_decode($row_fahrerx['name']),'1','0','L','1');
$pdf->SetFont('');
$pak=ceil($row['Pakete']);
$pdf->Cell(18,3.5,($pak." Pakete"),'1','0','R','1');
if ($row['gewicht']>1799) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(14,3.5,($row['gewicht']." kg"),'1','0','R','1');
$pdf->SetFont('');
$pdf->Cell(15,3.5,($row['Norm'])."er Norm",'1','0','R','1');
$pdf->Cell(15,3.5,($row['zeit']." Uhr"),'1','0','R','1');
$row_autox = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['auto']."'");
if($stamma != $row['auto']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(18,3.5,($row_autox['kz']),'1','0','L','1');
$pdf->SetFont('');
$pdf->Cell(8,3.5,($row['smsid']),'1','1','L','1');
$pdf->SetFont('');
$key++;
}
$pdf->SetFillColor(100,100,100);
$pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(190,1," ",'1','1','L','1');
/*
$pdf->SetTextColor(255,255,255);
$pdf->Cell(17,3.5,"Datum",'1','0','L','1');
$pdf->Cell(17,3.5,"Tour",'1','0','L','1');
$pdf->Cell(35,3.5,"Bezeichnung",'1','0','L','1');
$pdf->Cell(33,3.5,"Fahrer",'1','0','L','1');
$pdf->Cell(18,3.5,"Pakete",'1','0','L','1');
$pdf->Cell(14,3.5,"Gewicht",'1','0','L','1');
$pdf->Cell(15,3.5,"Norm",'1','0','L','1');
$pdf->Cell(15,3.5,"Stellzeit",'1','0','L','1');
$pdf->Cell(18,3.5,"Fahrzeug",'1','0','L','1');
$pdf->Cell(8,4,"SMS",'1','0','L','1');
$pdf->Write(4,"\n");
*/
$pdf->SetFillColor(255,255,255);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('');
$rs_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr_aktuell."' and typ=10");
while($row = $rs_tour->fetch_assoc()) {
$datum=$row['tag'].".".$row['monat'].".".$row['jahr'];
$pdf->Cell(17,3.5,($datum),'1','0','R','1');
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
$stamma=$row_tour['s_auto']; $stammf=$row_tour['s_fahrer'];
$pdf->Cell(17,3.5,utf8_decode($row_tour['tour']),'1','0','L','1');
$pdf->Cell(35,3.5,utf8_decode($row_tour['infotitel']),'1','0','L','1');
$row_fahrerx = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$row['fahrer']."'");
if ($stammf != $row['fahrer']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(33,3.5,utf8_decode($row_fahrerx['name']),'1','0','L','1');
$pdf->SetFont('');
$pak=ceil($row['Pakete']);
$pdf->Cell(18,3.5,($pak." Pakete"),'1','0','R','1');
if ($row['gewicht']>1799) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(14,3.5,($row['gewicht']." kg"),'1','0','R','1');
$pdf->SetFont('');
$pdf->Cell(15,3.5,($row['Norm'])."er Norm",'1','0','R','1');
$pdf->Cell(15,3.5,($row['zeit']." Uhr"),'1','0','R','1');
$row_autox = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['auto']."'");
if($stamma != $row['auto']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(18,3.5,($row_autox['kz']),'1','0','L','1');
$pdf->SetFont('');
$pdf->Cell(8,3.5,($row['smsid']),'1','1','L','1');
$pdf->SetFont('');
$key++;
}
//--------------------------------- Werbe-Freitag
$pdf->Write(1,"\n");
$pdf->SetFont('Helvetica','BI',10);
$pdf->SetFillColor(0,0,140);
$pdf->SetTextColor(240,150,0);
$pdf->Cell(190,3.5,"Werbung am Freitag *** Marktbelege / Kaufland / MPV",'1','0','L','1');
$pdf->Write(5,"\n");
$pdf->SetFillColor(100,100,100);
$pdf->SetFont('Helvetica','BI',8);
$pdf->SetTextColor(255,255,255);
$pdf->Cell(17,3.5,"Datum",'1','0','L','1');
$pdf->Cell(17,3.5,"Tour",'1','0','L','1');
$pdf->Cell(35,3.5,"Bezeichnung",'1','0','L','1');
$pdf->Cell(33,3.5,"Fahrer",'1','0','L','1');
$pdf->Cell(16,3.5,"kg 1",'1','0','L','1');
$pdf->Cell(15,3.5,"kg 2",'1','0','L','1');
$pdf->Cell(16,3.5,"Gewicht",'1','0','L','1');
$pdf->Cell(15,3.5,"Stellzeit",'1','0','L','1');
$pdf->Cell(18,3.5,"Fahrzeug",'1','0','L','1');
$pdf->Cell(8,4,"SMS",'1','0','L','1');
$pdf->Write(4,"\n");
$pdf->SetFillColor(255,255,255);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('');
$key=0;
$rs_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr_aktuell."' and typ=12");
while($row = $rs_tour->fetch_assoc()) {
$datum=$row['tag'].".".$row['monat'].".".$row['jahr'];
$pdf->Cell(17,3,($datum),'1','0','R','1');
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
$stamma=$row_tour['s_auto']; $stammf=$row_tour['s_fahrer'];
$pdf->Cell(17,3,utf8_decode($row_tour['tour']),'1','0','L','1');
$pdf->Cell(35,3,utf8_decode($row_tour['infotitel']),'1','0','L','1');
$row_fahrerx = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$row['fahrer']."'");
if ($stammf != $row['fahrer']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(33,3,utf8_decode($row_fahrerx['name']),'1','0','L','1');
$pdf->SetFont('');
if ($row['gewicht']>1799) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(16,3,($row['gewicht']." kg"),'1','0','R','1');
$pdf->SetFont('');
if ($row['gewicht2']>1799) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(15,3,($row['gewicht2']." kg"),'1','0','R','1');
$pdf->SetFont('');
$ggewicht=$row['gewicht']+$row['gewicht2'];
if ($ggewicht>1799) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(16,3,($ggewicht." kg"),'1','0','R','1');
$pdf->SetFont('');
$pdf->Cell(15,3,($row['zeit']." Uhr"),'1','0','R','1');
$row_autox = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['auto']."'");
if($stamma != $row['auto']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(18,3,($row_autox['kz']),'1','0','L','1');
$pdf->SetFont('');
$pdf->Cell(8,3,($row['smsid']),'1','1','L','1');
$pdf->SetFont('');
$key++;
}
$pdf->SetFillColor(100,100,100);
$pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(190,1," ",'1','1','L','1');
/*
$pdf->SetTextColor(255,255,255);
$pdf->Cell(20,3.5,"Datum",'1','0','L','1');
$pdf->Cell(20,3.5,"Tour",'1','0','L','1');
$pdf->Cell(35,3.5,"Bezeichnung",'1','0','L','1');
$pdf->Cell(35,3.5,"Fahrer",'1','0','L','1');
$pdf->Cell(20,3.5,"Gewicht",'1','0','L','1');
$pdf->Cell(20,3.5,"Stellzeit",'1','0','L','1');
$pdf->Cell(25,3.5,"Fahrzeug",'1','0','L','1');
$pdf->Cell(15,3.5,"SMS",'1','0','L','1');
$pdf->Write(4,"\n");
*/
$pdf->SetFillColor(255,255,255);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('');
$key=0;
$rs_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr_aktuell."' and typ=14");
while($row = $rs_tour->fetch_assoc()) {
$datum=$row['tag'].".".$row['monat'].".".$row['jahr'];
$pdf->Cell(17,3.5,($datum),'1','0','R','1');
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
$stamma=$row_tour['s_auto']; $stammf=$row_tour['s_fahrer'];
$pdf->Cell(17,3.5,utf8_decode($row_tour['tour']),'1','0','L','1');
$pdf->Cell(35,3.5,utf8_decode($row_tour['infotitel']),'1','0','L','1');
$row_fahrerx = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$row['fahrer']."'");
if ($stammf != $row['fahrer']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(33,3.5,utf8_decode($row_fahrerx['name']),'1','0','L','1');
$pdf->SetFont('');
if ($row['gewicht']>1799) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(16,3.5,($row['gewicht']." kg"),'1','0','R','1');
$pdf->SetFont('');
if ($row['gewicht2']>1799) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(15,3.5,($row['gewicht2']." kg"),'1','0','R','1');
$pdf->SetFont('');
$ggewicht=$row['gewicht']+$row['gewicht2'];
if ($ggewicht>1799) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(16,3.5,($ggewicht." kg"),'1','0','R','1');
$pdf->SetFont('');
$pdf->Cell(15,3.5,($row['zeit']." Uhr"),'1','0','R','1');
$row_autox = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['auto']."'");
if($stamma != $row['auto']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(18,3.5,($row_autox['kz']),'1','0','L','1');
$pdf->SetFont('');
$pdf->Cell(8,3.5,($row['smsid']),'1','1','L','1');
$pdf->SetFont('');
$key++;
}
$pdf->SetFillColor(100,100,100);
$pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(190,1," ",'1','1','L','1');
/*
$pdf->SetTextColor(255,255,255);
$pdf->Cell(20,3.5,"Datum",'1','0','L','1');
$pdf->Cell(20,3.5,"Tour",'1','0','L','1');
$pdf->Cell(35,3.5,"Bezeichnung",'1','0','L','1');
$pdf->Cell(35,3.5,"Fahrer",'1','0','L','1');
$pdf->Cell(20,3.5,"Gewicht",'1','0','L','1');
$pdf->Cell(20,3.5,"Stellzeit",'1','0','L','1');
$pdf->Cell(25,3.5,"Fahrzeug",'1','0','L','1');
$pdf->Cell(15,3.5,"SMS",'1','0','L','1');
//$pdf->Write(4,"\n");
*/
$pdf->SetFillColor(255,255,255);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('');
$key=0;
$rs_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr_aktuell."' and typ=11");
while($row = $rs_tour->fetch_assoc()) {
$datum=$row['tag'].".".$row['monat'].".".$row['jahr'];
$pdf->Cell(17,3.5,($datum),'1','0','R','1');
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
$stamma=$row_tour['s_auto']; $stammf=$row_tour['s_fahrer'];
$pdf->Cell(17,3.5,utf8_decode($row_tour['tour']),'1','0','L','1');
$pdf->Cell(35,3.5,utf8_decode($row_tour['infotitel']),'1','0','L','1');
$row_fahrerx = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$row['fahrer']."'");
if ($stammf != $row['fahrer']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(33,3.5,utf8_decode($row_fahrerx['name']),'1','0','L','1');
$pdf->SetFont('');
if ($row['gewicht']>1799) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(16,3.5,($row['gewicht']." kg"),'1','0','R','1');
$pdf->SetFont('');
if ($row['gewicht2']>1799) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(15,3.5,($row['gewicht2']." kg"),'1','0','R','1');
$pdf->SetFont('');
$ggewicht=$row['gewicht']+$row['gewicht2'];
if ($ggewicht>1799) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(16,3.5,($ggewicht." kg"),'1','0','R','1');
$pdf->SetFont('');
$pdf->Cell(15,3.5,($row['zeit']." Uhr"),'1','0','R','1');
$row_autox = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['auto']."'");
if($stamma != $row['auto']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(18,3.5,($row_autox['kz']),'1','0','L','1');
$pdf->SetFont('');
$pdf->Cell(8,3.5,($row['smsid']),'1','1','L','1');
$pdf->SetFont('');
$key++;
}
//-------------------------------------- SASO
$row_norm = $GLOBALS['mysql']->query_single("SELECT * FROM sasonorm WHERE kw='".$kw_aktuell."'");
$snorm=$row_norm['norm'];
$pdf->Write(2,"\n");
$pdf->SetFont('Helvetica','BI',10);
$pdf->SetFillColor(0,0,140);
$pdf->SetTextColor(240,150,0);
$pdf->Cell(190,3.5,"Sachsen-Sonntag ".$snorm."er Norm",'1','0','L','1');
$pdf->Write(5,"\n");
$pdf->SetFillColor(100,100,100);
$pdf->SetFont('Helvetica','BI',8);
$pdf->SetTextColor(255,255,255);
$pdf->Cell(17,3.5,"Datum",'1','0','L','1');
$pdf->Cell(17,3.5,"Tour",'1','0','L','1');
$pdf->Cell(35,3.5,"Bezeichnung",'1','0','L','1');
$pdf->Cell(33,3.5,"Fahrer",'1','0','L','1');
$pdf->Cell(16,3.5,"Tour kg",'1','0','L','1');
$pdf->Cell(15,3.5,"Pakete",'1','0','L','1');
$pdf->Cell(16,3.5,"Auto kg",'1','0','L','1');
$pdf->Cell(15,3.5,"Stellzeit",'1','0','L','1');
$pdf->Cell(18,3.5,"Fahrzeug",'1','0','L','1');
$pdf->Cell(8,3.5,"SMS",'1','0','L','1');
$pdf->Write(4,"\n");
$pdf->SetFillColor(255,255,255);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('');
$key=0;
$saso_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr_aktuell."' and typ=8 AND zeit >= 19 ORDER BY zeit");
while($row = $saso_tour->fetch_assoc()) {
$datum=$row['tag'].".".$row['monat'].".".$row['jahr'];
$pdf->Cell(17,3.5,($datum),'1','0','R','1');
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
$stamma=$row_tour['s_auto']; $stammf=$row_tour['s_fahrer'];
$row_fahrerx = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$row['fahrer']."'");
$agewicht=$row['gewicht2']*$row['pakete2'];
if($row['tour']>900) {
$pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(17,3.5,utf8_decode($row_tour['tour']),'1','0','L','1');
$pdf->SetFont('');
$pdf->Cell(35,3.5,utf8_decode($row_tour['infotitel']),'1','0','L','1');
if ($stammf != $row['fahrer']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(33,3.5,utf8_decode($row_fahrerx['name']),'1','0','L','1');
$pdf->SetFont('');
$pdf->Cell(16,3.5,(" "),'1','0','R','1');
} else { //----------------------------------- normale Tour !
$pdf->Cell(17,3.5,($row_tour['tour']),'1','0','L','1');
$pdf->Cell(35,3.5,($row_tour['infotitel']),'1','0','L','1');
if ($stammf != $row['fahrer']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(33,3.5,($row_fahrerx['name']),'1','0','L','1');
$pdf->SetFont('');
if ($row['gewicht']>1799) { $pdf->SetFont('Helvetica','BI',8); }
$pdf->Cell(16,3.5,($row['gewicht']." kg"),'1','0','R','1');
$pdf->SetFont('');
}
//************** Pakte * gewicht !!!!!!!!!!!
$pdf->Cell(15,3.5,($row['pakete2']." Pak."),'1','0','R','1');
if ($ggewicht>1799) $pdf->SetFont('Helvetica','BI',8);
$cargewicht=round($agewicht);
$pdf->Cell(16,3.5,($cargewicht." kg"),'1','0','R','1');
//************ gewichtsberechnung ende
$pdf->SetFont('');
$pdf->Cell(15,3.5,($row['zeit']." Uhr"),'1','0','R','1');
$row_autox = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['auto']."'");
if($stamma != $row['auto']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(18,3.5,($row_autox['kz']),'1','0','L','1');
$pdf->SetFont('');
if ($row['smsid']>0) {
$pdf->Cell(8,3.5,("OK"),'1','1','C','1');
} else {
$pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(8,3.5,("xxxx"),'1','1','C','1');
$pdf->SetFont('');
$key++;
}
}
//----------------- 2, teil ab 0 Uhr
$saso_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr_aktuell."' and typ=8 AND zeit <= 19 ORDER BY zeit");
while($row = $saso_tour->fetch_assoc()) {
$datum=$row['tag'].".".$row['monat'].".".$row['jahr'];
$pdf->Cell(17,3.5,($datum),'1','0','R','1');
$row_tour = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$row['tour']."'");
$stamma=$row_tour['s_auto']; $stammf=$row_tour['s_fahrer'];
$row_fahrerx = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$row['fahrer']."'");
$agewicht=$row['gewicht2']*$row['pakete2'];
if($row['tour']>900) {
$pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(17,3.5,utf8_decode($row_tour['tour']),'1','0','L','1');
$pdf->SetFont('');
$pdf->Cell(35,3.5,utf8_decode($row_tour['infotitel']),'1','0','L','1');
if ($stammf != $row['fahrer']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(33,3.5,utf8_decode($row_fahrerx['name']),'1','0','L','1');
$pdf->SetFont('');
$pdf->Cell(16,3.5,(" "),'1','0','R','1');
} else { //----------------------------------- normale Tour !
$pdf->Cell(17,3.5,($row_tour['tour']),'1','0','L','1');
$pdf->Cell(35,3.5,($row_tour['infotitel']),'1','0','L','1');
if ($stammf != $row['fahrer']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(33,3.5,($row_fahrerx['name']),'1','0','L','1');
$pdf->SetFont('');
if ($row['gewicht']>1799) { $pdf->SetFont('Helvetica','BI',8); }
$pdf->Cell(16,3.5,($row['gewicht']." kg"),'1','0','R','1');
$pdf->SetFont('');
}
//************** Pakte * gewicht !!!!!!!!!!!
$pdf->Cell(15,3.5,($row['pakete2']." Pak."),'1','0','R','1');
if ($ggewicht>1799) $pdf->SetFont('Helvetica','BI',8);
$cargewicht=round($agewicht);
$pdf->Cell(16,3.5,($cargewicht." kg"),'1','0','R','1');
//************ gewichtsberechnung ende
$pdf->SetFont('');
$pdf->Cell(15,3.5,($row['zeit']." Uhr"),'1','0','R','1');
$row_autox = $GLOBALS['mysql']->query_single("SELECT * FROM fahrzeuge WHERE id='".$row['auto']."'");
if($stamma != $row['auto']) $pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(18,3.5,($row_autox['kz']),'1','0','L','1');
$pdf->SetFont('');
if ($row['smsid']>0) {
$pdf->Cell(8,3.5,("OK"),'1','1','C','1');
} else {
$pdf->SetFont('Helvetica','BI',8);
$pdf->Cell(8,3.5,("xxxx"),'1','1','C','1');
$pdf->SetFont('');
$key++;
}
}
//---------------------------------------
if ($_GET['icon'] ==0) { $pdf->Output('Gesamtliste_'.($kw_aktuell).'kw.pdf','I'); }
if ($_GET['icon'] ==1) { $pdf->Output('Gesamtliste_'.($kw_aktuell).'kw.pdf','D'); }
if ($_GET['icon'] ==2) {
if (!class_exists("phpmailer")) {
require_once('lib/phpmailer/class.phpmailer.php');
}
$empfaenger = "dispo@jb-transport.de";
$betreff="Gesamtliste ".($kw_aktuell).".kw.pdf";
$Dateiname = "Gesamtliste_".($kw_aktuell).".kw.pdf";
$DateinameMail = "Gesamtliste_".($kw_aktuell).".kw.pdf";
require_once('lib/phpmailer/class.phpmailer.php');
$mail = new PHPMailer();
$mail->SetLanguage('de', $mail->PluginDir . '/language/');
$mail->Body = "Gesamtliste ".$kw_aktuell.".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,"Gesamtliste_".$kw_aktuell.".kw.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
}
?>