Your IP : 216.73.217.79


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

<h1>Practice Notes for Members</h1>
<?php 
include_once("memberauth.php");
include_once('inc_db.php'); 
?>
	<h1>Search Practice Notes:</h1>
	<?php
	
	LogUserActivity("Search Practice Notes");
	
	$command = mysql_real_escape_string($_REQUEST["command"]);
	$searchkeyword = mysql_real_escape_string($_REQUEST["searchkeyword"]);
	$searchsubcat = mysql_real_escape_string($_REQUEST["searchsubcat"]);
	$searchnumber1 = mysql_real_escape_string($_REQUEST["searchnumber1"]);
	$searchnumber2 = mysql_real_escape_string($_REQUEST["searchnumber2"]);
	$searchnumber3 = mysql_real_escape_string($_REQUEST["searchnumber3"]);
	
	$sql="";
	switch ($command) {
		case "keywordsearch":			
			$sql = "SELECT * FROM PracticeNotes where LOWER(Title) like '%".strtolower($searchkeyword)."%' OR LOWER(Keywords) like '%".strtolower($searchkeyword)."%' ORDER BY Category, SubCategory, Title";
			break;
		case "catsearch":
			$sql = "SELECT * FROM PracticeNotes where SubCategory LIKE '%$searchsubcat%' ORDER BY Category, SubCategory, Title";
			break;
		case "numbersearch":
			$sql = "SELECT * FROM PracticeNotes WHERE LOWER(PNNo)='".$searchnumber1."/".$searchnumber2."/".$searchnumber3."' ORDER BY Category, SubCategory, Title";
			break;
	}
	if (!empty($sql)) {
			$result = mysql_query($sql);
			$result_rows = mysql_num_rows($result);
			if ($result_rows > 0 ) {
				
				echo "<h1>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 Category and then Alphabetical Title order.</p>";
			echo "<table width=\"100%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\">";
			echo "<tr><th>Ref</th><th>Category</th><th>Sub-Category</th><th>Title</th><th>Download</th></tr>";
			while($row = mysql_fetch_array($result)) {
		    		echo "<tr><td valign=\"top\">".$row["PNNo"]."</td><td valign=\"top\">".$row["Category"]."</td><td valign=\"top\">".$row["SubCategory"]."</td><td valign=\"top\">".$row["Title"]."</td><td valign=\"top\">"."<a target=\"_blank\" href=\"/php/downloadPN.php?filename=".urlencode($row["Filename"])."\"><img src=\"/images/icon_pdf.gif\" width=\"16\" height=\"16\" alt=\"pdf file - click to download\" border=\"0\"></a>"."</td></tr>";
		    	
			}
			echo "</table>";
			
			} 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);
	}
			?>
			<table width="80%" border="0" cellspacing="0">
			<form action="/practice-notes/" method="post">
			<tr><td>
			<input type="text" name="searchkeyword" size="40"></td><td>
			<input type="hidden" name="command" value="keywordsearch">
			<input type="submit" value="Start keyword search">
			</td></tr>
			</form>
			<form action="/practice-notes/" method="post">
			<tr><td>
			<select name="searchsubcat" style="font-size:11px">
<?php
$sql = "SELECT DISTINCT Category, SubCategory FROM PracticeNotes ORDER BY Category,SubCategory";
			$result = mysql_query($sql);
			while($row = mysql_fetch_array($result)) {
?>
	
                <option value="<?php echo $row["SubCategory"]; ?>"><?php echo $row["Category"].": ".$row["SubCategory"]; ?></option>
<?php
}
?>                
              </select>
			</td><td>
			<input type="hidden" name="command" value="catsearch">
			<input type="submit" value="List Notes for the Category">
			</td></tr>
			</form>
			<form action="/practice-notes/" method="post">
			<tr><td>
			<input type="text" name="searchnumber1" size="2">/<input type="text" name="searchnumber2" size="2">/<input type="text" name="searchnumber3" size="2"></td>
			<td><input type="hidden" name="command" value="numbersearch">
			<input type="submit" value="Search by PN Number"></td></tr>
			</form>
			</table>
			<p>
			<a href="/practice-notes-list/"><strong>A full list of all practice notes is available here.</strong></a>
			</p>
<!--			
<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>
-->