Esempio n. 1
0
require_once "header.php";
if ($session->is_logged_in()) {
    $loggeduser = User::get_by_id($session->user_id);
}
$pathinfo = pathinfo($_SERVER["PHP_SELF"]);
$basename = $pathinfo["basename"];
$currentFile = str_replace(".php", "", $basename);
$pageURL = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
echo "<input id='schoolid' type='hidden' hidden value='" . $_GET['id'] . "'>";
if (isset($_GET['id'])) {
    $school = School::get_by_id($_GET['id']);
    if (!$school) {
        header("location: index.php?negative");
    }
    $schoolUsers = SchoolUser::getStudentsInSchool($school->id);
    if ($session->is_logged_in()) {
        if (!User::get_by_id($session->user_id)->is_super_admin()) {
            if ($school->pending == 1 || $school->enabled == 0) {
                header("location: index.php?negative");
            }
        }
    } else {
        if ($school->pending == 1 || $school->enabled == 0) {
            header("location: index.php?negative");
        }
    }
} else {
    header("location: index.php?negative");
}
?>