function list_events_at_venue($smarty, $venueID) { $query = "SELECT Events.EventID, EventName, EventTypeID, VenueName, RegionCode,ProductionID,DATE_FORMAT(EventDate, '%a. %M %e, %Y %h:%i %p'),CategoryUrl,City,Events.CategoryID, SanitizedVenueName FROM Events inner join Productions on (Events.EventID = Productions.EventID) LEFT JOIN Venues on (Productions.VenueID = Venues.VenueID) LEFT JOIN ModifiedPreorderTreeTraversalCategories as c on (Events.CategoryID=c.CategoryID) WHERE Productions.VenueID = '{$venueID}' ORDER BY EventDate ASC"; if ($query_result = mysql_query($query)) { while ($table_row = mysql_fetch_row($query_result)) { $eventID = $table_row[0]; $eventName = $table_row[1]; $eventTypeID = $table_row[2]; $venueName = $table_row[3]; $regionCode = $table_row[4]; $productionID = $table_row[5]; $date = $table_row[6]; $categoryUrl = $table_row[7]; $city = utf8_decode($table_row[8]); $categoryID = $table_row[9]; $sanitizedVenueName = $table_row[10]; if (strlen($eventName) < 1) { handle_error_no_exit('venues.php: empty event name from db query vid=' . $_REQUEST['venue_id'] . ' ' . $_SERVER['REQUEST_URI'] . ' returning 301'); } $prodUrl = make_production_url($eventName, $productionID, $city, $eventTypeID); $eventUrl = make_event_url($eventName); $events[] = array("name" => "{$eventName}", "date" => "{$date}", "event_url" => $eventUrl, "prod_url" => "{$prodUrl}"); } $title = "{$venueName} Tickets, {$venueName} Seating Chart"; $smarty->assign("title", $title); $keywords = "{$venueName} Seating Chart, {$venueName} Tickets"; $smarty->assign("SeoKeywords", $keywords); $smarty->assign("MetaDescr", "{$venueName} Tickets. Buy tickets to events at {$venueName} in {$city}, {$regionCode} at MongoTickets."); $smarty->display('main.tpl'); $breadcrumb_str = '<a href="/">Home</a>'; $venueUrl = make_venue_url($sanitizedVenueName); # $breadcrumb_str = AppendBreadcrumb($breadcrumb_str, "$venueUrl", $venueName); $breadcrumb_str = AppendBreadcrumbNoAnchor($breadcrumb_str, " {$venueName} Tickets"); $smarty->assign("Breadcrumbs", $breadcrumb_str); if (count($events) > 0) { $smarty->assign("venueName", $venueName); $smarty->assign("EventsArray", $events); $smarty->assign("NumEvents", count($events)); $smarty->display('events_at_venue.tpl'); } else { echo "<div id=\"content\">"; echo "<div id=\"breadcrumb_trail\">{$breadcrumb_str}</div>"; echo "<div id=\"no_tickets\">"; echo "<h1>{$venueName} Events</h1>"; echo "<p>There are currently no events at {$venueName}</p>"; echo "</div>"; } } else { # 5xx status code header('HTTP/1.0 500 Internal Server Error'); handle_error_no_exit('venues.code:list_events_at_venue(): query failed because: ' . mysql_error() . ' ' . $_SERVER['REQUEST_URI'] . ' returning 500'); $error_message = get_error_message(); $smarty->assign("ErrorMessage", $error_message); $smarty->display('main.tpl'); $smarty->display('error_page.tpl'); } }
redir_301($url); } else { handle_error_no_exit('tickets.new_urls.php: query failed during redirect find: ' . mysql_error() . ' production id' . $id . ' eventid=' . $_REQUEST['event_id'] . ' uri= ' . $_SERVER['REQUEST_URI'] . ' to home returning 301'); redir_301(); } } } else { header('HTTP/1.0 500 Internal Server Error'); handle_error_no_exit('tickets.code: query failed: production id' . $id . ' eventid=' . $_REQUEST['event_id'] . ' uri= ' . $_SERVER['REQUEST_URI'] . ' ' . mysql_error()); $error_message = get_error_message(); $smarty->assign("ErrorMessage", $error_message); $smarty->display('main.tpl'); $smarty->display('error_page.tpl'); } if ($regionCode != '') { $venueUrl = make_venue_url($sanitizedVenueName); } $soapclient = new nusoap_client($serverpath); $method = 'SearchTickets'; $soapAction = $namespace . $method; $id = 828731; $param = array('SecurityToken' => "{$securitytoken}", 'ProductionID' => "{$id}", 'MaximumPrice' => ''); // make the call $result = $soapclient->call($method, $param, $namespace, $soapAction); # header('Content-Type: text/xml; '); # print($soapclient->response); echo '<pre>' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '</pre>'; exit; $tickets = array(); // if a fault occurred, output error info if (isset($fault)) {
function list_events_at_venue($smarty, $venueID) { $query = "SELECT Events.EventID, EventName, EventTypeID, VenueName, RegionCode,ProductionID,DATE_FORMAT(EventDate, '%a. %M %e, %Y'),CategoryUrl,City,Events.CategoryID, SanitizedVenueName, Address1, PostalCode,DATE_FORMAT(EventDate, '%h:%i %p') FROM Events inner join Productions on (Events.EventID = Productions.EventID) LEFT JOIN Venues on (Productions.VenueID = Venues.VenueID) LEFT JOIN ModifiedPreorderTreeTraversalCategories as c on (Events.CategoryID=c.CategoryID) WHERE Productions.VenueID = '{$venueID}' AND DATEDIFF(NOW(), EventDate) <= 0 ORDER BY EventDate ASC"; if ($query_result = mysql_query($query)) { $num_rows = mysql_num_rows($query_result); while ($table_row = mysql_fetch_row($query_result)) { $eventID = $table_row[0]; $eventName = $table_row[1]; $eventTypeID = $table_row[2]; $venueName = $table_row[3]; $regionCode = $table_row[4]; $productionID = $table_row[5]; $date = $table_row[6]; $categoryUrl = $table_row[7]; $city = utf8_decode($table_row[8]); $categoryID = $table_row[9]; $sanitizedVenueName = $table_row[10]; $address1 = $table_row[11]; $zipcode = $table_row[12]; $productionTime = $table_row[13]; if (strlen($eventName) < 1) { handle_error_no_exit('venues.php: empty event name from db query vid=' . $_REQUEST['venue_id'] . ' ' . $_SERVER['REQUEST_URI'] . ' returning 301'); redir_301(); } $venueUrl = make_venue_url($sanitizedVenueName); $prodUrl = make_production_url($eventName, $productionID, $city, $eventTypeID); $eventUrl = make_event_url($eventName); $events[] = array("name" => "{$eventName}", "date" => "{$date}", "event_url" => $eventUrl, "prod_url" => "{$prodUrl}", "venue_url" => "{$venueUrl}", "event_id" => $eventID, "time" => "{$productionTime}"); } if ($num_rows < 1) { $query = "SELECT VenueName, Address1, RegionCode,City,PostalCode FROM Venues WHERE VenueID = '{$venueID}'"; if ($query_result = mysql_query($query)) { $num_rows = mysql_num_rows($query_result); while ($table_row = mysql_fetch_row($query_result)) { $venueName = $table_row[0]; $address1 = $table_row[1]; $regionCode = $table_row[2]; $city = utf8_decode($table_row[3]); $zipcode = $table_row[4]; } if ($num_rows < 1) { handle_error_no_exit('venues.new_urls.php: no productions at venue and cannot find venue id in database vid=' . $_REQUEST['venue_id'] . ' ' . $_SERVER['REQUEST_URI'] . ' returning 301'); redir_301(); } } } $title = "{$venueName} Tickets, {$venueName} Seating Chart"; $smarty->assign("title", $title); $keywords = "{$venueName} Seating Chart, {$venueName} Tickets"; $smarty->assign("SeoKeywords", $keywords); $smarty->assign("MetaDescr", "{$venueName} Tickets. Buy tickets to events at {$venueName} in {$city}, {$regionCode} at MongoTickets."); $smarty->display('main.tpl'); $breadcrumb_str = '<a href="/">Home</a>'; # $venueUrl = make_venue_url($sanitizedVenueName); # $breadcrumb_str = AppendBreadcrumb($breadcrumb_str, "$venueUrl", $venueName); $breadcrumb_str = AppendBreadcrumbNoAnchor($breadcrumb_str, " {$venueName} Tickets"); $smarty->assign("Breadcrumbs", $breadcrumb_str); if (count($events) > 0) { $venueMapUrl = GetVenueMapUrl($venueID, $events[0]['event_id']); } else { $venueMapUrl = GetVenueMapUrl($venueID, 1); } $address1 = htmlspecialchars($address1); $smarty->assign("Address", $address1); $smarty->assign("City", $city); $smarty->assign("ZipCode", $zipcode); $smarty->assign("State", $regionCode); $smarty->assign("venueName", $venueName); $smarty->assign("EventsArray", $events); $smarty->assign("NumEvents", count($events)); $smarty->assign("Address", $address1); $smarty->assign("City", $city); $smarty->assign("ZipCode", $zipcode); $smarty->assign("State", $regionCode); $smarty->assign("SeatingChartUrl", $venueMapUrl); $smarty->display('events_at_venue.tpl'); #else { # echo '<div id="content">'; # echo '<div class="left_bar">'; # echo "<div id=\"breadcrumb_trail\">$breadcrumb_str</div>"; # echo "<div id=\"no_tickets\">"; # echo "<h1>$venueName Events</h1>"; # echo '<p>Address: 4 Yawkey Way<br/>'; # echo 'City: Boston<br/>'; # echo 'State: MA<br/>'; # echo 'Zip: 02215'; # echo '</p>'; # echo '<h2><strong>Events at ' . $venueName . '</strong></h2>'; # echo "<p>There are currently no events at $venueName.</p>"; # echo "</div>"; # echo "</div> <!-- end left_bar -->"; # $smarty->display('right_bar.tpl'); # $smarty->display('left_column.tpl'); #} } else { # 5xx status code header('HTTP/1.0 500 Internal Server Error'); handle_error_no_exit('venues.code:list_events_at_venue(): query failed because: ' . mysql_error() . ' ' . $_SERVER['REQUEST_URI'] . ' returning 500'); $error_message = get_error_message(); $smarty->assign("ErrorMessage", $error_message); $smarty->display('main.tpl'); $smarty->display('error_page.tpl'); } }
<?php # # Copyright (c) 2007, Jassen Moran. All rights reserved. # Quad tickets Confidential Proprietary. # require_once '../include/new_urls/ticket_db.php'; include_once '../include/host_info.inc.php'; require_once '../include/new_urls/url_factory.inc.php'; $dbh = mysql_connect($host_name, $db_username, $db_password) or die('I cannot connect to the database because: ' . mysql_error()); mysql_select_db($db_name); for ($i = 2; $i < 5; $i++) { echo "\n\n"; $Bsql = 'SELECT VenueName, SanitizedVenueName, COUNT(Productions.ProductionID) as num_prods FROM Venues inner join Productions on (Venues.VenueID = Productions.VenueID) inner join Events on (Events.EventID = Productions.EventID) WHERE EventTypeID=' . $i . ' GROUP BY Venues.VenueID ORDER BY num_prods DESC LIMIT 10'; if ($query_result = mysql_query($Bsql)) { $ary = array(); while ($table_row = mysql_fetch_array($query_result)) { echo "\n" . '<a href="' . make_venue_url($table_row['SanitizedVenueName']) . '">' . $table_row['VenueName'] . '</a>'; } } else { handle_error_no_exit(': ' . mysql_error()); } }
if ($query_result = mysql_query($bsql)) { while ($table_row = mysql_fetch_array($query_result)) { $eventName = $table_row['EventName']; $eventID = $table_row['EventID']; $categoryID = $table_row['CategoryID']; $url = make_event_url($eventName); $s->addItem($url, $dt, 'daily', '0.5'); } } else { echo "Database error when getting all other events!"; } $bsql = "SELECT SanitizedVenueName FROM `Venues` WHERE 1"; if ($query_result = mysql_query($bsql)) { while ($table_row = mysql_fetch_array($query_result)) { $sanVenueName = $table_row['SanitizedVenueName']; $url = make_venue_url($sanVenueName); $s->addItem($url, $dt, 'daily', '0.4'); } } else { echo "Database error when getting all venues!"; } mysql_close($dbh); } else { handle_error_no_exit('main.code: I cannot connect to the database because: ' . mysql_error()); } #$_GET['target'] = 'google'; $_GET['target'] = 'google'; // output sitemap if (isset($_GET['target'])) { // generate Google sitemap if (($target = $_GET['target']) == 'google') {