Location: PHPKode > projects > PortalXP - Teacher Edition > PortalXP/PortalXP/periods.php
<?php

require('admin/config.php');
require('admin/connect.php');
include('admin/outputlib.php');

// query the DB for School Name & District Name
$sql = "select * from teacher, school, district where teacher.teacher_id = $id and school.school_id = teacher.school_id and district.district_id = teacher.district_id";
$result = mysql_query($sql);	
$myrow = mysql_fetch_array($result);

// query the DB for Latest News Item
//$sql2 = "select * from teacher, news where teacher.teacher_id = $id ORDER BY news.news_id DESC LIMIT 0,1";
//$result2 = mysql_query($sql2);	
//$myrow2 = mysql_fetch_array($result2);

// query the DB for Class Schedule
$sql3 = "select * from periods where periods.teacher_id = $id ORDER BY periodorder";
$result3 = mysql_query($sql3);	

// query the DB for Links
$sql4 = "select * from links where links.teacher_id = $id ORDER BY links.links_id DESC LIMIT 0,5";
$result4 = mysql_query($sql4);

// query the DB for Theme Information
$sql5 = "SELECT topname, topaddress, toprow, classrow, linksrow, contentrow, bottomrow, sidemenu FROM teacher, theme WHERE teacher.teacher_id = $id and teacher.theme_id = theme.theme_id";
$result5 = mysql_query($sql5);	
$myrow5 = mysql_fetch_array($result5);

// query the DB or Assignments based on periods
$sql6 = "select * from assignments where assignments.periods_id = $periods_id and assignments.visible = '1' ORDER BY datedue";
$result6 = mysql_query($sql6);

// query the DB for period information based on $period_id
$sql7 = "select * from periods where periods_id = $periods_id";
$result7 = mysql_query($sql7);
$myrow7 = mysql_fetch_array($result7);

?>

<HEAD>
<? INCLUDE("portalxp.php")?>

<STYLE>
A:hover
{
    COLOR: #ff3333;
    TEXT-DECORATION: none
}
</STYLE>
</HEAD>

<? INCLUDE("includes/backend_top.php")?>	

<!-- Content Area -->	
	

					  <table width='425px' BORDER="0" CELLSPACING="0" CELLPADDING="0">
					  <tr>
					  	  <td bgcolor='<?php echo $myrow5["contentrow"] ?>'>
						  <div class='fontwhite'>
						  <?php

						  if ($myrow7["timevisible"] == "0")
							printf("Period $myrow7[hournumber] - $myrow7[classname]\n");
						  else
						  	printf("$myrow7[classname] - $myrow7[starttime] - $myrow7[endtime]\n");
						  ?>

						  </div>
						  </td>
					  </tr>
					  <tr>
					  	   <td>
					  	   <?php
					  	   
					  	   if ($myrow7["periodsnotes"] == "None")
					  	   
					  	       printf("&nbsp;\n");
					  	       
					  	   else
					  	   	  
					  	   	  echo '<fieldset>'; 
   							  echo '<legend class="fieldset">Classroom Notes</legend>';
    						  echo print_output($myrow7['periodsnotes']).'</fieldset>'; 
					  	   	  
					  	   ?>
					  	   
					  	   </td>
					  </tr>
					  <tr>
						   <td>
						   <fieldset>
						   <legend class='fieldset'>Course Description</legend>
						   <?php print_output($myrow7["course"]) ?>
						   </fieldset>
						   </td>
					  </tr>

					  </table>
	
	</td>
	<td valign='top'>
					  <table width='125px' BORDER="0" CELLSPACING="0" CELLPADDING="0">
					  <tr>
					  	  <td bgcolor='<?php echo $myrow5["linksrow"] ?>'>
						  <div class='fontwhite'>
						  Assignments
						  </div>
						  </td>
					  </tr>
					  <tr>
					  	  <td>
						    <?php
					  		while ($myrow6 = mysql_fetch_array($result6)) {
    				  		printf("*<a href='assignments.php?assignment_id=%s&id=%s'>%s<br>%s</a><br>\n", $myrow6["assignments_id"], $myrow6["teacher_id"], $myrow6["shortname"], $myrow6["datedue"]);
  					  		}
					  		?>
							</td>
					  </tr>
					  </table>

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