- Move admin/reports.php to admin/reports_old.php

- Move admin/committee_reports.php to admin/reports.php
- Add some text explaining how the new system works
- Fix all linkage
This commit is contained in:
dave 2007-12-10 09:38:54 +00:00
parent d8e112cc4c
commit 4eb5098d59
6 changed files with 464 additions and 446 deletions

View File

@ -1,300 +0,0 @@
<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
Copyright (C) 2005 James Grant <james@lightbox.org>
Copyright (C) 2007 David Grant <dave@lightbox.org>
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.
*/
?>
<?
require_once("../common.inc.php");
require_once("../user.inc.php");
require_once("reports.inc.php");
user_auth_required('committee');
/* Load the user's volunteer position selections */
$edit_mode = array_key_exists('edit', $_GET);
$action = $_GET['action'];
if($action=='') $action = $_POST['action'];
if($action == 'unlink') {
$id = intval($_GET['id']);
mysql_query("DELETE FROM reports_committee WHERE
users_id='{$_SESSION['users_id']}' AND id='$id'");
header("Location: committee_reports.php?edit=1");
exit;
}
$reports_id = 0;
if($action == 'reload') {
$edit_mode = true;
$reports_id = intval($_POST['reports_id']);
}
if($action == 'add') {
$reports_id = intval($_POST['reports_id']);
/* reports_id might be < 0, that's ok */
$category = mysql_escape_string(stripslashes($_POST['category']));
$category_exist = mysql_escape_string(stripslashes($_POST['category_exist']));
$comment = mysql_escape_string(stripslashes($_POST['comment']));
if($category_exist != '') $category = $category_exist;
$type = $_POST['type'];
if(!array_key_exists($type, $report_options['type']['values'])) {
/* Invalid format, not possible unless someone manually
* changes the POST variable */
echo "Invalid format";
exit;
}
$stock = $_POST['stock'];
if(!array_key_exists($stock, $report_stock)) {
/* Invalid format, not possible unless someone manually
* changes the POST variable */
echo "Invalid stock";
exit;
}
mysql_query("INSERT INTO `reports_committee`
(`id`, `users_id` , `reports_id` , `category` , `comment` , `format` , `stock`)
VALUES (
NULL , '{$_SESSION['users_id']}',
'$reports_id', '$category', '$comment',
'$type', '$stock' );");
header("Location: committee_reports.php?edit=1");
}
//send the header
if($edit_mode == false) {
send_header("My Reports",
array("Committee Main" => "committee_main.php")
);
} else {
send_header("Edit My Reports",
array("Committee Main" => "committee_main.php",
"My Reports" => "admin/committee_reports.php")
);
}
/* Load all the users reports */
$q = mysql_query("SELECT reports_committee.*,reports.name
FROM reports_committee
LEFT JOIN reports ON reports.id=reports_committee.reports_id
WHERE users_id='{$_SESSION['users_id']}'
ORDER BY category,id");
echo mysql_error();
if(mysql_num_rows($q) == 0) {
echo i18n('You have no reports saved');
} else {
/* List each report with info */
if($edit_mode == true) {
echo i18n('Deleting all the reports from a category will also delete the category.');
echo '<br />';
echo '<br />';
echo '<a href="committee_reports.php">'.i18n('Click here when you are finished editing your report list').'</a>';
echo '<br />';
echo '<br />';
}
echo '<table>';
$last_category = '';
$x=0;
while($i = mysql_fetch_object($q)) {
$trclass = ($x % 2 == 0) ? "even" : "odd";
$x++;
if($last_category != $i->category) {
/* New category */
echo '<h4>';
if($edit_mode == true) echo i18n('Category').': ';
echo "{$i->category}</h4>";
$last_category = $i->category;
}
if($i->reports_id > 0) {
$name = $i->name;
$url = "admin/reports_gen.php?id={$i->reports_id}&show_options=1";
} else {
$name = $report_custom[-$i->reports_id]['name'];
$url = $report_custom[-$i->reports_id]['custom_url'];
}
if($edit_mode == false)
$name = "<a href=\"{$config['SFIABDIRECTORY']}/$url\">$name</a>";
echo "<table width=\"100%\"><tr class=\"$trclass\"><td>";
echo "<table><tr><td colspan=\"2\">";
if($edit_mode == true)
echo "<a title=\"Remove Report\" href=\"committee_reports.php?action=unlink&id={$i->id}\"><img src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\" border=\"0\" alt=\"Remove Report\" /></a>&nbsp;";
echo $name.'</td></tr>';
/*
if($i->reports_id > 0) {
echo '<tr><td width=\"20px\"></td><td>';
echo '<span style=\"font-size: 0.75em;\">';
echo i18n('Format').": {$i->format}, ";
echo i18n('Paper').": {$report_stock[$i->stock]['name']}, ";
echo i18n('Year').": {$config['FAIRYEAR']}";
echo '</span>';
echo '</td></tr>';
}
*/
echo "<tr><td width=\"20px\"></td><td><span style=\"font-size: 0.85em;\">{$i->comment}</span></td></tr>";
echo "</table></tr></td></table>";
}
}
/* Load available reports */
$reports = report_load_all();
if($edit_mode == false) {
echo '<hr />';
echo '<a href="committee_reports.php?edit=1">'.i18n('Click here to edit your Report List').'</a>';
echo '<hr />';
echo "<h4>".i18n("All Reports")."</h4>";
/* Print all the reports in a pulldown menu for generation */
echo "<form method=\"get\" name=\"reportgen\" action=\"reports_gen.php\">";
echo "<input type=\"hidden\" name=\"show_options\" value=\"1\" />";
echo "<select name=\"id\" id=\"report\">";
echo "<option value=\"0\">".i18n("Select a Report")."</option>\n";
$x=0;
foreach($reports as $r) {
echo "<option value=\"{$r['id']}\">{$r['name']}</option>\n";
}
echo "</select>";
echo "<input type=\"submit\" value=\"Generate Report\"></form>";
echo "<br />";
send_footer();
exit;
}
echo '<hr />';
?>
<SCRIPT language="JavaScript">
function add_reload()
{
document.addreport.action.value='reload';
document.addreport.submit();
return true;
}
</SCRIPT>
<?
/* Create an add report box */
echo '<h4>'.i18n('Add a Report to your Report List').'</h4>';
echo "<form method=\"post\" name=\"addreport\"action=\"committee_reports.php\">";
echo "<input type=\"hidden\" name=\"action\" value=\"add\">";
echo "<table>\n";
echo '<tr><td colspan="2">';
echo "<select name=\"reports_id\" onChange=\"add_reload()\">";
$x=0;
foreach($reports as $r) {
$x++;
$sel = ($reports_id == $r['id']) ? 'selected="selected"' : '';
echo "<option value=\"{$r['id']}\" $sel>$x. {$r['name']}</option>";
}
$rid = -1;
foreach($report_custom as $r) {
$x++;
$sel = ($reports_id == $rid) ? 'selected="selected"' : '';
echo "<option value=\"$rid\" $sel>$x. {$r['name']}</option>";
$rid--;
}
echo "</select></td></tr>";
echo "<tr><td>Category:</td><td>";
$q = mysql_query("SELECT DISTINCT category FROM reports_committee
WHERE users_id='{$_SESSION['users_id']}'
ORDER BY category");
echo "Existing Category: <select name=\"category_exist\">";
echo "<option value=\"\">-- ".i18n('Use New Category')." --</option>";
while($i = mysql_fetch_object($q)) {
echo "<option value=\"{$i->category}\">{$i->category}</option>";
}
echo "</select><br />";
echo "OR New Category: <input type=\"text\" name=\"category\">";
echo "</td></tr>";
/* Load the full specific report */
if($reports_id > 0) $report = report_load($reports_id);
$option_keys = array('type','stock');
foreach($report_options as $ok=>$o) {
if(!in_array($ok, $option_keys)) continue;
echo "<tr><td>{$o['desc']}:</td>";
echo "<td><select name=\"$ok\" id=\"$ok\">";
foreach($o['values'] as $k=>$v) {
$sel = ($report['option'][$ok] == $k) ? 'selected=\"selected\"' : '';
echo "<option value=\"$k\" $sel>$v</option>";
}
echo "</select></td></tr>";
}
echo "<tr><td>Comments:</td><td>";
echo "<textarea rows=\"3\" cols=\"60\" name=\"comment\"></textarea></td></tr>";
echo "<tr><td colspan=\"2\"><input type=\"submit\" value=\"Add Report to My Reports\" /></td></tr>";
echo '</table></form>';
echo '<hr />';
echo '<h4>Descriptions for All Reports</h4>';
echo i18n('Click on the report number to try the report with the default report options before you add it to your Report List');
echo '<br /><br />';
echo "<table>\n";
$x=0;
foreach(array_merge($reports, $report_custom) as $r) {
$trclass = ($x % 2 == 0) ? "even" : "odd";
$x++;
echo "<tr class=\"$trclass\">";
if($r['custom_url'] == '') {
$url = "admin/reports_gen.php?id={$r['id']}";
} else {
$url = $r['custom_url'];
}
echo "<td><a href=\"{$config['SFIABDIRECTORY']}/$url\">$x.</a></td>";
echo "<td><table width=\"100%\"><tr>";
echo "<td><b>{$r['name']}</b></td>";
echo "<td align=\"right\">Created By: {$r['creator']}</td></tr>";
echo "<tr><td colspan=\"2\">{$r['desc']}</td></tr>";
echo "</table></tr>";
}
echo "</table>";
echo "<br />";
send_footer();
?>

View File

@ -34,6 +34,7 @@
echo "<br />";
echo "<a href=\"registration.php\">".i18n("Participant Registration")."</a> <br />";
echo "<a href=\"reports.php\">".i18n("Print / Export Reports")."</a> <br />";
echo "<a href=\"reports_ceremony.php\">".i18n("Print Award Ceremony Scripts")."</a> <br />";
echo "<hr />";
echo "<a href=\"committees.php\">".i18n("Committee Management")."</a> <br />";
echo "<a href=\"awards.php\">".i18n("Awards Management")."</a> <br />";

View File

@ -250,6 +250,16 @@ foreach($report_stock as $n=>$v) {
'desc' => 'Award Winners',
'custom_url' => 'admin/reports_acpresentation.php?type=csv',
'creator' => 'The Grant Brothers');
$x++;
$report_custom[$x] = array('id' => $x, 'name' => 'Custom -- Available Tours (CSV)',
'desc' => 'Available Tours',
'custom_url' => 'admin/reports_tours.php?type=csv',
'creator' => 'The Grant Brothers');
$x++;
$report_custom[$x] = array('id' => $x, 'name' => 'Custom -- Participant Tour Choices (CSV)',
'desc' => 'Participant Tour Choices',
'custom_url' => 'admin/reports_tour_selection.php?type=csv',
'creator' => 'The Grant Brothers');
function report_save_field($report, $type, $loc)
{

View File

@ -5,6 +5,7 @@
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
Copyright (C) 2005 James Grant <james@lightbox.org>
Copyright (C) 2007 David Grant <dave@lightbox.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
@ -22,163 +23,284 @@
*/
?>
<?
require("../common.inc.php");
require_once("../common.inc.php");
require_once("../user.inc.php");
require_once('reports.inc.php');
user_auth_required('committee', 'admin');
send_header("Reports",
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php')
);
echo "<br />";
require_once("reports.inc.php");
$id = intval($_POST['id']);
echo "<h4>".i18n("All Reports")."</h4>";
echo "<form method=\"get\" name=\"reportgen\" action=\"reports_gen.php\">";
echo "<select name=\"id\" id=\"report\">";
echo "<option value=\"0\">".i18n("Select a Report")."</option>\n";
user_auth_required('committee');
/* Load the user's volunteer position selections */
$edit_mode = array_key_exists('edit', $_GET);
$action = $_GET['action'];
if($action=='') $action = $_POST['action'];
if($action == 'unlink') {
$id = intval($_GET['id']);
mysql_query("DELETE FROM reports_committee WHERE
users_id='{$_SESSION['users_id']}' AND id='$id'");
header("Location: reports.php?edit=1");
exit;
}
$reports_id = 0;
if($action == 'reload') {
$edit_mode = true;
$reports_id = intval($_POST['reports_id']);
}
if($action == 'add') {
$reports_id = intval($_POST['reports_id']);
/* reports_id might be < 0, that's ok */
$category = mysql_escape_string(stripslashes($_POST['category']));
$category_exist = mysql_escape_string(stripslashes($_POST['category_exist']));
$comment = mysql_escape_string(stripslashes($_POST['comment']));
if($category_exist != '') $category = $category_exist;
$type = $_POST['type'];
if(!array_key_exists($type, $report_options['type']['values'])) {
/* Invalid format, not possible unless someone manually
* changes the POST variable */
echo "Invalid format";
exit;
}
$stock = $_POST['stock'];
if(!array_key_exists($stock, $report_stock)) {
/* Invalid format, not possible unless someone manually
* changes the POST variable */
echo "Invalid stock";
exit;
}
mysql_query("INSERT INTO `reports_committee`
(`id`, `users_id` , `reports_id` , `category` , `comment` , `format` , `stock`)
VALUES (
NULL , '{$_SESSION['users_id']}',
'$reports_id', '$category', '$comment',
'$type', '$stock' );");
header("Location: reports.php?edit=1");
}
//send the header
if($edit_mode == false) {
send_header("My Reports",
array("Committee Main" => "committee_main.php")
);
/* Send a greeting */
echo i18n('Welcome to the new report interface. You can select and save specific reports under specific categories so you can always find the report you need without having to go through the list each time. To begin customizing this list, click on the "Click Here to edit your Report List" link at the bottom of this page. ');
echo i18n('The old report list is still available').' <a href="reports_old.php">'.i18n('here').'</a>, but will be deleted in the summer of 2008';
echo '<br /><br />';
} else {
send_header("Edit My Reports",
array("Committee Main" => "committee_main.php",
"My Reports" => "admin/reports.php")
);
}
/* Load all the users reports */
$q = mysql_query("SELECT reports_committee.*,reports.name
FROM reports_committee
LEFT JOIN reports ON reports.id=reports_committee.reports_id
WHERE users_id='{$_SESSION['users_id']}'
ORDER BY category,id");
echo mysql_error();
if(mysql_num_rows($q) == 0) {
echo i18n('You have no reports saved');
} else {
/* List each report with info */
if($edit_mode == true) {
echo i18n('Deleting all the reports from a category will also delete the category.');
echo '<br />';
echo '<br />';
echo '<a href="reports.php">'.i18n('Click here when you are finished editing your report list').'</a>';
echo '<br />';
echo '<br />';
}
echo '<table>';
$last_category = '';
$x=0;
while($i = mysql_fetch_object($q)) {
$trclass = ($x % 2 == 0) ? "even" : "odd";
$x++;
if($last_category != $i->category) {
/* New category */
echo '<h4>';
if($edit_mode == true) echo i18n('Category').': ';
echo "{$i->category}</h4>";
$last_category = $i->category;
}
if($i->reports_id > 0) {
$name = $i->name;
$url = "admin/reports_gen.php?id={$i->reports_id}&show_options=1";
} else {
$name = $report_custom[-$i->reports_id]['name'];
$url = $report_custom[-$i->reports_id]['custom_url'];
}
if($edit_mode == false)
$name = "<a href=\"{$config['SFIABDIRECTORY']}/$url\">$name</a>";
echo "<table width=\"100%\"><tr class=\"$trclass\"><td>";
echo "<table><tr><td colspan=\"2\">";
if($edit_mode == true)
echo "<a title=\"Remove Report\" href=\"reports.php?action=unlink&id={$i->id}\"><img src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\" border=\"0\" alt=\"Remove Report\" /></a>&nbsp;";
echo $name.'</td></tr>';
/*
if($i->reports_id > 0) {
echo '<tr><td width=\"20px\"></td><td>';
echo '<span style=\"font-size: 0.75em;\">';
echo i18n('Format').": {$i->format}, ";
echo i18n('Paper').": {$report_stock[$i->stock]['name']}, ";
echo i18n('Year').": {$config['FAIRYEAR']}";
echo '</span>';
echo '</td></tr>';
}
*/
echo "<tr><td width=\"20px\"></td><td><span style=\"font-size: 0.85em;\">{$i->comment}</span></td></tr>";
echo "</table></tr></td></table>";
}
}
/* Load available reports */
$reports = report_load_all();
if($edit_mode == false) {
echo '<hr />';
echo '<a href="reports.php?edit=1">'.i18n('Click here to edit your Report List').'</a>';
echo '<hr />';
echo "<h4>".i18n("All Reports")."</h4>";
/* Print all the reports in a pulldown menu for generation */
echo "<form method=\"get\" name=\"reportgen\" action=\"reports_gen.php\">";
echo "<input type=\"hidden\" name=\"show_options\" value=\"1\" />";
echo "<select name=\"id\" id=\"report\">";
echo "<option value=\"0\">".i18n("Select a Report")."</option>\n";
$x=0;
foreach($reports as $r) {
echo "<option value=\"{$r['id']}\">{$r['name']}</option>\n";
}
echo "</select>";
echo "<input type=\"submit\" value=\"Generate Report\"></form>";
echo "<br />";
send_footer();
exit;
}
echo '<hr />';
?>
<SCRIPT language="JavaScript">
function add_reload()
{
document.addreport.action.value='reload';
document.addreport.submit();
return true;
}
</SCRIPT>
<?
/* Create an add report box */
echo '<h4>'.i18n('Add a Report to your Report List').'</h4>';
echo "<form method=\"post\" name=\"addreport\"action=\"reports.php\">";
echo "<input type=\"hidden\" name=\"action\" value=\"add\">";
echo "<table>\n";
echo '<tr><td colspan="2">';
echo "<select name=\"reports_id\" onChange=\"add_reload()\">";
$x=0;
foreach($reports as $r) {
$sel = ($id == $r['id']) ? 'selected=\"selected\"' : '';
echo "<option value=\"{$r['id']}\" $sel>{$r['name']}</option>\n";
$x++;
$sel = ($reports_id == $r['id']) ? 'selected="selected"' : '';
echo "<option value=\"{$r['id']}\" $sel>$x. {$r['name']}</option>";
}
$rid = -1;
foreach($report_custom as $r) {
$x++;
$sel = ($reports_id == $rid) ? 'selected="selected"' : '';
echo "<option value=\"$rid\" $sel>$x. {$r['name']}</option>";
$rid--;
}
echo "</select>";
echo "<select name=\"type\"><option value=\"\">Default Format</option>";
echo "<option value=\"pdf\">PDF</option>";
echo "<option value=\"csv\">CSV</option>";
echo "<option value=\"label\">Label</option>";
echo "</select>";
echo "<input type=\"text\" value=\"{$config['FAIRYEAR']}\" size=\"5\" name=\"year\" />";
echo "<input type=\"submit\" value=\"Generate Report\"></form>";
echo "<br />";
echo "<hr />";
echo "<h4>".i18n("Custom Reports")."</h4>";
/*
echo i18n("Day of Fair Registration/Checkin Forms (All Categories)").": ";
echo "<a href=\"reports_gen.php?id=9&type=pdf\">PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?id=9&type=csv\">CSV</a> &nbsp; ";
*/
echo "</select></td></tr>";
//lets split this up by age category,
/*
$catq=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' ORDER BY id");
while($catr=mysql_fetch_object($catq))
{
echo "<td>";
echo "<a href=\"reports_checkin.php?type=pdf&cat=$catr->id\">$catr->category (PDF)</a> &nbsp; ";
echo "<br>";
echo "<a href=\"reports_checkin.php?type=csv&cat=$catr->id\">$catr->category (CSV)</a> &nbsp; ";
echo "</td>";
}
*/
echo "<br />";
echo i18n("Mailing Labels").": ";
echo "<a href=\"reports_mailinglabels.php\">".i18n("Mailing Label Generator")."</a>";
echo "<tr><td>Category:</td><td>";
$q = mysql_query("SELECT DISTINCT category FROM reports_committee
WHERE users_id='{$_SESSION['users_id']}'
ORDER BY category");
echo "<br />";
echo "<br />";
echo i18n("School Access Codes").": ";
echo "<a href=\"reports_gen.php?sid=36&type=pdf\">PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=36&type=csv\">CSV</a> &nbsp; ";
// echo "<a href=\"reports_schoolaccesscodes.php?type=pdf\">PDF</a> &nbsp; ";
// echo "<a href=\"reports_schoolaccesscodes.php?type=csv\">CSV</a> &nbsp; ";
echo "Existing Category: <select name=\"category_exist\">";
echo "<option value=\"\">-- ".i18n('Use New Category')." --</option>";
while($i = mysql_fetch_object($q)) {
echo "<option value=\"{$i->category}\">{$i->category}</option>";
}
echo "</select><br />";
echo "OR New Category: <input type=\"text\" name=\"category\">";
echo "</td></tr>";
echo "<br />";
echo i18n("Student Emergency Contact Names/Numbers").": ";
echo "<a href=\"reports_gen.php?sid=17&type=pdf\">PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=17&type=csv\">CSV</a> &nbsp; ";
echo "<br />";
echo i18n("Students/Projects From Each School").": ";
echo "<a href=\"reports_gen.php?sid=19&type=pdf\">PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=19&type=csv\">CSV</a> &nbsp; ";
echo "<br />";
echo i18n("Project Logistical Requirements (tables, electricity)").": ";
echo "<a href=\"reports_gen.php?sid=16&type=pdf\">PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=16&type=csv\">CSV</a> &nbsp; ";
echo "<br />";
echo i18n("Project Table Labels").": ";
echo "<a href=\"reports_gen.php?sid=30\">PDF</a> &nbsp; ";
echo "<br />";
echo i18n("Project Summary Details").": ";
echo "<a href=\"reports_projects_details.php?type=pdf\">PDF</a> &nbsp; ";
echo "<br />";
echo i18n("Nametags").": ";
echo "<a href=\"reports_gen.php?sid=26\">Students PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=26&type=csv\">Students CSV</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=27\">Judges PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=27&type=csv\">Judges CSV</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=28\">Committee PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=28&type=csv\">Committee CSV</a> &nbsp; ";
echo "<br />";
echo "<br />";
echo i18n("Judges List").": ";
echo "<a href=\"reports_judges.php?type=csv\">Judge List (CSV)</a> &nbsp; ";
echo "<br />";
echo i18n("Judging Teams").": ";
echo "<a href=\"reports_gen.php?sid=21&type=csv\">List (CSV)</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=21&type=pdf\">List (PDF)</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=22&type=csv\">Team Awards (CSV)</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=22&type=pdf\">Team Awards (PDF)</a> &nbsp; ";
echo "<br />";
echo i18n("Judging Teams Project Assignments").": ";
echo "<a href=\"reports_judges_teams_projects.php?type=csv\">CSV</a> &nbsp; ";
echo "<a href=\"reports_judges_teams_projects.php?type=pdf\">PDF</a> &nbsp; ";
echo "<br />";
echo i18n("Projects Judging Team Assignments").": ";
echo "<a href=\"reports_projects_judges_teams.php?type=csv\">CSV</a> &nbsp; ";
echo "<a href=\"reports_projects_judges_teams.php?type=pdf\">PDF</a> &nbsp; ";
echo "<br />";
echo i18n("Project Identification Labels (for judging sheets)").": ";
echo "<a href=\"reports_gen.php?sid=29\">PDF</a> &nbsp; ";
echo "<br />";
echo "<br />";
/* Load the full specific report */
if($reports_id > 0) $report = report_load($reports_id);
$option_keys = array('type','stock');
foreach($report_options as $ok=>$o) {
if(!in_array($ok, $option_keys)) continue;
echo "<tr><td>{$o['desc']}:</td>";
echo "<td><select name=\"$ok\" id=\"$ok\">";
foreach($o['values'] as $k=>$v) {
$sel = ($report['option'][$ok] == $k) ? 'selected=\"selected\"' : '';
echo "<option value=\"$k\" $sel>$v</option>";
}
echo "</select></td></tr>";
}
echo "<tr><td>Comments:</td><td>";
echo "<textarea rows=\"3\" cols=\"60\" name=\"comment\"></textarea></td></tr>";
echo "<tr><td colspan=\"2\"><input type=\"submit\" value=\"Add Report to My Reports\" /></td></tr>";
echo i18n("Awards list for Program").": ";
echo "<a href=\"reports_program_awards.php?type=csv\">CSV</a> &nbsp; ";
echo "<br />";
echo i18n("Award Ceremony Script").": ";
echo "<a href=\"reports_acscript.php?type=pdf\">FULL PDF</a> &nbsp;";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Divisional\">(Divisional)</a> &nbsp; ";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Special\">(Special)</a> &nbsp; ";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Interdisciplinary\">(Interdisciplinary)</a> &nbsp; ";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Other\">(Other)</a> &nbsp; ";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Grand\">(Grand)</a> &nbsp; ";
echo "<br />";
echo i18n("Award Ceremony Script").": ";
echo "<a href=\"reports_acscript.php?type=csv\">CSV</a> &nbsp; ";
echo "<br />";
echo "<a href=\"reports_acpresentation.php?type=csv\">Award Winners CSV</a> &nbsp; ";
echo "<br />";
if($config['tours_enable'] == 'yes') {
echo "<br />";
echo "<br />";
echo i18n("Available Tours").": ";
echo "<a href=\"reports_tours.php?type=csv\">CSV</a> &nbsp; ";
echo "<br />";
echo i18n("Participant Tour Choices").": ";
echo "<a href=\"reports_tour_selection.php?type=csv\">CSV</a> &nbsp; ";
echo "<br />";
// echo i18n("Tour Volunteers").": ";
// echo "<a href=\"reports_tour_volunteers.php?type=csv\">CSV</a> &nbsp; ";
// echo "<br />";
}
echo '</table></form>';
send_footer();
echo '<hr />';
echo '<h4>Descriptions for All Reports</h4>';
echo i18n('Click on the report number to try the report with the default report options before you add it to your Report List');
echo '<br /><br />';
echo "<table>\n";
$x=0;
foreach(array_merge($reports, $report_custom) as $r) {
$trclass = ($x % 2 == 0) ? "even" : "odd";
$x++;
echo "<tr class=\"$trclass\">";
if($r['custom_url'] == '') {
$url = "admin/reports_gen.php?id={$r['id']}";
} else {
$url = $r['custom_url'];
}
echo "<td><a href=\"{$config['SFIABDIRECTORY']}/$url\">$x.</a></td>";
echo "<td><table width=\"100%\"><tr>";
echo "<td><b>{$r['name']}</b></td>";
echo "<td align=\"right\">Created By: {$r['creator']}</td></tr>";
echo "<tr><td colspan=\"2\">{$r['desc']}</td></tr>";
echo "</table></tr>";
}
echo "</table>";
echo "<br />";
send_footer();
?>

185
admin/reports_old.php Normal file
View File

@ -0,0 +1,185 @@
<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
Copyright (C) 2005 James Grant <james@lightbox.org>
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.
*/
?>
<?
require("../common.inc.php");
require_once("../user.inc.php");
require_once('reports.inc.php');
user_auth_required('committee', 'admin');
send_header("Reports",
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php')
);
echo "<br />";
echo error('This page will no longer be available after Summer 2008. Please use the new \'My Reports\' interface. ');
$id = intval($_POST['id']);
echo "<h4>".i18n("All Reports")."</h4>";
echo "<form method=\"get\" name=\"reportgen\" action=\"reports_gen.php\">";
echo "<select name=\"id\" id=\"report\">";
echo "<option value=\"0\">".i18n("Select a Report")."</option>\n";
$reports = report_load_all();
$x=0;
foreach($reports as $r) {
$sel = ($id == $r['id']) ? 'selected=\"selected\"' : '';
echo "<option value=\"{$r['id']}\" $sel>{$r['name']}</option>\n";
}
echo "</select>";
echo "<select name=\"type\"><option value=\"\">Default Format</option>";
echo "<option value=\"pdf\">PDF</option>";
echo "<option value=\"csv\">CSV</option>";
echo "<option value=\"label\">Label</option>";
echo "</select>";
echo "<input type=\"text\" value=\"{$config['FAIRYEAR']}\" size=\"5\" name=\"year\" />";
echo "<input type=\"submit\" value=\"Generate Report\"></form>";
echo "<br />";
echo "<hr />";
echo "<h4>".i18n("Custom Reports")."</h4>";
/*
echo i18n("Day of Fair Registration/Checkin Forms (All Categories)").": ";
echo "<a href=\"reports_gen.php?id=9&type=pdf\">PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?id=9&type=csv\">CSV</a> &nbsp; ";
*/
//lets split this up by age category,
/*
$catq=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' ORDER BY id");
while($catr=mysql_fetch_object($catq))
{
echo "<td>";
echo "<a href=\"reports_checkin.php?type=pdf&cat=$catr->id\">$catr->category (PDF)</a> &nbsp; ";
echo "<br>";
echo "<a href=\"reports_checkin.php?type=csv&cat=$catr->id\">$catr->category (CSV)</a> &nbsp; ";
echo "</td>";
}
*/
echo "<br />";
echo i18n("Mailing Labels").": ";
echo "<a href=\"reports_mailinglabels.php\">".i18n("Mailing Label Generator")."</a>";
echo "<br />";
echo "<br />";
echo i18n("School Access Codes").": ";
echo "<a href=\"reports_gen.php?sid=36&type=pdf\">PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=36&type=csv\">CSV</a> &nbsp; ";
// echo "<a href=\"reports_schoolaccesscodes.php?type=pdf\">PDF</a> &nbsp; ";
// echo "<a href=\"reports_schoolaccesscodes.php?type=csv\">CSV</a> &nbsp; ";
echo "<br />";
echo i18n("Student Emergency Contact Names/Numbers").": ";
echo "<a href=\"reports_gen.php?sid=17&type=pdf\">PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=17&type=csv\">CSV</a> &nbsp; ";
echo "<br />";
echo i18n("Students/Projects From Each School").": ";
echo "<a href=\"reports_gen.php?sid=19&type=pdf\">PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=19&type=csv\">CSV</a> &nbsp; ";
echo "<br />";
echo i18n("Project Logistical Requirements (tables, electricity)").": ";
echo "<a href=\"reports_gen.php?sid=16&type=pdf\">PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=16&type=csv\">CSV</a> &nbsp; ";
echo "<br />";
echo i18n("Project Table Labels").": ";
echo "<a href=\"reports_gen.php?sid=30\">PDF</a> &nbsp; ";
echo "<br />";
echo i18n("Project Summary Details").": ";
echo "<a href=\"reports_projects_details.php?type=pdf\">PDF</a> &nbsp; ";
echo "<br />";
echo i18n("Nametags").": ";
echo "<a href=\"reports_gen.php?sid=26\">Students PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=26&type=csv\">Students CSV</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=27\">Judges PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=27&type=csv\">Judges CSV</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=28\">Committee PDF</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=28&type=csv\">Committee CSV</a> &nbsp; ";
echo "<br />";
echo "<br />";
echo i18n("Judges List").": ";
echo "<a href=\"reports_judges.php?type=csv\">Judge List (CSV)</a> &nbsp; ";
echo "<br />";
echo i18n("Judging Teams").": ";
echo "<a href=\"reports_gen.php?sid=21&type=csv\">List (CSV)</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=21&type=pdf\">List (PDF)</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=22&type=csv\">Team Awards (CSV)</a> &nbsp; ";
echo "<a href=\"reports_gen.php?sid=22&type=pdf\">Team Awards (PDF)</a> &nbsp; ";
echo "<br />";
echo i18n("Judging Teams Project Assignments").": ";
echo "<a href=\"reports_judges_teams_projects.php?type=csv\">CSV</a> &nbsp; ";
echo "<a href=\"reports_judges_teams_projects.php?type=pdf\">PDF</a> &nbsp; ";
echo "<br />";
echo i18n("Projects Judging Team Assignments").": ";
echo "<a href=\"reports_projects_judges_teams.php?type=csv\">CSV</a> &nbsp; ";
echo "<a href=\"reports_projects_judges_teams.php?type=pdf\">PDF</a> &nbsp; ";
echo "<br />";
echo i18n("Project Identification Labels (for judging sheets)").": ";
echo "<a href=\"reports_gen.php?sid=29\">PDF</a> &nbsp; ";
echo "<br />";
echo "<br />";
echo i18n("Awards list for Program").": ";
echo "<a href=\"reports_program_awards.php?type=csv\">CSV</a> &nbsp; ";
echo "<br />";
echo i18n("Award Ceremony Script").": ";
echo "<a href=\"reports_acscript.php?type=pdf\">FULL PDF</a> &nbsp;";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Divisional\">(Divisional)</a> &nbsp; ";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Special\">(Special)</a> &nbsp; ";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Interdisciplinary\">(Interdisciplinary)</a> &nbsp; ";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Other\">(Other)</a> &nbsp; ";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Grand\">(Grand)</a> &nbsp; ";
echo "<br />";
echo i18n("Award Ceremony Script").": ";
echo "<a href=\"reports_acscript.php?type=csv\">CSV</a> &nbsp; ";
echo "<br />";
echo "<a href=\"reports_acpresentation.php?type=csv\">Award Winners CSV</a> &nbsp; ";
echo "<br />";
if($config['tours_enable'] == 'yes') {
echo "<br />";
echo "<br />";
echo i18n("Available Tours").": ";
echo "<a href=\"reports_tours.php?type=csv\">CSV</a> &nbsp; ";
echo "<br />";
echo i18n("Participant Tour Choices").": ";
echo "<a href=\"reports_tour_selection.php?type=csv\">CSV</a> &nbsp; ";
echo "<br />";
// echo i18n("Tour Volunteers").": ";
// echo "<a href=\"reports_tour_volunteers.php?type=csv\">CSV</a> &nbsp; ";
// echo "<br />";
}
send_footer();
?>

View File

@ -52,7 +52,7 @@
echo '<ul>';
echo '<li><a href="user_personal.php">'.i18n('Edit My Profile').'</a></li>';
if(committee_auth_has_access('admin')) {
echo '<li><a href="admin/committee_reports.php">'.i18n('My Reports (View/Print/Edit)'
echo '<li><a href="admin/reports.php">'.i18n('My Reports (View/Print/Edit)'
).'</a></li>';
echo '<li><a href="admin/">'.i18n('Administer the Fair').'</a></li>';
}