/
adduniformcheck.php
136 lines (91 loc) · 4.8 KB
/
adduniformcheck.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php include 'session.php'; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php
include 'connection.php';
include 'header.php';
include 'functions.php';
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);
?>
</head>
<body>
<div class="bg">
<?php
include 'navback.php';
$source = '?source=viewuniformchecks';
include 'checksource.php';
?>
<div class="container">
<h1>Uniform Check</h1>
<div id="error">
<? echo $error.$successMessage; ?>
</div>
<form method="post" action="processuniformcheck.php<?php echo $source ?>">
<div class="form-group">
<label for="partner"><h4>Partner Being Checked</h4></label>
<select class="form-control" id="partner" name="partner">
<!-- populate the drop down list with Partners allowed to do rotation spot checks -->
<?php
$query = "SELECT * FROM `partners` WHERE `active`='1' ORDER BY `firstname`";
$result = mysqli_query($link, $query);
if (!$result) {
printf("Error: %s\n", mysqli_error($link));
exit();
}
while($row = mysqli_fetch_array($result)){
include 'selectfromallpartners.php';
}
?>
</select>
</div>
<div class="form-group">
<label for="result"><h4>Result</h4></label>
<div>
<h6>The Partner must have a name badge, correct shoes/skirt, no coloured nail varnish, smart shoes and either an apron or a jacket/body warmer. Team badge is recommended but not a fail if missing.</h6>
</div>
<select class="form-control" id="result" name="result">
<option value="pass">Pass</option>
<option value="fail">Fail</option>
</select>
</div>
<div class="form-group">
<label for="discussion"><h4>Summary of discussion</h4></label>
<div>
<h6>Even if passed, feel free to record any necessary comments, such as 'no team badge'.</h6>
</div>
<textarea class="form-control" id="discussion" name="discussion" rows="3"></textarea>
</div>
<div class="form-group">
<label for="manager"><h4>Partner Completing Check</h4></label>
<select class="form-control" id="manager" name="manager">
<!-- populate the drop down list with Partners allowed to do rotation spot checks -->
<?php
$query = "SELECT * FROM `partners` WHERE `canuniformcheck` = '1' ORDER BY `firstname`";
$result = mysqli_query($link, $query);
if (!$result) {
printf("Error: %s\n", mysqli_error($link));
exit();
}
while($row = mysqli_fetch_array($result)){
// if the option is the logged in user, preselect it
if($row['employee'] == $_SESSION['userData']['employee']){
echo '<option value="'.$row['employee'].'" selected="selected">'.$row['firstname'].' '.$row['surname'].'</option>';
} else {
echo '<option value="'.$row['employee'].'">'.$row['firstname'].' '.$row['surname'].'</option>';
}
}
?>
</select>
</div>
<button type="submit" class="btn btn-primary">Add Uniform Check</button>
</form>
</div>
<?php
include 'footer.php';
?>
</div>
</body>
</html>