Example #1
0
include "app/models/Dbc.php";
include "app/models/ActiveTables.php";
include "app/models/Student.php";
include "app/models/Preference.php";
// connect to our database
$db = Dbc::getReader();
// read complete students table
$empty = true;
$students = "";
$rows = $db->query("select * from Students order by lastName");
foreach ($rows as $key => $row) {
    $student = Student::fromRow($row);
    $students[$student->email] = $student;
}
// find active preference table
$activeTables = new ActiveTables($db);
$preferenceTable = $activeTables->getUniqueMatchingName('Preferences');
// do the query
$nTas = 0;
$preferences = "";
$rows = $db->query("select * from {$preferenceTable}");
foreach ($rows as $key => $row) {
    $preference = Preference::fromRow($row);
    $preferences[$preference->email] = $preference;
    $nTas = $nTas + 1;
}
// start page
print '<article class="page">' . "\n";
print '<h1>All Active TA Preferences</h1>' . "\n";
print "<p>Number of TAs with registered preferences: {$nTas}</p>\n";
print "\n";
Example #2
0
}
include "app/models/Dbc.php";
include "app/models/ActiveTables.php";
include "app/models/Student.php";
include "app/models/Ta.php";
// connect to our database
$db = Dbc::getReader();
// read complete students table
$students = "";
$rows = $db->query("select * from Students order by lastName");
foreach ($rows as $key => $row) {
    $student = Student::fromRow($row);
    $students[$student->email] = $student;
}
// find active Ta table
$activeTables = new ActiveTables($db);
$taTable = $activeTables->getUniqueMatchingName('Tas');
// do the query
$rows = $db->query("select Email, Fulltime, PartTime from {$taTable} order by Email");
$i = 0;
$tas = "";
foreach ($rows as $key => $row) {
    $ta = Ta::fromRow($row);
    $tas[$i] = $ta;
    $i = $i + 1;
}
$nTas = $i;
print "<article class=\"page\">\n";
print "<h1>Show Active TAs</h1>\n";
print "<p>Active assignment table: {$taTable}";
print " with {$nTas} Tas.</p>";
Example #3
0
// get TA names
$rows = $db->query("select * from Students order by lastName");
$taNames = "";
foreach ($rows as $key => $row) {
    $student = Student::fromRow($row);
    $taNames[$student->email] = "{$student->lastName}, {$student->firstName}";
}
// get teacher names
$rows = $db->query("select * from Faculties order by lastName");
$teacherNames = "";
foreach ($rows as $key => $row) {
    $teacher = Teacher::fromRow($row);
    $teacherNames[$teacher->email] = "{$teacher->lastName}, {$teacher->firstName}";
}
// find active evaluations table
$activeTables = new ActiveTables($db);
$evalTable = $activeTables->getUniqueMatchingName('Evaluations');
// get evaluations
$i = 0;
$evaluations = "";
$rows = $db->query("select * from {$evalTable} order by TaEmail");
foreach ($rows as $key => $row) {
    $evaluation = Evaluation::fromRow($row);
    $evaluations[$i] = $evaluation;
    $i = $i + 1;
}
// Present the results
print '<article class="page">' . "\n";
print '<h1>All Active TA Evaluations</h1>' . "\n";
print ' ' . "\n";
// loop through evaluations and print