Copyright (C) 2005-2006 James Grant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // This file was modified Jan of 2014 by Richard Sin // Flagging has been added to monitor projects with concern. ?> id]=$r->category; $q=mysql_query("SELECT * FROM projectdivisions WHERE year='$year' ORDER BY id"); while($r=mysql_fetch_object($q)) $divs[$r->id]=$r->division; $action=$_GET['action']; switch($action) { case 'load_row': $id = intval($_GET['id']); $q = list_query($year, '', $id); $r = mysql_fetch_object($q); print_row($r); exit; case 'delete': $regid = intval($_GET['id']); $q = mysql_query("SELECT * FROM projects WHERE registrations_id='$regid'"); if(mysql_num_rows($q)) { $p = mysql_fetch_assoc($q); mysql_query("DELETE FROM winners WHERE projects_id='{$p['id']}'"); } mysql_query("DELETE FROM registrations WHERE id='$regid' AND year='".$config['FAIRYEAR']."'"); mysql_query("DELETE FROM students WHERE registrations_id='$regid' AND year='".$config['FAIRYEAR']."'"); mysql_query("DELETE FROM projects WHERE registrations_id='$regid' AND year='".$config['FAIRYEAR']."'"); mysql_query("DELETE FROM safety WHERE registrations_id='$regid' AND year='".$config['FAIRYEAR']."'"); mysql_query("DELETE FROM questions_answers WHERE registrations_id='$regid' AND year='".$config['FAIRYEAR']."'"); mysql_query("DELETE FROM mentors WHERE registrations_id='$regid' AND year='".$config['FAIRYEAR']."'"); mysql_query("DELETE FROM emergencycontact WHERE registrations_id='$regid' AND year='".$config['FAIRYEAR']."'"); happy_("Registration and all related data successfully deleted"); exit; } if($auth_type == 'committee') { send_header("Registration Management", array('Committee Main' => 'committee_main.php', 'Administration' => 'admin/index.php', 'Participant Registration' => 'admin/registration.php') ); } else { send_header("Student/Project Management", array('Fair Main' => 'fair_main.php') ); } ?>
:
"; echo ""; if($showstatus) $stat="&showstatus=".$showstatus; echo "".i18n("Status").""; echo "".i18n("Email Address").""; echo "".i18n("Reg Num").""; echo "".i18n("Proj Num").""; echo "".i18n("Project Title").""; echo "".i18n("Age Category").""; echo "".i18n("Division").""; echo "".i18n("School(s)").""; echo "".i18n("Student(s)").""; echo "".i18n("Flagged").""; echo "".i18n("Action").""; echo ""; while($r=mysql_fetch_object($q)) { echo "reg_id}\">"; print_row($r); echo ""; } echo ""; echo "

The statistics have moved here: Registration Statistics

"; send_footer(); /* Now some helper functions we call more than once */ function list_query($year, $wherestatus, $reg_id) { global $auth_type; $reg = ''; if($reg_id != false) $reg = "AND registrations.id='$reg_id'"; $fair = ''; if($auth_type == 'fair') { $fair = "AND projects.fairs_id='{$_SESSION['fairs_id']}'"; } $q=mysql_query("SELECT registrations.id AS reg_id, registrations.num AS reg_num, registrations.status, registrations.email, projects.title, projects.projectnumber, projects.projectcategories_id, projects.projectdivisions_id, projects.feedback, projects.flagged FROM registrations left outer join projects on projects.registrations_id=registrations.id WHERE 1 AND registrations.year='$year' $wherestatus $reg $fair ORDER BY registrations.status DESC, projects.title "); echo mysql_error(); return $q; } function print_row($r) { global $cats, $divs, $config, $year; switch($r->status) { case "new": $status_text="New"; break; case "open": $status_text="Open"; break; case "paymentpending": $status_text="Payment Pending"; break; case "complete": $status_text="Complete"; break; } $status_text=i18n($status_text); $scl = "style=\"cursor:pointer;\" onclick=\"popup_editor('{$r->reg_id}','');\""; $pcl = "style=\"cursor:pointer;\" onclick=\"popup_editor('{$r->reg_id}','project');\""; echo "{$status_text}"; echo "{$r->email}"; echo "{$r->reg_num}"; $pn = str_replace(' ', ' ', $r->projectnumber); echo "$pn"; echo "{$r->title}"; echo "".i18n($cats[$r->projectcategories_id]).""; echo "".i18n($divs[$r->projectdivisions_id]).""; $sq=mysql_query("SELECT students.firstname, students.lastname, students.id, schools.school, schools.board, schools.id AS schools_id FROM students,schools WHERE students.registrations_id='$r->reg_id' AND students.schools_id=schools.id "); echo mysql_error(); $studnum=1; $schools=""; $students=""; while($studentinfo=mysql_fetch_object($sq)) { $students.="$studentinfo->firstname $studentinfo->lastname
"; $schools.="$studentinfo->school
"; } echo "$schools"; echo "$students"; echo ""; if($r->flagged == false) { echo "reg_id}','project');\" >"; echo ""; echo ""; } else { echo "reg_id}','project');\" >"; echo ""; echo ""; } echo ""; if($year==$config['FAIRYEAR']) { echo "reg_id});return false\" >"; echo ""; echo ""; echo "
"; echo ""; echo "email\">"; echo "reg_num\">"; echo ""; echo "
"; } echo ""; } ?>