Subversion Repositories computer_asset_manager_v1

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 rodolico 1
<?php include_once( 'header.php' ); 
2
  if ( getParameter('mode')=="edited") { 
3
    updateData( $DATABASE_DEFINITION[getParameter('currentdb')], getParameter('id') );
4
   $location = $_SESSION['previous page'];
5
   header("Location: $location");
6
  } elseif ( getParameter('mode')=="added") {
7
    insertData( $DATABASE_DEFINITION[getParameter('currentdb')] );
8
   $location = $_SESSION['previous page'];
9
   header("Location: $location");
10
  }
11
 
12
?>
13
<?xml version="1.0" encoding="utf-8"?>
14
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
15
<html xmlns="http://www.w3.org/1999/xhtml">
16
<head>
17
  <title>Daily Data - Computer Asset Management Program</title>
18
  <link rel="stylesheet" type="text/css" href="camp.css">
19
</head>
20
<body>
21
<?php include_once('menu.php'); ?>
22
 
23
<div id="content">
24
<?php
25
 
26
   $_SESSION['previous page'] = $_SERVER['HTTP_REFERER'];
27
  if ($command = getParameter('command')) {
28
     switch ($command) {
29
      case 'add_site'   : print addData($DATABASE_DEFINITION['site']);
30
                          break;
31
      case 'add_client' : print addData($DATABASE_DEFINITION['client']);
32
                          break;
33
      case 'add_device' : print addData($DATABASE_DEFINITION['device']);
34
                          break;
35
     }
36
  } else {
37
    $client_id = getParameter('client_id');
38
    $device_id = getParameter('device_id');
39
    $site_id = getParameter('site_id');
40
    if ($client_id) {
41
      print editData($DATABASE_DEFINITION['client'],$client_id);
42
    } elseif ($site_id) {
43
      print editData($DATABASE_DEFINITION['site'],$site_id);
44
    } elseif ($device_id) {
45
      print editData($DATABASE_DEFINITION['device'],$device_id);
46
    }
47
  }
48
?>
49
</div>
50
</body>
51
</html>
52