예제 #1
0
if ($phase == 2) {
    if ($nmatch == 0 && !$cli_mode && $output_format == OUTPUT_HTML) {
        if ($ajax) {
            echo json_encode($json_data);
        } else {
            echo "<p class=\"report_entries\">" . get_vocab("nothing_found") . "</p>\n";
        }
        sql_free($res);
    } elseif ($combination_not_supported) {
        echo "<p>" . get_vocab("combination_not_supported") . "</p>\n";
        sql_free($res);
    } else {
        if ($output_format == OUTPUT_ICAL) {
            // We set $keep_private to FALSE here because we excluded all private
            // events in the SQL query
            export_icalendar($res, FALSE, $report_end);
            exit;
        }
        if ($output_format == OUTPUT_HTML && !$ajax) {
            echo "<p class=\"report_entries\"><span id=\"n_entries\">" . $nmatch . "</span> " . ($nmatch == 1 ? get_vocab("entry_found") : get_vocab("entries_found")) . "</p>\n";
        }
        // Report
        if ($output == REPORT) {
            open_report();
            report_header();
            $body_rows = array();
            for ($i = 0; $row = sql_row_keyed($res, $i); $i++) {
                report_row($body_rows, $row);
            }
            output_body_rows($body_rows, $output_format);
            close_report();
예제 #2
0
            $sql .= " WHERE E.id={$id}";
        }
        $sql .= " AND E.room_id=R.id\n              AND R.area_id=A.id";
        if ($series) {
            $sql .= " ORDER BY E.ical_recur_id";
        }
        $res = sql_query($sql);
        if ($res === FALSE) {
            trigger_error(sql_error(), E_USER_WARNING);
            fatal_error(FALSE, get_vocab("fatal_db_error"));
        }
        // Export the calendar
        require_once "functions_ical.inc";
        header("Content-Type: application/ics;  charset=" . get_charset() . "; name=\"" . $mail_settings['ics_filename'] . ".ics\"");
        header("Content-Disposition: attachment; filename=\"" . $mail_settings['ics_filename'] . ".ics\"");
        export_icalendar($res, $keep_private);
        exit;
    }
}
// PHASE 1 - VIEW THE ENTRY
// ------------------------
print_header($day, $month, $year, $area, isset($room) ? $room : "");
// Need to tell all the links where to go back to after an edit or delete
if (!isset($returl)) {
    if (isset($HTTP_REFERER)) {
        $returl = $HTTP_REFERER;
    } else {
        switch ($default_view) {
            case "month":
                $returl = "month.php";
                break;