-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_lodgepestcontrol.php
executable file
·89 lines (72 loc) · 2.98 KB
/
admin_lodgepestcontrol.php
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
include 'tpl/auth.php';
include 'tpl/sql.php';
if ((strlen($_POST['submit']) > 1)) {
$treated_room = filter_var($_POST['treated_room'], FILTER_SANITIZE_STRING);
$action_taken = filter_var($_POST['action_taken'], FILTER_SANITIZE_STRING);
$sql="INSERT INTO treatments (room, action_taken) VALUES('$treated_room','$action_taken')";
if ($result = mysqli_query($con, $sql)) {
// echo "Returned rows are: " . mysqli_num_rows($result);
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
//$cultivarid = mysqli_insert_id();
mysqli_close($con);
$savesuccess = 'true';
}
?>
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>growTENT :: Lodge pest control</title>
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<!-- Makes your prototype chrome-less once bookmarked to your phone's home screen -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- Include the compiled Ratchet CSS -->
<link rel="stylesheet" href="ratchet-theme-ios.min.css">
<link rel="stylesheet" href="ratchet.min.css">
<link rel="stylesheet" href="app.css">
<!-- Include the compiled Ratchet JS -->
<!-- <script src="ratchet.js"></script> -->
<script src="html5-qrcode.min.js"></script>
</head>
<body>
<!-- Make sure all your bars are the first things in your <body> -->
<header class="bar bar-nav">
<a href="admin.php"><button class="btn btn-link btn-nav pull-left">
<span class="icon icon-home"></span>
Home
</button></a>
<h1 class="title">Lodge pest control action</h1>
</header>
<!-- Wrap all non-bar HTML in the .content div (this is actually what scrolls) -->
<div class="content">
<p class="content-padded" align='center'>Keep track of all the treatment actions taken for pest control / IPM</p>
<?php if($savesuccess=='true'){ echo "<p class='content-padded' align='center'><font color='red'>Saved!</font></p>";} ?>
<div class="card">
<p>
<form action='admin_lodgepestcontrol.php' method='post' class='input-group'>
Choose room the pest control was taken for:<br />
<select name='treated_room' id='treated_room'>
<?php foreach($rooms as $currentroom) {
echo " <option value='" . $currentroom . "'>" . $currentroom . "</option>";
} ?>
</select>
<br />
Select the pest-control action taken:<br />
<select name='action_taken' id='action_taken'>
<?php foreach($treatments as $currentaction) {
echo " <option value='" . $currentaction . "'>" . $currentaction . "</option>";
} ?>
</select>
<button class="btn btn-positive btn-block" type="submit" name="submit" value="save">Submit</button>
</form>
</p>
</div>
</div>
</body>
</html>