Commit f2b7a1d6 authored by William Paul Liggett's avatar William Paul Liggett

Placed form buttons on the scheduled tests control section. However, the buttons don't do much yet.

parent 1be3b308
......@@ -70,7 +70,7 @@
require_once "../../../../protected_site_configs/junktext.com/openvigilance_db_connection.php";
// Test Control: Active tests.
$sql = "SELECT subject_id, test_condition, test_pin FROM test_control WHERE active=1 ORDER BY subject_id";
$sql = "SELECT sk, subject_id, test_condition, test_pin FROM test_control WHERE test_scheduled=1 ORDER BY subject_id";
$statement = $pdo->prepare($sql);
$statement->execute();
$rows = $statement->fetchAll(); // Grabs all of the rows.
......@@ -81,29 +81,42 @@
echo "<h2>Scheduled Tests</h2>" . PHP_EOL;
if($num_rows > 0) {
// Creates the <form> to enable the add, edit, and remove button functionalities.
echo "$tab$tab<form action=\"admin\" name=\"ScheduledTests\" method=\"post\">" . PHP_EOL;
// Sets up the <table> heading.
echo "$tab$tab<table>" . PHP_EOL .
"$tab$tab$tab<thead>" . PHP_EOL .
"$tab$tab$tab$tab<tr>" . PHP_EOL .
"$tab$tab$tab$tab$tab<th>Subject ID</th>" . PHP_EOL .
"$tab$tab$tab$tab$tab<th>Test Condition</th>" . PHP_EOL .
"$tab$tab$tab$tab$tab<th>Test PIN</th>" . PHP_EOL .
"$tab$tab$tab$tab</tr>" . PHP_EOL .
"$tab$tab$tab</thead>" . PHP_EOL .
"$tab$tab$tab<tbody>" . PHP_EOL;
echo "$tab$tab$tab<table>" . PHP_EOL .
"$tab$tab$tab$tab<thead>" . PHP_EOL .
"$tab$tab$tab$tab$tab<tr>" . PHP_EOL .
"$tab$tab$tab$tab$tab$tab<th>&nbsp;</th>" . PHP_EOL .
"$tab$tab$tab$tab$tab$tab<th>Subject ID</th>" . PHP_EOL .
"$tab$tab$tab$tab$tab$tab<th>Test Condition</th>" . PHP_EOL .
"$tab$tab$tab$tab$tab$tab<th>Test PIN</th>" . PHP_EOL .
"$tab$tab$tab$tab$tab</tr>" . PHP_EOL .
"$tab$tab$tab$tab</thead>" . PHP_EOL .
"$tab$tab$tab$tab<tbody>" . PHP_EOL;
// The rows of the <table>.
foreach($rows as $key => $value) {
echo "$tab$tab$tab$tab<tr>" . PHP_EOL .
"$tab$tab$tab$tab$tab<td>" . $value["subject_id"] . "</td>" . PHP_EOL .
"$tab$tab$tab$tab$tab<td>" . $value["test_condition"] . "</td>" . PHP_EOL .
"$tab$tab$tab$tab$tab<td>" . $value["test_pin"] . "</td>" . PHP_EOL .
"$tab$tab$tab$tab</tr>" . PHP_EOL;
echo "$tab$tab$tab$tab$tab<tr>" . PHP_EOL .
"$tab$tab$tab$tab$tab$tab<td><input type=\"radio\" name=\"scheduled_test\" id=\"" . $value["sk"] . "\" /></td>" . PHP_EOL .
"$tab$tab$tab$tab$tab$tab<td>" . $value["subject_id"] . "</td>" . PHP_EOL .
"$tab$tab$tab$tab$tab$tab<td>" . $value["test_condition"] . "</td>" . PHP_EOL .
"$tab$tab$tab$tab$tab$tab<td>" . $value["test_pin"] . "</td>" . PHP_EOL .
"$tab$tab$tab$tab$tab</tr>" . PHP_EOL;
}
// Closes out the <table>
echo "$tab$tab$tab</tbody>" . PHP_EOL .
"$tab$tab</table>" . PHP_EOL;
echo "$tab$tab$tab$tab</tbody>" . PHP_EOL .
"$tab$tab$tab</table>" . PHP_EOL;
// Closes out the <form>.
echo "$tab$tab$tab<div id=\"scheduled_tests_buttons\">" . PHP_EOL .
"$tab$tab$tab$tab<input type=\"button\" name=\"add_test\" id=\"add_test\" value=\"Add Test\" />" . PHP_EOL .
"$tab$tab$tab$tab<input type=\"button\" name=\"edit_test\" id=\"edit_test\" value=\"Edit Test\" />" . PHP_EOL .
"$tab$tab$tab$tab<input type=\"button\" name=\"remove_test\" id=\"remove_test\" value=\"Remove Test\" />" . PHP_EOL .
"$tab$tab$tab</div>" . PHP_EOL .
"$tab$tab</form>" . PHP_EOL;
}
// There were no rows to display. More OV tests should be added.
......
......@@ -106,6 +106,17 @@ input[type = "submit"] {
display: inherit;
}
div#scheduled_tests_buttons {
margin-top: 1.5rem;
display: block;
text-align: center;
}
input[type = "button"] {
padding-left: 0.2rem;
padding-right: 0.2rem;
}
.error_msg {
text-align: center;
color: red;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment