<link href="wstyle.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<div align="center">
<? if ($_GET['stat'] == '' ) { ?>
  <p><a href="index.php?page=13&stat=adduser" class="link">Add New Technician</a></p>
  <table width="80%" border="0">
    <tr>
      <td class="td1"><div align="center">Technician Name</div></td>
      <td width="10%" class="td1"><div align="center">Stop</div></td>
      <td width="10%" class="td1"><div align="center">Edit</div></td>
    </tr>
    <?	
                        $result = mysql_query('select * from p1_technitian where stop_technitian = 0'); 
                        while($row = mysql_fetch_array($result)){ 
                ?>
    <tr>
      <td class="td2"><? echo $row['technitian']?></td>
      <td class="td3"><div align="center"><a href="index.php?page=13&stat=stop&tid=<? echo $row['tid'] ?>" class="td3">Stop</a></div></td>
      <td class="td3"><div align="center"><a href="index.php?page=13&stat=edit&tid=<? echo $row['tid'] ?>" class="td3">Edit</a></div></td>
    </tr>
    <?
          }
    ?>
  </table>
<? } if ($_GET['stat'] == 'adduser' ) { ?>
<form id="form1" name="form1" method="post" action="index.php?page=13&stat=add">
  <table width="80%" border="0">
    <tr>
      <td width="20%" class="td1"><div align="center">Technician Name</div></td>
      <td width="30%" class="td2"><div align="center"><span id="sprytextfield1">
        <label>
        <input type="text" name="technitian" id="technitian" />
        </label>
        <span class="textfieldRequiredMsg">*</span></span></div></td>
      </tr>
  </table>
    <p>
      <input name="Submit" type="submit" class="Submit" id="Submit" value="   Save   " />
    </p>
</form>

<? } if ($_GET['stat'] == 'edit' ) { 
		$tid = $_GET['tid'];
		$query = mysql_query("SELECT * FROM p1_technitian where tid = $tid"); 		

?>

  	<form id="form2" name="form1" method="post" action="index.php?page=13&stat=update&tid=<? echo $tid ?>">
      <table width="80%" border="0">
        <tr>
          <td width="20%" class="td1"><div align="center">Technician Name</div></td>
          <td width="30%" class="td2"><div align="center"><span id="sprytextfield2">
              <label>
              <input type="text" name="technitian" id="technitian" value="<? echo mysql_result($query,0,"technitian"); ?>" />
              </label>
              <span class="textfieldRequiredMsg">*</span></span></div></td>
        </tr>
</table>
      <p>
        <input name="Submit2" type="submit" class="Submit" id="Submit2" value="   Update   " />
      </p>
      <table width="80%" border="0">
      </table>
  </form>
  	<p>&nbsp;</p>
  <? } ?>  
</div>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
//-->
</script>
