<?
  $arrTea1 = getTeaList();
  if($_GET["yr"]!=""){
    $yr = $_GET["yr"];
  }else{
    $yr = date("Y");
  }
?>
<table width="100%">
<form action="main.php" method="get">
<input type="hidden" name="pg" value="<?= $_GET["pg"] ?>" />
<input type="hidden" name="ac" value="<?= $_GET["ac"] ?>" />
<input type="hidden" name="op" value="<?= $op ?>" />
<tr>
  <th bgcolor="#999999">TEACHER</th>
  <td bgcolor="#CCCCCC">
    <select name='teaid' onchange="this.form.submit()">
	<?
	  foreach($arrTea1 as $tid=>$ttea){
	    if($_GET["teaid"]=="$tid"){
		  $selected = "SELECTED";
		}else{
		  $selected = "";
		}
	  ?>
	  <option value="<?= $tid ?>" <?= $selected ?>><?= $ttea["ename"] ?></option>
	  <?
	  }
	?>
	</select>
  </td>
</tr>
<tr>
  <th bgcolor="#999999">
    MONTH / YEAR
  </th>
  <td bgcolor="#CCCCCC">
    <select name="mth" onchange="this.form.submit()">
	<?
	foreach($arrMonth as $tid=>$tval){
	    if($_GET["mth"]=="$tid"){
		  $selected = "SELECTED";
		}else{
		  $selected = "";
		}
	  ?>
	  <option value="<?= $tid ?>" <?= $selected ?>><?= $tval ?></option>
	  <?
	}
	?>
	</select>
	/
	<select name="yr" onchange="this.form.submit()">
	<?
	foreach($arrYear as $tid=>$tval){
	  if($yr=="$tval"){
		$selected = "SELECTED";
	  }else{
		$selected = "";
	  }
	  ?>
	  <option value="<?= $tval ?>" <?= $selected ?>><?= $tval ?></option>
	  <?
	}
	?>
	</select>
  </td>
</tr>
</form>
</table>