Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/members/inc/
Upload File :
Current File : /var/www/cesa.co.za/members/inc/work.inc

<?php
	
	// Database Connection String
	$connection = mysql_connect($server, $user, $pass);
	mysql_select_db($db,$connection);
	
	if ($workopps > 0) {
		$sql = "SELECT Id,Title,DateAdded FROM Work where Archive = 'new' ORDER BY DateAdded DESC LIMIT $workopps";
	} else if ($workopps < 0) {
		$sql = "SELECT Id,Title,DateAdded FROM Work where Archive = 'new' AND (TO_DAYS(NOW()) - TO_DAYS(DateAdded) <= 7) ORDER BY DateAdded DESC";
	} else {
		$sql = "SELECT Id,Title,DateAdded FROM Work where Archive = 'new' ORDER BY DateAdded DESC";
	}
	
	// Get Results and number of rows returned
	
	$result = mysql_query($sql);
	$result_rows = mysql_num_rows($result);
	If ($result_rows > 0) {
		
		?>
		<table width="100%" cellpadding="1" border="0" cellspacing="0">
			
		<?php
	
		while($row = mysql_fetch_array($result)) {
	    		echo "<tr><td valign=\"top\" class=\"tablerow\">".$row["DateAdded"]."</td><td valign=\"top\" class=\"tablerow\"><a href=\"showwork.php4?type=work&id=".$row["Id"]."\">". $row["Title"]."</a></td></tr>\n";
		}
		?>		
		<tr><td width="70"><img src="/pics/spacer.gif" height="1" width="70" alt=""></td><td></td></tr>
		</table>
		<?php
		
	} else {

		echo "No Work Opportunities Found.";

	}
	mysql_free_result($result);
	
?>