-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddCityAreaFront.php
More file actions
141 lines (102 loc) · 4.37 KB
/
addCityAreaFront.php
File metadata and controls
141 lines (102 loc) · 4.37 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
<?php
session_start();
include_once 'object/Customer.php'
?>
<!DOCTYPE html>
<html lang="en">
<?php include_once 'head.php' ?>
<style>
#activeCityArea {
background-color: #6200EA;
}
</style>
<body>
<?php include_once 'header.php' ?>
<div class="row w-50 m-auto pt-4 ">
<div class=" w-50 float-left ">
<form action="addCityAreaBackEnd.php" method="POST">
<div class=" float-left input-group input-group-sm mb-3 m-auto pr-3">
<input type="text" class="form-control" name="addCity" required>
<div class="input-group-prepend">
<input type="submit" class=" input-group-text text-white bg-primary" name="cityForm" value="Add City">
</div>
</div>
</form>
</div>
<div class=" w-50 float-left ">
<form method="POST" action="addCityAreaBackEnd.php">
<div class=" float-left input-group input-group-sm mb-3 m-auto pl-3">
<input type="text" class="form-control" name="addArea" required>
<div class="input-group-prepend">
<input type="submit" name="areaForm" class=" input-group-text text-white bg-primary" value="Add Area">
</div>
</div>
</form>
</div>
<!-- Starting of table html code and PHP OF CODE-->
<?php
$user = new User();
$cityResutl = $user->selectAllCity();
$areaResutl = $user->selectAllArea();
?>
<div class=" container m-auto pt-5 ">
<div class=" float-left">
<legend>
<left>
<h4><b class="text-primary">City</b></h4>
</left>
</legend>
<table class="table table-inverse table-sm table-hover ">
<thead class="thead-inverse">
<tr>
<th>ID</th>
<th>City Name</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php if (!empty($cityResutl)) { ?>
<?php foreach ($cityResutl as $result) { ?>
<tr>
<td scope="row"><?php echo $result['city_id']; ?></td>
<td><?php echo $result['cityName']; ?></td>
<td><a class="btn btn-danger btn-sm" href="deleteCityArea.php?cid=<?php echo $result['city_id'] ?>">Delete</a></td>
</tr>
<?php } ?>
<?php } ?>
</tbody>
</table>
</div>
<div class="float-right ">
<legend>
<left>
<h4><b class="text-primary">Area</b></h4>
</left>
</legend>
<table class="table table-inverse table-sm table-hover ">
<thead class="thead-inverse">
<tr>
<th>Area Id</th>
<th>Area Name</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php if (!empty($areaResutl)) { ?>
<?php foreach ($areaResutl as $result) { ?>
<tr>
<td scope="row"><?php echo $result['area_id']; ?></td>
<td><?php echo $result['areaName']; ?></td>
<td><a class="btn btn-danger btn-sm" href="deleteCityArea.php?aid=<?php echo $result['area_id'] ?>">Delete</a></td>
</tr>
<?php } ?>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- Ending of table html code and PHP OF CODE-->
<?php include_once 'footer.php' ?>
</body>
</html>