| |
Sorry ! Unable To Connect To The Server. Please Try Again !!! ";
print "Error performing query : " . mysql_error() . " ";
exit();
}
mysql_select_db("$vMySQLDatabase", $conn);
if (! @mysql_select_db("hodindia") ){
print "
Sorry ! Unable To Locate The Database At This Time. Please Try Again !!! ";
print "Error performing query : " . mysql_error() . " ";
mysql_close($conn);
exit();
}
if($v_acc_types == ""){
$Result = "";
$Result = " ";
$Result .= "";
$Result .="";
$Result .="| ";
$Result .="Hotels in india - Accommodation Types";
$Result .=" | ";
$Result .=" ";
$Result .=" ";
print $Result;
$Result = "";
// execute query
$QueryClass = "SELECT H_Class_Name, H_Class_Id FROM Hotel_Class_Mast Where H_Class_Status = 't' Order By H_Class_Name";
$ResultClass = mysql_query($QueryClass, $conn);
$NoOfRecord = mysql_num_rows($ResultClass);
$Result .= "";
$Result .="";
$Result .= "";
$Result .=" ";
while($RecordClass = mysql_fetch_assoc($ResultClass)){
$v_class_name = $RecordClass["H_Class_Name"];
$v_class_id = $RecordClass["H_Class_Id"];
// search again hotels in the city
$QueryHotel = "SELECT H_Id FROM Hotel_Mast Where H_Class_Id = $v_class_id AND H_Status = 't' ";
$ResultHotel = mysql_query($QueryHotel, $conn);
$no_of_hotels = mysql_num_rows($ResultHotel);
if ($no_of_hotels > 0) {
$v_class_name=ereg_replace(' ', '_', $v_class_name);
$Result .= " ";
$v_class_name=ereg_replace('_', ' ', $v_class_name);
$Result .= $v_class_name;
$Result .= "";
$Result .= " ";
}// end if - no_of_hotels
}//end while
$Result .="";
$Result .= " | ";
$Result .= " ";
$Result .=" ";
$Result .= " ";
$Result .= " ";
print $Result;
}//
else{
$v_acc_types = ucwords($v_acc_types);
$QueryClass = "SELECT H_Class_Id FROM Hotel_Class_Mast Where H_Class_Name = '$v_acc_types'";
$ResultClass = mysql_query($QueryClass, $conn);
$RecordClass = mysql_fetch_assoc($ResultClass);
$v_class_id = $RecordClass["H_Class_Id"];
//print "v_class_id = $v_class_id";
$QueryCity = "SELECT City_Id, City_Name FROM City_Mast Order By City_Name";
$ResultCity = mysql_query($QueryCity, $conn);
//$RecordCity = mysql_fetch_assoc($ResultCity);
//print "v_city_id = $v_city_id";
$Result = "";
$Result .= "
";
$Result .= "";
$Result .= "";
$Result .= " ";
print $Result;
$Result = "";
$Result .= "";
$Result .= " ";
while($RecordCity = mysql_fetch_assoc($ResultCity)){
$v_city_id = $RecordCity["City_Id"];
$v_city_name = $RecordCity["City_Name"];
// search again hotels in the city
$QueryHotel = "SELECT H_Login, H_Name FROM Hotel_Mast Where City_Id = $v_city_id And H_Class_Id = $v_class_id AND H_Status = 't'";
$ResultHotel = mysql_query($QueryHotel, $conn);
$no_of_ctg_hotels = mysql_num_rows($ResultHotel);
if ($no_of_ctg_hotels != 0){
$Result .= "| ";
$Result .= "";
$Result .= "";
$Result .= $RecordCity["City_Name"];
$Result .= "";
$Result .= "";
$Result .= " [";
$Result .= $no_of_ctg_hotels;
$Result .= "]";
$Result .= " | ";
$Result .= "";
while($RecordHotel = mysql_fetch_assoc($ResultHotel)){
$v_hotel_login = $RecordHotel["H_Login"];
$Result .= "  ";
$Result .= "";
$Result .= "";
$Result .= trim($RecordHotel["H_Name"]);
$Result .= " ";
}//end inner while
$Result .= " | ";
//$Result .= "$v_ctg_id ";
}
}//end while
$Result .= " ";
$Result .= " ";
$Result .= "
";
print $Result;
}
mysql_close($conn);
?>
|