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'); } //$temp = strtotime("next Sunday"); //$stag=date('d', $temp); $smonat=date('m', $temp); $sjahr=date('Y', $temp); //$sasodatum=$stag.".".$smonat.".".$sjahr; //-------------------------------------------------------------------------------------------------- require_once('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',20); // $pdf->SetTextColor(0,160,230); $pdf->SetFillColor(240,150,0); $pdf->Image('template/images/jb_logo2.png', 10, 6); $pdf->Image('template/images/saso.png', 140, 2); $pdf->Write(13,"\n"); //------------------------ SASO normal $pdf->SetFont('Helvetica','BI',14); $pdf->SetTextColor(0,0,140); $pdf->SetFillColor(240,150,0); unset ($tour_check); $tour_check = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr_aktuell."' and typ=19"); if($tour_check['num_rows'] != 0) { $pdf->Cell(140,7,"Sachsen-Sonntag Leipzig Stadt am ".$tour_check['tag'].".".$tour_check['monat'].".".$tour_check['jahr']." ( ".$kw_aktuell.".KW )",'1','0','L','1'); $pdf->SetTextColor(0,0,140); $pdf->Cell(50,7,$tour_check['Norm']."er Norm",'1','0','R','0'); $pdf->Write(3.5,"\n\n"); //--------------------------------- Tabellenkopf $pdf->SetFillColor(100,100,100); $pdf->SetFont('Helvetica','BI',9); $pdf->SetTextColor(255,255,255); $pdf->Cell( 6,4,"Nr.",'1','0','L','1'); $pdf->Cell(20,4,"Tour",'1','0','L','1'); $pdf->Cell(42,4,"Bezeichnung",'1','0','L','1'); $pdf->Cell(40,4,"Fahrer",'1','0','L','1'); $pdf->Cell(16,4,"Gewicht",'1','0','L','1'); $pdf->Cell(16,4,"Tour kg",'1','0','L','1'); $pdf->Cell(15,4,"Uhrzeit",'1','0','L','1'); $pdf->Cell(35,4,"Unterschrift",'1','1','C','1'); // $pdf->Write(2,"\n"); $pdf->SetFillColor(255,255,255); $pdf->SetTextColor(0,0,0); $pdf->SetFont('Helvetica','',10); $key=0; } //-------------------------------------- $key=1; $saso_tour = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE kw='".$kw_aktuell."' and jahr='".$jahr_aktuell."' and typ=19 ORDER BY zeit"); while($row = $saso_tour->fetch_assoc()) { $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( 6,5,utf8_decode($key),'1','0','R','1'); $pdf->Cell(20,5,utf8_decode($row_tour['tour']),'1','0','L','1'); $pdf->Cell(42,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',10); $pdf->Cell(40,5,utf8_decode($row_fahrerx['name']),'1','0','L','1'); $pdf->SetFont(''); if ($row['gewicht']>1499) $pdf->SetFont('Helvetica','BI',10); $pdf->Cell(16,5,($row['gewicht']." kg"),'1','0','R','1'); $pdf->SetFont(''); $pdf->SetFont(''); $pdf->Cell(16,5,($row['gewicht3']." kg"),'1','0','R','1'); $pdf->Cell(15,5,(" "),'1','0','R','1'); $pdf->Cell(35,5,(" "),'1','1','L','1'); $pdf->SetFont(''); $key++; } $pdf->Write(2,"\n"); $pdf->Write(2,"\n"); //--------------------------------------------------------------------- $pdf->Write(2,"\n"); //--------------------------------------------------------------------- if ($_GET['icon'] ==0) { $pdf->Output('SaSo_FAS_'.($datum).'.pdf','I'); } if ($_GET['icon'] ==1) { $pdf->Output('SaSo__FAS_'.($datum).'.pdf','D'); } if ($_GET['icon'] ==2) { if (!class_exists("phpmailer")) { echo "class-fehler"; require_once('lib/phpmailer/class.phpmailer.php'); } // require('lib/phpmailer/phpmailer.inc.php'); $empfaenger = "dispo@jb-transport.de"; $betreff="SaSo-FAS Einsatzplan ".($datum).".pdf"; $Dateiname = "saso_".($datum).".pdf"; $DateinameMail = "saso__FAS_".($datum).".pdf"; require_once('lib/phpmailer/class.phpmailer.php'); $mail = new PHPMailer(); $mail->SetLanguage('de', $mail->PluginDir . '/language/'); $mail->Body = "SaSo-FAS-Einsatzplan fuer den ".$datum; $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,"SaSo_".$datum.".pdf", 'base64', 'application/pdf'); //$Dateiname $mail->Send(); echo $Dateiname.' wurde versendet an: '.$empfaenger; ?>