Copyright (C) 2005 James Grant Copyright (C) 2007 David 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. */ ?> "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 '
'; echo '
'; echo ''.i18n('Click here when you are finished editing your report list').''; echo '
'; echo '
'; } echo ''; $last_category = ''; while($i = mysql_fetch_object($q)) { if($last_category != $i->category) { /* New category */ echo '

'; if($edit_mode == true) echo i18n('Category').': '; echo "{$i->category}

"; $last_category = $i->category; } if($i->reports_id > 0) $name = $i->name; else $name = $report_custom[-$i->reports_id]['name']; echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
$name
"; if($edit_mode == true) { echo "id}\">\"Remove"; } echo ""; if($i->reports_id > 0) { echo i18n('Format').": {$i->format}, "; echo i18n('Paper').": {$report_stock[$i->stock]['name']}, "; echo i18n('Year').": {$config['FAIRYEAR']}"; } else { echo i18n('Custom report, no options available'); } echo ""; if($edit_mode == false) { if($i->reports_id > 0) { echo "
"; echo "reports_id}\" />"; echo ""; } else { $url = $report_custom[-$i->reports_id]['custom_url']; echo ""; } echo "
"; echo "
"; } echo "
{$i->comment}
"; } } if($edit_mode == false) { echo "
"; echo ''.i18n('Click here to edit your Report List').''; send_footer(); exit; } echo '
'; /* Load available reports */ $reports = report_load_all(); /* Create an add report box */ echo '

'.i18n('Add a Report to your Report List').'

'; echo "
"; echo ""; echo "\n"; echo '"; echo ""; $option_keys = array('type','stock'); foreach($report_options as $ok=>$o) { if(!in_array($ok, $option_keys)) continue; echo ""; echo ""; } echo ""; echo ""; echo '
'; echo "
Category:"; $q = mysql_query("SELECT DISTINCT category FROM reports_committee WHERE users_id='{$_SESSION['users_id']}' ORDER BY category"); echo "Existing Category:
"; echo "OR New Category: "; echo "
{$o['desc']}:
Comments:"; echo "
'; echo '
'; echo '

Descriptions for All Reports

'; 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 '

'; echo "\n"; $x=0; foreach(array_merge($reports, $report_custom) as $r) { $trclass = ($x % 2 == 0) ? "even" : "odd"; $x++; echo ""; if($r['custom_url'] == '') { $url = "admin/reports_gen.php?id={$r['id']}"; } else { $url = $r['custom_url']; } echo ""; echo ""; } echo "
$x."; echo ""; echo ""; echo ""; echo "
{$r['name']}Created By: {$r['creator']}
{$r['desc']}
"; echo "
"; send_footer(); ?>