<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>

<center>
<form action="rptltelyprv.php" method="post">
<table style="font-family:Arial; font-size:14px" width="500">

<tr bgColor="#999999" style="color: #EEEEEE">
  <th colspan="2">
    <?= $REPORT ?>
  </th>
</tr>

<tr>
<?
  if($myuser->administrator<9){
    $exquery = " id='" . $myuser->id . "'";
	$strAll = "";
  }else{
    $exquery = " id!='admin'";
	$strAll = "<option value='all'>ALL</option>";
  }
  //--------- teacher id ---------------
  $qtea = "SELECT * FROM xoops_adm_teacher WHERE $exquery ORDER BY repPrint, id";
  $rtea = mysql_query($qtea);
  $ntea = mysql_num_rows($rtea);
?>
  <th bgColor="#999999" style="color: #EEEEEE">
    <?= $STAFF ?>
  </th>
  <th bgcolor="#EEEEEE">
  <select name="tea1">
<?
  echo $strAll;
  $i=0;
  while($i<$ntea){
    $id = mysql_result($rtea,$i,"id");
	$name = mysql_result($rtea,$i,"ename");
	if(strlen($name)>18){
	  $dot = "...";
	}else{
	  $dot = "";
	}
	$name = substr($name,0,15) . $dot;
	
	
	echo "<option value='$id'>($id) $name</option>";
	
    $i++;
  }
?>
  </select>
  ~  
  <select name="tea2">
<?
  echo $strAll;
  $i=0;
  while($i<$ntea){
    $id = mysql_result($rtea,$i,"id");
	$name = mysql_result($rtea,$i,"ename");
	if(strlen($name)>18){
	  $dot = "...";
	}else{
	  $dot = "";
	}
	$name = substr($name,0,15) . $dot;
	
	
	echo "<option value='$id'>($id) $name</option>";
	
    $i++;
  }
?>
  </select>
  </th>
</tr>

<?
  //------- date ---------------------------
?>
<tr>
  <th bgColor="#999999" style="color: #EEEEEE">DATE</th>
  <td align="center" bgcolor="#DDDDDD">
	<input type="text" id="txtDatefrom" name="txtDatefrom" size="9" value="<?= $today_date ?>">
	<button id="btnDatefrom" name="btnDatefrom">...</button>
	<script type='text/javascript'>
		Calendar.setup({
			inputField : "txtDatefrom",  //ID of the input field
			ifFormat   : "%Y-%m-%d",    //the date format
			button     : "btnDatefrom"   //ID of the button
		});
	</script>

    &nbsp; <?= $UNTIL ?> &nbsp;

	<input type="text" id="txtDatetil" name="txtDatetil" size="9" value="<?= $today_date ?>">
	<button id="btnDatetil" name="btnDatetil">...</button>
	<script type='text/javascript'>
		Calendar.setup({
			inputField : "txtDatetil",  //ID of the input field
			ifFormat   : "%Y-%m-%d",   //the date format
			button     : "btnDatetil"   //ID of the button
		});
	</script>
  </td>
</tr>

<tr>
<?
  //---------------- section -------------------------
  $qsec = "SELECT DISTINCT section FROM xoops_adm_teacher WHERE section<>''";
  $rsec = mysql_query($qsec);
  $nsec = mysql_num_rows($rsec);
?>
  <th bgColor="#999999" style="color: #EEEEEE">
    <?= $SECTION ?>
  </th>
  <th bgcolor="#EEEEEE">
  <select name="section">
    <option value="all"><?= $ALL ?></option>
<?
  $i=0;
  while($i<$nsec){
    $section = mysql_result($rsec,$i,"section");
	
	echo "<option value='$section'>$section</option>";
	
    $i++;
  }
?>
  </select>
  </th>
</tr>

<tr>
  <th bgColor="#999999" style="color: #EEEEEE">
    <?= $ORDERING ?> 
  </th>
  <th bgcolor="#DDDDDD">
    <input type="radio" name="radOrder" value="id" checked> ID &nbsp;&nbsp;&nbsp; 
	<input type="radio" name="radOrder" value="date"><?= $DATE ?>
  </th>
</tr>

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

<tr bgColor="#999999" style="color: #EEEEEE">
  <th colspan="2"><input type="submit" value="<?= REPORT ?>"></th>
</tr>

</table>
</form>
</center>