/***************************************************************************
* This script edits templates for reports *
* *
* Copyright (c) 2006 by Nico Stuurman *
* ------------------------------------------------------------------------ *
* 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; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
require('./include.php');
require('./includes/db_inc.php');
require('./includes/general_inc.php');
require('./includes/tablemanage_inc.php');
include_once ('./includes/defines_inc.php');
$editreport=$_GET['editreport'];
$editreport=true;
$post_vars='table_id,tablename';
globalize_vars($post_vars, $_POST);
globalize_vars($post_vars, $_GET);
// this needs to be done before headers are sent in printheader
while((list($key, $val) = each($_POST))) {
if (substr($key, 0, 9) == 'expreport') {
$modarray = explode('_', $key);
export_report($db,$modarray[1]);
exit;
}
}
reset($_POST);
printheader($httptitle,false,$jsfiles);
while((list($key, $val) = each($_POST))) {
if (substr($key, 0, 9) == "modreport") {
$modarray = explode("_", $key);
$tplmessage=mod_report($db,$modarray[1]);
break;
} elseif (substr($key, 0, 9) == "delreport") {
$modarray = explode("_", $key);
rm_report($db,$modarray[1]);
break;
} elseif (substr($key, 0, 10) == "testreport") {
$modarray = explode("_", $key);
$tplmessage=test_report($db,$modarray[1],$editreport);
break;
} elseif ($key=="addreport") {
$tplmessage=add_report($db);
break;
}
}
navbar($USER['permissions']);
// when no tablename is given, list all tables this user can write to
if (!$tablename) {
echo "
\n";
echo "