Update registration_list

Update registration_statistics
Update registration_receivedforms
Update student_editor
This commit is contained in:
james 2011-03-04 22:29:55 +00:00
parent 953e95ac3e
commit c995e226c7
5 changed files with 72 additions and 70 deletions

View File

@ -22,10 +22,10 @@
*/
?>
<?
require("../common.inc.php");
require_once("../common.inc.php");
require_once("../user.inc.php");
user_auth_required('admin');
require("../register_participants.inc.php");
require_once("../register_participants.inc.php");
send_header("Input Received Signature Forms",
array('Committee Main' => '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 "<tr><td><b>".i18n("Project Title")."</b></td><td>$projectinfo->title</td></tr>";
echo "<tr><td><b>".i18n("Category / Division")."</b></td><td>$projectinfo->category / $projectinfo->division</td></tr>";
$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 "</table>\n";
echo "<br />";
if($r->status!='complete')
{
if($r->status!='complete') {
echo "<table style=\"margin-left: 30px;\">";
echo "<tr><td colspan=\"3\">";
echo i18n("Is this the correct form to register?");
@ -137,30 +135,28 @@ echo mysql_Error();
echo "<form method=\"post\" action=\"registration_receivedforms.php\">";
echo "<input type=\"hidden\" name=\"registration_number\" value=\"$reg_num\" />";
echo "<input type=\"hidden\" name=\"action\" value=\"receivedno\" />";
echo "<input type=submit value=\"".i18n("No, this is the wrong form")."\" style=\"width: 400px;\"/>";
echo "<input type=submit value=\"".i18n("No, this is the wrong form")."\" style=\"width: 400px; height: 40px; margin: 10px;\"/>";
echo "</form>";
if($config['regfee']>0)
{
if($config['regfee']>0) {
echo "<form method=\"post\" action=\"registration_receivedforms.php\">";
echo "<input type=\"hidden\" name=\"registration_number\" value=\"$reg_num\" />";
echo "<input type=\"hidden\" name=\"action\" value=\"receivedyes\" />";
echo "<input type=submit value=\"".i18n("Yes, right form with registration fee")."\" style=\"width: 400px;\"/>";
echo "<input type=submit value=\"".i18n("Yes, right form with registration fee")."\" style=\"width: 400px; height: 40px; margin: 10px;\"/>";
echo "</form>";
echo "<form method=\"post\" action=\"registration_receivedforms.php\">";
echo "<input type=\"hidden\" name=\"registration_number\" value=\"$reg_num\" />";
echo "<input type=\"hidden\" name=\"action\" value=\"receivedyesnocash\" />";
echo "<input type=submit value=\"".i18n("Yes, right form without registration fee")."\" style=\"width: 400px;\"/>";
echo "<input type=submit value=\"".i18n("Yes, right form without registration fee")."\" style=\"width: 400px; height: 40px; margin: 10px;\"/>";
echo "</form>";
}
else
{
else {
echo "<form method=\"post\" action=\"registration_receivedforms.php\">";
echo "<input type=\"hidden\" name=\"registration_number\" value=\"$reg_num\" />";
echo "<input type=\"hidden\" name=\"action\" value=\"receivedyes\" />";
echo "<input type=submit value=\"".i18n("Yes, this is the right form")."\" style=\"width: 400px;\"/>";
echo "<input type=submit value=\"".i18n("Yes, this is the right form")."\" style=\"width: 400px; height: 40px; margin: 10px;\"/>";
echo "</form>";
@ -172,8 +168,7 @@ echo mysql_Error();
echo "</table>";
$showformatbottom=false;
}
else
{
else {
echo i18n("This form has already been received. Registration is complete");
echo "<br />";
echo "<a href=\"registration_receivedforms.php?action=unregister&registration_number=$reg_num\">".i18n("Click here to unregister this project")."</a>";
@ -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 "<table class=\"tableview\">";
echo "<b>Registration Number: {$reg['registration_number']}</b><br />\n";
foreach($reg['status'] AS $k=>$v) {
echo "<tr><th>$k</td><td>".outputStatus($v)."</td></tr>\n";
}
echo "</table>\n";
echo "<br /><br />\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 "<form id=\"inputform\" method=\"post\" action=\"registration_receivedforms.php\">";
echo "<input type=\"hidden\" name=\"action\" value=\"received\" />";
echo i18n("Enter the registration number from the signature form: ")."<br />";

View File

@ -22,10 +22,10 @@
*/
?>
<?
require("../common.inc.php");
require_once("../common.inc.php");
require_once("../user.inc.php");
user_auth_required('admin');
require("../register_participants.inc.php");
require_once("../register_participants.inc.php");
if($_GET['conferences_id']) $conferences_id=$_GET['conferences_id'];
else $conferences_id=$conference['id'];
@ -142,18 +142,18 @@ else $wherestatus="";
$status_text=i18n($status_text);
$sq=mysql_query("SELECT students.firstname,
students.lastname,
students.id,
$sq=mysql_query("SELECT users.firstname,
users.lastname,
users.id,
schools.school,
schools.board,
schools.id AS schools_id
FROM
students,schools
users,schools
WHERE
students.registrations_id='$r->reg_id'
users.registrations_id='$r->reg_id'
AND
students.schools_id=schools.id
users.schools_id=schools.id
");
echo mysql_error();

View File

@ -233,7 +233,7 @@ function students_load()
echo " <td>".i18n("Last Name")."</td><td><input type=\"text\" name=\"lastname[$x]\" value=\"$studentinfo->lastname\" />".REQUIREDFIELD."</td>\n";
echo "</tr>\n";
if($config['participant_student_personal']=="yes") {
// if($config['participant_student_personal']=="yes") {
echo "<tr>\n";
echo " <td>".i18n("Gender")."</td><td>";
echo "<select name=\"sex[$x]\">";
@ -243,7 +243,7 @@ function students_load()
if($studentinfo->sex=="female") $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"female\">".i18n("Female")."</option>\n";
echo "</select>".REQUIREDFIELD;
}
// }
echo "</td>\n";
echo " <td></td><td></td>\n";
echo "</tr>\n";
@ -253,17 +253,17 @@ function students_load()
echo " <td>".i18n("Email Address")."</td><td><input type=\"text\" name=\"email[$x]\" value=\"$studentinfo->email\" />".REQUIREDFIELD."</td>\n";
*/
if($config['participant_student_personal']=="yes") {
// if($config['participant_student_personal']=="yes") {
echo " <td>".i18n("City")."</td><td><input type=\"text\" name=\"city[$x]\" value=\"$studentinfo->city\" />".REQUIREDFIELD."</td>\n";
}
/* }
else {
echo "<td></td>";
}
*/
echo "</tr>\n";
if($config['participant_student_personal']=="yes")
{
// if($config['participant_student_personal']=="yes") {
echo "<tr>\n";
echo " <td>".i18n("Address")."</td><td><input type=\"text\" name=\"address[$x]\" value=\"$studentinfo->address\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n($config['provincestate'])."</td><td>";
@ -292,9 +292,11 @@ function students_load()
emit_year_selector("year[$x]",$year,$minyearselect,$maxyearselect);
echo "</td><td>".REQUIREDFIELD."</td></tr></table>\n";
echo "</td>\n";
/*
}
else
echo "<tr>";
*/
echo " <td>".i18n("Grade")."</td><td colspan=\"3\">\n";
@ -333,23 +335,21 @@ function students_load()
echo "</tr>";
}
if($config['participant_student_personal']=="yes")
{
// if($config['participant_student_personal']=="yes") {
echo "<tr>\n";
echo "<td>".i18n("Medical Alert Info")."</td><td colspan=\"3\">";
echo "<input name=\"medicalalert[$x]\" type=\"text\" size=\"50\" value=\"$studentinfo->medicalalert\" />";
echo "</td>";
echo "</tr>\n";
}
// }
if($config['participant_student_foodreq']=="yes")
{
// if($config['participant_student_foodreq']=="yes") {
echo "<tr>\n";
echo "<td>".i18n("Special Food Requirements")."</td><td colspan=\"3\">";
echo "<input name=\"foodreq[$x]\" type=\"text\" size=\"50\" value=\"$studentinfo->foodreq\" />";
echo "</td>";
echo "</tr>\n";
}
// }
echo "<tr>\n";
echo " <td>".i18n("School")."</td><td colspan=\"3\">";

View File

@ -270,6 +270,11 @@ function outputStatus($status) {
$ret.= i18n("Empty");
$ret.= "</div>";
break;
case 'notapplicable':
$ret.="<div class=\"complete\">";
$ret.= i18n("Not Applicable");
$ret.= "</div>";
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,
);
}
}

View File

@ -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);