Files
bm/public_html/public/tickets/events.php
2025-09-24 13:26:28 +02:00

58 lines
1.3 KiB
PHP

<?php
/** loads all events in the future that are available for ticket reservation
*
* @version 2.0.0
* @since 2008-02-13
* @author Martin Lenzelbauer
*
*/
define("ROOT", "../");
require_once(ROOT."include/config.inc.php");
require_once(ROOT."include/db.inc.php");
require_once(ROOT."include/xml.inc.php");
dbQuery("SET NAMES utf8");
switch($_GET['action']){
case "loadEvents": loadEvents();
break;
}
/** loads all events in the future that are available for ticket reservation
*/
########################################
function loadEvents(){
########################################
$xml = '<?xml version="1.0" encoding="utf-8"?>';
$xml .= '<events>';
$query = sprintf("SELECT id, name, dates FROM bruckm_ticketevent
WHERE endDate >= '%s' AND reservationType != 'none' AND visible = 1
ORDER BY endDate ASC",
date("Y-m-d"));
$result = dbQuery($query);
while($line = mysqli_fetch_array($result, MYSQLI_ASSOC)){
// silvestergala
if ($line['id'] == 2065) {
$line['name'] .= ' - Erdgeschoß';
continue;
} elseif ($line['id'] == 2034) {
$line['name'] .= ' - Empore';
}
if(!empty($line['dates'])){
$xml .= '<event title="' . xmlstring($line['name']) .'" id="' . $line['id'] . '" />';
}
}
$xml .= '</events>';
header('Content-Type: text/xml');
echo $xml;
}
?>