forked from science-ation/science-ation
Fix a typo bug on a variable name which prevented the system from cutting off registrations when the maximum is reached
This commit is contained in:
parent
a8e81cc84c
commit
d30468326e
@ -117,33 +117,25 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
$okaygrades=array();
|
||||
if($config['participant_registration_type']=="invite")
|
||||
{
|
||||
if($school->projectlimitper=="total")
|
||||
{
|
||||
if($school->projectlimit)
|
||||
{
|
||||
if($config['participant_registration_type']=="invite") {
|
||||
if($school->projectlimitper=="total") {
|
||||
if($school->projectlimit) {
|
||||
echo i18n("You have invited %1 of %2 total projects for your school",array($currentinvited,$school->projectlimit));
|
||||
if($currenteinvited<$school->projectlimit)
|
||||
{
|
||||
if($currentinvited<$school->projectlimit) {
|
||||
for($a=$config['mingrade'];$a<=$config['maxgrade'];$a++)
|
||||
$okaygrades[]=$a;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
echo i18n("You have invited %1 project(s) for your school",array($currentinvited,$school->projectlimit));
|
||||
for($a=$config['mingrade'];$a<=$config['maxgrade'];$a++)
|
||||
$okaygrades[]=$a;
|
||||
|
||||
}
|
||||
}
|
||||
else if($school->projectlimitper=="agecategory")
|
||||
{
|
||||
else if($school->projectlimitper=="agecategory") {
|
||||
echo "<br />";
|
||||
$catq=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' ORDER BY id");
|
||||
while($catr=mysql_fetch_object($catq))
|
||||
{
|
||||
while($catr=mysql_fetch_object($catq)) {
|
||||
|
||||
$q2=mysql_query("SELECT COUNT(students.id) AS num
|
||||
FROM
|
||||
@ -160,8 +152,7 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
|
||||
$r2=mysql_fetch_object($q2);
|
||||
$currentinvited=$r2->num;
|
||||
|
||||
if($currentinvited<$school->projectlimit || $school->projectlimit==0)
|
||||
{
|
||||
if($currentinvited<$school->projectlimit || $school->projectlimit==0) {
|
||||
for($a=$catr->mingrade;$a<=$catr->maxgrade;$a++)
|
||||
$okaygrades[]=$a;
|
||||
}
|
||||
@ -171,16 +162,14 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
//hmm projectlimitper has not been set
|
||||
//so we have no limits, anyone can register or they can add as many as they want.
|
||||
for($x=$config['mingrade']; $x<=$config['maxgrade']; $x++)
|
||||
$okaygrades[]=$x;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// this could be an else if $config['participant_registration_type']=="openorinvite" )
|
||||
//because openorinvite is the only other option
|
||||
|
||||
@ -194,8 +183,7 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
|
||||
}
|
||||
echo "<br />";
|
||||
|
||||
if(count($okaygrades))
|
||||
{
|
||||
if(count($okaygrades)) {
|
||||
|
||||
echo "<form method=POST action=\"schoolinvite.php\">";
|
||||
echo "<input type=hidden name=action value=\"invite\">";
|
||||
@ -210,8 +198,7 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
|
||||
echo "<select name=\"grade\">\n";
|
||||
echo "<option value=\"\">".i18n("Select Grade")."</option>\n";
|
||||
// for($gr=$config['mingrade'];$gr<=$config['maxgrade'];$gr++)
|
||||
foreach($okaygrades AS $gr)
|
||||
{
|
||||
foreach($okaygrades AS $gr) {
|
||||
echo "<option value=\"$gr\">$gr</option>\n";
|
||||
}
|
||||
|
||||
@ -221,8 +208,7 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
|
||||
echo "<input type=\"submit\" value=\"".i18n("Invite Participant")."\">";
|
||||
echo "</form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
echo notice(i18n("You have invited the maximum number of participants for your school"));
|
||||
|
||||
}
|
||||
@ -230,16 +216,14 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
|
||||
echo "<br />";
|
||||
|
||||
echo "<h4>".i18n("Invited participants from your school")."</h4>";
|
||||
if(mysql_num_rows($q))
|
||||
{
|
||||
if(mysql_num_rows($q)) {
|
||||
echo "<table class=\"summarytable\">";
|
||||
echo "<tr><th>".i18n("Last Name")."</th><th>".i18n("First Name")."</th>";
|
||||
echo "<th>".i18n("Email Address")."</th>";
|
||||
echo "<th>".i18n("Grade")."</th>";
|
||||
echo "<th>".i18n("Registration Number")."</th>";
|
||||
echo "<th colspan=\"2\">".i18n("Actions")."</th></tr>";
|
||||
while($r=mysql_fetch_object($q))
|
||||
{
|
||||
while($r=mysql_fetch_object($q)) {
|
||||
echo "<tr><td>$r->lastname</td><td>$r->firstname</td>";
|
||||
echo "<td>$r->email";
|
||||
if($r->emailcontact)
|
||||
@ -262,21 +246,20 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
else
|
||||
else {
|
||||
echo i18n("You have not yet invited any participants from your school");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
echo error(i18n("Invalid School ID or Access Code"));
|
||||
echo "<br />";
|
||||
echo "<a href=\"schoolaccess.php\">".i18n("Perhaps you should login first")."</a>";
|
||||
}
|
||||
send_footer();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
header("Location: schoolaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user