Location: PHPKode > projects > SchoolMate > schoolmate/AddTeacher.php

 print("<h1>Add New Teacher</h1>

  <form name='addteacher' action='./index.php' method='POST'>
  <table cellspacing='0' cellpadding='5' class='dynamiclist' align='center' width='450'>
   <tr class='header'>
	<th>First Name</th>
	<th>Last Name</th>
   <tr class='even'>
	<td><input type='text' name='fname' maxlength='15' size='15' /></td>
	<td><input type='text' name='lname' maxlength='15' size='15' /></td>
	 <select name='username'>");
	 // Get the list of usernames for the user to choose from //
	 $query = mysql_query("SELECT u.userid,u.username FROM users u LEFT JOIN teachers t ON u.userid = t.userid WHERE t.userid IS NULL AND (u.type='Teacher' OR u.type='Substitute')")
	   or die("AddTeacher: Unable to retrieve the list of users - ".mysql_error());

	 while($users = mysql_fetch_row($query))
	  print("<option value='$users[0]'>$users[1]</option>\n");
print("	 </select>


   <table cellpadding='0' border='0' align='center' width='450'>
   <td><input type='button' value='Add Teacher' onClick='document.addteacher.addteacher.value=1;document.addteacher.page2.value=3;document.addteacher.submit();'> <input type='button' value='Cancel' onClick='document.addteacher.page2.value=3;document.addteacher.submit();'></td>

  <input type='hidden' name='addteacher' value=''>
  <input type='hidden' name='page2' value='$page2'>
  <input type='hidden' name='logout'>
  <input type='hidden' name='page' value='$page'>


 <table width='520' border=0 cellspacing=0 cellpadding=0 height=1>
   <td valign='top'>
Return current item: SchoolMate