// Please see http://pandora.sourceforge.net for full contribution list
// 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 for 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; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/*
Database schema:
CREATE TABLE `pandora`.`tplanned_downtime` (
`id` MEDIUMINT( 8 ) NOT NULL AUTO_INCREMENT ,
`name` VARCHAR( 100 ) NOT NULL ,
`description` TEXT NOT NULL ,
`start` INT NOT NULL ,
`end` INT NOT NULL ,
`module_id` BIGINT( 14 ) NOT NULL ,
PRIMARY KEY ( `id` ) ,
INDEX ( `start` , `end` , `module_id` ) ,
UNIQUE (
`id`
)
) ENGINE = INNODB
*/
//ACL
require("include/config.php");
if (give_acl($id_user, 0, "AW")!=1) {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access downtime scheduler");
require ("general/noaccess.php");
exit;
};
function generate_options ($start, $number, $default = false) {
for($i=$start; $i<$start+$number; $i++) {
$val = str_pad($i,2,0,STR_PAD_LEFT);
echo '';
}
}
//Initialize data
$id_agente = get_parameter ("id_agente");
$modules = get_modules_in_agent ($id_agente);
$from_year = date("Y");
$from_month = date("m");
$from_day = date("d");
$to_year = date("Y");
$to_month = date("m");
$to_day = date("d");
//Here cometh the parsing of the entered form
if(isset ($_GET["delete"])) {
$sql = sprintf ("DELETE FROM tplanned_downtime WHERE id = %d",$_GET["delete"]);
$result = process_sql ($sql);
if ($result === false) {
echo '