-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompleted-confirmation.php
76 lines (71 loc) · 2.46 KB
/
completed-confirmation.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
<?php
include "classes/helpers.php";
if(!empty($_POST)){
if(isset($_POST['clear'])){
//clear the fixture
$query = "DELETE FROM scanned
WHERE fixtureNum = '".$_SESSION['fixnum']."' AND
store = '".$_SESSION['storenum']."' AND
dept = '".$_SESSION['dept']."';";
//echo $query;
if(mysqli_query($conn,$query)){
//remove the entries from completed_fixtures
$query = "DELETE FROM completed_fixtures
WHERE fixture = '".$_SESSION['fixnum']."' AND
store = '".$_SESSION['storenum']."' AND
department = '".$_SESSION['dept']."';" ;
if(mysqli_query($conn,$query))
Header("Location: scan.php");
else
echo "MySQL error: ".mysqli_error($conn);
}
else
echo "MySQL error: ".mysqli_error($conn);
}
else{
//remove the entries from completed_fixtures
$query = "DELETE FROM completed_fixtures
WHERE fixture = '".$_SESSION['fixnum']."' AND
store = '".$_SESSION['storenum']."' AND
department = '".$_SESSION['dept']."';";
if(mysqli_query($conn,$query))
Header("Location: scan.php");
else
echo "MySQL error: ".mysqli_error($conn);
}
}
$head = ['title'=>"Fixture Already Completed"];
$header = "Already <strong>Completed</strong>";
include 'classes/header.php';
?>
<div class="contain">
<h2>This fixture has already been marked complete.</h2>
FIXTURE: Department <?php echo $_SESSION['completedArray'][0]['department']; ?>, store <?php echo $_SESSION['completedArray'][0]['store']; ?>, fixture <?php echo $_SESSION['completedArray'][0]['fixture']; ?>.
<br>
Details:
<table class="table">
<tr>
<th>Completed</th>
<th>User</th>
<th>Comments</th>
</tr>
<?php foreach($_SESSION['completedArray'] as $completed): ?>
<tr>
<td><?php echo $completed['time_completed']; ?></td>
<td><?php echo getUsername($completed['scanner_id']); ?></td>
<td><?php echo $completed['comments']; ?></td>
</tr>
<?php endforeach; ?>
</table>
</div>
<div class="contain">
<h2> How do you want to continue? </h2>
<form method="POST" action="completed-confirmation.php" class="textcenter center">
<input type="submit" class="button" name="append" style="width:100px;" title="Add to fixture" value="Add to fixture">
<input type="submit" class="button" name="clear" style="width:90px;" title="Clear fixture" value="Clear fixture">
</form>
</div>
<a href="scanning.php">
<input class="button textcenter center" style="width: 140px; margin: 0 auto;" value="Cancel - go back" tabindex="13" readonly />
</a>
<?php include 'classes/footer.php'; ?>