예제 #1
0
파일: create.php 프로젝트: TohuMuna/akonga
<?php

/**
 * View a course
 */
if ($_SESSION['username'] != "") {
    if ($_SESSION['utype'] >= '5') {
        require_once 'web/core/navigation.php';
        // get and initiate the course class to access the functions
        require_once 'src/core/controller/classes.php';
        $ObjClass = new classes();
        if ($_POST['y'] == 'class' && $_POST['z'] == 'create' && $_POST['action'] == "save") {
            $createClass = $ObjClass->createClass($_POST['className'], $_POST['classTutor'], $_POST['classDescription'], $_POST['classState'], $_POST['classSubject'], $_POST['classSet']);
            if ($createClass !== false) {
                $responseMsg = "Your class has been created successfully";
            } else {
                $responseMsg = "Could not create your class at this time - something went wrong, sorry";
            }
        }
        // create the view for course information
        require_once 'web/core/class/create.php';
    } else {
        require_once 'web/core/security/insufficientrights.php';
    }
} else {
    require_once 'web/core/login/index.php';
}