diff --git a/admin/registration_receivedforms.php b/admin/registration_receivedforms.php index ffd32bc..587d179 100644 --- a/admin/registration_receivedforms.php +++ b/admin/registration_receivedforms.php @@ -22,10 +22,10 @@ */ ?> 'committee_main.php', @@ -45,14 +45,13 @@ $showformatbottom=true; $reg_num=$r->num; $reg_status=$r->status; - if($r->status=='new') - { + if($r->status=='new') { echo error(i18n("Invalid Registration Status (%1 is New). Cannot receive an empty form.",array($_POST['registration_number']))); } else { //make sure all of the statuses are correct - $statusstudent=studentStatus($reg_id); + $statusstudent=studentsStatus($reg_id); $statusemergencycontact=emergencycontactStatus($reg_id); $statusproject=projectStatus($reg_id); if($config['participant_mentor']=="yes") @@ -100,15 +99,15 @@ echo mysql_Error(); echo "".i18n("Project Title")."$projectinfo->title"; echo "".i18n("Category / Division")."$projectinfo->category / $projectinfo->division"; - $q=mysql_query("SELECT students.firstname, - students.lastname, + $q=mysql_query("SELECT users.firstname, + users.lastname, schools.school FROM - students,schools + users,schools WHERE - students.registrations_id='$reg_id' + users.registrations_id='$reg_id' AND - students.schools_id=schools.id + users.schools_id=schools.id "); $studnum=1; @@ -125,8 +124,7 @@ echo mysql_Error(); echo "\n"; echo "
"; - if($r->status!='complete') - { + if($r->status!='complete') { echo ""; echo "
"; echo i18n("Is this the correct form to register?"); @@ -137,30 +135,28 @@ echo mysql_Error(); echo "
"; echo ""; echo ""; - echo ""; + echo ""; echo "
"; - if($config['regfee']>0) - { + if($config['regfee']>0) { echo "
"; echo ""; echo ""; - echo ""; + echo ""; echo "
"; echo "
"; echo ""; echo ""; - echo ""; + echo ""; echo "
"; } - else - { + else { echo "
"; echo ""; echo ""; - echo ""; + echo ""; echo "
"; @@ -172,8 +168,7 @@ echo mysql_Error(); echo "
"; $showformatbottom=false; } - else - { + else { echo i18n("This form has already been received. Registration is complete"); echo "
"; echo "".i18n("Click here to unregister this project").""; @@ -183,9 +178,16 @@ echo mysql_Error(); } - else - { + else { echo error(i18n("All registration sections are not complete. Cannot register incomplete form")); + $reg=getRegistration($reg_id); + echo ""; + echo "Registration Number: {$reg['registration_number']}
\n"; + foreach($reg['status'] AS $k=>$v) { + echo "\n"; + } + echo "
$k".outputStatus($v)."
\n"; + echo "

\n"; } } } @@ -226,24 +228,22 @@ echo mysql_Error(); //get all students with this registration number $recipients=getEmailRecipientsForRegistration($reg_id); - if($_POST['action']=="receivedyes") - { + if($_POST['action']=="receivedyes") { //actually set it to 'complete' mysql_query("UPDATE registrations SET status='complete' WHERE num='$regnum' AND conferences_id='{$conference['id']}'"); foreach($recipients AS $recip) { - $to=$recip['to']; $subsub=array(); $subbod=array( - "TO"=>$recip['to'], "EMAIL"=>$recip['email'], "FIRSTNAME"=>$recip['firstname'], "LASTNAME"=>$recip['lastname'], + "USERNAME"=>$recip['username'], "NAME"=>$recip['firstname']." ".$recip['lastname'], "REGNUM"=>$regnum, "PROJECTNUMBER"=>$projectnumber, ); - email_send("register_participants_received",$to,$subsub,$subbod); + $res=email_send("register_participants_received",$recip['email'],$subsub,$subbod); } echo happy(i18n("Registration of form %1 successfully completed",array($regnum))); @@ -254,25 +254,23 @@ echo mysql_Error(); mysql_query("UPDATE registrations SET status='paymentpending' WHERE num='$regnum' AND conferences_id='{$conference['id']}'"); foreach($recipients AS $recip) { - $to=$recip['to']; $subsub=array(); $subbod=array( - "TO"=>$recip['to'], "EMAIL"=>$recip['email'], "FIRSTNAME"=>$recip['firstname'], "LASTNAME"=>$recip['lastname'], + "USERNAME"=>$recip['username'], "NAME"=>$recip['firstname']." ".$recip['lastname'], "REGNUM"=>$regnum, "PROJECTNUMBER"=>$projectnumber, ); - email_send("register_participants_paymentpending",$to,$subsub,$subbod); + email_send("register_participants_paymentpending",$recip['email'],$subsub,$subbod); } echo happy(i18n("Registration of form %1 marked as payment pending",array($regnum))); } } - else if($_POST['action']=="receivedno" && $_POST['registration_number']) - { + else if($_POST['action']=="receivedno" && $_POST['registration_number']) { echo notice(i18n("Registration of form %1 cancelled",array($_POST['registration_number']))); } @@ -286,8 +284,7 @@ echo mysql_Error(); } - if($showformatbottom) - { + if($showformatbottom) { echo "
"; echo ""; echo i18n("Enter the registration number from the signature form: ")."
"; diff --git a/admin/registration_stats.php b/admin/registration_stats.php index db3a2a5..80f72c3 100644 --- a/admin/registration_stats.php +++ b/admin/registration_stats.php @@ -22,10 +22,10 @@ */ ?> reg_id' + users.registrations_id='$r->reg_id' AND - students.schools_id=schools.id + users.schools_id=schools.id "); echo mysql_error(); diff --git a/admin/student_editor.php b/admin/student_editor.php index 39aa3c5..ba49f32 100644 --- a/admin/student_editor.php +++ b/admin/student_editor.php @@ -233,7 +233,7 @@ function students_load() echo " ".i18n("Last Name")."lastname\" />".REQUIREDFIELD."\n"; echo "\n"; - if($config['participant_student_personal']=="yes") { +// if($config['participant_student_personal']=="yes") { echo "\n"; echo " ".i18n("Gender").""; echo "".REQUIREDFIELD; - } +// } echo "\n"; echo " \n"; echo "\n"; @@ -253,17 +253,17 @@ function students_load() echo " ".i18n("Email Address")."email\" />".REQUIREDFIELD."\n"; */ - if($config['participant_student_personal']=="yes") { +// if($config['participant_student_personal']=="yes") { echo " ".i18n("City")."city\" />".REQUIREDFIELD."\n"; - } +/* } else { echo ""; } + */ echo "\n"; - if($config['participant_student_personal']=="yes") - { +// if($config['participant_student_personal']=="yes") { echo "\n"; echo " ".i18n("Address")."address\" />".REQUIREDFIELD."\n"; echo " ".i18n($config['provincestate']).""; @@ -292,9 +292,11 @@ function students_load() emit_year_selector("year[$x]",$year,$minyearselect,$maxyearselect); echo "".REQUIREDFIELD."\n"; echo "\n"; + /* } else echo ""; + */ echo " ".i18n("Grade")."\n"; @@ -333,23 +335,21 @@ function students_load() echo ""; } - if($config['participant_student_personal']=="yes") - { +// if($config['participant_student_personal']=="yes") { echo "\n"; echo "".i18n("Medical Alert Info").""; echo "medicalalert\" />"; echo ""; echo "\n"; - } +// } - if($config['participant_student_foodreq']=="yes") - { +// if($config['participant_student_foodreq']=="yes") { echo "\n"; echo "".i18n("Special Food Requirements").""; echo "foodreq\" />"; echo ""; echo "\n"; - } +// } echo "\n"; echo " ".i18n("School").""; diff --git a/common.inc.functions.php b/common.inc.functions.php index ace4f98..43333bc 100644 --- a/common.inc.functions.php +++ b/common.inc.functions.php @@ -270,6 +270,11 @@ function outputStatus($status) { $ret.= i18n("Empty"); $ret.= ""; break; + case 'notapplicable': + $ret.="
"; + $ret.= i18n("Not Applicable"); + $ret.= "
"; + break; default: $ret.=i18n("Unknown"); @@ -333,8 +338,9 @@ function email_send($val,$to,$sub_subject=array(),$sub_body=array()) { $sub_body = array_merge($sub_body, $stdsub); //if our "to" doesnt look like a valid email, then forget about sending it. - if(!isEmailAddress($to)) + if(!isEmailAddress($to)) { return false; + } $q=mysql_query("SELECT * FROM emails WHERE val='$val'"); if($r=mysql_fetch_object($q)) { @@ -436,6 +442,9 @@ function getEmailRecipientsForRegistration($reg_id) $q=mysql_query("SELECT * FROM registrations WHERE id='$reg_id' AND conferences_id='{$conference['id']}'"); $registration=mysql_fetch_object($q); + //we don't have this with the new stuff, + //FIXME: but i know it should be there, becuase sometimes teachers like putting in THEIR email address as an 'additiona' emailcontact for the registration. + if($registration->emailcontact && isEmailAddress($registration->emailcontact)) { $ret[]=array("to"=>$registration->emailcontact, "firstname"=>"", @@ -444,23 +453,18 @@ function getEmailRecipientsForRegistration($reg_id) ); } - $sq=mysql_query("SELECT users.firstname, users.lastname, accounts.email FROM users JOIN accounts ON users.accounts_id = accounts.id WHERE users.registrations_id='$reg_id' AND users.conferences_id='{$conference['id']}'"); + $sq=mysql_query("SELECT users.firstname, users.lastname, accounts.email, accounts.username, accounts.pendingemail FROM users JOIN accounts ON users.accounts_id = accounts.id WHERE users.registrations_id='$reg_id' AND users.conferences_id='{$conference['id']}'"); $ret=array(); while($sr=mysql_fetch_object($sq)) { - if($sr->email && isEmailAddress($sr->email)) { - if($sr->firstname && $sr->lastname) - $to=$sr->firstname." ".$sr->lastname." <".$sr->email.">"; - else if($sr->firstname) - $to=$sr->firstname." <".$sr->email.">"; - else if($sr->lastname) - $to=$sr->lastname." <".$sr->email.">"; - else - $to=$sr->email; + if($sr->email) $e=$sr->email; + else if($sr->pendingemail) $e=$sr->pendingemail; - $ret[]=array("to"=>$to, + if($e && isEmailAddress($e)) { + $ret[]=array( "firstname"=>$sr->firstname, "lastname"=>$sr->lastname, - "email"=>$sr->email, + "username"=>$sr->username, + "email"=>$e, ); } } diff --git a/participant.inc.php b/participant.inc.php index 35f82de..c614df1 100644 --- a/participant.inc.php +++ b/participant.inc.php @@ -50,6 +50,7 @@ function registrationDeadlinePassed() function studentIndividualStatus($userid) { global $config, $conference; + global $prependdir; $required_fields=user_fields_required('participant'); $required_fields[]="grade"; @@ -66,7 +67,7 @@ function studentIndividualStatus($userid) { } else { if(!$r->$req) { - $fp=fopen("data/logs/incomplete.log","a+"); + $fp=fopen($prependdir."data/logs/incomplete.log","a+"); $str="user id $userid ($r->firstname $r->lastname) incomplete on required field: $req, user[$req]='{$r->$req}'\n"; // echo $str; fputs($fp,$str);