Copyright (C) 2007 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. */ ?> category; echo json_encode($ret); exit; case 'save': echo "POST: "; print_r($_POST); $id = intval($_POST['id']); $reports_id = intval($_POST['reports_id']); if($id == -1) { /* New entry */ mysql_query("INSERT INTO `reports_committee` (`users_id`,`reports_id`) VALUES('{$_SESSION['accounts_id']}','$reports_id');"); echo mysql_error(); $id = mysql_insert_id(); } /* Update entry */ $category = $_POST['category']; $category_exist = $_POST['category_exist']; $comment = mysql_real_escape_string(stripslashes($_POST['comment'])); if($category_exist != '') $category = $category_exist; $category = mysql_real_escape_string(stripslashes(trim($category))); if($category == '') $category = 'default'; if($reports_id > 0) { /* SFIAB report */ $type = $_POST['type']; $stock = $_POST['stock']; if(!array_key_exists($type, $report_options['type']['values'])) { error_("Invalid format: type=$type"); exit; } if(!array_key_exists($stock, $report_stock)) { error_("Invalid stock: stock=$stock"); exit; } } else { /* Old custom */ $type = ''; $stock = ''; } mysql_query("UPDATE `reports_committee` SET `category`='$category', `comment`='$comment', `format`='$type', `stock`='$stock' WHERE id='$id'"); happy_("Saved"); exit; } //send the header send_header("My Reports", array("Committee Main" => "committee_main.php"), "print/export_reports" ); /* 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 "Edit This List" button at the bottom of this page.'); ?>

"; while($i = mysql_fetch_object($q)) { $x++; 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) { // $url = "admin/reports_gen.php?id={$i->reports_id}&show_options=1"; $name = "reports_id})\">{$i->name}"; } else { $name = "reports_id]['custom_url']}\"> {$report_custom[-$i->reports_id]['name']}"; } ?> comment?> reports_id > 0) { echo ''; echo ''; echo i18n('Format').": {$i->format}, "; echo i18n('Paper').": {$report_stock[$i->stock]['name']}, "; echo i18n('Year').": {$config['FAIRYEAR']}"; echo ''; echo ''; } */ } echo ""; } ?>
">

$r) { $r['id'] = -$id; $reports[-$id] = $r; } ?>


"> ">