-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevel2Citizen.php
204 lines (189 loc) · 8.26 KB
/
Level2Citizen.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
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
<?php
session_start();
$title = 'Welcome | BarangayIT MK.II';
$user = 2;
include_once('LoginCheck.php');
$currentPage = 'Level2Citizen';
include('head.php');
include('Level2_Navbar.php');
?>
<?php
include('dbconn.php');
$query = "SELECT *
FROM
bitdb_r_citizen
";
$result = mysqli_query($bitMysqli,$query)
?>
<section class="content">
<div class="container-fluid">
<!-- Basic Examples -->
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="card">
<div class="header">
<h2>
CITIZENS
<small>The list of all the citizens of the barangay. </small>
</h2>
<!-- <button type="button" class="btn bg-indigo waves-effect">
<i class="material-icons">add_circle_outline</i>
<a href="Level1AddCirtizen.php" style= "text-decoration: none;">
<span>View</span></a>
</button> -->
</div>
<div class="body">
<div class="table-responsive">
<!-- table table-bordered table-striped table-hover dataTable js-exportable -->
<table class="table table-bordered table-striped table-hover js-basic-example dataTable">
<thead>
<tr>
<th>Salutation</th>
<th>First Name</th>
<th>Middle Name</th>
<th>Last Name</th>
<th>Name Extension</th>
<th>Email</th>
<th>Height</th>
<th>Weight</th>
<th>Birth Place</th>
<th>Nationality</th>
<th>Status</th>
<th>Civil Status</th>
<th>Occupation</th>
<th>Gender</th>
<th>Blood Type</th>
<th>HouseNo</th>
<th>Street</th>
<th>Zone</th>
<th>Person in Contact</th>
<th>Contact</th>
<th>Date Recorded</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Salutation</th>
<th>First Name</th>
<th>Middle Name</th>
<th>Last Name</th>
<th>Name Extension</th>
<th>Email</th>
<th>Height</th>
<th>Weight</th>
<th>Birth Place</th>
<th>Nationality</th>
<th>Status</th>
<th>Civil Status</th>
<th>Occupation</th>
<th>Gender</th>
<th>Blood Type</th>
<th>HouseNo</th>
<th>Street</th>
<th>Zone</th>
<th>Person in Contact</th>
<th>Contact</th>
<th>Date Recorded</th>
</tr>
</tfoot>
<tbody>
<?php
while ($row = mysqli_fetch_assoc($result)) {
?>
<tr>
<td><?php echo $row['Salutation'];?></td>
<td><?php echo $row['First_Name'];?></td>
<td><?php echo $row['Middle_Name'];?></td>
<td><?php echo $row['Last_Name'];?></td>
<td><?php echo $row['Name_Ext'];?></td>
<td><?php echo $row['Citizen_Email'];?></td>
<td><?php echo $row['Height'];?></td>
<td><?php echo $row['Weight'];?></td>
<td><?php echo $row['Birth_Place'];?></td>
<td><?php echo $row['Nationality'];?></td>
<td>
<?php
if($row['Res_Status'] == 1)
{
echo $row['Res_Status'] = "Active";
}
else
{
echo $row['Res_Status'] = "Inactive";
}
?>
</td>
<td><?php echo $row['Civil_Status'];?></td>
<td><?php echo $row['Occupation'];?></td>
<td>
<?php
if($row['Gender'] == 1)
{
echo $row['Gender'] = "Male";
}
else
{
echo $row['Gender'] = "Female";
}
?>
</td>
<td><?php echo $row['Blood_Type'];?></td>
<td><?php echo $row['House_No'];?></td>
<td><?php echo $row['Street'];?></td>
<td><?php echo $row['Zone'];?></td>
<td><?php echo $row['Person_Con'];?></td>
<td><?php echo $row['Contact'];?></td>
<td><?php echo $row['Date_Rec'];?></td>
</tr>
<?php
}
mysqli_close($bitMysqli);
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Edit-->
<!--Add-->
</section>
<?php include('footer.php'); ?>
<script type="text/javascript">
$(document).ready(function()
{
$(".editCiti").click(function()
{
$("#CID").val($(this).closest("tbody tr").find("td:eq(0)").html());
$("#CitiSalutation").val($(this).closest("tbody tr").find("td:eq(1)").html());
$("#CitiFName").val($(this).closest("tbody tr").find("td:eq(2)").html());
$("#CitiMName").val($(this).closest("tbody tr").find("td:eq(3)").html());
$("#CitiLName").val($(this).closest("tbody tr").find("td:eq(4)").html());
$("#CitiNExt").val($(this).closest("tbody tr").find("td:eq(5)").html());
$("#CitiEmail").val($(this).closest("tbody tr").find("td:eq(6)").html());
$("#CitiHeight").val($(this).closest("tbody tr").find("td:eq(7)").html());
$("#CitiWeight").val($(this).closest("tbody tr").find("td:eq(8)").html());
$("#CitiBDate").val($(this).closest("tbody tr").find("td:eq(9)").html());
$("#CitiPOB").val($(this).closest("tbody tr").find("td:eq(10)").html());
$("#CitiNationality").val($(this).closest("tbody tr").find("td:eq(11)").html());
$("#CitiCivilStatus").val($(this).closest("tbody tr").find("td:eq(13)").html());
$("#CitiOccupation").val($(this).closest("tbody tr").find("td:eq(14)").html());
$("#CitiGender").val($(this).closest("tbody tr").find("td:eq(15)").html());
$("#CitiBloodType").val($(this).closest("tbody tr").find("td:eq(16)").html());
$("#CitiHouseNo").val($(this).closest("tbody tr").find("td:eq(17)").html());
$("#CitiStreet").val($(this).closest("tbody tr").find("td:eq(18)").html());
$("#CitiZone").val($(this).closest("tbody tr").find("td:eq(19)").html());
$("#CitiPerCon").val($(this).closest("tbody tr").find("td:eq(21)").html());
$("#CitiContact").val($(this).closest("tbody tr").find("td:eq(22)").html());
if ($(this).closest("tbody tr").find("td:eq(12)").text() === "Active") {
$("#editCheckA").prop("checked", true).trigger('click');
} else {
$("#editCheckI").prop("checked", true).trigger('click');
}
// ActOption = "option[value="+val($(this).closest("tbody tr").find("td:eq(4)").html())+"]";
// $("#PositionOption").find(ActOption).prop("selected",true);
});
});
</script>