init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
141
scripts/list_urlaub.php
Normal file
141
scripts/list_urlaub.php
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
<?php
|
||||
require('/lib/fpdf.php');
|
||||
// echo'<pre>';
|
||||
// print_r($row_nichtda);
|
||||
// echo'</pre>';
|
||||
|
||||
/*
|
||||
$tag=$_GET['tag'];
|
||||
$monat=$_GET['monat'];
|
||||
$jahr=$_GET['jahr'];
|
||||
*/
|
||||
|
||||
$tag = date("d"); $monat = date("m"); $jahr = date("Y");
|
||||
|
||||
$key=0; unset ($seite);
|
||||
|
||||
|
||||
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','BU',20);
|
||||
$pdf->SetTextColor(0,0,140);
|
||||
$pdf->SetFillColor(255,255,0);
|
||||
$pdf->Cell(40,6,"Urlaubsstatus",'0','0','L','0'); $pdf->Cell(30,6," ",'0','0','L','0'); $pdf->SetFont('Helvetica','B',12);
|
||||
$pdf->Cell(30,6,$tag.".".$monat.".".$jahr,'0','1','C','1');
|
||||
$pdf->SetTextColor(240,150,0);
|
||||
$pdf->SetFillColor(0,0,140);
|
||||
|
||||
$pdf->Image('template/images/jb_logo2.gif', 125, 5);
|
||||
|
||||
// $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);
|
||||
|
||||
//----------------------
|
||||
|
||||
$pdf->SetFont('Helvetica','B',10);
|
||||
// $pdf->SetTextColor(0,160,230);
|
||||
$pdf->SetFillColor(0,0,140);
|
||||
//$pdf->Cell(190,2," ",'1','1','0','0');
|
||||
$pdf->SetFillColor(240,150,0);
|
||||
//--------------------- Einträge nach typ auslesen
|
||||
|
||||
// echo'<pre>'; print_r($seite); echo'</pre>';
|
||||
|
||||
$pdf->Write(5,"\n"); /////// Abstand
|
||||
$pdf->SetFillColor(100,100,100);
|
||||
$pdf->SetFont('Helvetica','BI',8);
|
||||
$pdf->SetTextColor(255,255,255);
|
||||
$pdf->Cell(65,3.5,"Mitarbeiter",'1','0','L','1');
|
||||
$pdf->Cell(18,3.5,"ges.Urlaub",'1','0','L','1');
|
||||
$pdf->Cell(18,3.5,"genommen",'1','0','L','1');
|
||||
$pdf->Cell(18,3.5,"geplant",'1','0','L','1');
|
||||
$pdf->Cell(18,3.5,"krank",'1','0','L','1');
|
||||
$pdf->Cell(18,3.5,"K.krank",'1','0','L','1');
|
||||
$pdf->Cell(18,3.5,"Wunsch.",'1','0','L','1');
|
||||
$pdf->Cell(18,3.5,"noch frei",'1','1','L','1');
|
||||
|
||||
$pdf->SetFont('Helvetica','B',8);
|
||||
$pdf->SetFillColor(255,255,255);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('');
|
||||
// $pdf->Write(1,"\n"); /// Abstand
|
||||
|
||||
|
||||
$code = $GLOBALS['mysql']->query("SELECT * FROM mitarbeiter WHERE aktiv>0 ORDER BY name");
|
||||
while($row = $code->fetch_assoc()) {
|
||||
if($row['urlaub']>0) {
|
||||
$pdf->Cell(65,5,($row['name']),'1','0','L','1');
|
||||
$pdf->Cell(18,5,($row['urlaub']." Tage"),'1','0','R','1');
|
||||
//----------------------------------------------------------------------------------------
|
||||
$gen = $GLOBALS['mysql']->query("SELECT * FROM planer WHERE jahr='".$jahr."' AND mid='".$row['id']."' AND grund=4"); $genommen=0;
|
||||
while($rowg = $gen->fetch_assoc()) {
|
||||
if($rowg['monat']<$monat) { $genommen++; }
|
||||
elseif($rowg['monat']<$monat && $rowg['tag']<=$tag) { $genommen++; }
|
||||
}
|
||||
if($genommen) { $pdf->Cell(18,5,($genommen." Tage"),'1','0','R','1'); } else { $pdf->Cell(18,5,(' '),'1','0','R','1'); }
|
||||
//---------------------------------------------------------------------------------------- geplant
|
||||
$gpl = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE jahr='".$jahr."' AND mid='".$row['id']."' AND grund=4"); $geplant=0;
|
||||
if($gpl['num_rows']) { $pdf->Cell(18,5,($gpl['num_rows']." Tage"),'1','0','R','1'); $geplant=$gpl['num_rows']; } else { $pdf->Cell(18,5,(' '),'1','0','R','1'); }
|
||||
//----------------------------------------------------------------------------------------
|
||||
$krank = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE jahr='".$jahr."' AND mid='".$row['id']."' AND grund=5");
|
||||
if($krank['num_rows']) { $pdf->Cell(18,5,($krank['num_rows']." Tage"),'1','0','R','1'); } else { $pdf->Cell(18,5,(' '),'1','0','R','1'); }
|
||||
//----------------------------------------------------------------------------------------
|
||||
$kkrank = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE jahr='".$jahr."' AND mid='".$row['id']."' AND grund=6");
|
||||
if($kkrank['num_rows']) { $pdf->Cell(18,5,($kkrank['num_rows']." Tage"),'1','0','R','1'); } else { $pdf->Cell(18,5,(' '),'1','0','R','1'); }
|
||||
//---------------------------------------------------------------------------------------- wunsch
|
||||
$wunsch = $GLOBALS['mysql']->query_single("SELECT * FROM planer WHERE jahr='".$jahr."' AND mid='".$row['id']."' AND grund=22");
|
||||
if($wunsch['num_rows']) { $pdf->Cell(18,5,($wunsch['num_rows']." Tage"),'1','0','R','1'); } else { $pdf->Cell(18,5,(' '),'1','0','R','1'); }
|
||||
//---------------------------------------------------------------------------------------- freier Urlaub $furlaub=$row['urlaub']-$geplant;
|
||||
$furlaub=$row['urlaub']-$geplant;
|
||||
if($furlaub==0) { $pdf->SetTextColor(0,0,0); }
|
||||
if($furlaub>0) { $pdf->SetTextColor(0,0,255); }
|
||||
if($furlaub<0) { $pdf->SetTextColor(255,0,0); }
|
||||
$pdf->Cell(18,5,($furlaub." Tage"),'1','1','R','1'); $pdf->SetTextColor(0,0,0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$datum=$tag."_".$monat."_".$jahr;
|
||||
|
||||
$pdf->Output('Urlaubsliste_'.($datum).'.pdf','I');
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue