-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassignDelivery.php
78 lines (57 loc) · 1.86 KB
/
assignDelivery.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
<?php
require 'admin.php';
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="AssignDelivery.css">
<title>Assign Delivery</title>
</head>
<body>
<center><h1>Assign Hero Delivery</h1></center>
<div class="assignfom">
<form method="post">
<div class="section">
<select name="dboy">
<?php
$dboy = mysqli_query($conn,"SELECT * FROM deleveryman");
if (mysqli_num_rows($dboy)>0) {
while ($row=mysqli_fetch_assoc($dboy)) {
$em=$row['email'];
echo "<option >".$em."</option>";
}
}
?>
</select>
<select name="order">
<?php
$order = mysqli_query($conn,"SELECT * FROM seeorders");
if (mysqli_num_rows($order)>0) {
while ($row1=mysqli_fetch_assoc($order)) {
$oid=$row1['id'];
echo "<option >".$oid."</option>";
}
}
?>
</select>
<div class="asnbt">
<input type="submit" name="assign" value="ASSIGN">
</div>
<?php
if (isset($_POST["assign"])) {
$deliEmail = $_POST['dboy'];
$oid = $_POST['order'];
$check=mysqli_query($conn,"SELECT orderid FROM assign WHERE orderid='$oid'");
if(mysqli_num_rows($check)==0) {
$assign = mysqli_query($conn,"INSERT INTO assign(orderid,deliEmail) VALUES('$oid','$deliEmail')");
}
else{
echo "Assigned once!";
}
}
?>
</form>
</div>
</body>
</html>