コード例 #1
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";
コード例 #2
0
ファイル: remove.php プロジェクト: cpausmit/Tapas
<?php

include "app/views/ta/header.php";
// make sure we are dealing with a registered TA
if (!(isTa() || isMaster())) {
    exitAccessError();
}
print '<article class="page">' . "\n";
print '<h1>TA Preference Removal</h1>';
// connect to our database
$link = getLink();
// find the active tables
$tableNames = findActiveTable($link, 'Preferences');
$activeTable = $tableNames[0];
$email = strtolower($_SERVER['SSL_CLIENT_S_DN_Email']);
$query = "delete from {$activeTable} where Email = '" . $email . "'";
$statement = $link->prepare($query);
$rc = $statement->execute();
if (!$rc) {
    $errNum = mysqli_errno($link);
    $errMsg = mysqli_error($link);
    print " ERROR - could not remove preferences: ErrNo=" . $errNum . ": " . $errMsg . "\n";
} else {
    print '<p>Selected preferences have been removed.</p>';
}
print '</article>' . "\n";
include "app/views/ta/footer.php";
コード例 #3
0
<?php

include "app/views/admin/header.php";
include "app/models/TeachingTask.php";
// make sure we are dealing with a registered TA
if (!isMaster()) {
    exitAccessError();
}
print '<article class="page">' . "\n";
print '<h1>Show last years TA Assignments</h1>';
print ' ';
// connect to our database
$link = getLink();
// find the active tables and the last non-active table
$active = findActiveTable($link, 'Assignments');
$pattern = substr($active[0], 0, -4);
$last = findLastTable($link, $pattern, $active[0]);
print "Last assignment table: {$last}</p>";
// show last assignments
showAssignment($link, $last);
print '</article>' . "\n";
include "app/views/admin/footer.php";
コード例 #4
0
ファイル: db.php プロジェクト: cpausmit/Tapas
function readTeacherTable($link)
{
    // first find active tables
    $tables = findActiveTable($link, 'Evaluations');
    $term = substr($tables[0], -5, 5);
    $query = "select Person from Assignments{$term} where Task like '%Lec%'";
    $statement = $link->prepare($query);
    $rc = $statement->execute();
    // the one place where we load the active teachers
    $teachers = "";
    $i = 0;
    $statement->bind_result($email);
    while ($statement->fetch()) {
        $teachers[$i] = $email;
        $i = $i + 1;
    }
    return $teachers;
}