103 |
rodolico |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/*
|
|
|
4 |
* edit_device_attributes.html
|
|
|
5 |
*
|
|
|
6 |
* page in attributes module for CAMP that allows editing attributes for a device
|
|
|
7 |
*
|
|
|
8 |
*
|
|
|
9 |
*
|
|
|
10 |
* Copyright (c) 2020 by the Daily Data, Inc. All rights reserved. Redistribution and use in source and binary forms, with or
|
|
|
11 |
* without modification, are permitted provided that the following conditions are met:
|
|
|
12 |
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
|
13 |
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
|
|
|
14 |
* disclaimer in the documentation and/or other materials provided with the distribution.
|
|
|
15 |
* Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this
|
|
|
16 |
* software without specific prior written permission.
|
|
|
17 |
*
|
|
|
18 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
|
|
19 |
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
|
|
20 |
* SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
21 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
22 |
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
|
23 |
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
24 |
*
|
|
|
25 |
* 20200117 rodo@dailydata.net v0.1
|
|
|
26 |
* Initial build
|
|
|
27 |
*
|
|
|
28 |
*/
|
|
|
29 |
|
|
|
30 |
include_once( '../../header.php' );
|
|
|
31 |
include_once( './functions.php' );
|
|
|
32 |
include_once( '../../includes/functions.php' );
|
|
|
33 |
include_once( './database.php' );
|
|
|
34 |
define( DEBUG, true );
|
|
|
35 |
?>
|
|
|
36 |
<?xml version="1.0" encoding="utf-8"?>
|
|
|
37 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
|
|
|
38 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
39 |
<head>
|
|
|
40 |
<title>Computer Asset Management Program - Attributes - Edit Device</title>
|
|
|
41 |
<link rel="stylesheet" type="text/css" href="../../camp.css">
|
|
|
42 |
</head>
|
|
|
43 |
<body>
|
|
|
44 |
<?php include_once('../../menu.php'); ?>
|
|
|
45 |
<div id="content">
|
|
|
46 |
<h4>Edit Device Attributes</h4>
|
|
|
47 |
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
|
110 |
rodolico |
48 |
<input type='hidden' name='device_id' value='<?php print $adding ? 'null' : $_REQUEST[ 'device_id']; ?>' />
|
103 |
rodolico |
49 |
<?php
|
|
|
50 |
if ( isset( $_REQUEST['device_id'] ) ) {
|
|
|
51 |
print editDataTable( $DATABASE_DEFINITION['attrib_device'], "removed_date is null and device_id = " . $_REQUEST[ 'device_id'], array('device_id'=>$_REQUEST[ 'device_id']) );
|
110 |
rodolico |
52 |
|
103 |
rodolico |
53 |
} else {
|
|
|
54 |
//print "<pre>"; print_r( $DATABASE_DEFINITION ); print "</pre>";
|
|
|
55 |
?>
|
|
|
56 |
<table border='1'>
|
|
|
57 |
<tr>
|
|
|
58 |
<td>Machine</td>
|
|
|
59 |
<td>
|
|
|
60 |
<select name='device_id'>
|
|
|
61 |
<?php print queryToSelect( getAllDevices() ); ?>
|
|
|
62 |
</select>
|
|
|
63 |
</td>
|
|
|
64 |
</tr>
|
|
|
65 |
<tr>
|
|
|
66 |
<td colspan='2' align='center'><input type="submit" value="Select Device" name="submit"></td>
|
|
|
67 |
</tr>
|
|
|
68 |
</table>
|
|
|
69 |
<?php } ?>
|
|
|
70 |
</form>
|
|
|
71 |
</div>
|
|
|
72 |
</body>
|
|
|
73 |
</html>
|
|
|
74 |
|
|
|
75 |
|