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

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

?>

<TITLE><?php echo $domain ?> - Edit Periods</TITLE>

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

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

<h3>Edit Periods In Database:</h3><p>

<?php

// query the DB
$sql = "SELECT * FROM periods WHERE periods_id=$id";
$result = mysql_query($sql);	
$myrow = mysql_fetch_array($result);

if (isset($submit)) {

//process form
$sql2 = "UPDATE periods SET hournumber='$hournumber',starttime='$starttime',endtime='$endtime',classname='$classname',periodsnotes='$periodsnotes',course='$course',periodorder='$periodorder' WHERE periods_id=$id";
$result = mysql_query($sql2);
echo "Thank you.  Your information has been updated.\n";

} else {

//display form

$sql3 = "SELECT * FROM teacher, periods WHERE periods.periods_id = $id and periods.teacher_id = teacher.teacher_id";
$result3 = mysql_query($sql3);
$myrow3 = mysql_fetch_array($result3);

?>

<form method="post">
<table width=500px border=0>
<tr>
<td>Teacher ID:
<td><?php echo $myrow["teacher_id"] ?> - <?php echo $myrow3["lastname"] ?>, <?php echo $myrow3["firstname"] ?>
<tr>
<td>Hour Number:
<td><select name="hournumber">
    <option><?php echo $myrow["hournumber"] ?></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>
<tr>
<td>Start Time:
<td><input type="text" id="text" name="starttime" value="<?php echo $myrow["starttime"] ?>">
<tr>
<td>End Time:
<td><input type="text" id="text" name="endtime" value="<?php echo $myrow["endtime"] ?>">
<tr>
<td>Class Name:
<td><input type="text" id="text" name="classname" value="<?php echo $myrow["classname"] ?>">
<tr>
<td>Course Description:
<td><textarea rows="4" cols="55" id="text4" name="course" wrap="virtual"><?php echo $myrow["course"] ?></textarea>
<tr>
<td>Course Notes:
<td><textarea rows="4" cols="55" id="text4" name="periodsnotes" wrap="virtual"><?php echo $myrow["periodsnotes"] ?></textarea>
<tr>
<td>Period Sort Order:
<td><select name="periodorder">
    <option><?php echo $myrow["periodorder"] ?></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>Visible:
<td><input type="radio" name="timevisible" <?php if ($myrow["timevisible"] == "1") printf("checked\n"); else printf("&nbsp;\n"); ?> value="1">Yes<br>
	<input type="radio" name="timevisible" <?php if ($myrow["timevisible"] == "0") printf("checked\n"); else printf("&nbsp;\n"); ?>value="0">No<br>
-->



</table>

<input type="Submit" name="submit" value="Enter Information">

</form>

<?php

}  //end if

?>

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