\n"; echo " th, td\n"; echo " { font-size: 9pt;\n"; echo " padding-right: 1em;\n"; echo " }\n"; echo "\n"; if (array_key_exists("doPrint", $_REQUEST)) { $doPrint = " onLoad=\"window.print();\""; } echo "\n"; include_once '../../modules/comFunctions.php'; include_once '../../modules/config.php'; include_once '../../modules/sql.php'; if (empty($_REQUEST['period'])) $period = calcDates(); else $period = calcDates($_REQUEST['period']); // get employee list for the report(s) if (empty($_REQUEST['empNo'])) // no employee listed, so use all { if ($_SESSION['user']['empNo'] == 3) $q = ""; else $q = "empNo != '10'"; $tsList = sqlSelect("employees", "$q", "empNo", "lName,fName"); while ($tsEmp = mysql_fetch_assoc($tsList['r'])) { $empList[] = $tsEmp['empNo']; } } else { $empList[] = $_REQUEST['empNo']; } echo "\n"; foreach ($empList as $empNo) { $lList = sqlSelect("logents", "empNo = '$empNo' and eType='' and wDate >= '{$period['cStart']}' and wDate <= '{$period['cEnd']}' and (tStart != '' or wStart !='') and (wEnd != '' or tEnd != '')", "", "wDate,wStart"); if (mysql_num_rows($lList['r'])) { //<<-- show employee name echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $dttl = 0; // daily total of time $dotm = 0; // daily total of overtime $gttl = 0; // grand total of time $gtot = 0; // grand total of overtime $lwDate = ""; // last working date while ($lEnt = mysql_fetch_assoc($lList['r'])) { if ($dttl > 0) { if ($lwDate != $lEnt['wDate']) { $gttl += $dttl; echo "\n"; //echo "\n"; $dttl = 0; echo "\n"; } else { echo "\n"; //echo "\n"; echo "\n"; } } if (!empty($lEnt['linkRef'])) { $jobInfo = sqlSelect("headers", "tid='{$lEnt['linkRef']}'"); $jobInfo = mysql_fetch_assoc($jobInfo['r']); $clientInfo = sqlSelect("clientdat", "cCode='{$jobInfo['oCode']}'"); $clientInfo = mysql_fetch_assoc($clientInfo['r']); } echo "\n"; echo "\n"; echo "\n"; echo " onClick=\"PopUpWin('/print.php?noprint&jobRef={$jobInfo['tid']}', 'printPreview', 'height=600,width=820', true);\" title=\"{$lEnt['tagLine']}\">{$jobInfo['jobNo']}\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $tvl = 0; if (!empty($lEnt['tStart'])) $tvl = (((substr($lEnt['wStart'],0,2) * 60) + substr($lEnt['wStart'],-2)) - ((substr($lEnt['tStart'],0,2) * 60) + substr($lEnt['tStart'],-2))); if (!empty($lEnt['tEnd'])) $tvl += (((substr($lEnt['tEnd'],0,2) * 60) + substr($lEnt['tEnd'],-2)) - ((substr($lEnt['wEnd'],0,2) * 60) + substr($lEnt['wEnd'],-2))); $lab = ((substr($lEnt['wEnd'],0,2) * 60) + substr($lEnt['wEnd'],-2)) - ((substr($lEnt['wStart'],0,2) * 60) + substr($lEnt['wStart'],-2)); echo "\n"; echo "\n"; $dttl = $dttl + $tvl + $lab; } $gttl += $dttl; echo "\n"; $dttl = 0; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } } echo "
Accountable Labour: ".getEmployeeName($empNo, "full")." (".formatDate($period['cStart'])." - ".formatDate($period['cEnd']).")
DateOrderTvl StWrk StWrk EndTvl EndTvl TtlLab TtlDay TTL
".sprintf("%01.2f",$dttl / 60)."".sprintf("%01.2f",$ot / 60)."
"; if ($lwDate != $lEnt['wDate']) { echo formatDate($lEnt['wDate']); $lwDate = $lEnt['wDate']; } echo " 20) $cName = substr($cName, 0, 17)."..."; //echo " onClick=\"PopUpWin('/print.php?noprint&jobRef={$jobInfo['tid']}', 'printPreview', 'height=600,width=820', true);\" title=\"$tTip\">{$jobInfo['jobNo']}($cName)"; } else { echo " colspan=2 onClick=\"PopUpWin('./labEnt.php?tid={$lEnt['tid']}', 'printPreview', 'height=400,width=600', true);\">({$lEnt['tagLine']})"; } echo "{$lEnt['tStart']}{$lEnt['wStart']}{$lEnt['wEnd']}{$lEnt['tEnd']}".sprintf("%01.2f",$tvl / 60)."".sprintf("%01.2f",$lab / 60)."".sprintf("%01.2f",$dttl / 60)."
Period Total Time: ".sprintf("%01.2f",($gttl + $gtot) / 60)."
 
\n"; ?>