Subversion Repositories computer_asset_manager_v1

Rev

Rev 42 | Rev 47 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

<?php 
   include_once( '../../header.php' );
   include_once( './functions.php' );
?>
<?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>Computer Asset Management Program - MODULE NAME - PAGE NAME</title>
      <link rel="stylesheet" type="text/css" href="../../camp.css">
   </head>
   <body>
      <?php include_once('../../menu.php'); ?>
      <div id="content">
      <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
         <table border='1'>
            <tr>
               <td>Client</td>
               <td>
                  <select name='client_id'>
                     <option value=-1 selected>All</option>
                  <?php print queryToSelect( 'select client_id,name from client where removed_date is null order by name'); ?>
                  </select>
               </td>
            </tr>
            <tr>
               <td>Machine</td>
               <td>
                  <select name='device_id'>
                     <option value=-1 selected>All</option>
                  <?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"); ?>
                  </select>
               </td>
            </tr>
            <tr>
               <td>Product</td>
               <td>
                  <select name='license_product_id'>
                     <option value=-1 selected>All</option>
                  <?php print queryToSelect( 'select license_product_id,name from license_product order by name'); ?>
                  </select>
               </td>
            </tr>
            <tr>
               <td>*Product</td>
               <td><input type='text' name='product' width='20'></td>
            </tr>
            <tr>
               <td>*License</td>
               <td><input type='text' name='license' width='20'> 
               (<input type="checkbox" name="history" value="history"> show history)
               </td>
            </tr>
            <tr>
               <td colspan='2' align='center'><input type="submit" value="Show Results" name="submit"></td>
            </tr>
         </table>
         <p>* These items will search for substrings</p>
         <hr>
         </form>
         <?php 
            if ( $_POST["submit"] ) {
               $filter = array();
               if ( ! isset( $_REQUEST['history'] ) ) $filter[] = 'license.removed_date is null';
               foreach ( array( 'client_id','device_id','license_product_id' ) as $field ) {
                  if ( $_REQUEST[$field] > -1 ) 
                     $filter[] = "$field = " . $_REQUEST[$field];
               } // foreach
               if ( $_REQUEST['product'] )
                  $filter[] = "license_product.name like '%" . $_REQUEST['product'] . "%'";
               if ( $_REQUEST['license'] )
                  $filter[] = "license.license like '%" . $_REQUEST['license'] . "%'";
                  
               $query = insertValuesIntoQuery( SQL_SHOW_LICENSE,
                            array('whereClause' => implode( ' and ', $filter )
                                                                  ));
               //print "<pre>$query</pre>";
               print queryToTable( $query );
            } elseif ( $_REQUEST['action'] == 'move' ) {
         ?>
         <p>Moving license from current workstation to new machine. Select target machine below</p>
         <pre><?php print getDescription( $_REQUEST['license_id'] ); ?></pre>
         <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
            <table>
            <tr>
               <td>Select new Machine</td>
               <td>
                  <select name='new_device'>
                     <option value=-1 selected>Remove Only</option>
                  <?php print queryToSelect( "select device_id,name from view_device_systems where removed_date is null order by name"); ?>
                  </select>
               </td>
            </tr>
            </table>
         </form>
         <?php
         }
         ?>
      </div>
   </body>
</html>