diff --git a/common.inc.php b/common.inc.php
index 35acd5c..fbb88f3 100644
--- a/common.inc.php
+++ b/common.inc.php
@@ -168,6 +168,7 @@ echo "
diff --git a/register_participants.inc.php b/register_participants.inc.php
index 9fdbb07..9e46277 100644
--- a/register_participants.inc.php
+++ b/register_participants.inc.php
@@ -1,4 +1,32 @@
+function outputStatus($status)
+{
+ $ret="";
+ switch($status)
+ {
+ case 'incomplete':
+ $ret.="
";
+ $ret.= i18n("Incomplete");
+ $ret.= "
";
+ break;
+ case 'complete':
+ $ret.= "
";
+ $ret.= i18n("Complete");
+ $ret.= "
";
+ break;
+ case 'empty':
+ $ret.="
";
+ $ret.= i18n("Empty");
+ $ret.= "
";
+ break;
+
+ default:
+ $ret.=i18n("Unknown");
+ break;
+ }
+ return $ret;
+}
+
function studentStatus()
{
global $config;
@@ -6,6 +34,36 @@ function studentStatus()
$q=mysql_query("SELECT * FROM students WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'");
+ //if we dont have the minimum, return incomplete
+ if(mysql_num_rows($q)<$config['minstudentsperproject'])
+ return "incomplete";
+
+ while($r=mysql_fetch_object($q))
+ {
+ foreach ($required_fields AS $req)
+ {
+ if(!$r->$req)
+ {
+ return "incomplete";
+ }
+ }
+ }
+
+ //if it made it through without returning incomplete, then we must be complete
+ return "complete";
+}
+
+function projectStatus()
+{
+ global $config;
+ $required_fields=array("title","projectcategories_id","projectdivisions_id","summary","language");
+
+ $q=mysql_query("SELECT * FROM projects WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'");
+
+ //if we dont have a project entry yet, return empty
+ if(!mysql_num_rows($q))
+ return "empty";
+
while($r=mysql_fetch_object($q))
{
foreach ($required_fields AS $req)
diff --git a/register_participants_main.php b/register_participants_main.php
index a0ca9ac..c59c160 100644
--- a/register_participants_main.php
+++ b/register_participants_main.php
@@ -48,28 +48,22 @@ echo "
";
echo i18n("Student Information");
echo "";
echo "
";
-$status=studentStatus();
-switch($status)
-{
- case 'incomplete':
- echo " ";
- echo i18n("Incomplete");
- echo " ";
- break;
- case 'complete':
- echo "";
- echo i18n("Complete");
- echo " ";
- break;
- default:
- break;
-}
//check to see if its complete
+$status=studentStatus();
+echo outputStatus($status);
echo " | ";
//project information
-echo "
".i18n("Project Information")." | ";
+echo " |
";
+echo "";
+echo "".i18n("Project Information");
+echo "";
+echo " | ";
//check to see if its complete
+$status=projectStatus();
+echo outputStatus($status);
+
+
echo " |
";
//safety information
diff --git a/register_participants_project.php b/register_participants_project.php
new file mode 100644
index 0000000..acf9ea0
--- /dev/null
+++ b/register_participants_project.php
@@ -0,0 +1,39 @@
+
+ require("common.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;
+
+ }
+ $r=mysql_fetch_object($q);
+
+ send_header("Participant Registration - Project Information");
+echo "
<< ".i18n("Back to Participant Registration Summary")."";
+ echo "
";
+
+
+ send_footer();
+?>