Example #1
0
 * User: shawnrobin
 * Date: 7/27/16
 * Time: 11:12 AM
 */
include '../../util/main.php';
require_once '../../model/admin_db.php';
verify_admin();
$action = strtolower(filter_input(INPUT_POST, 'action'));
if ($action == NULL) {
    $action = strtolower(filter_input(INPUT_GET, 'action'));
    if ($action == NULL) {
        $action = 'default';
    }
}
switch ($action) {
    case 'modify':
        if (session_status() == PHP_SESSION_NONE) {
            session_start();
        }
        $usr_id = filter_input(INPUT_GET, "usr_id");
        $user = $_SESSION['user'];
        $_SESSION['prev_usr_id'] = $user->usr_id;
        $user = User::getUserByUsrId($usr_id);
        $_SESSION['user'] = $user;
        header("Location: ../../teacher/availability/index.php?next_page=admin");
        break;
    default:
        $free_mods = get_free_mods();
        include './view.php';
        break;
}
Example #2
0
 * Created by PhpStorm.
 * User: macbook
 * Date: 12/14/15
 * Time: 1:04 PM
 */
require_once __DIR__ . "/../../shared/model/user_db.php";
if ($debugging_login_active !== true) {
    header("Location: ..");
}
$action = strtolower(filter_input(INPUT_POST, 'action'));
if ($action == NULL) {
    $action = 'show_users';
}
switch ($action) {
    case 'show_users':
        $user_list = get_user_list_test_page();
        include 'login.php';
        break;
    case 'login':
        /**
         * The following session variables are set:
         * usr_id
         * usr_role_cde
         * user_type_cde
         */
        $user_from_post = filter_input(INPUT_POST, 'usr_id');
        $user = User::getUserByUsrId($user_from_post);
        $_SESSION['user'] = $user;
        goToLandingPage();
        break;
}
Example #3
0
 * Time: 2:04 PM
 *
 */
require_once "../util/main.php";
require_once "../model/teacher_db.php";
$action = strtolower(filter_input(INPUT_POST, 'action'));
if ($action == NULL) {
    $action = strtolower(filter_input(INPUT_GET, 'action'));
    if ($action == NULL) {
        $action = 'list_selected_tests';
    }
}
verify_logged_in();
if (isset($action) and $action == "logout") {
    if (isset($_SESSION['prev_usr_id'])) {
        $_SESSION['user'] = User::getUserByUsrId($_SESSION['prev_usr_id']);
        unset($_SESSION['prev_usr_id']);
        header("Location: ../admin/index.php");
    } else {
        session_destroy();
        header("Location: ../index.php");
    }
}
switch ($action) {
    case 'list_selected_tests':
        $count = get_count($user->usr_id);
        $testSelectedList = get_selected_test_list($user->usr_id);
        include './view.php';
        break;
    case 'show_itinerary':
        header("Location: ../itinerary");
Example #4
0
/**
 * Created by PhpStorm.
 * User: macbook
 * Date: 3/2/16
 * Time: 9:30 AM
 */
require_once "../../util/main.php";
require_once __DIR__ . "/../../../shared/model/user_db.php";
require_once __DIR__ . "/../../../shared/model/database.php";
require_once "../../model/teacher_db.php";
$action = strtolower(filter_input(INPUT_POST, 'action'));
if (empty($action)) {
    $action = 'show_users';
}
switch ($action) {
    case 'show_users':
        $user_list = get_mimic_list();
        include 'view.php';
        break;
    case 'login':
        if (session_status() == PHP_SESSION_NONE) {
            session_start();
        }
        $usr_id = filter_input(INPUT_POST, "usr_id");
        $user = $_SESSION['user'];
        $_SESSION['prev_usr_id'] = $user->usr_id;
        $_SESSION['user'] = User::getUserByUsrId($usr_id);
        header("Location: ../../mainPage/index.php");
        break;
}