215 lines
7.7 KiB
PHP
215 lines
7.7 KiB
PHP
<?php
|
|
require('lib/fpdf.php');
|
|
//echo'<pre>'; print_r($_GET['monat']); echo'</pre>';
|
|
$ma_id=$_GET['ma'];
|
|
$m=$_GET['monat'];
|
|
$j=$_GET['jahr'];
|
|
|
|
class PDF extends FPDF {
|
|
function Footer() {
|
|
$this->SetY(-15);
|
|
$this->SetFont('Helvetica','I',6);
|
|
$this->Cell(190,3,utf8_decode('JB-Transport.de - Bautzner Str. 67a - 04347 Leipzig ***** Interne Liste - NON Public ***** JB-EDV ©2012/2023'),'1','0','C','1');
|
|
}
|
|
|
|
}
|
|
$pdf = new PDF('P','mm','A4');
|
|
$pdf->AddPage();
|
|
// blau (0,160,230)
|
|
// Orange (240,150, 0)
|
|
// grau (200,200,200)
|
|
//--------------------------------------
|
|
$td=$GLOBALS['mysql']->query_id("SELECT * FROM touren ORDER BY id");
|
|
$pb=$GLOBALS['mysql']->query_id("SELECT * FROM planer_bez ORDER BY id");
|
|
//--------------------------------------
|
|
$tage = date("t",mktime(0, 0, 0,$m, 1,$j));
|
|
$tbez = array('So.','Mo.','Di.','Mi.','Do.','Fr.','Sa.');
|
|
//--------------------------------------
|
|
$ma_data = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$ma_id."'");
|
|
//--------------------------------------
|
|
$pdf->SetFont('Helvetica','B',12);
|
|
$pdf->SetTextColor(0,0,140);
|
|
$pdf->SetFillColor(240,150,0);
|
|
$pdf->Cell(130,6,"Mitarbeiter Einsatzplanung ".$ma_data['name']." ".$m."/".$j,'1','0','L','1');
|
|
$pdf->SetTextColor(240,150,0);
|
|
$pdf->SetFillColor(0,0,140);
|
|
$pdf->Cell(60,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);
|
|
|
|
//----------------------
|
|
|
|
$pdf->SetFont('Helvetica','B',10);
|
|
// $pdf->SetTextColor(0,160,230);
|
|
$pdf->SetFillColor(99,99,99);
|
|
$pdf->SetTextColor(255,255,255);
|
|
$pdf->SetFont('Helvetica','B',7);
|
|
$pdf->Cell(40,2," ",'0','1','0','0');
|
|
$pdf->Cell(27,2,"Datum",'0','0','0','1');
|
|
$pdf->Cell(33,2,"Einsatzplan",'0','0','0','1');
|
|
$pdf->Cell(20,2,"gepl. Startzeit",'0','0','0','1');
|
|
$pdf->Cell(20,2,"Message Nr.",'0','0','R','1');
|
|
$pdf->Cell(40,2,"Message Info",'0','1','0','1');
|
|
|
|
|
|
$pdf->SetFillColor(240,150,0);
|
|
|
|
for($i=1; $i <= $tage; $i++) {
|
|
|
|
$pdf->SetFillColor(200,200,200);
|
|
$pdf->SetTextColor(0,0,0);
|
|
$pdf->SetFont('Helvetica','B',10);
|
|
|
|
$key=0; //unset($db);
|
|
$db=$GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE tag='".$i."' AND monat='".$m."' AND jahr='".$j."' AND fahrer='".$ma_id."' ORDER BY typ");
|
|
$pdf->Cell(190,1,' ','0','1','l','0');
|
|
$pdf->Cell( 9,5,$tbez[date("w",mktime(0, 0, 0,$m,$i,$j))],'0','0','L','1'); $pdf->Cell(18,5,$i.".".$m.".".$j,'0','0','R','1');
|
|
// echo'<pre>'; print_r($db); echo'</pre>';
|
|
$tmp=(int)$db->num_rows;
|
|
//echo "xxxx".$tmp."xxxx";
|
|
if($tmp==0) {
|
|
$kal = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE mid='".$ma_id."' AND tag='".$i."' AND monat='".$m."' AND jahr='".$j."'");
|
|
if($kal['num_rows']!=0) {
|
|
$pdf->SetFillColor(230,240,250);
|
|
$pdf->Cell(163,5,$ma_data['name']." ".$pb[$kal['grund']]['bez'],'0','1','l','1');
|
|
} else {
|
|
if(date("w",mktime(0, 0, 0,$m,$i,$j))==0) {
|
|
$pdf->Cell(163,5," ",'0','1','l','0');
|
|
} else {
|
|
$pdf->SetFillColor(255,250,200);
|
|
$ft = $GLOBALS['mysql']->query_single("SELECT * FROM feiertage WHERE tag='".$i."' AND monat='".$m."' AND jahr='".$j."'");
|
|
if($ft['num_rows']!=0) {
|
|
$pdf->Cell(163,5,"Feiertag: ".$ft['info'],'0','1','l','1');
|
|
} else {
|
|
$pdf->Cell(163,5,"kein Eintrag ",'0','1','l','0');
|
|
}
|
|
}
|
|
}
|
|
//$pdf->Cell(163,5,$ma_data['name']." ",'0','1','l','0');
|
|
} else {
|
|
while($row = $db->fetch_assoc()) {
|
|
//163
|
|
$pdf->SetFont('Helvetica','B',10);
|
|
$pdf->Cell(33,5,utf8_decode($td[$row['tour']]['tour']),'0','0','l','0');
|
|
$pdf->Cell(20,5,$td[$row['tour']]['kalzeit']." Uhr",'0','0','R','0');
|
|
$pdf->SetFont('Helvetica','',10);
|
|
$pdf->Cell(20,5,$row['smsid'],'0','0','R','0');
|
|
//$ssd = $GLOBALS['mysql']->query_single("SELECT * FROM log_sms WHERE tId='".$row['id']."'");
|
|
//$lt=date("h:m",$ssd['senddate']);
|
|
//$lt=date("h:m",$row['smsstatusdate']);
|
|
if($row['smsstatus']==0) { $pdf->Cell(40,5,"no Data",'0','0','l','0'); }
|
|
if($row['smsstatus']==1) { $pdf->Cell(40,5,"versendet",'0','0','l','0'); }
|
|
//if($row['smsstatus']==2) { $pdf->Cell(40,5,"zugestellt - ".$lt." Uhr",'0','0','l','0'); }
|
|
if($row['smsstatus']==2) { $pdf->Cell(40,5,"zugestellt",'0','0','l','0'); }
|
|
if($row['smsstatus']==3) { $pdf->Cell(40,5,"Fehler",'0','0','l','0'); }
|
|
if($row['smsstatus']==4) { $pdf->Cell(40,5,"k. Bericht",'0','0','l','0'); }
|
|
if($row['smsstatus']==5) { $pdf->Cell(40,5,"Fehler kaudN",'0','0','l','0'); }
|
|
$pdf->Cell(20,5,' ','0','1','l','0');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($tmp!=$key) { $pdf->Cell( 9,5,' ','0','0','L','0'); $pdf->Cell(18,5,' ','0','0','R','0'); }
|
|
$key++;
|
|
}
|
|
|
|
|
|
//$pdf->Cell( 9,5,$tbez[date("w",mktime(0, 0, 0,$m,$i,$j))],'TL','0','L','1');
|
|
|
|
//echo'<pre>'; print_r($db); echo'</pre>';
|
|
|
|
}
|
|
}
|
|
/*
|
|
|
|
|
|
|
|
|
|
|
|
if($tour_eintrag['num_rows'] > 0) {
|
|
|
|
|
|
|
|
$pdf->SetFillColor(0,0,140); $pdf->SetTextColor(255,255,255); $pdf->SetFont('Helvetica','B',10);
|
|
$pdf->Cell(15,3.5," ",'1','0','L','1');
|
|
|
|
$pdf->Cell(15,3.5,"Tage: ".$tage,'1','0','L','1');
|
|
|
|
$pdf->Write(1,"\n"); /////// Abstand
|
|
|
|
$pdf->Cell(190,4,$tourtyp['tname']." - ".utf8_decode($tourtyp['tinfotitel']),'1','0','l','1');
|
|
$pdf->Write(5,"\n"); /////// Abstand
|
|
$pdf->SetFillColor(100,100,100);
|
|
$pdf->SetFont('Helvetica','BI',8);
|
|
$pdf->SetTextColor(255,255,255);
|
|
$pdf->Cell(15,3.5,"Datum",'1','0','L','1');
|
|
$pdf->Cell(19,3.5,"Tour",'1','0','L','1');
|
|
$pdf->Cell(50,3.5,"Bezeichnung",'1','0','L','1');
|
|
$pdf->Cell(33,3.5,"Fahrer",'1','0','L','1');
|
|
$pdf->Cell(15,3.5,"Gewicht",'1','0','L','1');
|
|
$pdf->Cell(17,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('');
|
|
$pdf->Write(1,"\n"); /// Abstand
|
|
// Touren nach sparte
|
|
$tour_data = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE tag='".$tag."' AND monat='".$monat."' AND jahr='".$jahr."' and typ='".$i."' ORDER BY id");
|
|
while($row = $tour_data->fetch_assoc()) {
|
|
|
|
// echo'<pre>'; print_r($row); echo'</pre>';
|
|
|
|
$datum=$row['tag'].".".$row['monat'].".".$row['jahr'];
|
|
$pdf->Cell(15,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(19,3.5,($row_tour['tour']),'1','0','L','1');
|
|
$pdf->Cell(50,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','B',8); } $pdf->Cell(33,3.5,utf8_decode($row_fahrerx['name']),'1','0','L','1'); $pdf->SetFont('');
|
|
|
|
if ($row['gewicht']<1) {
|
|
$pdf->Cell(15,3.5," ",'1','0','R','1');
|
|
} else {
|
|
if ($row['gewicht']>1799) { $pdf->SetFont('Helvetica','B',8); } $pdf->Cell(15,3.5,($row['gewicht']." kg"),'1','0','R','1'); $pdf->SetFont('');
|
|
}
|
|
if ($row['Norm']<1) { $pdf->Cell(17,3.5," ",'1','0','R','1'); } else { $pdf->Cell(17,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','B',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('');
|
|
}
|
|
}
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$pdf->Output('Gesamtliste_'.($ma_id).'Mitarbeiter_xxxxx.pdf','I');
|
|
|
|
?>
|