Advanced Housing Search v 1.3
Enter your search criteria in the fields below. You can use as many or as few search criteria as you want.
Hover your mouse over any of the to find out more about it.
Where available click on the to visit the manufacturers site for more details.
You can also click on the icon to enquire about price and availability from E. Fox Engineers.
|
$processed = $_POST["processed"];
$measure = $_POST["measure"];
$search_id_imp1 = $_POST["search_id_imp1"];
$search_id_imp2 = $_POST["search_id_imp2"];
$search_element = $_POST["search_element"];
$search_brand = $_POST["search_brand"];
$search_name = $_POST["search_name"];
$search_id = $_POST["search_id"];
$search_od = $_POST["search_od"];
$search_id2 = $_POST["search_id2"];
$search_od2 = $_POST["search_od2"];
$search_width = $_POST["search_width"];
$search_width2 = $_POST["search_width2"];
$search_w_imp1 = $_POST["search_w_imp1"];
$search_w_imp2 = $_POST["search_w_imp2"];
$tolerence_id = $_POST["tolerence_id"];
$tolerence_w = $_POST["tolerence_w"];
$tolerence_od = $_POST["tolerence_od"];
$metric_threshold = 0.1;
if($search_id2)
{$search_id2 += $metric_threshold; $search_id -= $metric_threshold;}
else if($search_id)
{$search_id2 = $search_id + $metric_threshold; $search_id -= $metric_threshold;}
?>
if($logged_in == "Yes") {
if($processed == "Yes") {
// echo "Processed ";
$valid_date = $_SESSION['valid_date'];
if( 1000 < 200)
{
?>
* Unfortunately your subscription to use this service expired on
*
Please click here to update your account. |
}else{
?>
if($num_results >= 0 && $num_results != "") {
?>
Rolling Element -
}
//echo "Processing ... ";
$threshold_metric = 2;
if($measure=="Imperial") {
// echo "Imperial ";
if ($search_id_imp1 != 0 || $search_id_imp2 != 0) {
// echo "$search_id_imp2" ;
$search_id = (($search_id_imp1 * 25.4) + ($search_id_imp2 * 25.4));
$search_id = $search_id - $tolerence_id;
$search_id2 = $search_id + ($tolerence_id * 2);
}
if ($search_od_imp1 != 0 || $search_od_imp2 != 0) {
$search_od = (($search_od_imp1 * 25.4) + ($search_od_imp2 * 25.4));
$search_od = $search_od - $tolerence_od;
$search_od2 = $search_od + ($tolerence_od * 2);
}
if ($search_w_imp1 != 0 || $search_w_imp2 != 0) {
$search_width = (($search_w_imp1 * 25.4) + ($search_w_imp2 * 25.4));
$search_width = $search_width - $tolerence_w;
$search_width2 = $search_width + ($tolerence_w * 2);
}
}
$query = "SELECT * FROM housing_data WHERE ";
if($search_element)
{ $xquery .= " sub_element='".$search_element."' AND "; }
if($search_brand)
{ $xquery .= " brand='".$search_brand."' AND "; }
// BORE
if($search_id != '' & $search_id2 == '' )
{ $xquery .= " id LIKE ".$search_id." AND "; }
else if($search_id != '' & $search_id2 != '' )
{ $xquery .= " ( id>=".$search_id." AND id<=".$search_id2." ) AND "; }
// BHC
$search_od_sml = $search_od - $threshold_metric;
$search_od_big = $search_od + $threshold_metric;
if($search_od != '' & $search_od2 == '' )
{ $xquery .= " (( bhc >=".$search_od_sml." AND bhc <= ".$search_od_big." ) OR bhc = 0 ) AND ";}
else if($search_od != '' & $search_od2 != '' )
{ $xquery .= " (( bhc >=".$search_od_sml." AND bhc <=".$search_od_big." ) OR bhc = 0 ) AND "; }
// HTC
$search_htc_sml = $search_width - $threshold_metric;
$search_htc_big = $search_width + $threshold_metric;
if($search_width != '' & $search_width2 == '' )
{ $xquery .= " (( htc >=".$search_htc_sml." AND htc<=".$search_htc_big.") OR htc = 0 ) AND "; }
else if($search_width != '' & $search_width2 != '' )
{ $xquery .= " (( htc >=".$search_htc_sml." AND htc<=".$search_htc_big." ) OR htc = 0 ) AND "; }
if($search_name)
{
$search_name_strip = $search_name;
$search_name_strip = str_replace(" ", "", $search_name_strip);
$search_name_strip = str_replace("*", "", $search_name_strip);
$search_name_strip = str_replace("/", "", $search_name_strip);
$search_name_strip = str_replace("-", "", $search_name_strip);
$xquery .= " ( designation LIKE '%".$search_name."%' OR designation2 LIKE '%".$search_name_strip."%' OR `insert` LIKE '%".$search_name."%' OR housing_code LIKE '%".$search_name."%' ) AND "; }
$query .= " ".$xquery." 1=1 ORDER BY sub_element,type,id, designation ASC";
// echo $query;
if($_SESSION['company'] != "E. Fox Engineers Ltd")
{ mail("alan.fox@efox.ie", "Brg Search - ".$_SESSION['company']." ".$_SESSION['email']."", $query); }
if($xquery != "")
{
$count = 0;
$current_element = "zzz";
$current_type = "zzz";
$num_results = 0;
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
// $id = $row["id"];
//$od = $row["od"];
//$width = $row["w"];
$type = $row["type"];
$designation = $row["designation"];
//$element = $row["element"];
$sub_element = $row["sub_element"];
if($current_element != $sub_element)
{
// echo " :".$current_element.": != :".$sub_element.": ";
$current_element = $sub_element;
?>
}
}
?>
?>
|
} // if xquery !- ""
} // Valid datestamp
} // if processed
} // logged in
else
{
if($processed || $badlogin)
{
?>
} // processed
} // not logged in
?>
|