 |
|
$Breadcrumburl = "http://www.12travel.com/ie/";
$Breadcrumbfile = "/index.html";
//stuff to use when geo-coords are on region database
//$geo_x=9.21;
//$geo_y=51.6;
//$Map = "http://images.12travel.com/geomap/drawmap.html?longitude=$geo_x&latitude=$geo_y";
include ('/home/sites/site5/require/req.html');
$db = "traveldb";
$connection = pg_connect("port=$port host=$server dbname=$db user=$user") or die("Invalid server or user");
// formulate the SQL query
$query = "SELECT attraction.name_english as att_name,
attraction_category.name_english as att_category_name,
attraction_discount.name_english as att_discount_name,
*
FROM attraction, attraction_category, attraction_discount, currency
WHERE attraction.attraction_id = $this_attraction
AND attraction.attraction_category_id = attraction_category.attraction_category_id
AND attraction.currency_id = currency.currency_id
AND attraction.attraction_discount_id = attraction_discount.attraction_discount_id"
or die("Error in query");
// run the query on the database
$result = pg_exec($connection, $query) or die("Error in query");
$att_row = @pg_fetch_array($result,0);
// set variables to be used later - mostly just access the myrow column directly
$att_name = $att_row["att_name"];
// memory flush
pg_FreeResult($result);
// formulate the SQL query to find hotel content
$query = "SELECT short_text FROM content_text WHERE content_text.attraction_id = $this_attraction"
or die ("Error in query");
$result = pg_exec($connection, $query) or die("Error in query");
$accom_text_array = @pg_fetch_array($result,0); //suppressing the error when the query returns empty fields
$accom_text = $accom_text_array["short_text"];
if ($accom_text)
{
$accom_text = ' '.ereg_replace("(\r\n|\r|\n)"," <>",$accom_text).'';
}
else
{
$accom_text = "History on this Attraction is currently unavailable.";
}
?>
HOME : ATTRACTIONS
:
|
| |
echo $att_name ?> |
//Format the atraction name to find the correct text file for display
$att_text_location = "/home/sites/site5/web/text/attractions/en/";
$att_image_location = "/images/wales/attraction/";
$att_name_formatted = strtolower($att_name);
$att_name_formatted = str_replace(" ", "", $att_name_formatted);
$att_text = $att_text_location.$att_name_formatted.".html";
$att_image1 = "/home/sites/site5/web".$att_image_location.$att_name_formatted.".jpeg";
$att_image2 = "http://images.12travel.com".$att_image_location.$att_name_formatted.".jpeg";
$alt_tag = $att_name;
$fp = @fopen($att_image1,"r");
if ($fp)
{
fclose ($fp);
echo " ";
}
else
{
echo "";
}
?>
echo $accom_text;
?>
echo "MORE..
";
?>
|
| Category |
echo $att_row["att_category_name"];?>
|
| Address |
$query = "SELECT street, town, directions_english, county.name as county_name
FROM address, county
WHERE address.attraction_id = $this_attraction
AND address.county_id = county.county_id"
or die("Error in query");
// run the query on the database
$result = pg_exec($connection, $query) or die("Error in query");
$address_row = @pg_fetch_array($result,0);
if ($address_row =='NULL')
{
echo " | No Address available | ";
}
else
{
echo $address_row["street"]." ".$address_row["town"].", Co ".$address_row["county_name"];
}
?>
| Directions |
echo $address_row["directions_english"]; ?>
|
|
| Opening Times |
//get the opening times
$query = "SELECT *
FROM attraction_opening
WHERE attraction_opening.attraction_id = $this_attraction"
or die("Error in query");
// run the query on the database
$result = pg_exec($connection, $query) or die("Error in query");
$limit = pg_numrows($result);
// with a while loop
// this loop will iterate as many times as there are records
if ($limit==0)
{
echo "| No Opening times available | ";
}
else
{
//set the column headings
echo "
| Date |
Day |
Time | ";
while($rownum < $limit)
{
$opening_row = pg_fetch_array($result, $rownum);
echo "| ";
echo $opening_row["date_english"]." | ";
echo "";
echo $opening_row["day_english"]." | ";
echo "";
// format time for display 00:00:00
$open_time = substr($opening_row["opening_time"],0,5);
$close_time = substr($opening_row["closing_time"],0,5);
echo $open_time."-".$close_time." | ";
$rownum++;
}
}
// memory flush
pg_FreeResult($result);
?>
|
|
echo ereg_replace("(\r\n|\r|\n)"," ",$att_row["opening_comment_english"]); ?>
|
| Visit Length |
// assuming never more than 10 hrs - 00:00:00
$visit_hour = substr($att_row["visit_length_average"],1,1);
if ($visit_hour>0) echo $visit_hour."hr ";
$visit_min = substr($att_row["visit_length_average"],3,2);
if ($visit_min>0) echo $visit_min."min ";
?>
|
|
| Admission |
// display message if there are no fees
if (($att_row["fee_adult"]==0) & ($att_row["fee_child"]==0) & ($att_row["fee_student"]==0) & ($att_row["fee_family"]==0) & ($att_row["fee_senior"]==0) & ($att_row["fee_group"]==0))
{echo "| No admission fees | ";}
else
{
echo
"
| Adult |
".$att_row["symbol"].$att_row["fee_adult"]." | ";
echo
"Child |
".$att_row["symbol"].$att_row["fee_child"]." | ";
echo "
| Student |
".$att_row["symbol"].$att_row["fee_student"]." | ";
echo
"Senior |
".$att_row["symbol"].$att_row["fee_senior"]." | ";
echo
"
| Family |
".$att_row["symbol"].$att_row["fee_family"]." | ";
echo
"Group |
".$att_row["symbol"].$att_row["fee_group"]." | ";
echo " ";
}
?>
echo $att_row["fee_group_comment"]." ";
echo "*".$att_row["att_discount_name"]; ?> |
|
| Information |
| Leaflets:
if ($att_row["leaflet"]) {echo "Yes";} else {echo "No";} ?>
|
Guided
Tours:
if ($att_row["guided_tour"]) {echo "Yes";} else {echo "No";} ?>
|
Audio
Visual:
if ($att_row["av_presentation"]) {echo "Yes";} else {echo "No";} ?>
|
Exhibition:
if ($att_row["exhibition"]) {echo "Yes";} else {echo "No";} ?>
|
| Facilities |
| Restaurant:
if ($att_row["restaurant"]) {echo "Yes";} else {echo "No";} ?>
|
Car
Park:
if ($att_row["car_parking"]) {echo "Yes";} else {echo "No";} ?>
|
Coach
Park:
if ($att_row["coach_parking"]) {echo "Yes";} else {echo "No";} ?>
|
Disabled
Access:
if ($att_row["disabled_access"]) {echo "Yes";} else {echo "No";} ?>
|
|
|
|
| |
| |
| |
| NEWSLETTER |
| |
 |
|
| |
| |
|