Subversion Repositories computer_asset_manager_v1

Rev

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

Rev 46 Rev 47
Line 1... Line 1...
1
<?php 
1
<?php 
2
   include_once( '../../header.php' );
2
   include_once( '../../header.php' );
3
   include_once( './functions.php' );
3
   include_once( './functions.php' );
-
 
4
   define ( DEBUG, false );
4
?>
5
?>
5
<?xml version="1.0" encoding="utf-8"?>
6
<?xml version="1.0" encoding="utf-8"?>
6
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
7
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
7
<html xmlns="http://www.w3.org/1999/xhtml">
8
<html xmlns="http://www.w3.org/1999/xhtml">
8
   <head>
9
   <head>
Line 10... Line 11...
10
      <link rel="stylesheet" type="text/css" href="../../camp.css">
11
      <link rel="stylesheet" type="text/css" href="../../camp.css">
11
   </head>
12
   </head>
12
   <body>
13
   <body>
13
      <?php include_once('../../menu.php'); ?>
14
      <?php include_once('../../menu.php'); ?>
14
      <div id="content">
15
      <div id="content">
-
 
16
         <?php if ( DEBUG ) { print "<pre>"; print_r( $_REQUEST ); print "</pre>\n"; } ?>
15
      <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
17
      <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
16
         <table border='1'>
18
         <table border='1'>
17
            <tr>
19
            <tr>
18
               <td>Client</td>
20
               <td>Client</td>
19
               <td>
21
               <td>
Line 26... Line 28...
26
            <tr>
28
            <tr>
27
               <td>Machine</td>
29
               <td>Machine</td>
28
               <td>
30
               <td>
29
                  <select name='device_id'>
31
                  <select name='device_id'>
30
                     <option value=-1 selected>All</option>
32
                     <option value=-1 selected>All</option>
-
 
33
                     <option value='null'>Available</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"); ?>
34
                  <?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"); ?>
32
                  </select>
35
                  </select>
33
               </td>
36
               </td>
34
            </tr>
37
            </tr>
35
            <tr>
38
            <tr>
Line 54... Line 57...
54
            <tr>
57
            <tr>
55
               <td colspan='2' align='center'><input type="submit" value="Show Results" name="submit"></td>
58
               <td colspan='2' align='center'><input type="submit" value="Show Results" name="submit"></td>
56
            </tr>
59
            </tr>
57
         </table>
60
         </table>
58
         <p>* These items will search for substrings</p>
61
         <p>* These items will search for substrings</p>
-
 
62
         <p align='center'><a href='edit.html?license_id=-1'>Add new License</a></p>
59
         <hr>
63
         <hr>
60
         </form>
64
         </form>
61
         <?php 
65
         <?php 
62
            if ( $_POST["submit"] ) {
66
            if ( isset( $_POST["submit"] ) && $_POST["submit"] == 'Show Results' ) {
63
               $filter = array();
67
               $filter = array();
64
               if ( ! isset( $_REQUEST['history'] ) ) $filter[] = 'license.removed_date is null';
68
               if ( ! isset( $_REQUEST['history'] ) ) $filter[] = 'license.removed_date is null';
65
               foreach ( array( 'client_id','device_id','license_product_id' ) as $field ) {
69
               foreach ( array( 'client_id','device_id','license_product_id' ) as $field ) {
66
                  if ( $_REQUEST[$field] > -1 ) 
70
                  if ( $_REQUEST[$field] > -1 ) 
67
                     $filter[] = "$field = " . $_REQUEST[$field];
71
                     $filter[] = ( $_REQUEST[$field] == 'null' ? "$field is " : "$field = " ) . $_REQUEST[$field];
68
               } // foreach
72
               } // foreach
69
               if ( $_REQUEST['product'] )
73
               if ( $_REQUEST['product'] )
70
                  $filter[] = "license_product.name like '%" . $_REQUEST['product'] . "%'";
74
                  $filter[] = "license_product.name like '%" . $_REQUEST['product'] . "%'";
71
               if ( $_REQUEST['license'] )
75
               if ( $_REQUEST['license'] )
72
                  $filter[] = "license.license like '%" . $_REQUEST['license'] . "%'";
76
                  $filter[] = "license.license like '%" . $_REQUEST['license'] . "%'";
73
                  
77
                  
74
               $query = insertValuesIntoQuery( SQL_SHOW_LICENSE,
78
               $query = insertValuesIntoQuery( SQL_SHOW_LICENSE,
75
                            array('whereClause' => implode( ' and ', $filter )
79
                            array('whereClause' => implode( ' and ', $filter )
76
                                                                  ));
80
                                                                  ));
77
               //print "<pre>$query</pre>";
81
               if ( DEBUG ) print "<pre>$query</pre>";
78
               print queryToTable( $query );
82
               print queryToTable( $query );
79
            } elseif ( $_REQUEST['action'] == 'move' ) {
83
            } elseif ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'move' ) {
80
         ?>
84
         ?>
81
         <p>Moving license from current workstation to new machine. Select target machine below</p>
85
         <p>Moving license from current workstation to new machine. Select target machine below</p>
82
         <pre><?php print getDescription( $_REQUEST['license_id'] ); ?></pre>
86
         <pre><?php print getDescription( $_REQUEST['license_id'] ); ?></pre>
83
         <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
87
         <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
-
 
88
            <input type='hidden' name='license_id' value='<?php print $_REQUEST['license_id'] ?>' />
84
            <table>
89
            <table>
85
            <tr>
90
            <tr>
86
               <td>Select new Machine</td>
91
               <td>Select new Machine</td>
87
               <td>
92
               <td>
88
                  <select name='new_device'>
93
                  <select name='new_device'>
89
                     <option value=-1 selected>Remove Only</option>
94
                     <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"); ?>
95
                  <?php print queryToSelect( "select device_id,name from view_device_systems where removed_date is null order by name"); ?>
91
                  </select>
96
                  </select>
92
               </td>
97
               </td>
93
            </tr>
98
            </tr>
-
 
99
            <tr>
-
 
100
               <td colspan='2' align='center'><input type="submit" value="Move License" name="submit"></td>
-
 
101
            </tr>
94
            </table>
102
            </table>
95
         </form>
103
         </form>
96
         <?php
104
         <?php
-
 
105
         } elseif ( isset( $_REQUEST['submit'] ) && $_REQUEST['submit'] == 'Move License' ) {
-
 
106
            moveLicense( $_REQUEST['license_id'], $_REQUEST['new_device'] );
97
         }
107
         }
98
         ?>
108
         ?>
99
      </div>
109
      </div>
100
   </body>
110
   </body>
101
</html>
111
</html>