function resolve_ambiguous_event($smarty, $cats, $sanEventName) { $categoryInfo = fixup_url($smarty, $cats); $query = "SELECT EventID, EventName, CategoryID FROM Events WHERE SanitizedEventName='" . $sanEventName . "' AND " . "CategoryID=" . $categoryInfo['categoryID']; if ($query_result = mysql_query($query)) { $num_rows = mysql_num_rows($query_result); if ($num_rows == 1) { $table_row = mysql_fetch_row($query_result); $eventDetails['eventID'] = $table_row[0]; $eventDetails['eventName'] = $table_row[1]; $eventDetails['categoryID'] = $table_row[2]; } ## put redirect or something here } else { # 5xx status code header('HTTP/1.0 500 Internal Server Error'); handle_error_no_exit('ticket_dispatch.code: resolve_ambiguous_event query failed: ' . mysql_error()); $error_message = get_error_message(); $smarty->assign("ErrorMessage", $error_message); $smarty->display('main.tpl'); $smarty->display('error_page.tpl'); } return $eventDetails; }
$smarty->display('error_page.tpl'); } } else { $sanCategoryUrl = mysql_escape_string($cats); $query = "SELECT CategoryID, CategoryName FROM ModifiedPreorderTreeTraversalCategories " . " WHERE CategoryUrl = {$sanCategoryUrl}"; if ($query_result = mysql_query($query)) { $num_rows = mysql_num_rows($query_result); if ($num_rows == 1) { $table_row = mysql_fetch_row($query_result); $_REQUEST['id'] = $table_row[0]; $_REQUEST['name'] = $table_row[1]; mysql_close($dbh); require 'category.php'; exit; } else { fixup_url($smarty, $cats); header('HTTP/1.1 301 Moved Permanently'); header('Location: http://www.mongotickets.com/'); } } else { # 5xx status code header('HTTP/1.0 500 Internal Server Error'); handle_error_no_exit('ticket_dispatch.code: ModifiedPreorderTreeTraversalCategories database query failed: ' . mysql_error()); $error_message = get_error_message(); $smarty->assign("ErrorMessage", $error_message); $smarty->display('main.tpl'); $smarty->display('error_page.tpl'); } } mysql_close($dbh); }
$sql = $db->bindVars($sql, ':rcId:', $_GET['record_company_id'], 'integer'); $sql = $db->bindVars($sql, ':languageId:', $_SESSION['languages_id'], 'integer'); $result = $db->execute($sql); if ($result->RecordCount()) { $zco_notifier->notify('NOTIFY_BEFORE_REDIRECT_ACTION_RECORD_COMPANY', array(), $_GET['record_company_id'], $_SESSION['languages_id']); zen_update_record_company_clicked($_GET['record_company_id'], $_SESSION['languages_id']); zen_redirect(fixup_url($result->fields['record_company_url'])); } else { $sql = "SELECT record_company_url from " . TABLE_RECORD_ARTISTS_INFO . " WHERE record_company_id = :rcId: AND languages_id = :languageId:"; $sql = $db->bindVars($sql, ':rcId:', $_GET['record_company_id'], 'integer'); $sql = $db->bindVars($sql, ':languageId:', DEFAULT_LANGUAGE, 'integer'); $result = $db->execute($sql); if ($result->RecordCount()) { $zco_notifier->notify('NOTIFY_BEFORE_REDIRECT_ACTION_RECORD_COMPANY', array(), $_GET['record_company_id'], $_SESSION['languages_id']); zen_update_record_company_clicked($_GET['record_company_id'], DEFAULT_LANGUAGE); zen_redirect(fixup_url($result->fields['record_company_url'])); } } } break; case 'banner': $banner_query = "SELECT banners_url\r\n FROM " . TABLE_BANNERS . "\r\n WHERE banners_id = :bannersID"; $banner_query = $db->bindVars($banner_query, ':bannersID', $_GET['goto'], 'integer'); $banner = $db->Execute($banner_query); if ($banner->RecordCount() > 0) { zen_update_banner_click_count($_GET['goto']); zen_redirect($banner->fields['banners_url']); } break; case 'manufacturer': if (isset($_GET['manufacturers_id']) && zen_not_null($_GET['manufacturers_id'])) {
if (isset($_GET['products_id']) && zen_not_null($_GET['products_id'])) { $sql = "SELECT products_url from " . TABLE_PRODUCTS_DESCRIPTION . " WHERE products_id = :productId: AND language_id = :languageId:"; $sql = $db->bindVars($sql, ':productId:', $_GET['products_id'], 'integer'); $sql = $db->bindVars($sql, ':languageId:', $_SESSION['languages_id'], 'integer'); $result = $db->execute($sql); if ($result->RecordCount()) { $zco_notifier->notify('NOTIFY_BEFORE_REDIRECT_ACTION_PRODUCT', array(), $_GET['products_id'], $_SESSION['languages_id']); zen_redirect(fixup_url($result->fields['products_url'])); } else { $sql = "SELECT products_url from " . TABLE_PRODUCTS_DESCRIPTION . " WHERE products_id = :productId: AND language_id = :languageId:"; $sql = $db->bindVars($sql, ':productId:', $_GET['products_id'], 'integer'); $sql = $db->bindVars($sql, ':languageId:', DEFAULT_LANGUAGE, 'integer'); $result = $db->execute($sql); if ($result->RecordCount()) { $zco_notifier->notify('NOTIFY_BEFORE_REDIRECT_ACTION_PRODUCT', array(), $_GET['products_id'], $_SESSION['languages_id']); zen_redirect(fixup_url($result->fields['products_url'])); } } } break; case 'banner': $banner_query = "SELECT banners_url\r\n FROM " . TABLE_BANNERS . " \r\n WHERE banners_id = :bannersID"; $banner_query = $db->bindVars($banner_query, ':bannersID', $_GET['goto'], 'integer'); $banner = $db->Execute($banner_query); if ($banner->RecordCount() > 0) { zen_update_banner_click_count($_GET['goto']); zen_redirect($banner->fields['banners_url']); } break; case 'url': if (isset($_GET['goto']) && zen_not_null($_GET['goto'])) {