Esempio n. 1
0
                                <option value="">-- <?php 
            echo $lg['EVENTS_EMPTY'];
            ?>
 --</option>
                                <?php 
        } else {
            ?>
                                <option value="">-- <?php 
            echo $lg['CHOOSE'];
            ?>
 --</option>
                                <?php 
            foreach ($events as $event) {
                $merged = getMergedRounds($event['xRunde']);
                if ($merged != "") {
                    $categories = getMergedCategories($merged);
                    $cat_string = "";
                    $tmp = "";
                    foreach ($categories as $cat) {
                        $cat_string .= $tmp . $cat['cat_name'];
                        $tmp = "/";
                    }
                } else {
                    $cat_string = $event['cat_name'];
                }
                $sel = $event['xSerie'] == CFG_CURRENT_EVENT ? ' selected="selected"' : '';
                $round_bez = $event['round_type'] != '0' ? "- " . $event['round_name'] . " " . $event['serie_bez'] : "";
                ?>
                                    <option value="<?php 
                echo $event['xSerie'];
                ?>
Esempio n. 2
0
function getEvents($meeting = 0, $event = 0)
{
    global $glb_connection_server;
    global $glb_status_results, $glb_status_live;
    global $glb_types_results;
    try {
        if ($meeting != 0) {
            $and_meeting = " AND xMeeting = :meeting";
        } else {
            $and_meeting = "";
        }
        if ($event != 0) {
            $and_event = " AND xSerie = :serie";
        } else {
            $and_event = "";
        }
        $sql_get = "SELECT disziplin.Name AS disc_name\r\n                            , disziplin.Typ AS disc_type\r\n                            , kategorie.Kurzname AS cat_name\r\n                            , rundentyp.Typ AS round_type\r\n                            , rundentyp.Wertung AS round_wertung\r\n                            , IF(rundentyp.Typ!='0',rundentyp.Name,'') AS round_name\r\n                            , serie.Bezeichnung AS serie_bez\r\n                            , TIME_FORMAT(runde.Startzeit, '%H:%i') AS round_start_time\r\n                            , TIME_FORMAT(runde.Stellzeit, '%H:%i') AS round_call_time\r\n                            , DATE_FORMAT(runde.Datum, '%d.%m.%y') AS round_start_date\r\n                            , runde.Status AS round_status\r\n                            , runde.Versuche AS round_attempts\r\n                            , runde.Endkampf AS round_final\r\n                            , runde.Finalisten AS round_finalists\r\n                            , runde.FinalNach AS round_final_after\r\n                            , runde.Drehen AS round_drop\r\n                            , wettkampf.Windmessung AS event_wind\r\n                            , serie.xSerie AS xSerie\r\n                            , runde.xRunde AS xRunde\r\n                            , wettkampf.xWettkampf AS xWettkampf\r\n                            , disziplin.xDisziplin AS xDisziplin\r\n                            , kategorie.xKategorie AS xKategorie\r\n                            , rundentyp.xRundentyp AS xRundentyp\r\n                      FROM serie\r\n                        LEFT JOIN runde USING(xRunde)\r\n                        LEFT JOIN wettkampf USING(xWettkampf)\r\n                        LEFT JOIN disziplin_" . strtolower(CFG_CURRENT_LANGUAGE) . " AS disziplin USING(xDisziplin)\r\n                        LEFT JOIN kategorie USING(xKategorie)\r\n                        LEFT JOIN rundentyp_" . strtolower(CFG_CURRENT_LANGUAGE) . " AS rundentyp USING (xRundentyp)\r\n                     WHERE runde.Status IN (" . implode(',', $glb_status_results) . ")\r\n                     AND disziplin.Typ IN (" . implode(',', array_keys($glb_types_results)) . ")\r\n                        " . $and_meeting . "\r\n                        " . $and_event . "\r\n                     ORDER BY \r\n                        Startzeit\r\n                        , disc_name;";
        $query_get = $glb_connection_server->prepare($sql_get);
        // +++ bind parameters
        if ($meeting != 0) {
            $query_get->bindValue(':meeting', $meeting);
        }
        if ($event != 0) {
            $query_get->bindValue(':serie', $event);
        }
        // --- bind parameters
        $query_get->execute();
        if ($event != 0) {
            $events = $query_get->fetch(PDO::FETCH_ASSOC);
            define('CFG_CURRENT_WIND', $events['event_wind']);
            $merged = getMergedRounds($events['xRunde']);
            if ($merged) {
                $where = "WHERE xRunde IN " . $merged;
                $categories = getMergedCategories($merged);
                $cat_string = "";
                $tmp = "";
                foreach ($categories as $cat) {
                    $cat_string .= $tmp . $cat['cat_name'];
                    $tmp = "/";
                }
                $events['cat_name'] = $cat_string;
            } else {
                $where = "WHERE xRunde = :runde";
            }
            $sql_status = "UPDATE runde\r\n                            SET Status = :status\r\n                            " . $where . ";";
            $query_status = $glb_connection_server->prepare($sql_status);
            // +++ bind parameters
            $query_status->bindValue(':status', $glb_status_live);
            if (!$merged) {
                $query_status->bindValue(':runde', $events['xRunde']);
            }
            // --- bind parameters
            $query_status->execute();
        } else {
            $events = $query_get->fetchAll(PDO::FETCH_ASSOC);
        }
    } catch (PDOException $e) {
        trigger_error($e->getMessage());
    }
    return $events;
}