From f56d8f576c444143f066b9a6cdea98a86219586f Mon Sep 17 00:00:00 2001 From: james Date: Fri, 2 Mar 2012 20:10:22 +0000 Subject: [PATCH] Group invitations list query by registration number so it only gets ONE student per project. --- schoolinvite.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/schoolinvite.php b/schoolinvite.php index 6341205..a3cf29e 100644 --- a/schoolinvite.php +++ b/schoolinvite.php @@ -96,7 +96,8 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode']) $datecheck=mysql_fetch_object($q); - $q=mysql_query("SELECT students.*, + $q=mysql_query("SELECT + students.*, registrations.num, registrations.emailcontact FROM @@ -106,13 +107,13 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode']) students.schools_id='".$school->id."' AND students.year='".$config['FAIRYEAR']."' AND students.registrations_id=registrations.id + GROUP BY registrations.num ORDER BY lastname, firstname"); $currentinvited=mysql_num_rows($q); - if($datecheck!=0) - { + if($datecheck!=0) { echo i18n("In order for your school's students to register for the fair, you will need to invite them to register. Simply enter their email address below to invite them to register. Important: for group projects, only add one of the participants, that participant will then add the other group member(s) to the project"); echo "
"; echo "
"; @@ -150,6 +151,7 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode']) AND students.grade<='$catr->maxgrade' AND students.year='".$config['FAIRYEAR']."' AND students.registrations_id=registrations.id + GROUP BY registrations.num "); echo mysql_error(); $r2=mysql_fetch_object($q2); @@ -226,6 +228,7 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode']) echo "".i18n("Grade").""; echo "".i18n("Registration Number").""; echo "".i18n("Actions").""; + while($r=mysql_fetch_object($q)) { echo "$r->lastname$r->firstname"; echo "$r->email";