<?php

#############################################################################
#                              Site@School
# status1.php: last changed 29/06/2006  , version: 2.4.02
# by Fred Stuurman  (fc.stuurman@hccnet.nl)
# LICENSE INFORMATION: see LICENCE.txt in starnet directory
#$Id: status1.php,v 1.1 2006/10/03 11:13:16 fstuurman Exp $
#############################################################################
if (!defined('IN_SAS'))
{
	die("Hacking attempt");
}
?>
<table border="0" width="100%" bgcolor="<?php echo $status_parm[2] ?>">
  <tr>
     <td width="160">&nbsp;</td>
     <td><span STYLE="font-family: <?php echo $status_parm[3] ?> ;font-size : <?php echo $status_parm[4] ?> ;color: <?php echo $status_parm[5] ?>">&nbsp;
<?php

$query = "SELECT name FROM $table_sections WHERE id = $section"; // getting the section name
$result = mysql_query($query) or die_script($query, mysql_error());
$sectionname = mysql_result($result, 0);
unset ($query);
unset ($result);
print "$status_parm[6] $sectionname -> $pagetitle </span></font>";

$news_table = $dbprefix . "m_news_articles";

if ($_SESSION['site'] == "protected")
{
	$query = "SELECT title,date FROM $news_table WHERE public = 1 AND archive = 0 ORDER BY id DESC LIMIT 1";
}
else
{
	$query = "SELECT title,date FROM $news_table WHERE public = 0 AND archive = 0 ORDER BY id DESC LIMIT 1";
}

$result = mysql_query($query) or die_script($query, mysql_error());
$RecordCount = mysql_num_rows($result);
if ($RecordCount > 0)
{
	$newstitle = mysql_result($result, 0);
	print "<TD><A STYLE=\"font-family: $status_parm[3];font-size : $status_parm[4] ;color: $status_parm[5]\" 
			href=\"index.php?section=$status_parm[8]&page=$status_parm[9]\">$status_parm[7]: <b>$newstitle</b></a></TD>";
}
?>
     </td>
     <td align="right">  
<?php

if ($_SESSION['site'] == "protected")
{
	print "<a href=\"index.php?section=$_SESSION[section_came_from]&page=$_SESSION[page_came_from]&site=public\"STYLE=\"font-family: $status_parm[3];
				font-size : $status_parm[4] ;color: $status_parm[5]\">" . $sas_lang['public_area'] . "&nbsp;/</a>";
}

if (IsSet ($_SESSION['userid']))
{
	print "<a href=index.php?section=$section&page=$page&logout=yes STYLE=\"font-family: $status_parm[3];
				font-size : $status_parm[4] ;color: $status_parm[5]\"> " . $sas_lang['logout'] . "&nbsp;&nbsp;</a>";
}
?>
		 </td>
   </tr>
</table> 