<style type="text/css">@import url(calendar-win2k-1.css);</style>
<script type="text/javascript" src="calendar.js"></script>
<script type="text/javascript" src="calendar-en.js"></script>
<script type="text/javascript" src="calendar-setup.js"></script>

<style>
  .mytable{
    font-size:16px;
	width:550px;
	margin-top:10px;
	color:#FFFFFF;
  }
  
  .mytableth{
    background-color:#000000;
	color:#FFCC00;
	padding:5px 5px 5px 5px;
  }
    
    .mytabletd{
        background-color: #EEEEEE;
        text-align: center;
        color: #000000;
    }
  
  .mybtn{
    width:100px;
	font-size:14px;
	font-weight: bold;
	font-family: Arial;
  }
</style>

<?php
  //---------------- section -------------------------
  $qsec0 = "SELECT DISTINCT section FROM punchsys_staff WHERE id NOT IN ('admin','pejabat') AND section<>'' ORDER BY section";
  $rsec0 = mysqli_query($conn,$qsec0);
  $nsec0 = mysqli_num_rows($rsec0);
  if($nsec0>0){
  while( $myrow = mysqli_fetch_array($rsec0) ){
    $arrSecid[] = $myrow["section"];
    $i++;
  }
  }
  $strSecid = "'" . implode("','",$arrSecid)."'";
?>
<?php
  $qsec = "SELECT * FROM punchsys_section WHERE id IN ($strSecid)";
  $rsec = mysqli_query($conn,$qsec);
  while( $myrow = mysqli_fetch_array($rsec)){
    $tid = $myrow["id"];
    $tname = $myrow["name"];
    $arrSection[$tid] = $tname;
  }
?>
<?php
  $qtea = "SELECT * FROM punchsys_staff WHERE id<>'admin' AND id<>'pejabat' AND userID<>'1' ORDER BY repPrint, CAST(id as SIGNED)";
  $rtea = mysqli_query($conn,$qtea);
  while( $myrow = mysqli_fetch_array($rtea) ){
    $tid = $myrow["id"];
    $arrStaff[$tid]["eName"] = $myrow["eName"];
    $arrStaff[$tid]["cName"] = $myrow["cName"];
    $arrStaffid[$tid] = $tid;
  }
  $strStaffid = "'".implode("','",$arrStaffid)."'";
?>

<center>
<table border="0" cellpadding="0" cellspacing="1" class="mytable">
  <tr bgColor="#999999" style="color: #EEEEEE">
    <th colspan="2" class="mytableth">DAILY REPORT</th>
  </tr>
	
  <form action="rptltely1_prv.php" method="post">
  <input type="hidden" name="pg" value="<?= $_GET["pg"] ?>" />
  <input type="hidden" name="ac" value="<?= $_GET["ac"] ?>" />
  <tr>
    <th class="mytableth" rowspan="2">
      GROUP/STAFF
    </th>
    <th class="mytabletd">
		
      <table>
		<tr><td>
        <input type="checkbox" name="chkSec[0]" checked="checked" value="0" /> ALL<br />
		<?php
		foreach($arrSection as $tid=>$tsec){
		  $txtSec = "chkSec[$tid]";
		  ?>
		  <input type="checkbox" name="<?= $txtSec ?>" value="<?= $tid ?>" /> (<?= $tid ?>)<?= $tsec ?><br />
		  <?php
		}
		?>
	    </td></tr>
	  </table>
		
     </th>
  </tr>
  
  
  <tr>
    <td class="mytabletd" style="text-align: left; padding-left: 10px">
      <select name="tea1">
        <option value="_s">OR select a staff...</option>
			<?php
              $i = 1;
			  foreach($arrStaff as $tid=>$tstaff){

				$name = $tstaff["eName"];
				if(strlen($name)>18){
				  $dot = "...";
				}else{
				  $dot = "";
				}
				$name = substr($name,0,15) . $dot;

				echo "<option value='$tid'>$i. $name</option>";

				$i++;
			  }
			?>
      </select>
    </td>
  </tr>

	<tr>
	  <th class="mytableth">DATE</th>
	  <td class="mytabletd" style="text-align: left; padding-left: 10px">
		<input type="date" name="txtDatefrom" value="<?= $today_date ?>">

		&nbsp; UNTIL &nbsp;

		<input type="date" name="txtDatetil" value="<?= $today_date ?>">
	  </td>
	</tr>

<!--form action="rptltelyprv.php" method="post"-->
<tr>
  <th class="mytableth" >
    SORTING
  </th>
  <th class="mytabletd" style="text-align: left; padding-left: 10px">
	<input type="radio" name="ord" value="date" checked>DATE
    <input type="radio" name="ord" value="id"> ID &nbsp;&nbsp;&nbsp; 
  </th>
</tr>

<!--tr>
  <th class="mytableth" >
    MAX ROWS PER PAGE
  </th>
  <th class="mytabletd" style="text-align: left; padding-left: 10px">
    <input type="text" name="npgbk" value="60" style="text-align:center; width:50px" />
  </th>
</tr-->
<input type="hidden" name="npgbk" value="30">

<!--tr>
  <th class="mytableth" >
    SHOW RECORD...
  </th>
  <td class="mytabletd" style="text-align: left; padding-left: 10px">
    <input type="radio" name="shw" value="1"  checked>ALL RECORDS
    <input type="radio" name="shw" value="0"> RECORDS ONLY &nbsp;&nbsp;&nbsp; 
  </td>
</tr-->
<input type="hidden" name="shw" value="1">

<!--tr>
  <th class="mytableth" >
    LATE RECORD
  </th>
  <td class="mytabletd" style="text-align: left; padding-left: 10px">
    <input type="radio" name="late" checked="checked" />NO  &nbsp;&nbsp;    <input type="radio" name="late" />YES
  </td>
</tr-->
<input type="hidden" name="late" value="0">

<!--tr>
  <th class="mytableth" >
    STYLE
  </th>
  <td class="mytabletd" style="text-align: left; padding-left: 10px">
    <input type="radio" name="style" value="1" checked="checked" /> 1  &nbsp;&nbsp;    <input type="radio" name="style" value="2" /> 2
  </td>
</tr-->
<input type="hidden" name="style" value="1">

<tr>
  <th class="mytableth" >
    HIGHLIGHT
  </th>
  <td class="mytabletd" style="text-align: left; padding-left: 10px">
    <input type="radio" name="highlight" value="1" checked="checked" /> ( )  &nbsp;&nbsp;    <input type="radio" name="highlight" value="2" /> <font color="#FF0000">RED</font>
  </td>
</tr>

<input type="hidden" name="pbrk" value="y" />
<!--tr>
  <th bgColor="#999999" style="color: #EEEEEE">
    PAGE BREAK
  </th>
  <th bgcolor="#EEEEEE">
    <input type="radio" name="pbrk" value="y" checked> YES &nbsp;&nbsp;&nbsp; 
	<input type="radio" name="pbrk" value="n">NO
  </th>
</tr-->

<tr>
  <th colspan="2" class="mytableth"><input type="submit" value="REPORT" class="mybtn" style="color: #0000FF"></th>
</tr>
<input type="hidden" name="teaids" value="<?= $strStaffid ?>" />
</form>

</table>
</center>