Your IP : 216.73.217.79


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

<?php 
include('inc_db.php'); 
?>
	<h1>Practice Notes for Members</h1>
	<h1>Search Practice Notes:</h1>
	<?php
	$command = mysql_real_escape_string($_REQUEST["command"]);
	$searchkeyword = mysql_real_escape_string($_REQUEST["searchkeyword"]);
	$searchyear = mysql_real_escape_string($_REQUEST["searchyear"]);
	$searchnumber = mysql_real_escape_string($_REQUEST["searchnumber"]);
	$year = mysql_real_escape_string($_REQUEST["year"]);
	
	switch ($command) {
		case "keywordsearch":
			
			$sql = "SELECT NoteId,Title,Description,Filename, Reference FROM advisory where confidential='N' AND (title like '%$searchkeyword%' OR description like '%$searchkeyword%' OR FILENAME like '%$searchkeyword%') AND Archive = 'new' ORDER BY Reference, Title";
			$result = mysql_query($sql);
			$result_rows = mysql_num_rows($result);
			If ($result_rows > 0 ) {
				
				echo "<h1>Keyword Search Results:</h1>";
				echo "<p>The following <b>".$result_rows." results</b> match your search criteria '<i>".$searchkeyword."</i>'<br>Please note: Items are listed in Reference and then Alphabetical Title order</p>";
				
				while($row = mysql_fetch_array($result)) {
			    		echo "<p class=\"advisorynotes\">";
			    		echo "<b>".ucwords(strtolower($row["Reference"]))."</b><br>";
			    		echo "<b>".ucwords(strtolower($row["Title"]))."</b><br>";
			    		echo substr($row["Description"],0,300)." ...<br><i>continued in the pdf version</i>";
			    		echo " click <a href=\"/_f1l3z_/advisorynotes/".strtolower($row["Filename"])."\"><img src=\"/images/icon_pdf.gif\" width=\"16\" height=\"16\" alt=\"pdf file\" border=\"0\"> here</a> to download" ;
			    		echo "</p>";
				}
			} else {
			
			echo "<p><br><B>No results found. Please go back and try a wider search criteria or a simpler keyword.</b></p>";
			}
			mysql_free_result($result);
			break;
		case "listyearsearch":
			$sql = "SELECT NoteId,Title,Description,Filename, Reference FROM advisory where confidential='N' AND LEFT(filename,2) = $year  AND Archive = 'new' ORDER BY Reference, Title";
			$result = mysql_query($sql);
			$result_rows = mysql_num_rows($result);
			If ($result_rows > 0 ) {
				echo "<h1>List Year Results:</h1>";
				if ($year > 75 ) { $newyear = "19".$year; }
				if ($year < 75 ) { $newyear = "20".$year; }
				echo "<p class=\"footer\">The following <b>".$result_rows." results</b> match the year '<i>".$newyear."</i>'<br>Please note: Items are listed in Reference and then Alphabetical Title order</p>";
				while($row = mysql_fetch_array($result)) {
			    		echo "<p class=\"advisorynotes\">";
			    		echo "<b>".ucwords(strtolower($row["Reference"]))."</b><br>";
			    		echo "<b>".ucwords(strtolower($row["Title"]))."</b><br>";
			    		echo substr($row["Description"],0,300)." ...<br><i>continued in the pdf version</i>";
			    		echo " click <a href=\"/_f1l3z_/advisorynotes/".strtolower($row["Filename"])."\"><img src=\"/images/icon_pdf.gif\" width=\"16\" height=\"16\" alt=\"pdf file\" border=\"0\"> here</a> to download" ;
			    		echo "</p>";
				}
			} else {
			echo "<p><br><B>No practice notes found for that year. Please go back and try another year.</b></p>";
			}
			mysql_free_result($result);	
			break;
		case "numbersearch":
			if ($searchnumber >= 10) {
				$searchcriteria = "where LEFT(filename,5) = \"".$searchyear."_".$searchnumber."\"";
			} else {
				$searchcriteria = "where (LEFT(filename,4) = \"".$searchyear."_".$searchnumber."\")";
			}
			$sql = "SELECT NoteId,Title,Description,Filename, Reference FROM advisory $searchcriteria  AND confidential='N' AND Archive = 'new' ORDER BY Reference, Title";
			$result = mysql_query($sql);
			$result_rows = mysql_num_rows($result);
			If ($result_rows > 0 ) {
				echo "<h1>Advisory Note Number Code Results:</h1>";
				echo "<p class=\"footer\">The following <b>".$result_rows." results</b> match the Advisory Note Number '<i>".$searchyear."/".$searchnumber."</i>'<br>Please note: Items are listed in Alphabetical Title order</p>";
				while($row = mysql_fetch_array($result)) {
			    		echo "<p class=\"advisorynotes\">";
			    		echo "<b>".ucwords(strtolower($row["Reference"]))."</b><br>";
			    		echo "<b>".ucwords(strtolower($row["Title"]))."</b><br>";
			    		echo substr($row["Description"],0,300)." ...<br><i>continued in the pdf version</i>";
			    		echo " click <a href=\"/_f1l3z_/advisorynotes/".strtolower($row["Filename"])."\"><img src=\"/images/icon_pdf.gif\" width=\"16\" height=\"16\" alt=\"pdf file\" border=\"0\"> here</a> to download" ;
			    		echo "</p>";
				}
			} else {
			$hint = "<p><b>Hint:</b><br>The practice note number is in the format year/number with the year being a two digit number and the article number. E.g. 00/1 represents Article number 1 from the year 2000.</p><p>If you are sure you are entering the number correctly, but cannot find the article you want by number, then go back and try using the text or year searches which are less strict and more likely to find results.</p>";
			if ($searchnumber != "" AND $searchyear != "") {
				echo "<p><br><B>No practice notes found for ".$searchyear."/".$searchnumber.". Please go back and try another number.</b></p>";
				echo $hint;
			} else {
				echo "<p><br><B>No practice notes found. Please go back and try another number.</b></p>";
				echo $hint;
			}
			}
			mysql_free_result($result);	
			break;
		default:
			?>
			<table width="80%" border="0" cellspacing="0">
			<form action="/node/19" method="post">
			<tr><td>
			<input type="text" name="searchkeyword" size="20"></td><td>
			<input type="hidden" name="command" value="keywordsearch">
			<input type="submit" value="Start keyword search">
			</td></tr>
			</form>
			<form action="/node/19" method="post">
			<tr><td>
			<select name="year">
<?php
for ($i = date("Y"); $i>=1980; $i--) {				
?>	
                <option value="<?php echo substr($i."",strlen($i."")-2,2); ?>"><?php echo $i; ?></option>
<?php
}
?>                
              </select>
			</td><td>
			<input type="hidden" name="command" value="listyearsearch">
			<input type="submit" value="List Notes for the Year">
			</td></tr>
			</form>
			<form action="/node/19" method="post">
			<tr><td>
			<input type="text" name="searchyear" size="2">/<input type="text" name="searchnumber" size="2"></td>
			<td><input type="hidden" name="command" value="numbersearch">
			<input type="submit" value="Search by Code Number"></td></tr>
			</form>
			</table>
			<p>
			<a href="/node/76">A full list of all practice notes is available here.</a>
			</p>
			
			<?php
			
			
			break;
			
	}
	?>
<h1>Client Information Sheets</h1>

<p>
<a href="/public_downloads/SAACEClientInformationSheet1.pdf" target="_blank">Client Information Sheet 1</a><br>
Professional Service Contracts (Why Clients Should Limit the Liability of their Consulting Engineer)
</p>
 
<p>
<a href="/public_downloads/SAACEClientInformationSheet2.pdf" target="_blank">Client Information Sheet 2</a><br>
Professional Service Contracts (Why Clients Should Use Standard Conditions of Contract For Professional Consultants)
</p>
 
<p>
<a href="/public_downloads/SAACEClientInformationSheet3.pdf" target="_blank">Client Information Sheet 3</a><br>
Construction Regulations 2003 
</p>
 
<p>
<a href="/public_downloads/SAACEClientInformationSheet4.pdf" target="_blank">Client Information Sheet 4</a><br>
How To handle Repeat Tenders
</p>