Exemple #1
0
if (isset($_GET['coursenews'])) {
    header("Content-Type: text/plain; charset=utf-8");
    echo utf8_encode($courseHandler->generateCourseNews());
    exit;
}
if (isset($_GET['export'])) {
    $exporter = new Exporter($db);
    if ($_GET['export'] == "xml") {
        header("Content-Type: text/xml; charset=utf-8");
        header('Content-Disposition: filename="kurse.xml"');
        echo $exporter->exportCoursesToXML();
        exit;
    } else {
        header("Content-Type: text/javascript");
        header('Content-Disposition: filename="kurse.txt"');
        echo $exporter->exportCoursesToJSON();
        exit;
    }
}
if (isset($_GET['delete_course'])) {
    $courseHandler->deleteCourse((int) $_GET['delete_course']);
    if (!isset($_GET['ajax'])) {
        header("Location: kurse.php");
    }
    exit;
}
if (isset($_POST['kursname'])) {
    $courseHandler->insertCourse($_POST['kursname'], $_POST['semester']);
    if (!isset($_GET['ajax'])) {
        header("Location: kurse.php");
    }