-
Notifications
You must be signed in to change notification settings - Fork 0
/
delivery_tables.php
executable file
·152 lines (133 loc) · 5.4 KB
/
delivery_tables.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html>
<html>
<head>
<title>Delivery Information</title>
<style>
<?php include "styles.css" ?>
</style>
</head>
<body>
<h2> Delivery Information </h2>
<div class="page-menu" onclick="window.location.href = 'index.php'"> Back</div>
<?php
require_once('api/db_selection.php');
require_once('api/db_connect.php');
if (connectToDB()) {
handleSelectionRequest("Delivery");
handleSelectionRequest("Drivers");
disconnectFromDB();
}
?>
<br/>
<h3>Choose a related table to display:</h3>
<form method="GET" action="delivery_tables.php">
<input type="hidden" id="selectRequest" name="selectRequest">
<select name="tableName">
<option value="transportvehicle"> Transport Vehicles</option>
<option value="items"> Items</option>
<option value="itemcosts"> Item Costs</option>
<option value="deliveryreceived"> Delivery Received</option>
</select>
<input type="submit" value="Go">
</form>
<h3>Find drivers who made all deliveries to a certain customer on a certain day:</h3>
<form method="GET" action="delivery_tables.php">
<input type="hidden" name="divisionRequest">
Date:<input type="date" name="date" style="margin: 10px;"><br/>
Customer ID: <input type="text" name="cid" style="margin: 10px;"><br/>
<input type="submit" value="Find Deliveries">
</form>
<br/>
<h3>Find counts and total weights of each item by name:</h3>
<form method="GET" action="delivery_tables.php">
<input type="hidden" name="groupByRequest">
<input type="submit" value="Go">
</form>
<br/>
<br/>
<!--<h3>Enter only the fields you would like to see for the delivery tables-->
<!-- (in capitals and seperated by a comma) and submit!</h3>-->
<!--<form method="GET" action="delivery_tables.php">-->
<!-- <input type="hidden" name="projectionRequest">-->
<!-- Fields: <input type="text" name="fields" style="margin: 10px;">-->
<!-- <input type="submit" value="Submit">-->
<!--</form>-->
<!-- <h3> Select only the fields you would like to see (press command or control to select multiple) </h3>
<form method="GET" action="delivery_tables.php">
<input type="hidden" id="projectionRequest" name="projectionRequest">
<input type="hidden" name="projectionTable" value="Delivery">
<select name="fields" multiple size="12">
<option value="DELIVERYID"> Delivery ID</option>
<option value="DELIVERYTIME"> Delivery time </option>
<option value="TOTALWEIGHT"> Total weight </option>
<option value="TOTALCOST"> Total cost </option>
<option value="CUSTOMERID"> Customer ID </option>
<option value="TRANSPORTSTATUS"> transport status </option>
<option value="DRIVERLICENSENUMBER"> driver license number </option>
<option value="TRANSPORTVEHICLENAME"> Transport vehicle name </option>
<option value="STOREDSINCE"> stored since </option>
<option value="WAREHOUSENAME"> warehouse name</option>
<option value="SCHEDULEDDATE"> scheduled date </option>
<option value="DESTINATION"> destination </option>
</select>
<input type="submit" value="Go">
</form> -->
<!-- <h3>Delete deliveries based on id</h3>
<form method="GET" action="delivery_tables.php">
<input type="hidden" id="deleteRequest" name="deleteRequest">
ID:<input id="id" name="id" style="margin: 10px;"><br/>
<input type="submit" value="Go">
</form>
<br/> -->
<h3>Find the license number and the total weight transported by the best driver
(driver with the maximum average weight transported</h3>
<form method="GET" action="delivery_tables.php">
<input type="hidden" name="nestedGroupByRequest">
<input type="submit" value="Go">
</form>
<br/>
<h3>Find the deliveries within two days of current day</h3>
<form method="GET" action="delivery_tables.php">
<input type="hidden" name="aggregationRequest">
<input type="submit" value="Go">
</form>
<h3>Find deliveries based on transport status (filtering/selection) </h3>
<form method="GET" action="delivery_tables.php">
<input type="hidden" id="filterRequest" name="filterRequest">
<select name="status">
<option value="in-delivery"> In delivery</option>
<option value="in warehouse"> In warehouse </option>
<option value="delayed"> Delayed </option>
<option value="delivered"> Delivered </option>
</select>
<input type="submit" value="Go">
</form>
<h3>Find deliveries and sort based on a sorting value (customerID or Total cost) and order (ASC/DESC) </h3>
<form method="GET" action="delivery_tables.php">
<input type="hidden" id="sortRequest" name="sortRequest">
<select name="sortValue">
<option value="customerID"> customer ID</option>
<option value="totalCost"> total CoSt </option>
</select>
<input type="hidden" id="orderRequest" name="orderRequest">
<select name="order">
<option value="ASC"> ascending order</option>
<option value="DESC"> descending order </option>
</select>
<input type="submit" value="Go">
</form>
<h3> Join the Delivery Table and Customer table to find the names and addresses of all customers who have scheduled delivery on a specific day </h3>
<form method="GET" action="delivery_tables.php">
<input type="hidden" id="joinRequest" name="joinRequest">
DATE: <input type="date" name="date" style="margin: 10px;">
<input type="submit" value="Go">
</form>
<br/>
<br/>
<?php
require_once('api/router.php');
?>
<br/>
<br/>
</body>
</html>