-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevel0CategoryProject.php
246 lines (236 loc) · 13.4 KB
/
Level0CategoryProject.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
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
<?php
session_start();
$title = 'Welcome | BarangayIT MK.II';
$user = 0;
include_once('LoginCheck.php');
?>
<?php $currentPage = 'Level0CategoryProject';?>
<?php include('head.php'); ?>
<?php include('Level0_Navbar.php'); ?>
<section class="content">
<div class="container-fluid">
<div class="block-header">
<h2>PROJECT CATEGORY</h2>
</div>
<!-- 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>
PROJECT CATEGORY LIST
<small>The list of all the existing types of project in the barangay. Click "VIEW" to view all or "Edit" to modify on the existing record</small>
</h2>
<br/>
<button type="button" class="btn bg-indigo waves-effect" data-toggle="modal" data-target="#addBusinessCategoryModal">
<i class="material-icons">add_circle_outline</i>
<span>ADD NEW</span>
</button>
</div>
<div class="body">
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover js-basic-example dataTable">
<thead>
<tr>
<th class="hide">ProjectCategoryID</th>
<th>Category</th>
<th>Description</th>
<th>Date</th>
<th style="width: 15px;">Actions</th>
</tr>
</thead>
<tfoot>
<tr>
<th class="hide">ProjectCategoryID</th>
<th>Category</th>
<th>Description</th>
<th>Date</th>
<th>Actions</th>
</tr>
</tfoot>
<tbody>
<?php
include('dbconn.php');
$AdminBusinessCategorySQL = 'SELECT bitdb_r_businesscategory.categoryID,
bitdb_r_businesscategory.categoryName,
bitdb_r_businesscategory.categoryDesc,
bitdb_r_businesscategory.categoryDate
FROM bitdb_r_businesscategory';
$AdminBusinessCategoryQuery = mysqli_query($bitMysqli,$AdminBusinessCategorySQL) or die (mysqli_error($bitMysqli));
if(mysqli_num_rows($AdminBusinessCategoryQuery) > 0)
{
while($row = mysqli_fetch_assoc($AdminBusinessCategoryQuery))
{
$CategoryID = $row['categoryID'];
$CategoryName = $row['categoryName'];
$CategoryDesc = $row['categoryDesc'];
$CategoryDate = $row['categoryDate'];
echo '
<tr>
<td class="hide">'.$CategoryID.'</td>
<td>'.$CategoryName.'</td>
<td>'.$CategoryDesc.'</td>
<td>'.$CategoryDate.'</td>
<td>
<button type="button" class="btn btn-success waves-effect editBusinessCategory" data-toggle="modal" data-target="#editBusinessCategoryModal">
<i class="material-icons">mode_edit</i>
<span>EDIT</span>
</button>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- #END# Basic Examples -->
<!-- Exportable Table
<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>
EXPORTABLE TABLE
</h2>
<ul class="header-dropdown m-r--5">
<li class="dropdown">
<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="material-icons">more_vert</i>
</a>
<ul class="dropdown-menu pull-right">
<li><a href="javascript:void(0);">Action</a></li>
<li><a href="javascript:void(0);">Another action</a></li>
<li><a href="javascript:void(0);">Something else here</a></li>
</ul>
</li>
</ul>
</div>
<div class="body">
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover dataTable js-exportable">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- #END# Exportable Table -->
</div>
<form id="BusinessAddCategory" action="Level0_AddBusinessCategory.php" method="POST" >
<div class="modal fade" id="addBusinessCategoryModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h2>
Add Business Category
<br/>
<button type="button" class="btn btn-success waves-effect"> Import from Excel</button>
</h2>
</div>
<div class="modal-body">
<div class="row clearfix margin-0">
<h4 class="card-inside-title">Category Name</h4>
<div class="form-group form-float">
<div class="form-line">
<input type="text" class="form-control" name="CategoryName"/>
<label class="form-label">Category Name</label>
</div>
</div>
<h4 class="card-inside-title">Description</h4>
<div class="form-group form-float">
<div class="form-line">
<input type="text" class="form-control" name="CategoryDesc"/>
<label class="form-label">Description</label>
</div>
</div>
</div>
<br/>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-link waves-effect">ADD</button>
<button type="button" class="btn btn-link waves-effect" data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
</div>
</form>
<form id="BusinessEditCategory" action="Level0_EditBusinessCategory.php" method="POST" >
<div class="modal fade" id="editBusinessCategoryModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h2>
Edit Business Category
<br/>
</h2>
</div>
<div class="modal-body">
<div class="row clearfix margin-0">
<h4 class="card-inside-title hide">Category ID</h4>
<div class="form-group form-float hide">
<div class="form-line hide">
<input id="editCategoryID" type="text" class="form-control hide" name="CategoryID"/>
<label class="form-label hide">Category ID</label>
</div>
</div>
<h4 class="card-inside-title">Category Name</h4>
<div class="form-group form-float">
<div class="form-line">
<input id="editCategoryName" type="text" class="form-control" name="CategoryName"/>
</div>
</div>
<h4 class="card-inside-title">Description</h4>
<div class="form-group form-float">
<div class="form-line">
<input id="editCategoryDesc" type="text" class="form-control" name="CategoryDesc"/>
</div>
</div>
</div>
<br/>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-link waves-effect">EDIT</button>
<button type="button" class="btn btn-link waves-effect" data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
</div>
</form>
</section>
<?php include('footer.php'); ?>
<script type="text/javascript">
$(document).ready(function()
{
$(".editBusinessCategory").click(function()
{
$("#editCategoryID").val($(this).closest("tbody tr").find("td:eq(0)").html());
$("#editCategoryName").val($(this).closest("tbody tr").find("td:eq(1)").html());
$("#editCategoryDesc").val($(this).closest("tbody tr").find("td:eq(2)").html());
});
});
</script>