private $dbh;
private $cfg;
private $legend = array();
- private $report = array("pot" => array("top"=>"20mm","bottom" =>"15mm","left"=>"5mm","right"=>"5mm","size"=>"A4","orientation"=>"Landscape","encoding"=>"ISO-8859-1"));
+ private $report = array("pot" => array("top"=>"20mm","bottom" =>"15mm","left"=>"25mm","right"=>"5mm","size"=>"A4","orientation"=>"Portrait","encoding"=>"ISO-8859-1"));
public function __construct($dblink,$cfg){
$this->dbh = $dblink;
$this->cfg = $cfg;
$this->conn = null;
}
- public function createReport($schema,$template,$data){
- $resReports = array();
+ public function createReport($schema,$template,$data){
+ $resfile = null;
+ $tmpfile = $template.randStr(10);
+ $outpath = $this->cfg["datapath"].$schema.'/'.$template;
+ if (!file_exists($outpath)){
+ mkdir($outpath,755,true);
+ }
if ($template =="pot"){
- $repsql = "select srp.id_staff,srp.id_reportperiod,'pot_' || to_char(rp.startdate,'YYYYMMDD') || '-' || to_char(rp.enddate,'YYYYMMDD') || '_' || coalesce(surname || '_','') || coalesce(prename,'') || '.pdf' as fname
-from ".$schema.".staffreportperiod srp
-join ".$schema.".reportperiod rp on (srp.id_reportperiod=rp.id)
-join ".$schema.".staff st on (st.id=srp.id_staff)";
- $wh = array();
- if (count($data["id_staff"]) > 0){
- array_push ($wh,"srp.id_staff in ('".join("','",data["id_staff"])."')");
- }
- if (count($data["id_period"]) > 0){
- array_push ($wh,"srp.id_reportperiod in ('".join("','",$data["id_period"])."')");
- }
- if (count($wh) > 0){
- $repsql .= implode(' AND ',$wh);
- }
- $repdata =$this->dbh->queryarray($repsql);
- foreach ($repdata as $r){
- $this->printPOTContent($schema,$this->cfg["tmppath"].$tmpfile.".html",$r["id_staff"],$r["id_reportperiod"]);
- $this->printPOTHeader($schema,$this->cfg["tmppath"].$tmpfile.".header.html");
- $this->printPOTFooter($schema,$this->cfg["tmppath"].$tmpfile.".footer.html");
- $resfile = $this->createPDF($schema,$template,$r["fname"]);
- array_push($resReports,$resfile);
- }
+ $repsql = "select srp.id_staff,srp.id_reportperiod,'pot_' || to_char(rp.startdate,'YYYYMMDD') || '-' || to_char(rp.enddate,'YYYYMMDD') || '_' || coalesce(surname || '_','') || coalesce(prename,'') || '.pdf' as fname from ".$schema.".staffreportperiod srp join ".$schema.".reportperiod rp on (srp.id_reportperiod=rp.id) join ".$schema.".staff st on (st.id=srp.id_staff) where srp.id_staff='".$data["id_staff"]."' and srp.id_reportperiod ='".$data["id_period"]."'";
+ $repdata =$this->dbh->query($repsql);
+ //error_log(print_r($repdata,true));
+ $this->printPOTContent($schema,$this->cfg["tmppath"].$tmpfile.".html",$repdata["id_staff"],$repdata["id_reportperiod"]);
+ $this->printPOTHeader($schema,$this->cfg["tmppath"].$tmpfile.".header.html");
+ $this->printPOTFooter($schema,$this->cfg["tmppath"].$tmpfile.".footer.html");
+
+ $resfile = $this->createPDF($schema,$template,$tmpfile,$outpath.'/'.$repdata["fname"]);
} elseif ($template =="tracker"){
}
- return $resReports;
+ return $resfile;
}
- public function createPDF($schema,$template,$pdfname,$data){
+ public function createPDF($schema,$template,$tmpfile,$pdfname){
- $time = time();
- $tmpfile = $template.$time;
$r = null;
- if ($template =="pot"){
-
-
- }
-
-
-
- //dircopy($self->{tmplpath}.'/'.$template,$this->cfg["tmppath"].'/'.$template);
+ #dircopy($self->{tmplpath}.'/'.$template,$this->cfg["tmppath"].'/'.$template);
if (file_exists($this->cfg["tmppath"].$tmpfile.'.html')){
$cmd = '"'.$this->cfg["toolspath"]."/bin/wkhtmltopdf".'"';
if ($this->report[$template]["bottom"]){ $cmd .= " -B ".$this->report[$template]["bottom"]; }
$r = system($cmd);
}
if (file_exists($pdfname)){
- unlink($this->cfg["tmppath"].'/'.$tmpfile.'.html');
- unlink($this->cfg["tmppath"].'/'.$tmpfile.'.header.html');
- unlink($this->cfg["tmppath"].'/'.$tmpfile.'.footer.html');
- return $pdfname;
+ // unlink($this->cfg["tmppath"].'/'.$tmpfile.'.html');
+ // unlink($this->cfg["tmppath"].'/'.$tmpfile.'.header.html');
+ // unlink($this->cfg["tmppath"].'/'.$tmpfile.'.footer.html');
+ return substr($pdfname,strlen($this->cfg["datapath"])) ;
}
return "";
}
// $self->printContent($schema,$this->cfg["tmppath"].'/'.$template.$$.".html",$inputdata);
// $self->printHeader($schema,$this->cfg["tmppath"].'/'.$template.$$.".header.html");
// $self->printFooter($schema,$this->cfg["tmppath"].'/'.$template.$$.".footer.html");
-// //dircopy($self->{tmplpath}.'/'.$template,$this->cfg["tmppath"].'/'.$template);
+// #dircopy($self->{tmplpath}.'/'.$template,$this->cfg["tmppath"].'/'.$template);
// if ((-e $this->cfg["tmppath"].'/'.$template.$$.'.html')){
// $cmd = '"'.$self->{pdf}->{app}.'"';
// if ($pdfreports->{$template}->{bottom}){ $cmd .= " -B ".$pdfreports->{$template}->{bottom}; }
</tr>
</table>
</body></html>";
-
+ file_put_contents($outfile,$outdata);
return 1;
}
$legend["vacancy"] =$this->dbh->querybykey("id","SELECT id,legend FROM ".$schema.".vacancytypes WHERE isworktime=true order by legend;");
$legend["recup"] =$this->dbh->querybykey("id","SELECT id,legend FROM ".$schema.".vacancytypes WHERE isworktime<>true order by legend;");
- $outdata .= "
+ $outdata = "
<!DOCTYPE html>
<html>
<head>
[class^=\"icon-\"], [class*=\" icon-\"] { font-family: 'pot' !important; speak: never; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.icon-pause:before { content: \"\e900\"; }
div { font-size: 12pt; }
- table { font-size: 8pt; border-spacing: 0; border-collapse: collapse; border: none; width: 100%; }
+ table { font-size: 12pt; border-spacing: 0; border-collapse: collapse; border: none; }
th { border: 1px solid black; }
- td { text-align: center;vertical-align: top; border: 1px solid black; }
+ td { text-align: center; vertical-align: top; border: 1px solid black; }
.right{ text-align: right; }
table.tbinline { border-collapse: collapse; }
- /*table.tbinline td { border: 0.5px solid //969696; }*/
+ /*table.tbinline td { border: 0.5px solid #969696; }*/
table.tbinline tr:first-child td { border-top: 0; }
table.tbinline tr td:first-child { border-left: 0; }
table.tbinline tr:last-child td { border-bottom: 0; }
where st.isdeleted is null and id_staff='".$id_staff."' and srp.id_reportperiod='".$id_period."'
order by rp.startdate,rp.enddate,st.surname,st.prename;";
$rpdata =$this->dbh->queryarray($sql);
- $rpmax = count($rpdata)-1;
+ //$rpmax = count($rpdata)-1;
foreach ($rpdata as $rd){
- $outdata .= $this->ReportPage($schema,$rpdata[$rd]);
- if ($rd != $rpmax){
- $outdata .= "<div class=\"page-break\"></div>";
- }
+ //(print_r($rd,true));
+ $outdata .= $this->ReportPage($schema,$rd);
+ // if ($rd != $rpmax){
+ // $outdata .= "<div class=\"page-break\"></div>";
+ // }
}
$outdata .= "</body></html>";
file_put_contents($outfile,$outdata);
}
public function ReportPage($schema,$data){
-
+ error_log("Call Report Page!");
$perioddata = $this->getPeriodDays($schema,$data["id_staff"],$data["startdate"],$data["enddate"]);
$weeksums = $this->getPeriodWeekSums($schema,$data["id_staff"],$data["startdate"],$data["enddate"]);
$tblheader = "<table>
+ <thead>
+ <tr>
+ <th rowspan=\"2\" style=\"width: 30mm;\">Date</th>
+ <th rowspan=\"2\">Heures de travail</th>
+ <th rowspan=\"2\">Pauses</th>
+ <th colspan=\"3\">Congés</th>
+ <th rowspan=\"2\">Récup</th>
+ <th rowspan=\"2\">Total</th>
+ </tr>
+ <tr><th>Normal</th><th>maladie</th><th>extra</th></tr>
+ </thead></tbody>";
+ foreach ($perioddata as $pw){
+ if ($pw["dspworkdata"] == null){
+
+ } else {
+ $tblheader .= "<tr>
+ <td style=\"vertical-align: middle;width: 25mm;height: 9mm;\">".$pw["dspdate"]."</td>
+ <td style=\"vertical-align: middle;font-size: 10pt;width: 35mm;\">".$pw["dspworkdata"]."</td>
+ <td style=\"vertical-align: middle;font-size: 8pt; width: 25mm;\">".$pw["dsppausedata"]."</td>
+ <td style=\"vertical-align: middle;width: 18mm;\">".$pw["vacancyhours"]."</td>
+ <td style=\"vertical-align: middle;width: 18mm;\">".$pw["vacillhours"]."</td>
+ <td style=\"vertical-align: middle;width: 18mm;\">".$pw["vacextrahours"]."</td>
+ <td style=\"vertical-align: middle;width: 18mm;\">".$pw["recuperationhours"]."</td>
+ <td style=\"vertical-align: middle;width: 18mm; font-weight: bold;\">".$pw["dayhours"]."</td>
+ </tr>";
+ }
+ }
+
+ $tblheader .= "</tbody></table>";
+ $tblheader .= "<table>
<thead>
- <tr ><th colspan=\"4\" style=\"border-right: 0px;font-size: 10pt;\">".$data["dspstartdate"]." - ".$data["dspenddate"]."</th><th colspan=\"3\" style=\"border-left: 0px;font-size: 10pt;\">".(($data["staffnumber"] != "")?"".$data["staffnumber"]."":"")." ".$data["surname"]." ".$data["prename"]." ".(($data["matricule"] != "")?"(".$data["matricule"].")":"")."</th></tr>
+ <tr ><th colspan=\"4\" style=\"border-right: 0px;font-size: 10pt;\">".$data["dspstartdate"]." - ".$data["dspenddate"]."</th><th colspan=\"4\" style=\"border-left: 0px;font-size: 10pt;\">".(($data["staffnumber"] != "")?"".$data["staffnumber"]."":"")." ".$data["surname"]." ".$data["prename"]." ".(($data["matricule"] != "")?"(".$data["matricule"].")":"")."</th></tr>
<tr>
- <!--<th style=\"background-color: //e6e6e6;\">Semaine</th>-->
- <th style=\"background-color: //e6e6e6;\">Lundi</th>
- <th style=\"background-color: //e6e6e6;\">Mardi</th>
- <th style=\"background-color: //e6e6e6;\">Mecredi</th>
- <th style=\"background-color: //e6e6e6;\">Jeudi</th>
- <th style=\"background-color: //e6e6e6;\">Vendredi</th>
- <th style=\"background-color: //e6e6e6;\">Samedi</th>
- <th style=\"background-color: //e6e6e6;\">Dimanche</th>
- <!--<th style=\"background-color: //e6e6e6;\">Totaux</th>-->
+ <!--<th style=\"background-color: #e6e6e6;\">Semaine</th>-->
+ <th style=\"background-color: #e6e6e6;\">Lundi</th>
+ <th style=\"background-color: #e6e6e6;\">Mardi</th>
+ <th style=\"background-color: #e6e6e6;\">Mecredi</th>
+ <th style=\"background-color: #e6e6e6;\">Jeudi</th>
+ <th style=\"background-color: #e6e6e6;\">Vendredi</th>
+ <th style=\"background-color: #e6e6e6;\">Samedi</th>
+ <th style=\"background-color: #e6e6e6;\">Dimanche</th>
+ <th style=\"background-color: #e6e6e6;\">Totaux</th>
</tr>
</thead>
<tbody>";
foreach ($perioddata as $pw){
$wd = explode(',',','.$pw["weekdates"]);
+ error_log("WD: ".$pw["daydate"]);
+
//print STDERR "CWEEKDAY:".$pw["daydate"]."=>".$wd[$wdk]."\n";
if ($wdk == 0 ){
if ($cntr > 6){
$cntr++;
$dspwd = explode(',',$pw["dspweekdates"]);
- $txtpage .="<tr>
- <!--<th rowspan=\"2\" style=\"background-color: //e6e6e6;\">".$pw["dspweekshort"]."</th>-->
- <th style=\"width: 44mm;background-color: //e6e6e6;\">".$dspwd[0]."</th>
- <th style=\"width: 44mm;background-color: //e6e6e6;\">".$dspwd[1]."</th>
- <th style=\"width: 44mm;background-color: //e6e6e6;\">".$dspwd[2]."</th>
- <th style=\"width: 44mm;background-color: //e6e6e6;\">".$dspwd[3]."</th>
- <th style=\"width: 44mm;background-color: //e6e6e6;\">".$dspwd[4]."</th>
- <th style=\"width: 44mm;background-color: //e6e6e6;\">".$dspwd[5]."</th>
- <th style=\"width: 44mm;background-color: //e6e6e6;\">".$dspwd[6]."</th>
- <!--<th style=\"background-color: //e6e6e6;\"> </th></tr><tr>-->
- ";
- $wdk = 1;
+ $txtpage .="<tr>
+ <!--<th rowspan=\"2\" style=\"background-color: #e6e6e6;\">".$pw["dspweekshort"]."</th>-->
+ <th style=\"width: 44mm;background-color: #e6e6e6;\">".$dspwd[0]."</th>
+ <th style=\"width: 44mm;background-color: #e6e6e6;\">".$dspwd[1]."</th>
+ <th style=\"width: 44mm;background-color: #e6e6e6;\">".$dspwd[2]."</th>
+ <th style=\"width: 44mm;background-color: #e6e6e6;\">".$dspwd[3]."</th>
+ <th style=\"width: 44mm;background-color: #e6e6e6;\">".$dspwd[4]."</th>
+ <th style=\"width: 44mm;background-color: #e6e6e6;\">".$dspwd[5]."</th>
+ <th style=\"width: 44mm;background-color: #e6e6e6;\">".$dspwd[6]."</th>
+ <th style=\"background-color: #e6e6e6;\"> </th>
+ </tr><tr>";
+ $wdk = 1;
}
//print STDERR "CWEEKDAY:".$pw["daydate"]."=>".$wd[$wdk]."\n";
while (($pw["daydate"] != $wd[$wdk]) && $wdk <= "7"){
if ($wdk == 0){$wdk++; next; }
if (($pw["daydate"] >= $data["startdate"]) || ($pw["daydate"] <= $data["enddate"])){
- $txtpage .="<td style=\"max-height: 15px!important;height: 15mm;background-color: //d6d6d6;\"> </td>";
+ $txtpage .="<td style=\"max-height: 15px!important;height: 15mm;background-color: #d6d6d6;\"> </td>";
}
$wdk++;
$txtpage .= "<td style=\"max-height: 15px!important; height: 15mm;\">
<table class=\"tbinline\" style=\"height: 15mm;\" style=\"border: 0px;\"><tr style=\"border: 0px;\"><td style=\"border: 0px;\">
<table class=\"tbinline\">
- <tr style=\" border-bottom: 0.5px solid //969696;\" >
- <td class=\"datavalues\" style=\"height: 8mm;border-right: 0.5px solid //969696;\"><div>".$pw["dspworkdata"]."</div></td>
+ <tr style=\" border-bottom: 0.5px solid #969696;\" >
+ <td class=\"datavalues\" style=\"height: 8mm;border-right: 0.5px solid #969696;\"><div>".$pw["dspworkdata"]."</div></td>
</tr>
- <tr style=\"border-right: 0.5px solid //969696;\">
- <td class=\"datavalues\" style=\"height: 7mm;border-right: 0.5px solid //969696;\">
+ <tr style=\"border-right: 0.5px solid #969696;\">
+ <td class=\"datavalues\" style=\"height: 7mm;border-right: 0.5px solid #969696;\">
<div style=\"font-size: 6pt;\">".(($pw["dsppausedata"])?$pw["dsppausedata"]:" ")."</div>
</td>
</tr>
</td><td style=\"width: 15mm;border: 0px; \">
<table class=\"tbinline\" style=\"border: 0px;\">
<tr>
- <td class=\"datavalues\" style=\"height: 5mm;border-bottom: 0.5px solid //969696;border-right: 0;\"\">
+ <td class=\"datavalues\" style=\"height: 5mm;border-bottom: 0.5px solid #969696;border-right: 0;\"\">
".(($pw["dayhours"])?"<div style=\"font-weight: bold;\">".$pw["dayhours"]."</div>":" ")."
</td>
</tr>
<tr>
- <td class=\"datavalues\" style=\"height: 5mm;border-bottom: 0.5px solid //969696;border-right: 0;\">
+ <td class=\"datavalues\" style=\"height: 5mm;border-bottom: 0.5px solid #969696;border-right: 0;\">
".(($pw["vacancyhours"])?"<div style=\"font-style: bold;\">".$pw["vacancyhours"]." <sup>".$this["legend"]["vacancy"][$pw["id_vacancytype"]][legend].")</sup></div>":" ")."
</td>
</tr>
<table class=\"tbinline\">
<tr>
<td class=\"datavalues\" style=\"height: 5mm;\">
- <div style=\"font-weight: bold;border-bottom: 0.5px solid //969696;\">".$weeksums[$ws]["totalhours"]."</div>
+ <div style=\"font-weight: bold;border-bottom: 0.5px solid #969696;\">".$weeksums[$ws]["totalhours"]."</div>
</td>
</tr>
</table>
";
- //<div style=\"font-weight: bold;text-decoration: underline;text-decoration-style: double;border-bottom: 0.5px solid //969696;\">".(($weeksums->{$ws}->{diffhours} =="00:00")?"":$weeksums->{$ws}->{diffhours})."</div>
+ //<div style=\"font-weight: bold;text-decoration: underline;text-decoration-style: double;border-bottom: 0.5px solid #969696;\">".(($weeksums->{$ws}->{diffhours} =="00:00")?"":$weeksums->{$ws}->{diffhours})."</div>
}
$txtpage .= "</td></tr></table>
</td></tr>
//print STDERR "WDK: ".$wdk."\n";
if ($wdk >= "0"){
while ($wdk <= "7"){
- $txtpage .="<td style=\"height: 15mm;background-color: //d6d6d6;\"> </td>";
+ $txtpage .="<td style=\"height: 15mm;background-color: #d6d6d6;\"> </td>";
$wdk++;
}
if ($wdk >= "7"){
$txtpage .= "<td class=\"datavalues\">
<table class=\"tbinline\"><tr><td class=\"datavalues\">";
- $ws = $perioddata[$lastpw]["weekstart"];
+ $ws = $lastpw["weekstart"];
if (isset($weeksums[$ws])){
$txtpage .= "
<table class=\"tbinline\">
<tr>
<td class=\"datavalues\" style=\"height: 5mm;\">
- <div style=\"font-weight: bold;border-bottom: 0.5px solid //969696;\">".$weeksums[$ws]["totalhours"]."</div>
+ <div style=\"font-weight: bold;border-bottom: 0.5px solid #969696;\">".$weeksums[$ws]["totalhours"]."</div>
</td>
</tr>
</table>
";
// <tr>
// <td class=\"datavalues\" style=\"height: 5mm;\">
- // <div style=\"font-weight: bold;text-decoration: underline;border-bottom: 0.5px solid //969696;\">".(($weeksums->{$ws}->{recperationhours} =="00:00")?"":$weeksums->{$ws}->{recperationhours})."</div>
+ // <div style=\"font-weight: bold;text-decoration: underline;border-bottom: 0.5px solid #969696;\">".(($weeksums->{$ws}->{recperationhours} =="00:00")?"":$weeksums->{$ws}->{recperationhours})."</div>
// </td>
// </tr>
// <tr>
// <td class=\"datavalues\" style=\"height: 5mm;\">
- // <div style=\"font-weight: bold;font-style: italic;border-bottom: 0.5px solid //969696;\">".(($weeksums->{$ws}->{vacancyhours} =="00:00")?"":$weeksums->{$ws}->{vacancyhours})."</div>
+ // <div style=\"font-weight: bold;font-style: italic;border-bottom: 0.5px solid #969696;\">".(($weeksums->{$ws}->{vacancyhours} =="00:00")?"":$weeksums->{$ws}->{vacancyhours})."</div>
// </td>
// </tr>
- //<div style=\"font-weight: bold;text-decoration: underline;text-decoration-style: double;border-bottom: 0.5px solid //969696;\">".(($weeksums->{$ws}->{diffhours} =="00:00")?"":$weeksums->{$ws}->{diffhours})."</div>
+ //<div style=\"font-weight: bold;text-decoration: underline;text-decoration-style: double;border-bottom: 0.5px solid #969696;\">".(($weeksums->{$ws}->{diffhours} =="00:00")?"":$weeksums->{$ws}->{diffhours})."</div>
}
$txtpage .= "</td></tr></table>
</td></tr>
$txtpage .= "</tbody> </table>";
// $spt = $data["sums"];
- $txtpage .= "<table>
- <thead>
- <tr><th colspan=\"20\">Résumée période de référence: ".$data["dspstartdate"]." - ".$data["dspenddate"]."</th></tr>
+ $txtpage .= "<div style = \"display:block; clear:both; page-break-after:always;\"></div>";
+
+ $txtpage .= "<h2>Résumée / Période de référence</h2>
+ <h3>Période du ".$data["dspstartdate"]." au ".$data["dspenddate"]."</h3>
+ <h4>".$data["surname"]." ".$data["prename"]." ".(($data["matricule"] != "")?"(".$data["matricule"].")":"")."</h4>
+ <table style=\"width: unset!important;\">
+ <tbody>
+ <tr>
+ <td style=\"text-align: left;vertical-align: top; width: 70mm;padding: 5px;padding-left: 15px; \">heures contractuelles:</td>
+ <td style=\"text-align: right; width: 30mm; font-weight: bold; padding: 5px;padding-left: 15px;\">".$data["contracthours"]." h</td></tr>
<tr>
- <td style=\"text-align: right;background-color: //e6e6e6;\">heures contractuelles:<br/>heures travaillées:</td>
- <th style=\"width: 15mm;\">".$data["contracthours"]."<br/>".$data["workhours"]."</th>
- <td style=\"text-align: right;background-color: //e6e6e6;\">congé maladie:<br>congé:<br>congé except.:</td>
- <th style=\"width: 15mm;\">".(($data["vacancyill"] != '')?$data["vacancyill"] :"00:00")."<br>".(($data["vacancynormal"] != '')?$data["vacancynormal"] :"00:00")."<br>".(($data["vacancyextra"] != '')?$data["vacancyextra"] :"00:00")."</th>
- <td style=\"text-align: right;background-color: //e6e6e6;\">heures<br/>récupérées:</td>
- <th style=\"width: 15mm;\">".$data["recuperationhours"]."<br/> </th>
- <td style=\"text-align: right;background-color: //e6e6e6;\">durée travail<br/>réel prestée:</td>
- <th style=\"width: 15mm;\">".$data["totalhours"]."</th>
- <td style=\"text-align: right;background-color: //e6e6e6;\">moyenne durée<br/>travail réel:</td>
- <th style=\"width: 15mm;\">".$data["avgtotalweekhours"]."</th>
- <td style=\"text-align: right;background-color: //e6e6e6;\">décompte reporté:<br/>heures payées:</td>
- <th style=\"width: 15mm;\">".(($data["transferedhourscalc"] != '')?$data["transferedhourscalc"]:"00:00")."<br/>".(($data["payedhours"] != '')?$data["payedhours"]:"00:00")."</th>
- <td style=\"text-align: right;background-color: //e6e6e6;\">décompte<br/>fin POT:</td>
- <th style=\"width: 15mm;\">".$data["hoursdiff"]."</th>
- <td style=\"text-align: right;background-color: //e6e6e6;\">congé suppl. +44h:<br/>congé suppl. dimache travaillé:</td>
- <th style=\"width: 15mm;\">".(($data["suppvacancy44hours"] != '')?$data["suppvacancy44hours"]:" ")."<br/>".(($data["suppvacancysunwork"] != '')?$data["suppvacancysunwork"]:" ")."</th>
+ <td style=\"text-align: left;vertical-align: top; padding: 5px; width: 70mm;padding: 5px;padding-left: 15px;\">heures travaillées:</td>
+ <td style=\"text-align: right; width: 30mm; font-weight: bold;padding: 5px;padding-left: 15px; \">".$data["workhours"]." h</td>
</tr>
- </thead>
+ <tr>
+ <td style=\"text-align: left;vertical-align: top; padding: 5px; width: 70mm;padding: 5px;padding-left: 15px;\">congé normal</td>
+ <td style=\"text-align: right; width: 30mm; font-weight: bold;padding: 5px;padding-left: 15px; \">".$data["vacancynormal"]." h</td>
+ </tr>
+ <tr>
+ <td style=\"text-align: left;vertical-align: top; padding: 5px; width: 70mm;padding: 5px;padding-left: 15px;\">congé maladie</td>
+ <td style=\"text-align: right; width: 30mm; font-weight: bold;padding: 5px;padding-left: 15px; \">".$data["vacancyill"]." h</td>
+ </tr>
+ <tr>
+ <td style=\"text-align: left;vertical-align: top; padding: 5px; width: 70mm;padding: 5px;padding-left: 15px;\">congé extraordinaire</td>
+ <td style=\"text-align: right; width: 30mm; font-weight: bold;padding: 5px;padding-left: 15px; \">".$data["vacancyextra"]." h</td>
+ </tr>
+ <tr>
+ <td style=\"text-align: left;vertical-align: top; padding: 5px; width: 70mm;padding: 5px;padding-left: 15px;\">heures récupérées:</td>
+ <td style=\"text-align: right; width: 30mm; font-weight: bold;padding: 5px;padding-left: 15px; \">".$data["recuperationhours"]." h</td>
+ </tr>
+ <tr>
+ <td style=\"text-align: left;vertical-align: top; padding: 5px; width: 70mm;padding: 5px;padding-left: 15px;\">durée travail réel prestée:</td>
+ <td style=\"text-align: right; width: 30mm; font-weight: bold;padding: 5px;padding-left: 15px; \">".$data["totalhours"]." h</td>
+ </tr>
+ <tr>
+ <td style=\"text-align: left;vertical-align: top; padding: 5px; width: 70mm;padding: 5px;padding-left: 15px;\">moyenne durée travail réel:</td>
+ <td style=\"text-align: right; width: 30mm; font-weight: bold;padding: 5px;padding-left: 15px; \">".$data["avgtotalweekhours"]." h</td>
+ </tr>
+ <tr>
+ <td style=\"text-align: left;vertical-align: top; padding: 5px; width: 70mm;padding: 5px;padding-left: 15px;\">décompte reporté:</td>
+ <td style=\"text-align: right; width: 30mm; font-weight: bold;padding: 5px;padding-left: 15px; \">".$data["transferedhourscalc"]." h</td>
+ </tr>
+ <tr>
+ <td style=\"text-align: left;vertical-align: top; padding: 5px; width: 70mm;padding: 5px;padding-left: 15px;\">heures payées:</td>
+ <td style=\"text-align: right; width: 30mm; font-weight: bold;padding: 5px;padding-left: 15px;\">".$data["payedhours"]."</td>
+ </tr>
+ <tr>
+ <td style=\"text-align: left;vertical-align: top; padding: 5px; width: 70mm;padding: 5px;padding-left: 15px;\">décompte fin POT:</td>
+ <td style=\"text-align: right; width: 30mm; font-weight: bold;padding: 5px;padding-left: 15px;\">".$data["hoursdiff"]."</td>
+ </tr>
+ <tr>
+ <td style=\"text-align: left;vertical-align: top; padding: 5px; width: 70mm;\">congé suppl. +44h:</td>
+ <td style=\"text-align: center; width: 30mm; font-weight: bold;padding: 5px;padding-left: 15px;\">".$data["suppvacancy44hours"]."</td>
+ </tr>
+ <tr>
+ <td style=\"text-align: left;vertical-align: top; padding: 5px; width: 70mm;\">congé suppl. dimache travaillé:</td>
+ <td style=\"text-align: center; width: 30mm; font-weight: bold;padding: 5px;padding-left: 15px;\">".$data["suppvacancysunwork"]."</td>
+ </tr>
+ </tbody>
</table>";
return $txtpage;
}
public function getPeriodDays($schema,$id_staff,$date_start,$date_end){
- $sql = "SELECT pd.id,pd.daydate,pd.id_vacancytype,pd.id_recuperationtype,
+ $sql = "SELECT pd.id,pd.daydate,pd.id_vacancytype,pd.id_recuperationtype,to_char(pd.daydate, 'DD.MM.YYYY') as dspdate,
date(date_trunc('week',pd.daydate)) as weekstart,
date_part('isoyear',pd.daydate) || '-' || lpad(date_part('week',pd.daydate)::text, 2, '0') AS dspweekshort,
to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
+ to_char(case when pd.vacillhours::interval = '00:00:00'::interval then null else pd.vacillhours end::interval, 'HH24:MI') as vacillhours,
+ to_char(case when pd.vacextrahours::interval = '00:00:00'::interval then null else pd.vacextrahours end::interval, 'HH24:MI') as vacextrahours,
to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
}
- public function getPeriodWeekSums($schem,$id_staff,$date_start,$date_end){
+ public function getPeriodWeekSums($schema,$id_staff,$date_start,$date_end){
$sql = "select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
,to_char(ws.vacancyhours,'HH24:MI') as vacancyhours