Blame | Last modification | View Log | RSS feed
<?php include_once( 'header.php' );
if ( getParameter('mode')=="edited") {
updateData( $DATABASE_DEFINITION[getParameter('currentdb')], getParameter('id') );
$location = $_SESSION['previous page'];
header("Location: $location");
} elseif ( getParameter('mode')=="added") {
insertData( $DATABASE_DEFINITION[getParameter('currentdb')] );
$location = $_SESSION['previous page'];
header("Location: $location");
}
?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Daily Data - Computer Asset Management Program</title>
<link rel="stylesheet" type="text/css" href="camp.css">
</head>
<body>
<?php include_once('menu.php'); ?>
<div id="content">
<?php
$_SESSION['previous page'] = $_SERVER['HTTP_REFERER'];
if ($command = getParameter('command')) {
switch ($command) {
case 'add_site' : print addData($DATABASE_DEFINITION['site']);
break;
case 'add_client' : print addData($DATABASE_DEFINITION['client']);
break;
case 'add_device' : print addData($DATABASE_DEFINITION['device']);
break;
}
} else {
$client_id = getParameter('client_id');
$device_id = getParameter('device_id');
$site_id = getParameter('site_id');
if ($client_id) {
print editData($DATABASE_DEFINITION['client'],$client_id);
} elseif ($site_id) {
print editData($DATABASE_DEFINITION['site'],$site_id);
} elseif ($device_id) {
print editData($DATABASE_DEFINITION['device'],$device_id);
}
}
?>
</div>
</body>
</html>