- display status on project and student pages to show if the section is complete or not

- add a new function happy() for displaying 'good' things... also the CSS to go with it.
   now we have:		error() - displaying bad things (in red)
   			notice() - displaying neutral things (in grey/blue)
			happy() - displaying good things (in green)
This commit is contained in:
james 2004-12-08 20:34:02 +00:00
parent 44473f264b
commit 880d5b0a82
4 changed files with 47 additions and 4 deletions

View File

@ -129,6 +129,11 @@ function notice($str)
return "<div class=\"notice\">$str</div><br />";
}
function happy($str)
{
return "<div class=\"happy\">$str</div><br />";
}
$HEADER_SENT=false;
function send_header($title="")
{

View File

@ -34,6 +34,9 @@ echo mysql_error();
//send the header
send_header("Participant Registration - Project Information");
echo "<a href=\"register_participants_main.php\">&lt;&lt; ".i18n("Back to Participant Registration Summary")."</a><br />";
echo "<br />";
$studentstatus=studentStatus();
if($studentstatus!="complete")
{
@ -105,8 +108,21 @@ echo mysql_error();
}
echo "<a href=\"register_participants_main.php\">&lt;&lt; ".i18n("Back to Participant Registration Summary")."</a><br />";
echo "<br />";
//output the current status
$newstatus=projectStatus();
if($newstatus!="complete")
{
echo error(i18n("Project Information Incomplete"));
}
else if($newstatus=="complete")
{
echo happy(i18n("Project Information Complete"));
}
echo "<form method=\"post\" action=\"register_participants_project.php\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"save\">\n";
echo "<input type=\"hidden\" name=\"id\" value=\"$projectinfo->id\">\n";

View File

@ -1,5 +1,6 @@
<?
require("common.inc.php");
include "register_participants.inc.php";
//authenticate based on email address and registration number from the SESSION
if(!$_SESSION['email'])
@ -89,6 +90,7 @@ echo mysql_error();
}
$x++;
}
}
if($_GET['action']=="removestudent")
@ -107,6 +109,19 @@ if($_GET['action']=="removestudent")
}
//output the current status
$newstatus=studentStatus();
if($newstatus!="complete")
{
echo error(i18n("Student Information Incomplete"));
}
else if($newstatus=="complete")
{
echo happy(i18n("Student Information Complete"));
}
//now query and display
$q=mysql_query("SELECT * FROM students WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'");
@ -206,10 +221,10 @@ if($_GET['action']=="removestudent")
echo "</tr>";
echo "<tr>\n";
echo " <td>".i18n("School")."</td><td>";
$q=mysql_query("SELECT id,school FROM schools WHERE year='".$config['FAIRYEAR']."' ORDER by school");
$schoolq=mysql_query("SELECT id,school FROM schools WHERE year='".$config['FAIRYEAR']."' ORDER by school");
echo "<select name=\"schools_id[$x]\">\n";
echo "<option value=\"\">".i18n("Choose School")."</option>\n";
while($r=mysql_fetch_object($q))
while($r=mysql_fetch_object($schoolq))
{
if($studentinfo->schools_id==$r->id) $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"$r->id\">".htmlspecialchars($r->school)."</option>\n";

View File

@ -153,6 +153,13 @@ a {
background: #E0E0FF;
}
.happy {
color: green;
font-weight: bold;
border: 1px solid Silver;
background: #D0EED0;
}
.caution {
text-decoration: none;
font-weight: bold;