예제 #1
0
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, "&nbsp;{$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');
    }
}
예제 #2
0
function GetProductionList($eventID, $eventName, $home_only)
{
    include '../include/host_info.inc.php';
    if ($home_only == 1) {
        $bsql = "SELECT ProductionID, DATE_FORMAT(EventDate, '%a. %M %e, %Y %h:%i %p'), VenueName, e1.EventName, e1.EventTypeID, City, RegionCode, e2.EventID, e2.EventName, ShortNote FROM Productions left join Venues on (Venues.VenueID = Productions.VenueID) left join Events as e1 on (e1.EventID = Productions.EventID) left join Events as e2 on (e2.EventID = Productions.OpponentEventID) where Productions.EventID=" . $eventID . " ORDER BY EventDate ASC";
    } else {
        $bsql = "SELECT ProductionID, DATE_FORMAT(EventDate, '%a. %M %e, %Y %h:%i %p'), VenueName, e1.EventName, e1.EventTypeID, City, RegionCode, e2.EventID, e2.EventName, ShortNote FROM Productions left join Venues on (Venues.VenueID = Productions.VenueID) left join Events as e1 on (e1.EventID = Productions.EventID) left join Events as e2 on (e2.EventID = Productions.OpponentEventID) where Productions.EventID=" . $eventID . " OR Productions.OpponentEventID=" . $eventID . " ORDER BY EventDate ASC";
    }
    $num_productions = 0;
    $count = 0;
    if ($query_result = mysql_query($bsql)) {
        while ($table_row = mysql_fetch_row($query_result)) {
            $productionID = $table_row[0];
            $eventDate = preg_replace('/11:59 PM$/', 'TBD', $table_row[1]);
            $venueName = utf8_decode($table_row[2]);
            $homeEventName = $table_row[3];
            $eventTypeID = $table_row[4];
            $city = utf8_decode($table_row[5]);
            $regionCode = $table_row[6];
            $opponentEventID = $table_row[7];
            $opponentEventName = $table_row[8];
            $shortNote = utf8_decode($table_row[9]);
            $shortNote = str_replace('?', '-', $shortNote);
            if ($opponentEventID != 1 && $opponentEventID != "") {
                if ($eventTypeID == 3) {
                    if ($eventName == $homeEventName) {
                        $eventDescr = "{$opponentEventName}";
                    } else {
                        $eventDescr = " at {$homeEventName}";
                    }
                } else {
                    if ($eventTypeID == 2) {
                        $eventDescr = "{$homeEventName} w/{$opponentEventName}";
                    }
                }
            } elseif ($eventID == 1124) {
                $eventName .= " {$shortNote}";
                $eventDescr = $eventName;
            } else {
                $eventDescr = "{$homeEventName}";
            }
            $url = make_production_url($eventName, $productionID);
            $productions[] = array("eventname" => "{$eventName}", "url" => "{$url}", "venuename" => "{$venueName}<br />{$city}, {$regionCode}", "date" => "{$eventDate}<br />{$shortNote}", "eventid" => "{$eventID}", "eventDescr" => "{$eventDescr}");
            $count++;
            $num_productions++;
        }
        if ($num_productions < 1) {
            $productions = 0;
        }
    } else {
        handle_error_no_exit('GetProductionList: ' . mysql_error());
        $productions = "Error";
    }
    return $productions;
}
function ticketslist_to_sorted_grouped($sortBy, $sortOrder, $ticket_list, $startFrom, $eventName, $eventDate, $venueName, $productionID, $city)
{
    include '../include/host_info.inc.php';
    global $query_string;
    global $eventTypeID;
    # Section Row Price Seat Quanity Button
    $SECTION_WIDTH = "29%";
    $ROW_WIDTH = "15%";
    $PRICE_WIDTH = "15%";
    $SEAT_WIDTH = "13%";
    $QUANTITY_WIDTH = "12%";
    $BUYNOW_WIDTH = "16%";
    $MAX_TIX_PP = 500;
    $NUM_TIX_PP = $MAX_TIX_PP;
    echo '<div class="tickets">';
    $num_pages = ceil((double) count($ticket_list) / (double) $MAX_TIX_PP);
    #echo count($ticket_list) . " tickets sets available for this Event<br/>";
    if ($num_pages > 1) {
        print_page_nav($startFrom, $num_pages, $sortBy, $sortOrder, $productionID);
    }
    $image_path = "{$root_url}/Images/";
    $image_up = "arrow-up.gif";
    $image_down = "arrow-down.gif";
    $image_none = "arrow-none.gif";
    $ticket_limit_reached = 0;
    if ($sortBy == 'sec' || $sortBy == 'row') {
        foreach ($ticket_list as $key => $row) {
            $SeatSection[$key] = $row['SeatSection'];
            $TicketPrice[$key] = $row['TicketPrice'];
            $SeatRow[$key] = $row['SeatRow'];
        }
        if ($sortOrder == 'desc') {
            $sortOrderCode = SORT_DESC;
        } else {
            $sortOrderCode = SORT_ASC;
        }
        if ($sortBy == 'sec') {
            array_multisort($SeatSection, $sortOrderCode, $TicketPrice, SORT_ASC, $ticket_list);
        } else {
            array_multisort($SeatRow, $sortOrderCode, $TicketPrice, SORT_ASC, $ticket_list);
        }
        $sorted_array = $ticket_list;
    } elseif ($sortBy == 'pr') {
        if ($sortOrder == 'desc') {
            $sorted_array = $ticket_list;
        } else {
            $sorted_array = array_reverse($ticket_list);
        }
    } else {
        $sorted_array = array_reverse($ticket_list);
    }
    echo '<table  width="100%" cellspacing="0">';
    $url = make_production_url($eventName, $productionID, $city, $eventTypeID);
    $url_array = explode('?', $url);
    $url = $url_array[0];
    $query_string = "&event_id={$productionID}";
    echo "<tr class=\"tableHeading\">";
    $sortable_columns = array("sec" => "Section", "row" => "Row", "pr" => "Price");
    foreach ($sortable_columns as $columnID => $columnHeading) {
        if (strlen($sortBy) == 0 && $columnID == 'pr') {
            $nextSortOrder = 'desc';
            $arrow = $image_path . $image_up;
        } elseif ($sortBy == $columnID) {
            if ($sortOrder == 'desc') {
                $nextSortOrder = 'asc';
                $arrow = $image_path . $image_down;
            } else {
                $nextSortOrder = 'desc';
                $arrow = $image_path . $image_up;
            }
        } else {
            $nextSortOrder = 'asc';
            $arrow = $image_path . $image_none;
        }
        if ($columnID == 'sec') {
            echo '<th width="' . $SECTION_WIDTH . '">';
        } elseif ($columnID == 'pr') {
            echo '<th width="' . $PRICE_WIDTH . '">';
        } else {
            echo '<th width="' . $ROW_WIDTH . '">';
        }
        $url_sort_params = $url . "?sortBy={$columnID}&sortOrder={$nextSortOrder}" . $query_string;
        echo '<a href="' . $url_sort_params . "\">{$columnHeading}</a><img src=\"{$arrow}\" alt=\"&darr;\"/></th>";
    }
    echo '<th width="' . $SEAT_WIDTH . '">Seat No.</th><th width="' . $QUANTITY_WIDTH . '">Quantity</th><th width="' . $BUYNOW_WIDTH . '">&nbsp;&nbsp;</th>';
    echo "</tr>";
    echo "</table>";
    $ticket_index = 1;
    for ($j = ($startFrom - 1) * $MAX_TIX_PP; $j < $startFrom * $MAX_TIX_PP - 1 && $j < count($sorted_array); $j++) {
        # foreach($sorted_array as $index=>$ticket_info) {
        # echo '<form action="/ticket_order.html" method="post">';
        echo '<table width="100%" cellspacing="0">';
        if ($ticket_index % 2 == 0) {
            $class = "class=\"even\"";
        } else {
            $class = "class=\"odd\"";
        }
        echo "\n<tr {$class}>";
        echo '<td width="' . $SECTION_WIDTH . '"><strong>Section: </strong>' . $sorted_array[$j]['SeatSection'] . "\n" . '</td><td width="' . $ROW_WIDTH . '"><strong>Row: </strong>' . $sorted_array[$j]['SeatRow'] . '</td><td width="' . $PRICE_WIDTH . '">' . $sorted_array[$j]['TicketPrice'] . '</td><td width="' . $SEAT_WIDTH . '">' . $sorted_array[$j]['SeatFrom'] . "-" . $sorted_array[$j]['SeatThru'] . '</td><td width="' . $QUANTITY_WIDTH . '"> ';
        $section_lower = strtolower($sorted_array[$j]['SeatSection']);
        $seat_lower = strtolower($sorted_array[$j]['SeatRow']);
        if (preg_match("/^lawn\$/", $section_lower) || preg_match("/^ga\$/", $section_lower) || preg_match("/^g\\.a\$/", $section_lower) || preg_match("/^ga\$/", $seat_lower) || preg_match("/^g\\.a\\.\$/", $section_lower) || preg_match("/^ga\\.\$/", $seat_lower)) {
            $min_num_tickets = 1;
        } else {
            if ($sorted_array[$j]['Available'] % 2 == 0) {
                $min_num_tickets = 2;
            } else {
                $min_num_tickets = 1;
                $max_num_tickets = $sorted_array[$j]['Available'];
                $num_tickets_array = array();
                for ($num_tickets = $min_num_tickets; $num_tickets <= $max_num_tickets; $num_tickets++) {
                    if ($max_num_tickets - $num_tickets != 1) {
                        $num_tickets_array[] = $num_tickets;
                    }
                }
                $num_tickets_descending_array = array_reverse($num_tickets_array);
            }
        }
        $ticketid = $sorted_array[$j]['TicketID'];
        echo "\n<span class=\"tiny\">Up to " . $sorted_array[$j]['Available'] . " Available</span>";
        echo "</td>";
        #########
        # OLD, non-framed
        echo '<td width="' . $BUYNOW_WIDTH . '"><a href="https://www.ticketsnow.com/buytickets.aspx?id=' . $ticketid . '&reqqty=0&client=4089" rel="nofollow"><img src="/Images/buy_tix.png" onmouseover="this.src=\'/Images/buy_tix_mouse_over.png\';" onmouseout="this.src=\'/Images/buy_tix.png\';" alt="' . "Buy {$eventName} {$venueName} Section " . $sorted_array[$j]['SeatSection'] . " Row " . $sorted_array[$j]['SeatRow'] . ' tickets"/></a>';
        # echo ' <input type="image" src="/Images/buy_tix.png" onmouseover="this.src=\'/Images/buy_tix_mouse_over.png\';" onmouseout="this.src=\'/Images/buy_tix.png\';" value="Submit" alt="' . "Buy $eventName $venueName Section " . $sorted_array[$j]['SeatSection'] . " Row " . $sorted_array[$j]['SeatRow'] . ' tickets" /></td>';
        #########
        echo '<td width="18%">';
        # echo '<input type="hidden" name="ticket_id" value="' . $ticketid . '"/>';
        # echo '<input type="hidden" name="event_name" value="' . $eventName . '"/>';
        # echo '<input type="hidden" name="event_date" value="' . $eventDate . '"/>';
        # echo '<input type="hidden" name="venue_name" value="' . $venueName . '"/>';
        # echo '<input type="hidden" name="quantity" value="0"/>';
        # echo ' <input type="image" src="/Images/buy_tix.png" onmouseover="this.src=\'/Images/buy_tix_mouse_over.png\';" onmouseout="this.src=\'/Images/buy_tix.png\';" value="Submit" alt="' . "Buy $eventName $venueName Section " . $sorted_array[$j]['SeatSection'] . " Row " . $sorted_array[$j]['SeatRow'] . ' tickets" /></td>';
        # echo '<input type="hidden" name="quantity" value="0"/> <input type="image" src="/Images/buy_tix.png" value="Submit" alt="' . "Buy $eventName $venueName Section " . $sorted_array[$j]['SeatSection'] . " Row " . $sorted_array[$j]['SeatRow'] . ' tickets" /></td>';
        # old echo '<input type="hidden" name="quantity" value="0"/> <button title="Buy these Tickets." type="submit" name="submit" value="1">Order</button></td>';
        #echo "<td><span class=tiny>" . utf8_decode($sorted_array[$j]['Descr']) . "</span>&nbsp;</td>";
        #		# echo "</form>";
        echo "</tr>";
        echo "<tr {$class}><td style=\"text-align=left;\" colspan=\"6\"><span class=\"tiny\">" . utf8_decode($sorted_array[$j]['Descr']) . "</span></td></tr>";
        echo "</table>";
        #echo "</form>";
        $ticket_index++;
    }
    if ($num_pages > 1) {
        print_page_nav($startFrom, $num_pages, $sortBy, $sortOrder, $productionID);
    }
    echo "</div>";
}
    mysql_select_db($db_name);
    $bsql = "SELECT MinCost, ProductionID, PostalCode, RegionCode, City, EventName, DATE_FORMAT(EventDate, '%Y-%m-%e') as event_date, DATE_FORMAT(EventDate, '%Y-%m-%eT%T-07:00') as event_time, DATE_FORMAT(EventDate, '%m/%e/%Y %r') as event_date_time_title, CategoryID, VenueName FROM Productions INNER JOIN Events  ON (Events.EventID=Productions.EventID) INNER JOIN Venues ON (Venues.VenueID=Productions.VenueID) WHERE EventTypeID=2";
    if ($query_result = mysql_query($bsql)) {
        while ($table_row = mysql_fetch_array($query_result)) {
            $prodID = $table_row['ProductionID'];
            $postalCode = $table_row['PostalCode'];
            $regionCode = $table_row['RegionCode'];
            $city = utf8_decode($table_row['City']);
            $eventName = $table_row['EventName'];
            $eventDate = $table_row['event_date'];
            $eventTime = $table_row['event_time'];
            $eventDateTimeTitle = $table_row['event_date_time_title'];
            $categoryID = $table_row['CategoryID'];
            $venueName = $table_row['VenueName'];
            $price = $table_row['MinCost'];
            $url = make_production_url($eventName, $prodID, $city, 2);
            if (strlen($city) > 0) {
                $feed->addItem($url, 'Concert Tickets', $prodID, "{$eventName} {$eventDateTimeTitle} \${$price}", $eventDate, $eventTime, $venueName, $city, $regionCode, $postalCode, $price);
            }
            # else skip production
        }
    } else {
        echo "Database error when getting Events!";
    }
    mysql_close($dbh);
} else {
    handle_error_no_exit('main.code: I cannot connect to the database because: ' . mysql_error());
}
$feed->getOodle();
?>
 
예제 #5
0
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, "&nbsp;{$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');
    }
}
 if ($query_result = mysql_query($Bsql)) {
     $num_rows = mysql_num_rows($query_result);
     if ($num_rows > 0) {
         while ($table_row = mysql_fetch_row($query_result)) {
             $eventID = $table_row[0];
             # not used, was causing bug
             $venueName = $table_row[1];
             $eventDate = $table_row[2];
             $city = utf8_decode($table_row[3]);
             $regionCode = $table_row[4];
             $venueID = $table_row[5];
             $productionID = $table_row[6];
             $eventName = $table_row[7];
             $categoryID = $table_row[8];
             $eventTypeID = $table_row[9];
             $url = make_production_url($eventName, $productionID, $city, $eventTypeID);
             $venueNameLocation = "{$venueName}, {$city}, {$regionCode}";
             $productions[] = array("date" => $eventDate, "venuename" => $venueNameLocation, "eventDescr" => "{$eventName}", "url" => "{$url}");
         }
     } else {
         handle_error_no_exit('tickets_for_venue.php: EventID and city lookup returned 0 results: eventID=' . $eventID . ' sancity= ' . $sanCity . ' : attempting to find appropriate redirect ' . $_SERVER['REQUEST_URI'] . ' ');
         $Bsql = "SELECT EventName FROM Events where EventID={$eventID}";
         if ($query_result = mysql_query($Bsql)) {
             $num_rows = mysql_num_rows($query_result);
             if ($num_rows == 1) {
                 $urlEventName = '';
                 while ($table_row = mysql_fetch_row($query_result)) {
                     $eventName = $table_row[0];
                     # not used, was causing bug
                     $urlEventName = make_event_url($eventName);
                     $urlEventName = ltrim($urlEventName, '/');
                    }
                }
                $title .= " Tickets";
                $eventDate = $table_row['event_date'];
                $eventTimeRss = $table_row['event_time_rss'];
                $eventDateTimeTitle = $table_row['event_date_title'];
                if ($table_row['event_date_time_title'] != '11:59 PM') {
                    $eventDateTimeTitle .= ' ' . $table_row['event_time_title'];
                }
                $categoryID = $table_row['CategoryID'];
                $venueName = $table_row['VenueName'];
                $price = $table_row['MinCost'];
                if (substr_count($price, '.') == 0) {
                    $price .= '.00';
                }
                $url = make_production_url($eventName, $prodID, $city, $event_type);
                if (strlen($city) > 0) {
                    $feed->addItem($url, $category, $prodID, $title, $eventDate, $eventTimeRss, $venueName, $city, $regionCode, $postalCode, $price);
                }
                # else skip production
            }
        } else {
            echo "Database error when getting Events!";
        }
    }
    mysql_close($dbh);
} else {
    handle_error_no_exit('main.code: I cannot connect to the database because: ' . mysql_error());
}
$feed->getOodle();
?>
예제 #8
0
function GetProductionList($eventID, $eventName, $home_only, $categoryID, $max_display)
{
    include '../include/host_info.inc.php';
    $Bsql = "SELECT CategoryUrl FROM ModifiedPreorderTreeTraversalCategories " . " WHERE CategoryID = {$categoryID}";
    $result = mysql_query($Bsql);
    while ($row = mysql_fetch_array($result)) {
        $categoryUrl = $row['CategoryUrl'];
    }
    if ($home_only == 1) {
        $bsql = "SELECT ProductionID, DATE_FORMAT(EventDate, '%a. %M %e, %Y %h:%i %p'), VenueName, e1.EventName, e1.EventTypeID, City, RegionCode, e2.EventID, e2.EventName, ShortNote, DATE_FORMAT(EventDate, '%M %e, %Y') FROM Productions left join Venues on (Venues.VenueID = Productions.VenueID) left join Events as e1 on (e1.EventID = Productions.EventID) left join Events as e2 on (e2.EventID = Productions.OpponentEventID) where Productions.EventID=" . $eventID . " AND DATEDIFF(NOW(), EventDate) <= 0 ORDER BY EventDate ASC";
    } elseif ($home_only <= 0) {
        $bsql = "SELECT ProductionID, DATE_FORMAT(EventDate, '%a. %M %e, %Y %h:%i %p'), VenueName, e1.EventName, e1.EventTypeID, City, RegionCode, e2.EventID, e2.EventName, ShortNote, DATE_FORMAT(EventDate, '%M %e, %Y') FROM Productions left join Venues on (Venues.VenueID = Productions.VenueID) left join Events as e1 on (e1.EventID = Productions.EventID) left join Events as e2 on (e2.EventID = Productions.OpponentEventID) where Productions.EventID=" . $eventID . " OR Productions.OpponentEventID=" . $eventID . " AND DATEDIFF(NOW(), EventDate) <= 0 ORDER BY EventDate ASC";
    } elseif ($home_only == 2) {
        $bsql = "SELECT ProductionID, DATE_FORMAT(EventDate, '%a. %M %e, %Y %h:%i %p'), VenueName, e1.EventName, e1.EventTypeID, City, RegionCode, e2.EventID, e2.EventName, ShortNote, DATE_FORMAT(EventDate, '%M %e, %Y') FROM Productions left join Venues on (Venues.VenueID = Productions.VenueID) left join Events as e1 on (e1.EventID = Productions.EventID) left join Events as e2 on (e2.EventID = Productions.OpponentEventID) where Productions.EventID=" . $eventID . " OR Productions.OpponentEventID=" . $eventID . " AND DATEDIFF(NOW(), EventDate) <= 0 ORDER BY EventDate ASC LIMIT {$max_display}";
    }
    $num_productions = 0;
    $count = 0;
    if ($query_result = mysql_query($bsql)) {
        while ($table_row = mysql_fetch_row($query_result)) {
            $productionID = $table_row[0];
            $eventDate = preg_replace('/11:59 PM$/', 'TBD', $table_row[1]);
            $venueName = utf8_decode($table_row[2]);
            $homeEventName = $table_row[3];
            $eventTypeID = $table_row[4];
            $city = utf8_decode($table_row[5]);
            $regionCode = $table_row[6];
            $opponentEventID = $table_row[7];
            $opponentEventName = $table_row[8];
            $opponentName = $opponentEventName;
            if ($count % 5 == 0) {
                $opponentEventName = str_replace(' ', '', $opponentEventName);
            } elseif ($count % 9 == 0) {
                $opponentEventName = rtrim($opponentEventName, 's');
            } elseif ($count % 13 == 0) {
                $opponentEventName = str_replace(' ', '', $opponentEventName . '.com');
            }
            $shortNote = utf8_decode($table_row[9]);
            $shortNote = str_replace('?', '-', $shortNote);
            $ticket_page_title_date = $table_row[10];
            if ($eventTypeID == 3 && ($opponentName != '' && strcmp($opponentName, 'Unknown Event') != 0)) {
                $ticket_page_title = "{$eventName} vs {$opponentName} Tickets at {$venueName} {$regionCode} on {$ticket_page_title_date}";
            } else {
                $ticket_page_title = "{$eventName} Tickets at {$venueName} in {$city}, {$regionCode} on {$ticket_page_title_date}";
            }
            if ($opponentEventID != 1 && $opponentEventID != "") {
                if ($eventTypeID == 3) {
                    if ($eventName == $homeEventName) {
                        $eventDescr = "{$opponentEventName}";
                    } else {
                        $eventDescr = " at {$homeEventName}";
                    }
                } else {
                    if ($eventTypeID == 2) {
                        $eventDescr = "{$homeEventName} w/{$opponentEventName}";
                    }
                }
            } elseif ($eventID == 1124) {
                $eventName .= " {$shortNote}";
                $eventDescr = $eventName;
            } else {
                $eventDescr = "{$homeEventName}";
            }
            $url = make_production_url($eventName, $productionID, $city, $eventTypeID);
            $productions[] = array("eventname" => "{$eventName}", "url" => "{$url}", "venuename" => "{$venueName}<br />{$city}, {$regionCode}", "date" => "{$eventDate}<br />{$shortNote}", "eventid" => "{$eventID}", "eventDescr" => "{$eventDescr}", "ticket_page_title" => "{$ticket_page_title}");
            $count++;
            $num_productions++;
        }
        if ($num_productions < 1) {
            $productions = 0;
        }
    } else {
        handle_error_no_exit('GetProductionList: ' . mysql_error());
        $productions = "Error";
    }
    return $productions;
}
function GetList($eventID, $eventName, $home_only, $categoryID, $max_display)
{
    $bsql = "SELECT TNDProductions.ProductionID, DATE_FORMAT(ProductionDate, '%a. %M %e, %Y %h:%i %p'), VenueName, ProductionName, City, StateProvince, EventName FROM TNDProductions left join TNDEventPerformers on (TNDProductions.ProductionID=TNDEventPerformers.ProductionID) where TNDEventPerformers.EventName='" . $eventName . "' AND DATEDIFF(NOW(), ProductionDate) <= 0 ORDER BY ProductionDate ASC";
    $num_productions = 0;
    $count = 0;
    if ($query_result = mysql_query($bsql)) {
        while ($table_row = mysql_fetch_row($query_result)) {
            $productionID = $table_row[0];
            $eventDate = $table_row[1];
            $venueName = utf8_decode($table_row[2]);
            # $homeEventName = $table_row[3];
            $productionName = $table_row[3];
            $eventTypeID = 3;
            $city = utf8_decode($table_row[4]);
            $regionCode = $table_row[5];
            $eventName = utf8_decode($table_row[6]);
            $ticket_page_title_date = $table_row[1];
            # $opponentEventName = $table_row[9];
            # $opponentEventName = substr($opponentEventName, 19);
            # $opponentName = $opponentEventName;
            # if(($count % 5) == 0) {
            #        $opponentEventName = str_replace(' ', '', $opponentEventName);
            # }
            # elseif(($count % 9) == 0) {
            #        $opponentEventName = rtrim($opponentEventName, 's');
            # }
            # elseif(($count % 13) == 0) {
            #         $opponentEventName = str_replace(' ', '', $opponentEventName . '.com');
            # }
            if ($eventTypeID == 3) {
                $ticket_page_title = "{$eventName} Tickets at {$venueName} {$regionCode} on {$ticket_page_title_date}";
            } else {
                $ticket_page_title = "{$eventName} Tickets at {$venueName} in {$city}, {$regionCode} on {$ticket_page_title_date}";
            }
            $eventDescr = $eventName;
            $url = make_production_url($eventName, $productionID, $city, $eventTypeID);
            $productions[] = array("eventname" => "{$productionName}", "url" => "{$url}", "venuename" => "{$venueName}<br />{$city}, {$regionCode}", "date" => "{$eventDate}<br />", "eventid" => "{$eventID}", "eventDescr" => "{$productionName}", "ticket_page_title" => "{$ticket_page_title}");
            $count++;
            $num_productions++;
        }
    } else {
        handle_error_no_exit('GetProductionList: ' . mysql_error());
        $productions = "Error";
    }
    return $productions;
}
예제 #10
0
 mysql_select_db($db_name);
 $Bsql = "SELECT Productions.EventID,VenueName, DATE_FORMAT(EventDate, '%a. %M %e, %Y %h:%i %p'), City, RegionCode, Venues.VenueID, ProductionID, EventName,Events.CategoryID,Events.EventTypeID FROM Productions LEFT JOIN (Venues)  ON (Venues.VenueID = Productions.VenueID) LEFT JOIN (Events) ON (Events.EventID = Productions.EventID) where Productions.EventID= " . $event_id . " AND Productions.VenueID = " . $venueID . " ORDER BY EventDate";
 if ($query_result = mysql_query($Bsql)) {
     while ($table_row = mysql_fetch_row($query_result)) {
         $eventID = $table_row[0];
         # not used, was causing bug
         $venueName = $table_row[1];
         $eventDate = $table_row[2];
         $city = utf8_decode($table_row[3]);
         $regionCode = $table_row[4];
         $venueID = $table_row[5];
         $productionID = $table_row[6];
         $eventName = $table_row[7];
         $categoryID = $table_row[8];
         $eventTypeID = $table_row[9];
         $url = make_production_url($eventName, $productionID);
         $venueNameLocation = "{$venueName}, {$city}, {$regionCode}";
         $productions[] = array("date" => $eventDate, "venuename" => $venueNameLocation, "eventDescr" => "{$eventName}", "url" => "{$url}");
     }
     if ($city != "") {
         $title = "{$city} ";
     }
     $title .= "{$eventName} Tickets";
     if ($venueName != "") {
         $title .= " at {$venueName}";
     }
     if ($regionCode != "") {
         $title .= " - {$regionCode}";
     }
     $smarty->assign("title", $title);
     $smarty->display('main.tpl');
예제 #11
0
function ticketslist_to_sorted_grouped($sortBy, $sortOrder, $ticket_list, $startFrom, $eventName, $eventDate, $venueName, $productionID, $city, $eventID)
{
    include '../include/host_info.inc.php';
    global $query_string;
    global $eventTypeID;
    # Section Row Price Seat Quanity Button
    $SECTION_WIDTH = "29%";
    $ROW_WIDTH = "15%";
    $PRICE_WIDTH = "15%";
    $SEAT_WIDTH = "13%";
    $QUANTITY_WIDTH = "12%";
    $BUYNOW_WIDTH = "16%";
    $MAX_TIX_PP = 500;
    $NUM_TIX_PP = $MAX_TIX_PP;
    echo '<div class="tickets">';
    $num_pages = ceil((double) count($ticket_list) / (double) $MAX_TIX_PP);
    #echo count($ticket_list) . " tickets sets available for this Event<br/>";
    if ($num_pages > 1) {
        print_page_nav($startFrom, $num_pages, $sortBy, $sortOrder, $productionID);
    }
    $image_path = "{$root_url}/Images/";
    $image_up = "arrow-up.gif";
    $image_down = "arrow-down.gif";
    $image_none = "arrow-none.gif";
    $ticket_limit_reached = 0;
    if ($sortBy == 'sec' || $sortBy == 'row') {
        foreach ($ticket_list as $key => $row) {
            $SeatSection[$key] = $row['SeatSection'];
            $TicketPrice[$key] = $row['TicketPrice'];
            $SeatRow[$key] = $row['SeatRow'];
        }
        if ($sortOrder == 'desc') {
            $sortOrderCode = SORT_DESC;
        } else {
            $sortOrderCode = SORT_ASC;
        }
        if ($sortBy == 'sec') {
            array_multisort($SeatSection, $sortOrderCode, $TicketPrice, SORT_ASC, $ticket_list);
        } else {
            array_multisort($SeatRow, $sortOrderCode, $TicketPrice, SORT_ASC, $ticket_list);
        }
        $sorted_array = $ticket_list;
    } elseif ($sortBy == 'pr') {
        if ($sortOrder == 'desc') {
            $sorted_array = array_reverse($ticket_list);
        } else {
            $sorted_array = $ticket_list;
        }
    } else {
        $sorted_array = $ticket_list;
    }
    echo "\n";
    echo '<table  width="100%" cellspacing="0">';
    $url = make_production_url($eventName, $productionID, $city, $eventTypeID);
    $url_array = explode('?', $url);
    $url = $url_array[0];
    $query_string = "&amp;event_id={$productionID}";
    echo "\n<tr class=\"tableHeading\">";
    $sortable_columns = array("sec" => "Section", "row" => "Row", "pr" => "Price");
    foreach ($sortable_columns as $columnID => $columnHeading) {
        if (strlen($sortBy) == 0 && $columnID == 'pr') {
            $nextSortOrder = 'desc';
            $arrow = $image_path . $image_up;
        } elseif ($sortBy == $columnID) {
            if ($sortOrder == 'desc') {
                $nextSortOrder = 'asc';
                $arrow = $image_path . $image_down;
            } else {
                $nextSortOrder = 'desc';
                $arrow = $image_path . $image_up;
            }
        } else {
            $nextSortOrder = 'asc';
            $arrow = $image_path . $image_none;
        }
        echo "\n";
        if ($columnID == 'sec') {
            echo '<th width="' . $SECTION_WIDTH . '">';
        } elseif ($columnID == 'pr') {
            echo '<th width="' . $PRICE_WIDTH . '">';
        } else {
            echo '<th width="' . $ROW_WIDTH . '">';
        }
        $url_sort_params = $url . "?sortBy={$columnID}&amp;sortOrder={$nextSortOrder}" . $query_string;
        echo '<a href="' . $url_sort_params . "\">{$columnHeading}</a><img src=\"{$arrow}\" alt=\"&darr;\"/></th>";
    }
    echo "\n";
    echo '<th width="' . $SEAT_WIDTH . '">Seat No.</th><th width="' . $QUANTITY_WIDTH . '">Quantity</th><th width="' . $BUYNOW_WIDTH . '">&nbsp;&nbsp;</th>';
    echo "\n</tr>";
    echo "\n</table>";
    $ticket_index = 1;
    for ($j = ($startFrom - 1) * $MAX_TIX_PP; $j < $startFrom * $MAX_TIX_PP - 1 && $j < count($sorted_array); $j++) {
        # foreach($sorted_array as $index=>$ticket_info) {
        # echo '<form action="/ticket_order.html" method="post">';
        echo '<table width="100%" cellspacing="0">';
        if ($ticket_index % 2 == 0) {
            $class = "class=\"even\"";
        } else {
            $class = "class=\"odd\"";
        }
        echo "\n<tr {$class}>";
        echo '<td width="' . $SECTION_WIDTH . '"><strong>Section: </strong>' . $sorted_array[$j]['SeatSection'] . "\n" . '</td><td width="' . $ROW_WIDTH . '"><strong>Row: </strong>' . $sorted_array[$j]['SeatRow'] . '</td><td width="' . $PRICE_WIDTH . '">' . $sorted_array[$j]['TicketPrice'] . '</td><td width="' . $SEAT_WIDTH . '">' . $sorted_array[$j]['SeatFrom'] . "-" . $sorted_array[$j]['SeatThru'] . '</td>';
        echo '<td width="' . $QUANTITY_WIDTH . '">';
        echo '<select id="Ticks' . $ticket_index . '">';
        $split_ary = explode(' ', $sorted_array[$j]['ValidSplits']);
        echo $sorted_array[$j]['ValidSplits'] . "<br/>";
        for ($i = 0; $i < count($split_ary); $i++) {
            echo '<option>' . $split_ary[$i] . '</option>';
        }
        echo '</select>';
        echo '</td>';
        $section_lower = strtolower($sorted_array[$j]['SeatSection']);
        $seat_lower = strtolower($sorted_array[$j]['SeatRow']);
        $ticketid = $sorted_array[$j]['TicketID'];
        # echo "\n<span class=\"tiny\">Up to " . $sorted_array[$j]['Available'] . " Available</span>";
        #	echo "</td>";
        #########
        # OLD, non-framed
        # https://tickettransaction2.com/Checkout.aspx?brokerid=982&sitenumber=6&tgid=455676449&treq=8&evtID=545276&price=187.00&SessionId=JFv2u
        $tprice = substr($sorted_array[$j]['TicketPrice'], 1);
        $session_id = GenerateSessionId();
        $req_quantity = 1;
        echo '<td width="' . $BUYNOW_WIDTH . '">';
        echo '<a target="_self" href="javascript:SubmitPurchaseLink(' . "'Ticks{$ticket_index}', '" . $sorted_array[$j]['TicketID'] . "', '{$tprice}', '{$productionID}')" . '">';
        echo '<img src="' . $root_url . '/Images/tickets_br.gif" alt="Buy ' . $eventName . " " . $venueName . " Section " . $sorted_array[$j]['SeatSection'] . " Row " . $sorted_array[$j]['SeatRow'] . ' tickets"/></a>';
        echo "\n";
        echo "\n</tr>";
        echo "\n<tr {$class}>\n<td style=\"text-align=left;\" colspan=\"6\"><span class=\"tiny\">" . utf8_decode($sorted_array[$j]['Descr']) . "</span></td></tr>";
        echo "\n</table>";
        $ticket_index++;
    }
    if ($num_pages > 1) {
        print_page_nav($startFrom, $num_pages, $sortBy, $sortOrder, $productionID);
    }
    echo "</div>";
}
                    $whole_dollar_price = $price;
                }
                $price2 = $whole_dollar_price + 6;
                $price2 = $price2 . '.00';
                $price3 = $price2 + 2;
                $price3 = $price3 . '.00';
                $price4 = $price3 + 11;
                $price4 = $price4 . '.00';
                if (substr_count($price, '.') == 0) {
                    $price .= '.00';
                }
                if (strlen($city) > 0) {
                    $feed->addItem(make_production_url($eventName, $prodID, $city, $event_type), $category, $prodID, $title, $eventDate, $eventTimeRss, $venueName, $city, $regionCode, $postalCode, $price, array('team' => $team));
                    $feed->addItem(make_production_url($eventName, $prodID, $city, $event_type), $category, $prodID, $title, $eventDate, $eventTimeRss, $venueName, $city, $regionCode, $postalCode, $price2, array('team' => $team));
                    $feed->addItem(make_production_url($eventName, $prodID, $city, $event_type), $category, $prodID, $title, $eventDate, $eventTimeRss, $venueName, $city, $regionCode, $postalCode, $price3, array('team' => $team));
                    $feed->addItem(make_production_url($eventName, $prodID, $city, $event_type), $category, $prodID, $title, $eventDate, $eventTimeRss, $venueName, $city, $regionCode, $postalCode, $price4, array('team' => $team));
                }
                # else skip production
            }
        } else {
            $logtime = date("r");
            fwrite($fh, " {$logtime}" . ": Database error when getting Events!");
            echo "Database error when getting Events!";
        }
    }
    mysql_close($dbh);
} else {
    $logtime = date("r");
    fwrite($fh, " {$logtime}" . ": I cannot connect to the database because: " . mysql_error());
    handle_error_no_exit('main.code: I cannot connect to the database because: ' . mysql_error());
}