0){ //if user loaded a tripid from database $tripid = $_SESSION["_tripid"]; } if(isset($_GET["act"])){ if($_GET["act"] . "" == "addtotripplanner" && isset($_GET["o"]) && is_numeric($_GET["o"]) && isset($_GET["i"]) && is_numeric($_GET["i"])){ $categoryid = $_GET["i"]; $interestid = $_GET["o"]; if($categoryid > 0 && $interestid > 0){ if($tripid . "" == ""){ //get a tripid for this sessionid, or generate a new one $query = "select * from tbl_trip_planner_trips where session='$sessionid' and saved='0';"; $rs = mysql_query($query); if($rs && mysql_num_rows($rs) > 0){ $row_rs = mysql_fetch_assoc($rs); $tripid = $row_rs["tripid"]; } else{ $query = "insert into tbl_trip_planner_trips (session, last_accessed, saved) values ('$sessionid', now(), '0');"; mysql_query($query); if(mysql_errno() == 0 && mysql_affected_rows() == 1){ $tripid = mysql_insert_id(); } } mysql_free_result($rs); } //check if this object is in category selected $query = "select * from tbl_trip_planner_interests where categoryid=$categoryid and interestid=$interestid;"; $rs = mysql_query($query); if($rs && mysql_num_rows($rs) > 0){ //get the interest name $query = "select * from tbl_trip_planner_interests where interestid=$interestid;"; $rs = mysql_query($query); $row_rs = mysql_fetch_assoc($rs); mysql_free_result($rs); //check if this object is already in table $query = "select tbl_trip_planner_interests.title, tbl_trip_planner_objects.* from tbl_trip_planner_objects inner join tbl_trip_planner_interests on tbl_trip_planner_interests.interestid=tbl_trip_planner_objects.interestid where tbl_trip_planner_objects.interestid=$interestid and tripid=$tripid;"; $rs = mysql_query($query); if(mysql_errno() == 0){//query is ok if(mysql_num_rows($rs) == 0){ $query = "insert into tbl_trip_planner_objects (tripid, interestid) values (".$tripid.", ".$interestid.")"; mysql_query($query); if(mysql_errno() == 0 && mysql_affected_rows() == 1){ $message = htmlentities($row_rs["title"]) . " has been added to your Trip Plan.
"; $message .= 'Click here to see the Trip Plan.'; $query = "update tbl_trip_planner_trips set last_accessed=now() where tripid=$tripid;"; mysql_query($query); } else{ if(mysql_errno() != 0) $message = mysql_error(); } } else{ $message = htmlentities($row_rs["title"]) . " is already in your Trip Plan.
"; $message .= 'Click here to see the Trip Plan.'; $query = "update tbl_trip_planner_trips set last_accessed=now() where tripid=$tripid;"; mysql_query($query); } } } mysql_free_result($rs); } } } ?> Interests
0){ if($row_rs = mysql_fetch_assoc($rs)){ $category_name = $row_rs["title_menu"]; if($row_rs["categoryid_parent"] . "" != "0"){ //get the parent name mysql_free_result($rs); $query_rs = "SELECT * FROM tbl_trip_planner_categories where categoryid=".$row_rs["categoryid_parent"].";"; $rs = mysql_query($query_rs, $conn) or die(mysql_error()); if($rs && mysql_num_rows($rs)> 0){ if($row_rs = mysql_fetch_assoc($rs)){ $categoryid_parent = $row_rs["categoryid"]; $category_parent_name = $row_rs["title_menu"]; } } } } } mysql_free_result($rs); } ?>
You are here : Home ►Interests
Interests
Contact Us
Name:
E-Mail:
Project Overview:
0){ if($row_rs = mysql_fetch_assoc($rs)){ //title in page echo '

'.$row_rs["title_page"]."\n"; echo '

'.str_replace("\n", "
", htmlentities($row_rs["text_page"]))."\n"; } } mysql_free_result($rs); echo ''; if($message . "" != "") { echo '

'.$message.'

'; } $query_rs = "SELECT tbl_trip_planner_interests.* FROM tbl_trip_planner_interests where categoryid=$categoryid order by title asc;"; $rs = mysql_query($query_rs, $conn) or die(mysql_error()); if($rs && mysql_num_rows($rs) > 0){ ?>

Important! You can use the right side buttons to add the preferred items to your itinerary (Trip Plan). When the plan is complete, please click on Trip Plan to view all items.

'.$row_rs["title"]."
"; echo '
Add '.htmlentities($row_rs["title"]).' to Trip Planner

'; //contact details echo ''.str_replace("\n", "
", $row_rs["text_contact"]) . ""; if(strpos(strtolower($row_rs["link"]), "http://") === 0) { echo " ".$row_rs["link"]."\n"; } echo "\n"; echo '

'.$row_rs["text_description"]."

\n"; } } mysql_free_result($rs); ?>