From 68ff4380e18cc8276606c22bbf6720228c629d3e Mon Sep 17 00:00:00 2001 From: james Date: Fri, 3 Dec 2004 00:11:09 +0000 Subject: [PATCH] introduce new config parameters: minstudentsperproject and maxstudentsperproject make students page use these values --- register_participants_students.php | 48 +++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/register_participants_students.php b/register_participants_students.php index 0799ec3..4388b33 100644 --- a/register_participants_students.php +++ b/register_participants_students.php @@ -42,40 +42,40 @@ echo mysql_error(); //although... this can never really happen, since the above queries only allow the page to view if the student //is found in the students table... soo... well, lets leave it here as a fallback anyways, just incase mysql_query("INSERT INTO students (registrations_id,email,year) VALUES ('".$_SESSION['registration_id']."','".mysql_escape_string($_SESSION['email'])."','".$config['FAIRYEAR']."')"); - } - else if(mysql_num_rows($q)==1) - { - $numstudents1="checked=\"checked\""; - $numstudents2=""; - - } - else if(mysql_num_rows($q)==2) - { - $numstudents1=""; - $numstudents2="checked=\"checked\""; - + //if we just inserted it, then we will obviously find 1 + $numfound=1; } else { - //this should never happen - //we cant have more than two on a project - echo error(i18n("More than two students associated with this registration")); - //FIXME: eventually provide a solution to fix this if it ever happens.. like say.... - // "click here" to remove all students and start again.. or something + $numfound=mysql_num_rows($q); } - echo "
"; - echo " ".i18n("I worked on the project by myself")."
"; - echo " ".i18n("I worked on the project with a partner")."
"; + echo ""; + echo i18n("Number of students that worked on the project: "); + echo ""; echo "
"; + if($_GET['numstudents']) + $numtoshow=$_GET['numstudents']; + else + $numtoshow=$numfound; - for($x=1;$x<=2;$x++) + for($x=1;$x<=$numtoshow;$x++) { $studentinfo=mysql_fetch_object($q); - echo "
\n"; - echo "

Student Details

"; - echo "
\n\n"; + echo "

".i18n("Student %1 Details",array($x))."

"; + echo ""; + echo ""; + echo "
".i18n("Name").": name\">
"; + echo "
"; + echo "
"; } send_footer();