Your IP : 216.73.217.79


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

<?php 
include_once("memberauth.php");
include("inc_db.php");
?>

	<!-- Start Page Content Here -->
	<table width="100%" cellpadding="10" border="0" cellspacing="0"><tr>
          <td valign="top"> 
            <h1>National Liaison Comittee Reports and Minutes of National Liaison Meetings</h1>
	  
            The following is a list of all reports received 
      from the Convenors of Liaison Committees over the last year. Please e-mail 
      <?php echo generate_obfuscated_mailto("general@cesa.co.za"); ?> for archived 
      reports. <br><br>
      <?php

	// Database Connection String
	
	$ClientID = intval("0".$_REQUEST["ClientID"]);
	$type = $_REQUEST["type"];
	
	if  (($ClientID > 0) || (!empty($type))) {
	
		$sql = "SELECT ClientBodyID, ClientBodyTypeA, ClientBodyName FROM NLCClientBody";
		
		if ($ClientID > 0) $sql .= " where ClientBodyID=".intval($ClientID);
		if ($type) $sql .= " where ClientBodyTypeA='".mysql_real_escape_string($type)."'";
		
		$sql .= " order by ClientBodyName";
		
		// Get Results and number of rows returned
		$result = mysql_query($sql);
		$result_rows = mysql_num_rows($result);
		while($row = mysql_fetch_array($result)) {
			$sql = "SELECT Document, DocName, SortOrder, REPLACE(Document, '".$row["ClientBodyID"]."/', '') AS DocSort FROM NLCDocuments WHERE ClientBodyID='".$row["ClientBodyID"]."' ORDER BY SortOrder, DocSort DESC";
			$recF=mysql_query($sql);
			if (mysql_num_rows($recF)>0) {
				echo "<b>".$row["ClientBodyName"]."</b><br><br>";
				while ($rowF = mysql_fetch_assoc($recF)) {
					$DocName = $rowF["DocName"];
					if (empty($DocName)) {
						$DocName = basename($rowF["Document"]);
						$DocName = substr($DocName, 0, strrpos($DocName, '.'));
						$DocName = ucwords(str_replace('_',' ',$DocName));
					}
					echo '<a href="/NLCReports/'.$rowF["Document"].'" target="_blank">'.$DocName.'</a><br><br>';
				}
			} else {
				if ($ClientID > 0) echo "<b>".$row["ClientBodyName"]."</b><br><br>No reports found.";
			}
			mysql_free_result($recF);
				
		}
		mysql_free_result($result);
	 } else {

		// Built sql statement
		$sql = "SELECT DISTINCT ClientBodyTypeA FROM NLCClientBody";
		// Get Results and number of rows returned
		$result = mysql_query($sql);
		$result_rows = mysql_num_rows($result);
		echo "<p class=\"footer\">Select the category you wish to use</p>";
		while($row = mysql_fetch_array($result))
		{
			echo "<a href=\"/node/71?type=".urlencode($row["ClientBodyTypeA"])."\">".$row["ClientBodyTypeA"]."</a><br>\n";
		}
		mysql_free_result($result);

	}
		?>
	</td></tr></table>