Exemple #1
0
    while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
        echo "<tr><td>" . $row["NAME"] . "</td><td>" . $row["MAXSIZE"] . "</td><td>" . $row["PRICE"] . "</td></tr>";
    }
    echo "</table>";
}
function printActivityUseTable($result)
{
    echo "<table class=\"myTable\">";
    echo "<tr>\n\t\t\t\t<th>Activity ID</th>\n\t\t\t\t<th>Name</th>\n\t\t\t\t<th>Day</th><th></th><th></th>\n\t\t\t\t<th>Start Time</th><th></th><th></th>\n\t\t\t\t<th>End Time</th><th></th>\n\t\t\t\t<th>Room</th>\n\t\t\t</tr>";
    while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {
        echo "<tr><td>" . $row["ACTIVITY_ID"] . "</td><td>" . $row["NAME"] . "</td><td>" . $row["DAY"] . "</td><td>" . "</td><td>" . "</td><td>" . $row["START_TIME"] . "</td><td>" . "</td><td>" . "</td><td>" . $row["END_TIME"] . "</td><td>" . "</td><td>" . $row["ROOMNUM"] . "</td></tr>";
    }
    echo "</table>";
}
if ($db_conn) {
    dropDownFromQuery($attr_name, $table, "activities.php");
    // Display Activity_Info and Activity_Uses entires
    $activityInfoCmd = "select * from Activity_Info";
    $activityUseCmd = "select * from Activity_uses";
    if ($_POST["activityName"] != "") {
        $activityInfoCmd = "select * from Activity_Info where name like '%" . $_POST["activityName"] . "%'";
        $activityUseCmd = "select * from Activity_uses where name like '%" . $_POST["activityName"] . "%'";
    }
    echo '<h2>Activity Info</h2>';
    $result1 = executePlainSQL($activityInfoCmd);
    printActivityInfoTable($result1);
    echo '<h2>Activity Uses</h2>';
    $result2 = executePlainSQL($activityUseCmd);
    printActivityUseTable($result2);
}
?>
Exemple #2
0
    // echo $queryString . "<br>";
    $result = executePlainSQL($queryString);
    printResultTable($result, "Classes", $attributes[1], $attributes[2]);
}
if ($db_conn) {
    // Generate form for user input
    echo "<h2>Filter Classes</h2>";
    generateClassForm();
    if ($_GET["select"] == "Search...") {
        echo "<b>ERROR: Not a valid search term</b> <br>";
    } elseif (array_key_exists("selectMode", $_GET)) {
        executeClassQuery(projectionConditions(), $_GET["selectMode"]);
    }
    // Create Dropdown Menu
    echo "<h2>Class Names</h2>";
    dropDownFromQuery($attr_name, $table, "classes.php");
    // Display Class_Info and Class_Uses entires
    $classInfoCmd = "select * from class_info";
    $classUseCmd = "select c.activity_ID, c.name, c.day, c.start_time, c.end_time, c.repeatedOn, c.NumOfSessions, c.roomNum, t.name as InstructorName from class_uses c, teaches t where c.activity_id = t.activity_id";
    if ($_POST["activityName"] != "") {
        $classInfoCmd = "select * from class_info where name like '%" . $_POST["activityName"] . "%'";
        $classUseCmd = "select c.activity_ID, c.name, c.day, c.start_time, c.end_time, c.repeatedOn, c.NumOfSessions, c.roomNum, t.name as InstructorName from class_uses c, teaches t where c.name like '%" . $_POST["activityName"] . "%' and c.activity_id = t.activity_id";
    }
    echo '<h2>Class Info</h2>';
    $result1 = executePlainSQL($classInfoCmd);
    printClassInfoTable($result1);
    echo '<h2>Class Uses</h2>';
    $result2 = executePlainSQL($classUseCmd);
    printClassUseTable($result2);
}
?>