Subversion Repositories computer_asset_manager_v1

Rev

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

Rev 42 Rev 46
Line 1... Line 1...
1
<?php 
1
<?php 
2
   include_once( '../../header.php' ); 
2
   include_once( '../../header.php' );
-
 
3
   include_once( './functions.php' );
3
?>
4
?>
4
<?xml version="1.0" encoding="utf-8"?>
5
<?xml version="1.0" encoding="utf-8"?>
5
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
6
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
6
<html xmlns="http://www.w3.org/1999/xhtml">
7
<html xmlns="http://www.w3.org/1999/xhtml">
7
   <head>
8
   <head>
Line 9... Line 10...
9
      <link rel="stylesheet" type="text/css" href="../../camp.css">
10
      <link rel="stylesheet" type="text/css" href="../../camp.css">
10
   </head>
11
   </head>
11
   <body>
12
   <body>
12
      <?php include_once('../../menu.php'); ?>
13
      <?php include_once('../../menu.php'); ?>
13
      <div id="content">
14
      <div id="content">
-
 
15
      <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
-
 
16
         <table border='1'>
-
 
17
            <tr>
14
         <?php print queryToTable( 
18
               <td>Client</td>
15
               "select 
19
               <td>
16
                  license_product.name 'Product',
20
                  <select name='client_id'>
-
 
21
                     <option value=-1 selected>All</option>
-
 
22
                  <?php print queryToSelect( 'select client_id,name from client where removed_date is null order by name'); ?>
-
 
23
                  </select>
-
 
24
               </td>
-
 
25
            </tr>
-
 
26
            <tr>
-
 
27
               <td>Machine</td>
-
 
28
               <td>
17
                  license.license 'License',
29
                  <select name='device_id'>
18
                  ifnull(device.name,'--- Available ---') 'Installed On',
30
                     <option value=-1 selected>All</option>
-
 
31
                  <?php print queryToSelect( "select device.device_id,device.name from device where device_type_id in (select device_type_id from device_type where show_as_system = 'Y') order by device.name"); ?>
19
                  client.name 'Client'
32
                  </select>
-
 
33
               </td>
-
 
34
            </tr>
-
 
35
            <tr>
-
 
36
               <td>Product</td>
20
               from
37
               <td>
21
                  license join license_product using (license_product_id)
38
                  <select name='license_product_id'>
22
                  left outer join device using (device_id)
39
                     <option value=-1 selected>All</option>
-
 
40
                  <?php print queryToSelect( 'select license_product_id,name from license_product order by name'); ?>
-
 
41
                  </select>
-
 
42
               </td>
-
 
43
            </tr>
-
 
44
            <tr>
-
 
45
               <td>*Product</td>
-
 
46
               <td><input type='text' name='product' width='20'></td>
-
 
47
            </tr>
-
 
48
            <tr>
-
 
49
               <td>*License</td>
-
 
50
               <td><input type='text' name='license' width='20'> 
-
 
51
               (<input type="checkbox" name="history" value="history"> show history)
-
 
52
               </td>
-
 
53
            </tr>
-
 
54
            <tr>
-
 
55
               <td colspan='2' align='center'><input type="submit" value="Show Results" name="submit"></td>
-
 
56
            </tr>
-
 
57
         </table>
-
 
58
         <p>* These items will search for substrings</p>
-
 
59
         <hr>
-
 
60
         </form>
-
 
61
         <?php 
-
 
62
            if ( $_POST["submit"] ) {
-
 
63
               $filter = array();
-
 
64
               if ( ! isset( $_REQUEST['history'] ) ) $filter[] = 'license.removed_date is null';
-
 
65
               foreach ( array( 'client_id','device_id','license_product_id' ) as $field ) {
23
                  join client using ( client_id )
66
                  if ( $_REQUEST[$field] > -1 ) 
-
 
67
                     $filter[] = "$field = " . $_REQUEST[$field];
-
 
68
               } // foreach
24
               order by license_product.name, device.name
69
               if ( $_REQUEST['product'] )
-
 
70
                  $filter[] = "license_product.name like '%" . $_REQUEST['product'] . "%'";
-
 
71
               if ( $_REQUEST['license'] )
-
 
72
                  $filter[] = "license.license like '%" . $_REQUEST['license'] . "%'";
25
               "
73
                  
-
 
74
               $query = insertValuesIntoQuery( SQL_SHOW_LICENSE,
-
 
75
                            array('whereClause' => implode( ' and ', $filter )
-
 
76
                                                                  ));
-
 
77
               //print "<pre>$query</pre>";
-
 
78
               print queryToTable( $query );
-
 
79
            } elseif ( $_REQUEST['action'] == 'move' ) {
-
 
80
         ?>
-
 
81
         <p>Moving license from current workstation to new machine. Select target machine below</p>
-
 
82
         <pre><?php print getDescription( $_REQUEST['license_id'] ); ?></pre>
-
 
83
         <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
-
 
84
            <table>
-
 
85
            <tr>
-
 
86
               <td>Select new Machine</td>
26
               );
87
               <td>
-
 
88
                  <select name='new_device'>
-
 
89
                     <option value=-1 selected>Remove Only</option>
-
 
90
                  <?php print queryToSelect( "select device_id,name from view_device_systems where removed_date is null order by name"); ?>
-
 
91
                  </select>
-
 
92
               </td>
-
 
93
            </tr>
-
 
94
            </table>
-
 
95
         </form>
-
 
96
         <?php
-
 
97
         }
27
         ?>
98
         ?>
28
      </div>
99
      </div>
29
   </body>
100
   </body>
30
</html>
101
</html>