Exemplo n.º 1
0
    $ObjClass = new classes();
    // Set what we are loading up for editing
    if ($d) {
        $classid = $d;
    } elseif ($_POST['classid'] != "") {
        $classid = $_POST['classid'];
    } else {
        $classid = "";
    }
    // If a valid id comes forth then utilise that to load data or save
    if ($classid) {
        $classid = $ObjClass->convertUUIDToClassID($classid);
        // Update information if it has ben requested
        if ($_POST['action'] == "remove" && $classid != "") {
            $deleteClass = $ObjClass->deleteClass($classid);
            if ($createClass !== false) {
                $responseMsg = "Your class has been removed successfully";
            } else {
                $responseMsg = "Could not remove your class at this time - something went wrong, sorry";
            }
        }
        // else display the information
        $class = $ObjClass->getClassInformation($classid);
    } else {
        $classes = $ObjClass->getClassList();
    }
    // create the view for course information
    require_once 'web/core/class/delete.php';
} else {
    require_once 'web/core/login/index.php';
}