<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=25&stat=adduser" class="link">Add New Staff</a></p>
  <table width="80%" border="0">
    <tr>
      <td class="td1"><div align="center">Staff 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_staff where stop_staff = 0'); 
                        while($row = mysql_fetch_array($result)){ 
                ?>
    <tr>
      <td class="td2"><? echo $row['staff']?></td>
      <td class="td3"><div align="center"><a href="index.php?page=25&stat=stop&sid=<? echo $row['sid'] ?>" class="td3">Stop</a></div></td>
      <td class="td3"><div align="center"><a href="index.php?page=25&stat=edit&sid=<? echo $row['sid'] ?>" class="td3">Edit</a></div></td>
    </tr>
    <?
          }
    ?>
  </table>
<? } if ($_GET['stat'] == 'adduser' ) { ?>
<form id="form1" name="form1" method="post" action="index.php?page=25&stat=add">
  <table width="80%" border="0">
    <tr>
      <td width="20%" class="td1"><div align="center">Staff Name</div></td>
      <td width="30%" class="td2"><div align="center"><span id="sprytextfield1">
        <label>
        <input type="text" name="staff" id="staff" />
        </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' ) { 
		$sid = $_GET['sid'];
		$query = mysql_query("SELECT * FROM p1_staff where sid = $sid"); 		

?>

  	<form id="form2" name="form1" method="post" action="index.php?page=25&stat=update&sid=<? echo $sid ?>">
      <table width="80%" border="0">
        <tr>
          <td width="20%" class="td1"><div align="center">Staff Name</div></td>
          <td width="30%" class="td2"><div align="center"><span id="sprytextfield2">
              <label>
              <input type="text" name="staff" id="staff" value="<? echo mysql_result($query,0,"staff"); ?>" />
              </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>
