Add safety page, doesnt save yet.

modify CSS for all TD's vertical-align: top
This commit is contained in:
james 2004-12-10 20:38:16 +00:00
parent 0ba15a3f4f
commit f11226ebd4
4 changed files with 123 additions and 1 deletions

View File

@ -114,6 +114,11 @@ function mentorStatus()
}
function safetyStatus()
{
return "incomplete";
}
?>

View File

@ -84,8 +84,16 @@ echo outputStatus($status);
echo "</td></tr>";
//safety information
echo "<tr><td>".i18n("Safety Information")."</td><td>";
echo "<tr><td>";
if($status=="complete")
echo "<a href=\"register_participants_safety.php\">";
echo i18n("Safety Information");
if($status=="complete")
echo "</a>";
echo "</td><td>";
//check to see if its complete
$status=safetyStatus();
echo outputStatus($status);
echo "</td></tr>";
//signature page

View File

@ -0,0 +1,105 @@
<?
require("common.inc.php");
include "register_participants.inc.php";
//authenticate based on email address and registration number from the SESSION
if(!$_SESSION['email'])
{
header("Location: register_participants.php");
exit;
}
if(!$_SESSION['registration_number'])
{
header("Location: register_participants.php");
exit;
}
$q=mysql_query("SELECT registrations.id AS regid, students.id AS studentid, students.firstname FROM registrations,students ".
"WHERE students.email='".$_SESSION['email']."' ".
"AND registrations.num='".$_SESSION['registration_number']."' ".
"AND registrations.id='".$_SESSION['registration_id']."' ".
"AND students.registrations_id=registrations.id ".
"AND registrations.year=".$config['FAIRYEAR']." ".
"AND students.year=".$config['FAIRYEAR']);
echo mysql_error();
if(mysql_num_rows($q)==0)
{
header("Location: register_participants.php");
exit;
}
$authinfo=mysql_fetch_object($q);
//send the header
send_header("Participant Registration - Safety Information");
echo "<a href=\"register_participants_main.php\">&lt;&lt; ".i18n("Back to Participant Registration Summary")."</a><br />";
echo "<br />";
if($_POST['action']=="save")
{
/*
do nothing yet
//first, lets make sure this project really does belong to them
$q=mysql_query("SELECT * FROM projects WHERE id='".$_POST['id']."' AND registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'");
if(mysql_num_rows($q)==1)
{
mysql_query("UPDATE projects SET ".
"title='".mysql_escape_string(stripslashes($_POST['title']))."', ".
"projectdivisions_id='".$_POST['projectdivisions_id']."', ".
"language='".mysql_escape_string(stripslashes($_POST['language']))."', ".
"req_table='".mysql_escape_string(stripslashes($_POST['req_table']))."', ".
"req_electricity='".mysql_escape_string(stripslashes($_POST['req_electricity']))."', ".
"req_special='".mysql_escape_string(stripslashes($_POST['req_special']))."', ".
"summary='".mysql_escape_string(stripslashes($_POST['summary']))."' ".
"WHERE id='".$_POST['id']."'");
echo mysql_error();
echo notice(i18n("Safety information successfully updated"));
}
else
{
echo error(i18n("Invalid project to update"));
}
*/
}
//output the current status
$newstatus=safetyStatus();
if($newstatus!="complete")
{
echo error(i18n("Safety Information Incomplete"));
}
else if($newstatus=="complete")
{
echo happy(i18n("Safety Information Complete"));
}
echo "<form method=\"post\" action=\"register_participants_safety.php\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"save\">\n";
echo "<table>\n";
$q=mysql_query("SELECT * FROM safetyquestions ORDER BY ord");
$num=1;
while($r=mysql_fetch_object($q))
{
echo "<tr><td><b>$num</b>. </td><td>".i18n($r->question)."</td>";
echo "<td>";
if($r->type=="check")
{
echo "<input type=\"checkbox\" name=\"safety[$r->id]\" value=\"checked\" />";
}
echo "</td>";
echo "</tr>";
$num++;
}
echo "</table>";
echo "<input type=\"submit\" value=\"".i18n("Save Safety Information")."\" />\n";
echo "</form>";
send_footer();
?>

View File

@ -7,6 +7,10 @@ body
background: #E0E0FF;
}
td {
vertical-align: top;
}
#header {
height: 50px;
text-align: center;