예제 #1
0
function isIn()
{
    if (isset($_SESSION["userkey"]) && isset($_SESSION["usertype"])) {
        if (isTeacher()) {
            return true;
        } else {
            date_default_timezone_set('Asia/Singapore');
            return gameStartTime() <= time() ? true : false;
        }
    }
    return false;
}
예제 #2
0
파일: user.php 프로젝트: CMIP5/HUC8Climate
 public function add()
 {
     $selection = "";
     //Display the appropriate user authority to add depending on the user's authority //@TODO
     if (isAdmin()) {
         $selection = $this->authDropDown();
     } elseif (isTeacher()) {
         $selection = $this->teacherDropDown();
     } elseif (isStudent()) {
         $this->kickOut();
     }
     //List of CSS to pass to this view
     $data = $this->StyleData;
     $data['selection'] = $selection;
     $this->load->view('users/add', $data);
 }
<?php

include __DIR__ . "/include.php";
check_access(TEACHER);
list($class, $challenge) = apiCheckParams("class", "challenge");
$user = $_SESSION["user"];
$extra = isset($_POST["extra"]);
apiCheck(dbExists(isTeacher() ? "SELECT id FROM class WHERE id = :class AND teacher = :teacher" : "SELECT id FROM class WHERE id = :class AND :teacher != -1", ['class' => $class, "teacher" => $user]), "Ungültige Klasse");
apiCheck(dbExists("SELECT id FROM challenge WHERE id = :id", ["id" => $challenge]), "Ungültige Challenge");
apiCheck(!dbExists("SELECT * FROM solved_challenge WHERE class = :class AND challenge = :challenge", ["class" => $class, "challenge" => $challenge]), "Challenge wurde von der Klasse schon gelöst");
apiCheck(!$extra || dbExists("SELECT id FROM challenge WHERE id = :id AND extrapoints IS NOT NULL", ["id" => $challenge]), "Kann keine Extrapunkte für Challenge ohne Extrapunkte setzen!");
apiAction(function () use($class, $challenge, $extra) {
    checkMilestone($class, function () use($class, $challenge, $extra) {
        dbExecute("INSERT INTO solved_challenge (class, challenge, extra, at) VALUES (:class, :challenge, :extra, NOW())", ["class" => $class, "challenge" => $challenge, "extra" => $extra]);
    });
});
<?php

session_start();
require_once "../include.php";
if (!isIn() || !isTeacher()) {
    header("Location: ../");
    exit;
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Forex Trading Simulator - View Currency Change Values</title>
        <style>
            table, th, td {
                border: 1px solid black;
                border-collapse: collapse;
            }
            th, td {
                padding: 5px;
                text-align:center;
            }
            p
            {
                text-align:center;
            }
        </style>
        <?php 
global $mysqlusername, $mysqlpassword, $mysqldatabase, $mysqllocation;
$db = new mysqli($mysqllocation, $mysqlusername, $mysqlpassword, $mysqldatabase);
예제 #5
0
파일: review.php 프로젝트: cpausmit/Tapas
<?php

include "app/views/teacher/header.php";
// make sure we have a registered TA
if (!(isTeacher() || isMaster())) {
    exitAccessError();
}
print '<article class="page">' . "\n";
print '<h1>Review TA Evaluations</h1>' . "\n";
print ' ' . "\n";
$email = strtolower($_SERVER['SSL_CLIENT_S_DN_Email']);
// connect to our database
$link = getLink();
$active = findActiveTable($link, 'Evaluations');
print "Active evaluations table: {$active['0']}</p>";
$query = "select TeacherEmail,TaEmail,EvalText,Award,Citation from {$active['0']} " . "where TeacherEmail='{$email}'";
$statement = $link->prepare($query);
$rc = $statement->execute();
if (!$rc) {
    $errNum = mysqli_errno($link);
    $errMsg = mysqli_error($link);
    print " ERROR - could not get evaluations: ErrNo={$errNum}: {$errMsg}\n";
    exit;
}
$statement->bind_result($teacherEmail, $taEmail, $evalText, $award, $citation);
$empty = true;
while ($statement->fetch()) {
    $empty = false;
    print '<hr>';
    print '<p>';
    print "<b>Evaluee:  </b> {$taEmail}<br>\n";
예제 #6
0
<?php

include "include/access.php";
check_access(TEACHER);
include "include/header.php";
if (isTeacher()) {
    $classStmt = $db->prepare("SELECT id, name FROM class WHERE teacher = :teacher ");
    $classStmt->execute(["teacher" => $_SESSION['user']]);
} else {
    // admins are allowed to change everything
    $classStmt = $db->prepare("SELECT id, name FROM class");
    $classStmt->execute();
}
$allowed_classes = $classStmt->fetchAll(PDO::FETCH_OBJ);
include "include/chart.php";
?>

<div  style="
margin-left: 1%;
float: left;
width: 100%;
z-index: 2;
margin-left: 0%;
margin-top: -14px;
margin-right: 0%;
margin-bottom: 0px;
">


   <img src="teacher-banner.png" tag="light" width="100%" alt="light"
 height="auto">
예제 #7
0
    <h4>' . getTxt('Users') . '</h4>
    </a>
      <ul style="list-style: none;" class="collapse" id="usermgmt">';
    echo "<li class=\"add_user\"><a href='" . site_url('user/add') . "'>" . getTxt('AddUser') . "</a></li>";
    echo "<li class=\"edit_user\"><a href='" . site_url('user/changepass') . "'>" . getTxt('ChangePassword') . "</a></li>";
    echo "<li class=\"edit_user\"><a href='" . site_url('user/changeownpass') . "'>" . getTxt('ChangeYourPassword') . "</a></li>";
    // > admin
    if (isAdmin()) {
        echo "<li class=\"change_authority\"><a href='" . site_url('user/edit') . "'>" . getTxt('ChangeAuthorityButton') . "</a></li>";
    }
    // > teacher admin
    echo "<li class=\"remove_user\"><a href='" . site_url('user/delete') . "'>" . getTxt('RemoveUser') . "</a></li>";
    echo "</ul>";
    echo "</li>";
}
if (isStudent() || isTeacher() || isAdmin()) {
    // student teacher
    echo '<li class="nav-header"> <a href="#" data-toggle="collapse" data-target="#dataMgmt">
    <h4>' . getTxt('AddData') . '</h4>
    </a>
      <ul style="list-style: none;" class="collapse" id="dataMgmt">';
    echo "<li class=\"add_single_value\"><a href='" . site_url('datapoint/addvalue') . "'>" . getTxt('AddSingleValue') . "</a></li>";
    echo "<li class=\"add_multiple_value\"><a href='" . site_url('datapoint/addmultiplevalues') . "'>" . getTxt('AddMultipleValues') . "</a></li>";
    echo "<li class=\"import_data\"><a href='" . site_url('datapoint/importfile') . "'>" . getTxt('ImportDataFiles') . "</a></li>";
    echo "</ul>";
    echo "</li>";
}
echo "<li class=\"search\"><a href='" . site_url('sites/map') . "'>" . getTxt('SearchData') . "</a></li>";
echo "<li class=\"help\"><a href='" . site_url('home/help') . "'>" . getTxt('Help') . "</a></li>";
echo "<li class=\"search\"><a href='" . "/climate/services/" . "'>" . getTxt('WebServices') . "</a></li>";
if (isLoggedIn()) {
예제 #8
0
/**
 * @package:SMS
 * @helper::whoIs().
 * @Author:Techno Services
 */
function whoIs()
{
    $page = 'dashboard';
    if (isParent()) {
        $page = 'parents/parents-module';
    } elseif (isStudent()) {
        $page = 'students/students-module';
    } elseif (isTeacher()) {
        $page = 'teachers/teacher-module';
    }
    return $page;
}