diff --git a/admin/award_awardcreatedivisional.php b/admin/award_awardcreatedivisional.php index 57bc696..d70e176 100644 --- a/admin/award_awardcreatedivisional.php +++ b/admin/award_awardcreatedivisional.php @@ -23,9 +23,13 @@ ?> 'committee_main.php', + 'Administration' => 'admin/index.php', + 'Awards Main' => 'admin/awards.php') + ); if($_GET['award_sponsors_id']) $award_sponsors_id=$_GET['award_sponsors_id']; else if($_POST['award_sponsors_id']) $award_sponsors_id=$_POST['award_sponsors_id']; @@ -33,10 +37,6 @@ if($_GET['award_types_id']) $award_types_id=$_GET['award_types_id']; else if($_POST['award_types_id']) $award_types_id=$_POST['award_types_id']; - - echo "<< ".i18n("Back to Administration")."\n"; - echo "<< ".i18n("Back to Awards Main")."\n"; - //first, we can only do this if we dont have any type=divisional awards created yet $q=mysql_query("SELECT COUNT(id) AS num FROM award_awards WHERE award_types_id='1' AND year='{$config['FAIRYEAR']}'"); $r=mysql_fetch_object($q); diff --git a/admin/award_awards.php b/admin/award_awards.php index 49c7a57..70e8d30 100644 --- a/admin/award_awards.php +++ b/admin/award_awards.php @@ -23,9 +23,12 @@ ?> 'committee_main.php', + 'Administration' => 'admin/index.php', + 'Awards Main' => 'admin/awards.php') ); if($_GET['award_sponsors_id'] && $_GET['award_sponsors_id']!="all") $_SESSION['award_sponsors_id']=$_GET['award_sponsors_id']; @@ -41,9 +44,6 @@ $award_types_id=$_SESSION['award_types_id']; $award_sponsors_id=$_SESSION['award_sponsors_id']; - echo "<< ".i18n("Back to Administration")."\n"; - echo "<< ".i18n("Back to Awards Main")."\n"; - if($_POST['save']=="edit" || $_POST['save']=="add") { if(!$_POST['award_types_id']) { diff --git a/admin/award_contacts.php b/admin/award_contacts.php index 6959e12..4cbf982 100644 --- a/admin/award_contacts.php +++ b/admin/award_contacts.php @@ -23,9 +23,12 @@ ?> 'committee_main.php', + 'Administration' => 'admin/index.php', + 'Awards Main' => 'admin/awards.php')); if($_GET['award_sponsors_id']) $award_sponsors_id=$_GET['award_sponsors_id']; @@ -34,9 +37,6 @@ ?> << ".i18n("Back to Administration")."\n"; - echo "<< ".i18n("Back to Awards")."\n"; - $q=mysql_query("SELECT id,organization FROM award_sponsors ORDER BY organization"); echo "
"; echo ""; diff --git a/admin/registration_receivedforms.php b/admin/registration_receivedforms.php index 0c8c95c..e0e048a 100644 --- a/admin/registration_receivedforms.php +++ b/admin/registration_receivedforms.php @@ -23,14 +23,14 @@ ?> << ".i18n("Back to Administration").""; - echo "   "; - echo "<< ".i18n("Back to Registration").""; - echo "
"; + send_header("Received Forms", + array('Committee Main' => 'committee_main.php', + 'Administration' => 'admin/index.php', + 'Participant Registration' => 'admin/registration.php') + ); echo "
"; $showformatbottom=true; diff --git a/admin/registration_webconsent.php b/admin/registration_webconsent.php index 1b301d9..2a4cbe5 100644 --- a/admin/registration_webconsent.php +++ b/admin/registration_webconsent.php @@ -23,15 +23,14 @@ ?> 'committee_main.php', + 'Administration' => 'admin/index.php', + 'Participant Registration' => 'admin/registration.php') + ); - echo "<< ".i18n("Back to Administration").""; - echo "   "; - echo "   "; - echo "<< ".i18n("Back to Registration").""; - echo "
"; echo "
"; if(is_array($_POST['changed'])) diff --git a/admin/reports.php b/admin/reports.php index 6aaff11..f784136 100644 --- a/admin/reports.php +++ b/admin/reports.php @@ -24,9 +24,11 @@ << ".i18n("Back to Administration")."
"; + user_auth_required('committee', 'admin'); + send_header("Reports", + array('Committee Main' => 'committee_main.php', + 'Administration' => 'admin/index.php') + ); echo "
"; $id = intval($_POST['id']); diff --git a/admin/reports_acpresentation.php b/admin/reports_acpresentation.php index c0a6df7..7a4c40b 100644 --- a/admin/reports_acpresentation.php +++ b/admin/reports_acpresentation.php @@ -1,6 +1,6 @@ Editor"); + send_header("Reports Editor", + array('Committee Main' => 'committee_main.php', + 'Administration' => 'admin/index.php') + ); if($repaction == 'save') { /* Save the report */ @@ -254,7 +257,6 @@ function reportChange() case 'volunteer': $fields = $report_volunteers_fields; break; } - echo "<< ".i18n("Back to Reports")."
"; echo "
"; echo ""; diff --git a/admin/reports_gen.php b/admin/reports_gen.php index 25fd683..c8acf57 100644 --- a/admin/reports_gen.php +++ b/admin/reports_gen.php @@ -23,7 +23,7 @@ ?> Mailing Labels"); + user_auth_required('committee', 'admin'); + send_header("Mailing Label Generator", + array('Committee Main' => 'committee_main.php', + 'Administration' => 'admin/index.php', + 'Reports' => 'admin/reports.php') + ); + ?> << ".i18n("Back to Reports")."
"; echo "
"; echo ""; diff --git a/admin/reports_mailinglabels_generator.php b/admin/reports_mailinglabels_generator.php index a594e38..c709c02 100644 --- a/admin/reports_mailinglabels_generator.php +++ b/admin/reports_mailinglabels_generator.php @@ -23,7 +23,7 @@ ?> array( 'name' => 'Student -- Email', 'header' => 'Email', - 'width' => 1.5, + 'width' => 1.75, 'table' => 'students.email'), 'phone' => array( @@ -321,7 +321,7 @@ $report_students_fields = array( 'header' => 'Prize Name', 'width' => 4, 'table' => "CONCAT(award_prizes.prize,' in ',projectcategories.category,' ', projectdivisions.division)", - 'table_sort' => 'award_awards.category', + 'table_sort' => 'award_prizes.order', 'components' => array('awards')), 'nom_awards' => array( diff --git a/admin/reports_tour_selection.php b/admin/reports_tour_selection.php index 61eb8a9..2075785 100644 --- a/admin/reports_tour_selection.php +++ b/admin/reports_tour_selection.php @@ -23,7 +23,7 @@ ?> - -<< ".i18n("Back to Administration")."\n"; if($_POST['save']=="edit" || $_POST['save']=="add") { @@ -69,21 +64,21 @@ echo mysql_error(); if($_POST['save']=="add") - echo happy("School successfully added"); + $notice = 'added'; else - echo happy("Successfully saved changes to school"); + $notice = 'saved'; } if($_GET['action']=="delete" && $_GET['delete']) { mysql_query("DELETE FROM schools WHERE id='".$_GET['delete']."'"); - echo happy("School successfully deleted"); + $notice = 'deleted'; } if($_GET['action']=="clearaccesscodes") { mysql_query("UPDATE schools SET accesscode=NULL WHERE year='{$config['FAIRYEAR']}'"); - echo happy("Access Codes successfully cleared from all schools"); + $notice = 'clearaccess'; } if($_GET['action']=="makeaccesscodes") @@ -95,23 +90,25 @@ mysql_query("UPDATE schools SET accesscode='$ac' WHERE id='$r->id' AND year='{$config['FAIRYEAR']}'"); } - echo happy("Access Codes successfully set for schools that didn't have one"); + $notice = 'makeaccess'; } if($_GET['action']=="edit" || $_GET['action']=="add") { - echo "<< ".i18n("Back to Schools")."\n"; + send_header(($_GET['action']=='edit') ? "Edit School" : "Add New School", + array('Committee Main' => 'committee_main.php', + 'Administration' => 'admin/index.php', + 'School Management' => 'admin/schools.php') + ); if($_GET['action']=="edit") { - echo "

".i18n("Edit School")."

\n"; $buttontext="Save School"; $q=mysql_query("SELECT * FROM schools WHERE id='".$_GET['edit']."'"); $r=mysql_fetch_object($q); } else if($_GET['action']=="add") { - echo "

".i18n("Add New School")."

\n"; $buttontext="Add School"; } $buttontext=i18n($buttontext); @@ -193,7 +190,28 @@ } else { - + send_header("School Management", + array('Committee Main' => 'committee_main.php', + 'Administration' => 'admin/index.php') + ); + + switch($notice) { + case 'added': + echo happy("School successfully added"); + break; + case 'saved': + echo happy("Successfully saved changes to school"); + break; + case 'deleted': + echo happy("School successfully deleted"); + break; + case 'clearaccess': + echo happy("Access Codes successfully cleared from all schools"); + break; + case 'makeaccess': + echo happy("Access Codes successfully set for schools that didn't have one"); + break; + } echo "
"; echo "Add New School\n"; diff --git a/admin/schoolsimport.php b/admin/schoolsimport.php index cac301b..9e5ea9f 100644 --- a/admin/schoolsimport.php +++ b/admin/schoolsimport.php @@ -25,11 +25,14 @@ require("../common.inc.php"); require("../csvimport.inc.php"); - auth_required('admin'); + user_auth_required('committee', 'admin'); - send_header("Administration - Schools Import"); + send_header("Schools Import", + array('Committee Main' => 'committee_main.php', + 'Administration' => 'admin/index.php', + 'School Management' => 'admin/schools.php') + ); - echo "<< ".i18n("Back to Administration")."\n"; $showform=true; if($_POST['action']=="import") diff --git a/admin/settranslation.php b/admin/settranslation.php index 40e31fe..adedf3b 100644 --- a/admin/settranslation.php +++ b/admin/settranslation.php @@ -23,7 +23,7 @@ ?> $ln) { if($l=="en") continue; diff --git a/admin/student_editor.php b/admin/student_editor.php index 42f7c39..d47a540 100644 --- a/admin/student_editor.php +++ b/admin/student_editor.php @@ -23,10 +23,14 @@ ?> << ".i18n("Back to Registration List")."
"; + send_header("Student Editor", + array('Committee Main' => 'committee_main.php', + 'Administration' => 'admin/index.php', + 'Participant Registration' => 'admin/registration.php', + 'Registration List and Statistics' => 'admin/registration_list.php') + ); echo "
"; if($_POST['registration_id']) $registration_id=$_POST['registration_id']; diff --git a/admin/students_info.php b/admin/students_info.php index b95170b..55abd0b 100644 --- a/admin/students_info.php +++ b/admin/students_info.php @@ -27,7 +27,7 @@ //it needs the student ID passed into it. //thus, we do not need the normal header and footer require("../common.inc.php"); - auth_required('admin'); + user_auth_required('committee', 'admin'); if($_GET['id']) { diff --git a/admin/tours_manager.php b/admin/tours_manager.php index 7c12227..4a22dc1 100644 --- a/admin/tours_manager.php +++ b/admin/tours_manager.php @@ -23,11 +23,14 @@ ?> 'committee_main.php', + 'Administration' => 'admin/index.php') + ); ?> << ".i18n("Back to Administration")."\n"; $icon_path = $config['SFIABDIRECTORY']."/images/16/"; $icon_exitension = $config['icon_extension']; - print("
"); $editor = new TableEditor('tours'); diff --git a/admin/translations.php b/admin/translations.php index b8c212c..26a5698 100644 --- a/admin/translations.php +++ b/admin/translations.php @@ -23,10 +23,12 @@ ?> << ".i18n("Back to Administration")."\n"; + send_header("Translations", + array('Committee Main' => 'committee_main.php', + 'Administration' => 'admin/index.php') + ); //by default, we will edit the french translations if($_GET['translang']) $_SESSION['translang']=$_GET['translang']; diff --git a/admin/volunteer_positions_manager.php b/admin/volunteer_positions_manager.php index babd31f..f18c7c4 100644 --- a/admin/volunteer_positions_manager.php +++ b/admin/volunteer_positions_manager.php @@ -25,7 +25,7 @@ require("../common.inc.php"); require("../tableeditor.class.php"); - auth_required('admin'); + user_auth_required('committee', 'admin'); send_header("Volunteer Positions Manager", array("Administration" => "admin/") ); diff --git a/admin/winners.php b/admin/winners.php index fba879f..2814a34 100644 --- a/admin/winners.php +++ b/admin/winners.php @@ -24,9 +24,8 @@ << ".i18n("Back to Administration")."\n"; -if($_GET['edit']) $edit=$_GET['edit']; -if($_POST['edit']) $edit=$_POST['edit']; +if($_GET['edit']) $edit=intval($_GET['edit']); +if($_POST['edit']) $edit=intval($_POST['edit']); if($_GET['action']) $action=$_GET['action']; if($_POST['action']) $action=$_POST['action']; @@ -62,14 +60,15 @@ if($action=="addwinner") if($count<$number) { mysql_query("INSERT INTO winners (awards_prizes_id,projects_id,year) VALUES ('".$_POST['prize_id']."','".$_POST['winner']."','".$config['FAIRYEAR']."')"); - echo happy(i18n("Winning project added")); + $notice = 'added'; } else { - echo error(i18n("This prize cannot accept any more winners. Maximum: %1",array($number))); + $notice = 'nomore'; + $notice_data = array($number); } } - $action="edit"; + $action="edit"; } if($action=="delete") @@ -77,14 +76,31 @@ if($action=="delete") if($_GET['prize_id'] && $_GET['project_id']) { mysql_query("DELETE FROM winners WHERE awards_prizes_id='".$_GET['prize_id']."' AND projects_id='".$_GET['project_id']."'"); - echo happy(i18n("Winning project removed")); + $notice = 'removed'; } $action="edit"; } if($action=="edit" && $edit) { - echo "<< Back to Winners List
"; + send_header("Choose Projects", + array('Committee Main' => 'committee_main.php', + 'Administration' => 'admin/index.php', + 'Enter Winning Projects' => 'admin/winners.php') + ); + + switch($notice) { + case 'removed': + echo happy(i18n("Winning project removed")); + break; + case 'nomore': + echo error(i18n("This prize cannot accept any more winners. Maximum: %1",$notice_data)); + break; + case 'added': + echo happy(i18n("Winning project added")); + break; + } + $q=mysql_query("SELECT award_awards.id, award_awards.name, @@ -234,6 +250,22 @@ if($action=="edit" && $edit) } else { + send_header("Enter Winning Projects", + array('Committee Main' => 'committee_main.php', + 'Administration' => 'admin/index.php') + ); + + switch($notice) { + case 'removed': + echo happy(i18n("Winning project removed")); + break; + case 'nomore': + echo error(i18n("This prize cannot accept any more winners. Maximum: %1",$notice_data)); + break; + case 'added': + echo happy(i18n("Winning project added")); + break; + } $q=mysql_query("SELECT award_awards.id, diff --git a/admin/ysfstats.php b/admin/ysfstats.php index a1390a2..2c95c12 100644 --- a/admin/ysfstats.php +++ b/admin/ysfstats.php @@ -22,11 +22,13 @@ ?> << ".i18n("Back to Administration")."\n"; + send_header("YSF Regional Affiliation Stats", + array('Committee Main' => 'committee_main.php', + 'Administration' => 'admin/index.php') + ); echo "
"; if($_POST['action']=="register" && $_POST['xml'])