| Current Path : /var/www/cesa.co.za/cesanet/ |
| Current File : /var/www/cesa.co.za/cesanet/resources.php |
<?php
include("inc_functions.php");
if (!isset($_SESSION["StudentID"]) || empty($_SESSION["StudentID"])) header("Location: /cesanet/login.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>CESAnet</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<!--[if IE 5]>
<style type="text/css">
/* place css box model fixes for IE 5* in this conditional comment */
.twoColFixLtHdr #sidebar1 { width: 230px; }
</style>
<![endif]--><!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.twoColFixLtHdr #sidebar1 { padding-top: 30px; }
.twoColFixLtHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
<style type="text/css">
<!--
.style2 {color: #FFFFFF}
-->
</style>
<link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
</head>
<body class="twoColFixLtHdr">
<div id="container">
<?php include("inc_header.php"); ?>
<?php include("inc_sidebar.php"); ?>
<div id="mainContent">
<h1> Resources<?php
if (!CurrentStudent()) echo " - Archived ".$_SESSION["StudentYear"];
?></h1>
<form id="form1" name="form1" method="post" action="resources.php">
Search now:
<label>
<input name="keywords" type="text" id="keywords" value="<?php echo $_REQUEST["keywords"]; ?>" />
</label>
<label>
<input type="submit" name="submit" id="submit" value="Search" />
</label>
</form>
<?php
if (isset($_REQUEST["keywords"]) && !empty($_REQUEST["keywords"])) {
?>
<p>The results of your search for <b>"<?php echo $_REQUEST["keywords"]; ?>"</b> appear below. <a href="resources.php">Click here to clear your search and show all resources.</a></p>
<?php
}
?>
<div id="Accordion1" class="Accordion" tabindex="0">
<?php
$sql = "SELECT * FROM CCEResourceGroups ";
if (isset($_REQUEST["keywords"]) && !empty($_REQUEST["keywords"])) {
$sql .= "WHERE CCEResourceGroupName LIKE '%".$_REQUEST["keywords"]."%' OR CCEResourceGroupID IN (select ResourceGroupID FROM CCEResources WHERE ResourceName LIKE '%".$_REQUEST["keywords"]."%' AND Archived=0";
$sql.=")";
}
$sql .= " ORDER BY CCEResourceGroupName";
$recMod = mysql_query($sql);
while ($rowMod = mysql_fetch_assoc($recMod)) {
$sql = "SELECT * FROM CCEResources WHERE ResourceGroupID=".$rowMod["CCEResourceGroupID"];
if (CurrentStudent()) {
$sql.=" AND Archived=0";
} else {
$sql.=" AND (Archived=0 OR ArchiveYear=".$_SESSION["StudentYear"].")";
}
if (isset($_REQUEST["keywords"]) && !empty($_REQUEST["keywords"])) {
$sql .= "AND ResourceName LIKE '%".$_REQUEST["keywords"]."%'";
}
$sql .= " ORDER BY ResourceName";
$rec=mysql_query($sql);
$iheight = mysql_num_rows($rec)*15+35;
if ($iheight > 300) $iheight=300;
?>
<div class="AccordionPanel">
<div class="AccordionPanelTab"><b><?php echo $rowMod["CCEResourceGroupName"]; ?></b></div>
<div class="AccordionPanelContent" style="height:<?php echo $iheight; ?>px !important;<?php if (isset($_REQUEST["keywords"]) && !empty($_REQUEST["keywords"])) echo " display:block !important"; ?>">
<ul>
<?php
if (!empty($rowMod["CCEResourceGroupURL"])) {
?>
<li><a href="<?php if (substr($rowMod["CCEResourceGroupURL"],0,7) != "http://") echo "http://"; echo $rowMod["CCEResourceGroupURL"]; ?>" target="_blank"><?php echo $rowMod["CCEResourceGroupName"]; ?></a></li>
<?php
}
$iNumCol=0;
while ($row=mysql_fetch_assoc($rec)) {
?>
<li><a href="<?php if (substr($row["ResourceURL"],0,7) != "http://") echo "http://"; echo $row["ResourceURL"]; ?>" target="_blank"><?php echo $row["ResourceName"]; ?></a></li>
<?php
}
?>
</ul>
</div>
</div>
<?php
}
?>
</div>
<p> </p>
<p> </p>
</div>
<?php include("inc_footer.php"); ?>
</div>
<script type="text/javascript">
var Accordion1 = new Spry.Widget.Accordion("Accordion1");
</script>
</body>
</html>