<center>
<div style="font-family:Arial">PUNCH CARD REPORT - DAYLY
</div>
</center>
<hr width="720">
<center>
<?
  foreach($arrTea as $teaid=>$teaname){
    $totallate[$teaid] = "00:00:00";
?>
  <table style="font-family:Arial; font-size:13px" width="720">
    <tr>
	  <td width="50%">ID : <b><?= $teaid ?></b></td>
	  <td width="50%">NAME : <b><font style="font-family:'»ªÎÄ¿¬Ìå' "><?= $teaname ?></font></b></td>
	</tr>
	<tr>
	  <td>POSITION : <b><?= "POSITION" ?></b></td>
	</tr>
  </table>
  <table width="720" style="border-collapse:collapse; font-family:Arial; font-size:12px " border="1">
    <tr>
	  <th width="120">DATE</th>
	  <th width="85">PUNCH IN</th>
	  <th width="85">COME LATE</th>
	  <th width="85">PUNCH OUT</th>
	  <th width="85">LEAVE EARLY</th>
	  <th>NOTE</th>
	</tr>
<?
  $myArrDate = getDateBtw($datefrom,$datetil);
  foreach($myArrDate as $key=>$mydate){
  
    $myweek = getWeek($mydate);
	$punchin = $arrPunchIn[$teaid][$mydate];
	$comLate = $arrComeLate[$teaid][$mydate];
	$punchout = $arrPunchOut[$teaid][$mydate];
	$levEarly = $arrLevEarly[$teaid][$mydate];
	$mynote = $arrNote[$staffId][$punchDate];
	
    $myhol = chkPubHol($mydate);

    if( getWeek($mydate)=="Sun" || $myhol!="" ){
	  if($myhol!=""){
	    $mynote=$myhol;
	  }else{
	    if( getWeek($mydate)=="Sun" ){
		  $mynote = "SUNDAY";
		}
	  }
	  $colors="style='color:#999999'";
	}else{
	  $colors="";
	}
	
    if( $arrRemark[$teaid][$mydate]!="" ){
	  $mynote = $arrRemark[$teaid][$mydate];
	  $colors="style='color:#999999'";
	  $comLate="00:00:00";
	}
	
	$totallate[$teaid] = addTime($totallate[$teaid],$comLate);
?>
    <tr align="center" <?= $colors ?> >
	  <th><?= $mydate ?> (<?= $myweek ?>)</th>
	  <td><?= $punchin ?></td>
	  <td><?= $comLate ?></td>
	  <td><?= $punchout ?></td>
	  <td><?= $levEarly ?></td>
	  <td><?= $mynote ?></td>
	</tr>
<?
  }
?>
    <tr>
	  <th colspan="5" align="right">TOTAL</th>
	  <th><?= $totallate[$teaid] ?></th>
	</tr>
  </table>
<?
  if($_POST["radPgbrk"]=="y"){
    echo "<p style='page-break-after:always'></p>";
  }
?>
<?
  }
?>
</center>