コード例 #1
0
ファイル: mediator.php プロジェクト: banjo78910/CCEL-Schedule
// $_GET['content'] = 'i hope to god this works ben';
// $_GET['jsonString'] = '{"recipient":"ben","subject":"json test","message":"JSON TEST DURRRRR"}';
$med = new Mediator();
// $med->displayAllSessions();
// $_GET['site'] = "John Hay HS";
// $_GET['date'] = "12-01-2015";
// $_GET['time'] = "8:30PM";
// $_GET['subject'] = "programming";
// $_GET['gradeLevel'] = "12";
if (isset($_GET['function'])) {
    $function = $_GET['function'];
    /* Mediator functions: */
    if ($function == 'displayAllSessions') {
        $med->displayAllSessions();
    } elseif ($function == 'logout') {
        $med->getUser()->logout();
    } elseif ($function == 'getJsonMessages') {
        $med->getJsonMessages();
    } elseif ($function == 'sendJsonMessage') {
        $med->sendJsonMessage($_GET['jsonString']);
    } elseif ($function == 'sendMessage') {
        $med->sendMessage($_GET['recipient'], $_GET['subject'], $_GET['content']);
    } elseif ($function == 'getAllowedRecipients') {
        $med->getAllowedRecipients();
    } elseif ($function == 'deleteMessage') {
        $med->deleteMessage($_GET['messageID']);
    } elseif ($function == 'registerJsonUser') {
        $med->registerJsonUser($_GET['jsonString']);
    } elseif ($function == 'displayAttendingSessions') {
        $med->displayAttendingSessions();
    } elseif ($function == 'willAttend') {