Location: PHPKode > projects > PortalXP - Teacher Edition > PortalXP/PortalXP/admin/addperiods.php
<?PHP

require('config.php');
require('connect.php');

?>

<TITLE><?php echo $domain ?> - Add Classes</TITLE>

<? INCLUDE("top-mini.php")?>

<link REL="stylesheet" TYPE="text/css" HREF="../portalxp.css">

<h3>Add Classes To Database:</h3><p>

<?php

if (isset($submit)) {

//process form
$sql = "INSERT INTO periods (teacher_id,hournumber,starttime,endtime,classname,periodsnotes,course,periodorder) VALUES ('$teacher_id','$hournumber','$starttime','$endtime','$classname','$periodsnotes','$course','$periodorder')";
$result = mysql_query($sql);
echo "Thank you.  Your information has been entered.\n";

} else {

//display form

$sql2 = "SELECT firstname, lastname FROM teacher where teacher_id = $id";
$result2 = mysql_query($sql2);	
$myrow2 = mysql_fetch_array($result2);

?>

<form method="post" action="<?php echo $PHP_SELF?>">
<table width=500px border=0>
<tr>
<td>Teacher ID:
<td><?php echo $id ?> - <?php echo $myrow2["lastname"] ?>, <?php echo $myrow2["firstname"] ?>
<tr>
<td>Hour Number:
<td><select name="hournumber">
    <option>Select One</option>
	<option value="One">One</option>
	<option value="Two">Two</option>
	<option value="Three">Three</option>
	<option value="Four">Four</option>
	<option value="Five">Five</option>
	<option value="Six">Six</option>
	<option value="Seven">Seven</option>
	<option value="Eight">Eight</option>
	<option value="Prep">Prep/Open</option>
	<option value="">Blank</option>
	</select>

<tr>
<td>Start Time:
<td><input type="text" id="text" name="starttime">
<tr>
<td>End Time:
<td><input type="text" id="text" name="endtime">
<tr>
<td>Classname:
<td><input type="text" id="text" name="classname">
<tr>
<td>Course Description:
<td><textarea rows="4" cols="55" id="text4" name="course" wrap="virtual"></textarea>
<tr>
<td>Course Notes:
<td><textarea rows="4" cols="55" id="text4" name="periodsnotes" wrap="virtual">none</textarea>
<tr>
<td>Period Sort Order:
<td><select name="periodorder">
    <option>Select One</option>
	<option value="1">1</option>
	<option value="2">2</option>
	<option value="3">3</option>
	<option value="4">4</option>
	<option value="5">5</option>
	<option value="6">6</option>
	<option value="7">7</option>
	<option value="8">8</option>
	<option value="9">9</option>
<tr>
<!-- <td>Show Period Times:
<td><input type="radio" name="timevisible" checked value="1">Yes<br>
	<input type="radio" name="timevisible" value="0">No<br>
-->

</table>
<input type="Hidden" name="teacher_id" value="<?php echo $id ?>">
<input type="Submit" name="submit" value="Enter Information">
</form>

<?php

}  //end if

?>

<? INCLUDE("bottom.php")?>
Return current item: PortalXP - Teacher Edition