Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/mentanet/
Upload File :
Current File : /var/www/cesa.co.za/mentanet/library.php

<?php
include("inc_functions.php");

if (!isset($_SESSION["StudentID"]) || empty($_SESSION["StudentID"])) header("Location: http://www.cesa.co.za/mentanet/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>MentaNet</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></head>

<body class="twoColFixLtHdr">

<div id="container">
<?php include("inc_header.php"); ?>
<?php include("inc_sidebar.php"); ?>
  <div id="mainContent">
    <h1> Reading Library</h1>
    
<?php
function ShowDocs($iModID) {
	$sql = "SELECT * FROM CCEDocCategories";
	$recCat = mysql_query($sql);
	while ($rowCat = mysql_fetch_assoc($recCat)) {
		$sql = "SELECT * FROM CCEDocuments WHERE ";
		if (empty($iModID)) {
			$sql .= "CCEModuleID IS NULL";
		} else {
			$sql .= "CCEModuleID=".$iModID;
		}
		$sql .= " AND DocumentCategory=".$rowCat["CCEDocCategoryID"];
		if (in_array($_SESSION["StudentID"], array(7,13))) {
			$sql.=" AND CCEDocumentID <= 111";
		} else {
			$sql.=" AND Archived=0";
		}
		$sql .=" ORDER BY DocumentName";
		$rec=mysql_query($sql);
		$iNumCol=0;
		if (mysql_num_rows($rec) > 0) {
?>    
    <table width="700" border="10" cellpadding="5" cellspacing="0" bordercolor="#663300">
      <tr>
        <td colspan="5" bgcolor="#663300"><span class="style2"><?php echo $rowCat["CategoryName"]; ?></span></td>
      </tr>
      <tr>
<?php
			while ($row=mysql_fetch_assoc($rec)) {
				$iNumCol++;
				if ($iNumCol == 5) {
					echo "</tr><tr>";
					$iNumCol=1;
				}
?>      
        <td width="20%" valign="top"><?php if (!empty($row["DocumentFile"])) echo '<a href="/cceadmin/documents/'.$row["DocumentFile"].'" target="_blank">'; ?><img src="<?php
				$thumbfile = "";
				if (empty($row["DocumentThumb"])) {
					if (strtolower(substr($row["DocumentFile"],-4))==".pdf") {
						$docthumb=CreateThumb($row["CCEDocumentID"], $row["DocumentFile"]);
						$thumbfile = 'docthumbs/'.$docthumb;
					} else {
						$thumbfile = 'images/book.jpg';
					}
				} else {
					$thumbfile = 'docthumbs/'.$row["DocumentThumb"];
				}
				echo $thumbfile;
        ?>" alt="<?php echo $row["DocumentName"]; ?>" height="60" border="0"<?php $size=getimagesize($thumbfile); if ($size[0]<70) echo ' align="left"'; ?> hspace="2" /><?php if ($size[0]>70) echo '<br>'; ?><?php echo $row["DocumentName"]; ?><?php if (!empty($row["DocumentFile"])) echo "</a>"; ?></td>
<?php
			}
			for ($iRemCols = $iNumCol; $iRemCols < 4; $iRemCols++) {
				echo "<td>&nbsp;</td>";
			}
?>        
      </tr>
      <tr>
        <td colspan="5">&nbsp;</td>
      </tr>
    </table>
<?php
		}
	}
}

?>
    <h2><strong><a name="modgeneral" id="modgeneral"></a>General</strong></h2>
<?php
ShowDocs("");

$sql = "SELECT CCEModules.* FROM CCEStudentCourses, CCEModules 
WHERE CCEStudentCourses.CCEStudentID=".$_SESSION["StudentID"]."
AND CCEStudentCourses.CCECourseID=CCEModules.CCECourseID
ORDER BY CCEModules.ModuleNum";
$recMod = mysql_query($sql);
while ($rowMod = mysql_fetch_assoc($recMod)) {
?>
    <h2><strong><a name="mod<?php echo $rowMod["ModuleNum"]; ?>" id="mod<?php echo $rowMod["ModuleNum"]; ?>"></a><?php echo $rowMod["ModuleName"]; ?></strong></h2>
<?php
	ShowDocs($rowMod["CCEModuleID"]);
}
?>      
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    </div>
<?php include("inc_footer.php"); ?>
	</div>
</body>
</html>