" . i18n("Invalid school ID") . "

"; return; } switch($config['participant_registration_type']){ case "schoolpassword": echo "

".i18n("Participant Registration Password")."

"; echo "

" . i18n("In order for your school's students to register for the fair, they will need to know your specific school registration password") . "

"; echo "

" . i18n("Registration Password: %1",array($school->registration_password)) . "

"; break; case "invite": case "openorinvite": draw_invitation_form($school); break; case "open": echo "

" . i18n("Registration for this conference is open.") . "

"; break; default: echo $config['participant_registration_type']; } } function draw_invitation_form($school){ global $config, $conference; $q=mysql_query("SELECT (NOW()>'".$config['dates']['regopen']."' AND NOW()<'".$config['dates']['regclose']."') AS datecheck"); $datecheck=mysql_fetch_object($q); /* $query = " SELECT JOIN user_roles ON user_roles.users_id = users.id JOIN roles ON roles.id = user_roles.roles_id WHERE roles.`type` = 'participant' */ /* $q=mysql_query("SELECT students.*, registrations.num, registrations.emailcontact FROM students, registrations WHERE students.schools_id='".$school->id."' AND students.conferences_id='".$conference['id']."' AND students.registrations_id=registrations.id ORDER BY lastname, firstname"); */ $currentinvited= 'FIXME';//mysql_num_rows($q); 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 "
"; $okaygrades=array(); 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){ for($a=$config['mingrade'];$a<=$config['maxgrade'];$a++) $okaygrades[]=$a; } } 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") { echo "
"; $catq=mysql_query("SELECT * FROM projectcategories WHERE conferences_id='".$conference['id']."' ORDER BY id"); while($catr=mysql_fetch_object($catq)){ $q2=mysql_query("SELECT COUNT(students.id) AS num FROM students, registrations WHERE students.schools_id='".$school->id."' AND students.grade>='$catr->mingrade' AND students.grade<='$catr->maxgrade' AND students.conferences_id='".$conference['id']."' AND students.registrations_id=registrations.id "); echo mysql_error(); $r2=mysql_fetch_object($q2); $currentinvited = $r2->num; if($currentinvited < $school->projectlimit || $school->projectlimit==0){ for($a=$catr->mingrade;$a<=$catr->maxgrade;$a++) $okaygrades[]=$a; } echo i18n("You have invited %1 of %2 total projects for for the %3 age category",array($currentinvited,$school->projectlimit,i18n($catr->category))); echo "
"; } } 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 { // this could be an else if $config['participant_registration_type']=="openorinvite" ) //because openorinvite is the only other option //so we have no limits, anyone can register or they can add as many as they want. //you cannot enforce limits when the system is 'open' because anyone can choose any school //and if its openorinvite then whatever happens in the inviter still morepeople can be added //by themselves, so there's no point in having limits. for($x=$config['mingrade']; $x<=$config['maxgrade']; $x++) $okaygrades[]=$x; } echo "
"; if(count($okaygrades)) { echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".i18n("Student Email Address")."".i18n("Or unique username for student")."
".i18n("Student Password")."
".i18n("Contact Email Address")."".i18n("Any emails that would normally go to the student, will also be sent to this address")."
".i18n("Student First Name")."
".i18n("Student Last Name")."
".i18n("Grade").""; echo "
"; echo ''; echo "
"; } else { echo notice(i18n("You have invited the maximum number of participants for your school")); } } echo "
"; echo "

".i18n("Invited participants from your school")."

"; echo "
"; draw_student_list($school->id); echo "
"; } function draw_student_list($schoolId){ global $config, $roles; $studentList = user_list_modifiable($roles['participant']['id']); if(count($studentList) > 0){ echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; foreach($studentList as $student){ echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; // FIXME this should be the registration number echo ""; echo ""; } echo "
".i18n("Last Name")."".i18n("First Name")."".i18n("Username")."".i18n("Grade")."".i18n("Registration Number")."".i18n("Actions")."
{$student['lastname']}{$student['firstname']}{$student['username']}{$student['grade']}
"; }else{ echo i18n("You have not yet invited any participants from your school"); } }