Subversion Repositories computer_asset_manager_v1

Rev

Rev 1 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 62
Line 9... Line 9...
9
<body>
9
<body>
10
<?php include_once('menu.php'); ?>
10
<?php include_once('menu.php'); ?>
11
 
11
 
12
<div id="content">
12
<div id="content">
13
<?php
13
<?php
-
 
14
   $callables = '';
14
   $client_id = $_GET['client_id'];
15
   $client_id = $_GET['client_id'];
15
   $site_id = $_GET['site_id'];
16
   $site_id = $_GET['site_id'];
16
   $where = setAuth();
17
   $where = setAuth();
17
   /* 
18
   /* 
18
      this code will see if the requested data is only one row for clients and sites
19
      this code will see if the requested data is only one row for clients and sites
Line 41... Line 42...
41
   if ( $client_id ) { // we have a client, show sites
42
   if ( $client_id ) { // we have a client, show sites
42
      $sql = insertValuesIntoQuery(SQL_SHOW_SITES,
43
      $sql = insertValuesIntoQuery(SQL_SHOW_SITES,
43
                            array('whereClause' => setAuth(implode( ' and ', 
44
                            array('whereClause' => setAuth(implode( ' and ', 
44
                                                                  array("site.client_id = $client_id"
45
                                                                  array("site.client_id = $client_id"
45
                                                                  )))));
46
                                                                  )))));
-
 
47
                                                         
46
      $currentScreen = '<a href="edit.html?command=add_site">Add Site</a>';
48
      $currentScreen = '<a href="edit.html?command=add_site">Add Site</a>';
-
 
49
      $callables = callableOutput( 'client view', array( 'client_id' => $client_id ) );
47
   } elseif ($site_id) { // we have a site, show devices
50
   } elseif ($site_id) { // we have a site, show devices
48
      $sql = insertValuesIntoQuery(SQL_SHOW_DEVICES,
51
      $sql = insertValuesIntoQuery(SQL_SHOW_DEVICES,
49
                            array('whereClause' => setAuth(implode( ' and ', 
52
                            array('whereClause' => setAuth(implode( ' and ', 
50
                                                                  array("device.site_id = $site_id"
53
                                                                  array("device.site_id = $site_id"
51
                                                                  )))));
54
                                                                  )))));
52
      $currentScreen = '<a href="edit.html?command=add_device">Add Device</a>';
55
      $currentScreen = '<a href="edit.html?command=add_device">Add Device</a>';
-
 
56
      $callables = callableOutput( 'site view', array( 'site_id' => $site_id ) );
-
 
57
 
53
   } else { // we have nothing, show client list
58
   } else { // we have nothing, show client list
54
      $sql = insertValuesIntoQuery(SQL_SHOW_CLIENTS,
59
      $sql = insertValuesIntoQuery(SQL_SHOW_CLIENTS,
55
                            array('whereClause' => setAuth('1')));
60
                            array('whereClause' => setAuth('1')));
56
      $currentScreen = '<a href="edit.html?command=add_client">Add Client</a>';
61
      $currentScreen = '<a href="edit.html?command=add_client">Add Client</a>';
57
   }
62
   }
58
   //print "<pre>\n$sql\n</pre>";
63
   //print "<pre>\n$sql\n</pre>";
59
   print queryToTable( $sql );
64
   print queryToTable( $sql );
60
   print $currentScreen;
65
   print $currentScreen;
-
 
66
   print $callables;
61
?>
67
?>
62
</div>
68
</div>
63
</body>
69
</body>
64
</html>
70
</html>
65
 
71