-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup_rfid_tag.php
More file actions
61 lines (51 loc) · 1.62 KB
/
Copy pathsetup_rfid_tag.php
File metadata and controls
61 lines (51 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
require_once('config.php');
require_once('lib/misc.php');
if(!logged_in()) {
require_once('index.php');
exit();
}
require_once('lib/db.php');
require_once('lib/rabbit.php');
$rabbit = find_rabbit($db, $_REQUEST['rabbit']);
$tag = rfid_tag_for_rabbit($db, $rabbit, $_REQUEST['tag']);
if($_SERVER['REQUEST_METHOD'] == 'POST') {
// we need to save the data!
foreach($_POST as $key => $value) {
if($key == 'submit') {
// do nothing
} else {
$tag[$key] = $value;
}
}
save_rfid_tag($db, $tag);
header("Location: apps.php?rabbit=".$rabbit['mac_id']);
exit();
}
require('header.php');
?>
<header class="jumbotron masthead">
<div class="inner">
<h1>Nabaztag Server</h1>
<p><?php echo rabbit_name($rabbit); ?></p>
</div>
</header>
<hr class="soften">
<div class="marketing">
<h1>Configure RFID Tag <?php echo $tag['rfid']; ?></h1>
</div>
<form method="post" action="setup_rfid_tag.php?rabbit=<?php echo $_REQUEST['rabbit']; ?>&tag=<?php echo $_REQUEST['tag']; ?>" id="app-setup-form" data-ajax="false" class="ui-body ui-body-b ui-corner-all">
<fieldset data-role="controlgroup">
<legend>Command:</legend>
<div data-role="fieldcontain">
<textarea name="command" id="command" cols="80" rows="10"><?php echo htmlentities($tag['command']); ?></textarea>
<div class="alert alert-info">
<strong>Help:</strong> The following commands are supported....
</div>
</div>
</fieldset>
<fieldset data-role="controlgroup">
<input type="submit" name="submit" value="Save" id="submit" data-role="none" class="btn button"/>
</fieldset>
</form>
<?php require('footer.php'); ?>