rendered paste body<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$pcodesearch = "area";
$pocode = $_POST['pocode'];
$pocode1 = $_POST['pocode'] + 1;
$pocode2 = $_POST['pocode'] + 2;
$pocode3 = $_POST['pocode'] - 1;
$pocode4 = $_POST['pocode'] - 2;
if ($_POST['searchtype'] == "Area and surroundings") { $pocodesearch = "surr"; }
elseif ($_POST['searchtype'] == "State Wide") { $pocodesearch = "state"; }
else {$pcodesearch == "area";}
$state = "Victoria";
if ($pocode[0] == 2) { $state = "New South Wales"; }
elseif ($pocode[0] == 8) { $state = "South Australia"; }
elseif ($pocode[0] == 4) { $state = "Queensland"; }
elseif ($pocode[0] == 5) { $state = "Western Australia"; }
elseif ($pocode[0]== 6) { $state = "Tasmania"; }
elseif ($pocode[0] == 7) { $state = "Northern Territory"; }
else { $state = "Victoria"; }
if ($pcodesearch == "area") { $searchcall = "pcode = $pocode"; }
elseif ($pcodesearch == "surr") { $searchcall = "pcode = $pocode OR pcode = $pocode1 OR pcode = $pocode2 OR pcode = $pocode3 OR pcode = $pocode4";}
else { $searchcall = "state = $state"; }
$services = $_POST['services'];
$conn = mysql_connect("localhost", "root", "");
mysql_select_db("clientregister",$conn);
$sql = "SELECT * FROM customertable WHERE service='$services' AND state='$state' ";
$result = mysql_query($sql, $conn);
$number_of_rows = mysql_num_rows($result);
if (!mysql_num_rows($result))
{
echo
'<table width="575" border="1" cellpadding="5" cellspacing="5" bordercolor="#FFFFFF">
<tr>
<td width="578"> <table width="100%" border="1" bordercolor="#FF6F6F" bgcolor="#FF6F6F">
<tr>
<td width="325"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Category</strong>:
' . $category . '</font></td>
<td width="234"><font size="2" face="Arial, Helvetica, sans-serif"><strong>State
or Pcode:</strong></font><font size="2">' . $pcode . '</font></td>
</tr>
<tr>
<td><p><font face="Arial, Helvetica, sans-serif">We found you: <strong>' . $number_of_rows . '</strong>
Results</font></p>
</td>
<td><font size="2" face="Arial, Helvetica, sans-serif"><a href="index.php">Search
again</a></font></td>
</tr>
</table>
</td>
</tr>
</table>';
}
else
{
while ($newArray = mysql_fetch_array($result))
{
$busname = $newArray['busname'];
$address = $newArray['address'];
$suburb = $newArray['suburb'];
$pcode = $newArray['pcode'];
$state = $newArray['state'];
$acode = $newArray['acode'];
$phone = $newArray['phone'];
$fax = $newArray['fax'];
$website = $newArray['website'];
$category = $newArray['service'];
$comments = $newArray['comments'];
$contact = $newArray['contact'];
$highlight = $newArray['highlight'];
$hlcolour = "#FFFFFF";
if ($highlight == "Yes") { $hlcolour = "#FFD9D9"; } else { $hlcolour = "#FFFFFF"; }
echo
'<table width="575" border="1" cellpadding="5" cellspacing="5" bordercolor="#FFFFFF">
<tr>
<td width="578"> <table width="100%" border="1" bordercolor="#FF6F6F" bgcolor="#FF6F6F">
<tr>
<td width="325"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Category</strong>:
' . $category . '</font></td>
<td width="234"><font size="2" face="Arial, Helvetica, sans-serif"><strong>State
or Pcode:</strong></font><font size="2">' . $pcode . '</font></td>
</tr>
<tr>
<td><p><font face="Arial, Helvetica, sans-serif">We found you: <strong>' . $number_of_rows . '</strong>
Results</font></p>
</td>
<td><font size="2" face="Arial, Helvetica, sans-serif"><a href="index.php">Search
again</a></font></td>
</tr>
</table>
<table width="100%" border="1" bordercolor="#FFFFFF">
<tr>
<td> </td>
</tr>
</table>
<table width="100%" border="0" bordercolor=$hlcolour bgcolor=$hlcolour>
<tr>
<td width="62%"><font size="3" face="Arial, Helvetica, sans-serif"><strong>' . $busname . '</strong></font></td>
<td width="38%"><font size="3" face="Arial, Helvetica, sans-serif"><strong><img src="phonelogo.jpg" width="7" height="14">
('.$acode.' )' . $phone . '</strong></font></td>
</tr>
<tr>
<td><font size="2" face="Arial, Helvetica, sans-serif">' . $address . $suburb
. $pcode . '</font></td>
<td><font color="#FF0000" size="2" face="Arial, Helvetica, sans-serif">' . $website . '</font></td>
</tr>
<tr>
<td><font color="#FF0000" size="2" face="Arial, Helvetica, sans-serif">' . $comments . '</font></td>
<td><font size="3" face="Arial, Helvetica, sans-serif"> </font></td>
</tr>
</table>
<table width="100%" border="0">
<tr>
<td><div align="center"><img src="divider.jpg" width="500" height="8"></div></td>
</tr>
</table>
</td>
</tr>
</table>';
}
}
?>
<table width="575" border="0" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<tr>
<td><img src="bottombar.jpg" width="575" height="25"></td>
</tr>
</table>
<table width="575" border="0" cellspacing="0">
<tr>
<td><div align="right">
<p><font size="1" face="Arial, Helvetica, sans-serif">© Copyright
mylocalauto.com.au 2007. All rights reserved.</font><br>
<font size="1" face="Arial, Helvetica, sans-serif">Use of this website
constitutes acceptance of the <a href="terms.php">Terms & Conditions</a></font></p>
<p> <font size="2" face="Arial, Helvetica, sans-serif"><a href="index.php">Home</a>
| <a href="aboutus.php">About Us</a> | <a href="advertise.php">Advertise</a>
| <a href="contactus.php">Contact Us</a> | <a href="newsmedia.php">News
& Media</a></font><br>
</p>
</div></td>
</tr>
</table>
</body>
</html>