예제 #1
0
print "<th>&nbsp; Email &nbsp;</th>";
print "<th>&nbsp; Preference 1 &nbsp;</th>";
print "<th>&nbsp; Preference 2 &nbsp;</th>";
print "<th>&nbsp; Preference 3 &nbsp;</th>";
print "</tr>\n";
$empty = true;
foreach ($preferences as $email => $preference) {
    $empty = false;
    if (array_key_exists($email, $students)) {
        $student = $students[$email];
        $name = "{$student->lastName}, {$student->firstName}";
    } else {
        $name = "<b>NO NAME FOUND IN DATABASE - FIX IT!</b>";
    }
    $task1 = new TeachingTask($preference->pref1);
    $task2 = new TeachingTask($preference->pref2);
    $task3 = new TeachingTask($preference->pref3);
    print "<tr>";
    print "<td>&nbsp; {$name} &nbsp;</td>";
    print "<td>&nbsp; {$email} &nbsp;</td>";
    print "<td>&nbsp; " . $task1->getTaTask() . " &nbsp;</td>";
    print "<td>&nbsp; " . $task2->getTaTask() . " &nbsp;</td>";
    print "<td>&nbsp; " . $task3->getTaTask() . " &nbsp;</td>";
    print "</tr>\n";
}
print "</table>\n";
if ($empty) {
    print ' No preferences found in this term.';
}
print '</article>' . "\n";
include "app/views/admin/footer.php";
예제 #2
0
파일: db.php 프로젝트: cpausmit/Tapas
function findTaNames($link, $table)
{
    // show all assignments
    $query = "select Students.FirstName, Students.LastName, {$table}.Person, {$table}.Task" . " from {$table},Students where Students.Email = {$table}.Person order by Students.LastName";
    $statement = $link->prepare($query);
    $rc = $statement->execute();
    if (!$rc) {
        $errNum = mysqli_errno($link);
        $errMsg = mysqli_error($link);
        print " ERROR - could not register selection: ErrNo=" . mysqli_errno($link) . ": " . mysqli_error($link) . "\n";
        exit;
    }
    $statement->bind_result($firstName, $lastName, $email, $task);
    $i = 0;
    $names = "";
    while ($statement->fetch()) {
        $myTask = new TeachingTask($task);
        $description = $myTask->getTaTask();
        $names[$email] = $lastName . ', ' . $firstName . '  Task: ' . $description;
        $i = $i + 1;
    }
    return $names;
}
예제 #3
0
파일: select.php 프로젝트: cpausmit/Tapas
print "Active tables: {$tasTable} (TAs), {$active['0']} (Assignments)</p>";
// start the form
print '<form class="ta" action="/register" method="post">' . "\n";
// start the table
print '<p>' . "\n";
print '<table>' . "\n";
// generate the options
$options = array();
$query = "select * from {$active['0']} order by Task";
$statement = $link->prepare($query);
$statement->execute();
$statement->bind_result($task, $email);
while ($statement->fetch()) {
    $myTask = new TeachingTask($task);
    if ($myTask->isTa() && $myTask->getEffort() == 'full') {
        $option = $myTask->getTaTask();
        $find = array_search($option, $options);
        if (!$find) {
            $options[$task] = $option;
        }
    }
}
// First preference
print '<tr><td>What is your first preference?</td><td><select class="ta" name="pref1">' . "\n";
print '  <option value="">Select Preference 1</option>' . "\n";
foreach ($options as $key => $option) {
    print "<option value=\"" . $key . "\"> {$option} </option>";
}
print '</select></td></tr>' . "\n";
// Second preference
$query = "select * from {$active['0']}";