-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtailor_interface.php
More file actions
277 lines (233 loc) · 10.1 KB
/
tailor_interface.php
File metadata and controls
277 lines (233 loc) · 10.1 KB
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<?php
@include 'config.php';
session_start();
if (!isset($_SESSION['tailor_login'])) {
?>
<html>
<script type='text/javascript'>
alert('Please login to access the page');
window.location.href = '<?php echo SITEURL; ?>index.php';
</script>
</html>
<?php
exit();
}
$query_client = "SELECT * FROM client";
$query_shirt = "SELECT * FROM shirt";
$query_pant = "SELECT * FROM pant";
$query_orders = "SELECT * FROM orders";
$result1 = mysqli_query($conn, $query_client);
$result2 = mysqli_query($conn, $query_shirt);
$result3 = mysqli_query($conn, $query_pant);
$result4 = mysqli_query($conn, $query_orders);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SmartStitch-TailorsDatabase</title>
<link rel="stylesheet" href="tailordatabase.css">
<link rel="icon" type="image/x-icon" href="Images/Favicon.png">
<script>
function hideElement(element, activeButton) {
const elements = ['clientdata', 'shirtdata', 'pantdata', 'orderdata'];
const buttons = ['btn1', 'btn2', 'btn3', 'btn4'];
elements.forEach(el => {
const currentElement = document.getElementById(el);
if (el === element) {
currentElement.style.display = 'block';
} else {
currentElement.style.display = 'none';
}
});
buttons.forEach(btn => {
const currentButton = document.getElementById(btn);
if (btn === activeButton) {
currentButton.style.borderBottom = '2px solid #2b300d';
} else {
currentButton.style.borderBottom = null;
}
});
}
function clienthide() {
hideElement('clientdata', 'btn1');
}
function shirthide() {
hideElement('shirtdata', 'btn2');
}
function panthide() {
hideElement('pantdata', 'btn3');
}
function orderhide() {
hideElement('orderdata', 'btn4');
}
function hide() {
btn1.style.borderBottom = '2px solid #2b300d';
clientdata.style.display = 'block';
shirtdata.style.display = 'none';
pantdata.style.display = 'none';
orderdata.style.display = 'none';
}
</script>
</head>
<body onload="hide()">
<header>
<nav class="navbar">
<div class="nav-div">
<div class="logo"><a href="<?php echo SITEURL; ?>tailor_interface.php"><img src="Images/SmartStitchLogo.png" alt="SmartStitch" width="180px"></a></div>
<div class="heading">TAILOR DATABASE</div>
<div class="logout"><a href="<?php echo SITEURL; ?>logout.php"><button>Logout</button></a></div>
</div>
</nav>
</header>
<main>
<div class="main">
<div class="main-nav">
<div class="nav-items">
<p id="btn1" onclick="clienthide()">Client Database</p>
<p id="btn2" onclick="shirthide()">Shirt Database</p>
<p id="btn3" onclick="panthide()">Pant Database</p>
<p id="btn4" onclick="orderhide()">Orders Database</p>
</div>
</div>
<!-- <div class="buttons">
<div class="button"><button id="btn1" onclick="clienthide()">Client Database</button></div>
<div class="button"><button id="btn2" onclick="shirthide()">Shirt Database</button></div>
<div class="button"><button id="btn3" onclick="panthide()">Pant Database</button></div>
<div class="button"><button id="btn4" onclick="orderhide()">Orders Database</button></div><br>
</div> -->
<div class="data">
<div class="details" id="clientdata">
<h3>Clients database:</h3>
<table>
<tr>
<th>Client ID</th>
<th>Client Name</th>
<th>Age</th>
<th>Gender</th>
<th>Address</th>
<th>Phone Number</th>
<th>Email ID</th>
</tr>
<tr>
<?php
while ($row = mysqli_fetch_assoc($result1)) {
?>
<td><?php echo $row['client_id']; ?></td>
<td><?php echo $row['client_name']; ?></td>
<td><?php echo $row['age']; ?></td>
<td><?php echo $row['gender']; ?></td>
<td><?php echo $row['address']; ?></td>
<td><?php echo $row['ph_no']; ?></td>
<td><?php echo $row['email_id']; ?></td>
</tr>
<?php
}
?>
</table>
</div>
<div class="details" id="shirtdata">
<h3>Shirts database</h3>
<table>
<tr>
<th>Shirt ID</th>
<th>Client ID</th>
<th>Collar</th>
<th>Neck to shoulder</th>
<th>Sleeve length</th>
<th>Shoulder to shoulder</th>
<th>Chest</th>
<th>Front length</th>
<th>Sleeve cuff</th>
<th>Hem</th>
</tr>
<tr>
<?php
while ($row = mysqli_fetch_assoc($result2)) {
?>
<td><?php echo $row['shirt_id']; ?></td>
<td><?php echo $row['client_id']; ?></td>
<td><?php echo $row['collar']; ?> inches</td>
<td><?php echo $row['neck_to_shoulder']; ?> inches</td>
<td><?php echo $row['sleeve_length']; ?> inches</td>
<td><?php echo $row['shoulder_to_shoulder']; ?> inches</td>
<td><?php echo $row['chest']; ?> inches</td>
<td><?php echo $row['front_length']; ?> inches</td>
<td><?php echo $row['sleeve_cuff']; ?> inches</td>
<td><?php echo $row['hem']; ?> inches</td>
</tr>
<?php
}
?>
</table>
</div>
<div class="details" id="pantdata">
<h3>Pants database</h3>
<table>
<tr>
<th>Pant ID</th>
<th>Client ID</th>
<th>Waist</th>
<th>Front Rise</th>
<th>Hip</th>
<th>Thigh</th>
<th>Length</th>
<th>Knee</th>
<th>Inseam</th>
<th>Leg opening</th>
</tr>
<tr>
<?php
while ($row = mysqli_fetch_assoc($result3)) {
?>
<td><?php echo $row['pant_id']; ?></td>
<td><?php echo $row['client_id']; ?></td>
<td><?php echo $row['waist']; ?> inches</td>
<td><?php echo $row['front_rise']; ?> inches</td>
<td><?php echo $row['hip']; ?> inches</td>
<td><?php echo $row['thigh']; ?> inches</td>
<td><?php echo $row['length']; ?> inches</td>
<td><?php echo $row['knee']; ?> inches</td>
<td><?php echo $row['inseam']; ?> inches</td>
<td><?php echo $row['leg_opening']; ?> inches</td>
</tr>
<?php
}
?>
</table>
</div>
<div class="details" id="orderdata">
<h3>Orders database:</h3>
<table>
<tr>
<th>Order ID</th>
<th>Client ID</th>
<th>Shirt type</th>
<th>Pant type</th>
<th>Order date</th>
<th>Delivery date</th>
<th>Order Total</th>
</tr>
<tr>
<?php
while ($row = mysqli_fetch_assoc($result4)) {
?>
<td><?php echo $row['order_id']; ?></td>
<td><?php echo $row['client_id']; ?></td>
<td><?php echo $row['shirt_type']; ?></td>
<td><?php echo $row['pant_type']; ?></td>
<td><?php echo $row['order_date']; ?></td>
<td><?php echo $row['delivery_date']; ?></td>
<td><?php echo $row['order_total']; ?></td>
</tr>
<?php
}
?>
</table>
</div>
</div>
</div>
</main>
</body>
</html>