コード例 #1
0
ファイル: delete.php プロジェクト: TohuMuna/akonga
if ($_SESSION['username'] != "") {
    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();
    // 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
コード例 #2
0
ファイル: create.php プロジェクト: TohuMuna/akonga
    if ($_SESSION['utype'] >= '5') {
        // get and initiate the course class to access the functions
        require_once 'src/core/controller/content.php';
        $ObjContent = new content();
        require_once 'src/core/controller/classes.php';
        $ObjClass = new classes();
        // Sort out the class ID
        if ($d) {
            $classid = $d;
        } elseif ($_POST['classid'] != "") {
            $classid = $_POST['classid'];
        } else {
            $classid = "";
        }
        if ($_POST['y'] == 'content' && $_POST['z'] == 'create' && $_POST['action'] == "save") {
            // $contentTitle, $classid, $userid, $contentType, $contentDescription='', $contentLink='', $contentFile='', $contentFileExtension='', $documentContent=''
            $createContent = $ObjContent->createContent($_POST['contentTitle'], $ObjClass->convertUUIDToClassID($_POST['classid']), $ObjAkonga->usernametoid($_SESSION['username']), $_POST['contentType'], $_POST['contentDescription'], $_POST['contentLink'], $_FILES['contentFile']['name'], $_FILES['contentFile']['tmp_name'], $_POST['documentContent'], $_POST['contentState']);
            if ($createContent !== false) {
                $responseMsg = "Your content has been created successfully";
            } else {
                $responseMsg = "Could not create your content at this time - something went wrong, sorry";
            }
        }
        // create the view for course information
        require_once 'web/core/content/create.php';
    } else {
        require_once 'web/core/security/insufficientrights.php';
    }
} else {
    require_once 'web/core/login/index.php';
}
コード例 #3
0
ファイル: create.php プロジェクト: TohuMuna/akonga
<?php

/**
 * Create a register - build the view and form to create a register
 */
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();
        require_once 'src/core/controller/register.php';
        $ObjRegister = new register();
        if ($_POST['y'] == 'register' && $_POST['z'] == 'create' && $_POST['action'] == "save") {
            $saveRegister = $ObjRegister->storeRegister($ObjClass->convertUUIDToClassID($_POST['classid']), $ObjAkonga->usernametoid($_SESSION['username']), $_POST['pupil'], $_POST['mark']);
            if ($saveRegister === false) {
                $responseMsg = "Could not create your register at this time - something went wrong, sorry";
            } else {
                $responseMsg = "Register saved";
            }
            // return to class view
            $classid = $ObjClass->convertUUIDToClassID($_POST['classid']);
            $className = $ObjClass->getClassName($classid);
            require_once 'web/core/register/create.php';
        } else {
            // create the view for course information
            $classid = $ObjClass->convertUUIDToClassID($d);
            $className = $ObjClass->getClassName($classid);
            $myRegister = $ObjRegister->createRegister($classid);
            require_once 'web/core/register/create.php';
        }
コード例 #4
0
ファイル: create.php プロジェクト: TohuMuna/akonga
 */
if ($_SESSION['username'] != "") {
    require_once 'web/core/navigation.php';
    if ($_SESSION['utype'] >= '5') {
        // get and initiate the course class to access the functions
        require_once 'src/core/controller/classes.php';
        $ObjClass = new classes();
        require_once 'src/core/controller/quiz.php';
        $ObjQuiz = new quiz();
        // set class id for form and links
        if ($_POST['classid'] != "") {
            $classid = $_POST['classid'];
        } else {
            $classid = $d;
        }
        if ($_POST['y'] == 'quiz' && $_POST['z'] == 'create' && $_POST['action'] == "save") {
            $createContent = $ObjQuiz->createQuiz($_POST['quizTitle'], $_POST['quizState'], $_POST['quizDescription'], $ObjClass->convertUUIDToClassID($_POST['classid']));
            if ($createContent !== false) {
                $responseMsg = "Your quiz has been created successfully";
            } else {
                $responseMsg = "Could not create your quiz at this time - something went wrong, sorry";
            }
        }
        // create the view for coursek information
        require_once 'web/core/quiz/create.php';
    } else {
        require_once 'web/core/security/insufficientrights.php';
    }
} else {
    require_once 'web/core/login/index.php';
}