Ejemplo n.º 1
0
    // Timetables laden
    $running_weeks = $sql->getData("running_weeks", "running_weeks_id", "WHERE `running_year` = '" . date("Y") . "' AND `movie_id` = '" . $movie['movie_id'] . "' AND (`running_week` = '" . $this_week . "' OR `running_week` = '" . ($this_week + 1) . "' )", 0, TRUE);
    $movie['running_weeks_id'] = array();
    // Array initialisieren
    foreach ($running_weeks as $running_week) {
        // Die IDs aus den einzelnen Showwochen laden
        $movie['running_weeks_ids'][] = $running_week['running_weeks_id'];
    }
    // HTML Ausgabe für Timetable laden
    $all_now_movies .= getTimetableHTML($movie['running_weeks_ids']);
}
// Template für Jetzt im Kino-Seite laden
$theTemplate = new Template("main.tpl");
$theTemplate->load("RESERVATION");
// Wochendaten ermitteln
$week_data = getWeekData($this_week);
$theTemplate->tag("start", $week_data[1][4]);
// Wochenstart
$theTemplate->tag("end", $week_data[1][3]);
// Wochen-Ende
$theTemplate->tag("number", $this_week);
// Wochen-Nummer
if ($all_now_movies != "") {
    $theTemplate->tag("movies", $all_now_movies);
    // Die Filme ins Template einbinden
} else {
    // Movie-Templates laden
    $movieTemplate = new Template("movie.tpl");
    $movieTemplate->load("NO_SHOWS");
    $theTemplate->tag("movies", (string) $movieTemplate);
    // keine Vorstellungen gefunden-Template einbinden
Ejemplo n.º 2
0
                                <td>
                                    <?php 
    echo $form->hiddenField($model, "image", array('name' => "image[{$i}]", 'style' => 'width:100px', 'value' => '/optionsimages/' . getWeekImg($i), 'id' => 'img' . $i, 'name' => "CustomOptions[{$i}][image]"));
    ?>
                                    <?php 
    echo CHtml::image(getSiteUrl() . '/optionsimages/' . getWeekImg($i), 'Product', array('style' => 'width:250px', 'class' => 'img' . $i));
    ?>
                                    <a class='' style='margin-left:10px' onclick="changeELM(this)" href="javascript:BrowtopseFiles('<?php 
    echo getSiteUrl() . "/mfm.php?mode=standalone&amp;field=img{$i}";
    ?>
');">Choose</a>
                                </td>
                                <td>
                                    <?php 
    $model->title = getWeekData($i, true);
    $model->description = getWeekData($i, false, true);
    ?>
                                    <?php 
    echo $form->textField($model, "title", array('style' => 'width:100%;border:0px', 'placeholder' => 'Default Title', 'name' => "CustomOptions[{$i}][title]"));
    ?>
                                    <?php 
    echo $form->textArea($model, "description", array('style' => 'width:100%;height:160px;border:0px', 'placeholder' => 'Default Content', 'name' => "CustomOptions[{$i}][description]"));
    ?>
                                </td>
                                <td><?php 
    echo $form->dropDownList($model, 'week', $weeks, array('empty' => 'Select Week', 'name' => "CustomOptions[{$i}][week]", 'rowid' => $i));
    ?>
</td>
                                <!--<td><i class="remove">Remove</i></td>-->
                            </tr>
                        <?php 
Ejemplo n.º 3
0
$all_now_movies = "";
foreach ($movies_this_week as $movie) {
    // HTML Ausgabe für Film laden
    $all_now_movies .= getMovieHTML($movie['movie_id']);
    // HTML Ausgabe für Timetable laden
    $all_now_movies .= getTimetableHTML($movie['running_weeks_id']);
}
// Template für Jetzt im Kino-Seite laden
$theTemplate = new Template("main.tpl");
if ($this_week == $show_week) {
    $theTemplate->load("NOW");
} else {
    $theTemplate->load("PROGRAM");
}
// Wochendaten ermitteln
$week_data = getWeekData($show_week);
$theTemplate->tag("start", $week_data[1][4]);
// Wochenstart
$theTemplate->tag("end", $week_data[1][3]);
// Wochen-Ende
$theTemplate->tag("number", $show_week);
// Wochen-Nummer
if ($all_now_movies != "") {
    $theTemplate->tag("movies", $all_now_movies);
    // Die Filme ins Template einbinden
} else {
    // Movie-Templates laden
    $movieTemplate = new Template("movie.tpl");
    $movieTemplate->load("NO_SHOWS");
    $theTemplate->tag("movies", (string) $movieTemplate);
    // keine Vorstellungen gefunden-Template einbinden
Ejemplo n.º 4
0
function getTimetableHTML($RUNNING_IDS, $ADMIN = FALSE)
{
    global $sql;
    // Kinowochen der Running IDS ermitteln
    if (!is_array($RUNNING_IDS)) {
        $RUNNING_IDS = array($RUNNING_IDS);
        // Bei nur einer einzigen Running ID muss nicht extra ein Array übergeben werden
    }
    $kino_weeks = $sql->getData("running_weeks", "*", "WHERE `running_weeks_id` IN(" . implode(",", $RUNNING_IDS) . ") ORDER BY `running_week`");
    $kino_weeks = $kino_weeks == FALSE ? array() : $kino_weeks;
    // Fehler abfangen, wenn keine running week gefunden wird
    // Template laden
    $theTemplate = new Template("movie.tpl");
    // Für jede Woche durchgehen
    $all_show_weeks = "";
    foreach ($kino_weeks as $kino_week) {
        // Wochendaten laden
        $week_data = getWeekData($kino_week['running_week']);
        // Spielzeiten laden
        $showtimes = $sql->getData("running_table", "*", "WHERE `running_weeks_id` = '" . $kino_week['running_weeks_id'] . "' ORDER BY `running_day`, `running_time`");
        $showtimes = $showtimes == FALSE ? array() : $showtimes;
        // Alle Auführungen der Woche durchgehen
        $times = array(0 => array(), 1 => array(), 2 => array(), 3 => array(), 4 => array(), 5 => array(), 6 => array());
        // Times Array initialisieren
        foreach ($showtimes as $show) {
            // Timestamp der Auffühung
            $showtimestamp = strtotime(date("Y-m-d", $week_data[0][$show['running_day']]) . $show['running_time']);
            // Unterscheidung zw. normaler und Admin ausgabe
            if ($ADMIN) {
                $theTemplate->load("SHOW");
                $theTemplate->clearTags();
                $theTemplate->tag("url", "?go=admin&id=" . $show['show_id']);
            } else {
                // Showtime Template laden und Tags umsetzen
                if ($showtimestamp >= time() + 60 * 45) {
                    $theTemplate->load("SHOW");
                    $theTemplate->clearTags();
                    $theTemplate->tag("url", "?go=booking&id=" . $show['show_id']);
                } else {
                    $theTemplate->load("SHOW_OLD");
                    $theTemplate->clearTags();
                }
            }
            $theTemplate->tag("time", date("H:i", $showtimestamp));
            $times[$show['running_day']][] = (string) $theTemplate;
        }
        // Showtime Separator laden
        $theTemplate->load("SHOW_SEPARATOR");
        $theTemplate->clearTags();
        $theSeparator = (string) $theTemplate;
        // Timetable Template laden und Tags umsetzen
        $theTemplate->load("SHOW_WEEK");
        $theTemplate->clearTags();
        $theTemplate->tag("start", $week_data[1][4]);
        $theTemplate->tag("end", $week_data[1][3]);
        $theTemplate->tag("so_times", implode($theSeparator, $times[0]));
        $theTemplate->tag("mo_times", implode($theSeparator, $times[1]));
        $theTemplate->tag("di_times", implode($theSeparator, $times[2]));
        $theTemplate->tag("mi_times", implode($theSeparator, $times[3]));
        $theTemplate->tag("do_times", implode($theSeparator, $times[4]));
        $theTemplate->tag("fr_times", implode($theSeparator, $times[5]));
        $theTemplate->tag("sa_times", implode($theSeparator, $times[6]));
        $theTemplate->tag("so_date", $week_data[1][0]);
        $theTemplate->tag("mo_date", $week_data[1][1]);
        $theTemplate->tag("di_date", $week_data[1][2]);
        $theTemplate->tag("mi_date", $week_data[1][3]);
        $theTemplate->tag("do_date", $week_data[1][4]);
        $theTemplate->tag("fr_date", $week_data[1][5]);
        $theTemplate->tag("sa_date", $week_data[1][6]);
        // Show Week hinten dran hängen
        $all_show_weeks .= (string) $theTemplate;
    }
    // Timetable Template laden
    $theTemplate->load("TIMETABLE");
    $theTemplate->clearTags();
    $theTemplate->tag("show_weeks", $all_show_weeks);
    // HTML zurückgeben
    return (string) $theTemplate;
}