-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmanage_customers.php
executable file
·282 lines (268 loc) · 15.2 KB
/
manage_customers.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
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
278
279
280
281
<?php
session_start();
include('assets/configs/config.php');
include('assets/configs/checklogin.php');
check_login();
$aid=$_SESSION['admin_id'];
// remove users
if(isset($_GET['del']))
{
$id=intval($_GET['del']);
$adn="delete from customer where c_id=?";
$stmt= $mysqli->prepare($adn);
$stmt->bind_param('i',$id);
$stmt->execute();
$stmt->close();
$msg = " Client Details Deleted!";
}
?>
<!DOCTYPE html>
<html lang="en">
<?php include("assets/_partials/head.php");?>
<body class="hold-transition sidebar-mini">
<!--preloader-->
<div id="preloader">
<div id="status"></div>
</div>
<!-- Site wrapper -->
<div class="wrapper">
<?php include('assets/_partials/header.php');?>
<!-- =============================================== -->
<!-- Left side column. contains the sidebar -->
<aside class="main-sidebar">
<!-- sidebar -->
<?php include('assets/_partials/navbar.php');?>
<!-- /.sidebar -->
</aside>
<!-- =============================================== -->
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="header-icon">
<i class="fa fa-users"></i>
</div>
<div class="header-title">
<h1>Customer</h1>
<small>Customer List</small>
</div>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-bd lobidrag">
<div class="panel-heading">
<div class="btn-group" id="buttonexport">
<a href="#">
<h4>Customers</h4>
</a>
</div>
</div>
<div class="panel-body">
<!-- Plugin content:powerpoint,txt,pdf,png,word,xl -->
<div class="btn-group">
<div class="buttonexport" id="buttonlist">
<a class="btn btn-add" href="add-customer.php"> <i class="fa fa-plus"></i> Add Customer
</a>
</div>
<button class="btn btn-exp btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-bars"></i> Export Table Data</button>
<ul class="dropdown-menu exp-drop" role="menu">
<li>
<a href="#" onclick="$('#dataTableExample1').tableExport({type:'json',escape:'false'});">
<img src="assets/dist/img/json.png" width="24" alt="logo"> JSON</a>
</li>
<li>
<a href="#" onclick="$('#dataTableExample1').tableExport({type:'json',escape:'false',ignoreColumn:'[2,3]'});">
<img src="assets/dist/img/json.png" width="24" alt="logo"> JSON (ignoreColumn)</a>
</li>
<li><a href="#" onclick="$('#dataTableExample1').tableExport({type:'json',escape:'true'});">
<img src="assets/dist/img/json.png" width="24" alt="logo"> JSON (with Escape)</a>
</li>
<li class="divider"></li>
<li><a href="#" onclick="$('#dataTableExample1').tableExport({type:'xml',escape:'false'});">
<img src="assets/dist/img/xml.png" width="24" alt="logo"> XML</a>
</li>
<li><a href="#" onclick="$('#dataTableExample1').tableExport({type:'sql'});">
<img src="assets/dist/img/sql.png" width="24" alt="logo"> SQL</a>
</li>
<li class="divider"></li>
<li>
<a href="#" onclick="$('#dataTableExample1').tableExport({type:'csv',escape:'false'});">
<img src="assets/dist/img/csv.png" width="24" alt="logo"> CSV</a>
</li>
<li>
<a href="#" onclick="$('#dataTableExample1').tableExport({type:'txt',escape:'false'});">
<img src="assets/dist/img/txt.png" width="24" alt="logo"> TXT</a>
</li>
<li class="divider"></li>
<li>
<a href="#" onclick="$('#dataTableExample1').tableExport({type:'excel',escape:'false'});">
<img src="assets/dist/img/xls.png" width="24" alt="logo"> XLS</a>
</li>
<li>
<a href="#" onclick="$('#dataTableExample1').tableExport({type:'doc',escape:'false'});">
<img src="assets/dist/img/word.png" width="24" alt="logo"> Word</a>
</li>
<li>
<a href="#" onclick="$('#dataTableExample1').tableExport({type:'powerpoint',escape:'false'});">
<img src="assets/dist/img/ppt.png" width="24" alt="logo"> PowerPoint</a>
</li>
<li class="divider"></li>
<li>
<a href="#" onclick="$('#dataTableExample1').tableExport({type:'png',escape:'false'});">
<img src="assets/dist/img/png.png" width="24" alt="logo"> PNG</a>
</li>
<li>
<a href="#" onclick="$('#dataTableExample1').tableExport({type:'pdf',pdfFontSize:'7',escape:'false'});">
<img src="assets/dist/img/pdf.png" width="24" alt="logo"> PDF</a>
</li>
</ul>
</div>
<!--Pretty Alerts--code-->
<?php if(isset($msg))
{?>
<script>
setTimeout(function ()
{
swal("Success!","<?php echo $msg;?>!","success");
},
100);
</script>
<?php }?>
<div class="table-responsive">
<table id="dataTableExample1" class="table table-bordered table-striped table-hover">
<thead>
<tr class="info">
<th>Photo</th>
<th>Customer Name</th>
<th>Mobile</th>
<th>Email</th>
<th>Address</th>
<th>type</th>
<th>Join</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<?php
$ret="SELECT * FROM customer";
$stmt= $mysqli->prepare($ret) ;
//$stmt->bind_param('i',$aid);
$stmt->execute() ;//ok
$res=$stmt->get_result();
$cnt=1;
while($row=$res->fetch_object())
{
?>
<tbody>
<tr>
<td><img src="assets/dist/img/<?php echo $row->pic;?>" class="img-circle" alt="User Image" width="50" height="50"> </td>
<td><?php echo $row->fname;?> <?php echo $row->lname;?></td>
<td><?php echo $row->mobile;?></td>
<td><?php echo $row->email;?></td>
<td><?php echo $row->address;?></td>
<td><?php echo $row->c_type;?></td>
<td><?php echo $row->dob;?></td>
<td><span class="label-custom label label-default"><?php echo $row->status;?></span></td>
<td>
<a class="btn btn-add btn-sm" href="update_single_customer.php?c_id=<?php echo $row->c_id;?>"><i class="fa fa-pencil"></i></a>
<a class="btn btn-danger btn-sm" href="manage_customers.php?del=<?php echo $row->c_id;?>" onClick= "return confirm('Delete?');"><i class="fa fa-trash-o"></i> </a>
</td>
</tr>
</tbody>
<?php $cnt=$cnt+1; } ?>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- customer Modal1 -->
<!-- /.modal -->
<!-- Modal -->
<!-- Customer Modal2 -->
<div class="modal fade" id="customer2" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header modal-header-primary">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3><i class="fa fa-user m-r-5"></i> Delete Customer</h3>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<form class="form-horizontal">
<fieldset>
<div class="col-md-12 form-group user-form-group">
<label class="control-label">Delete Customer</label>
<div class="pull-right">
<button type="button" class="btn btn-danger btn-sm">NO</button>
<button type="submit" class="btn btn-add btn-sm">YES</button>
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger pull-left" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php include("assets/_partials/footer.php");?>
</div>
<!-- ./wrapper -->
<!-- Start Core Plugins
=====================================================================-->
<!-- jQuery -->
<script data-cfasync="false" src="http://thememinister.com/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script src="assets/plugins/jQuery/jquery-1.12.4.min.js" type="text/javascript"></script>
<!-- jquery-ui -->
<script src="assets/plugins/jquery-ui-1.12.1/jquery-ui.min.js" type="text/javascript"></script>
<!-- Bootstrap -->
<script src="assets/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<!-- lobipanel -->
<script src="assets/plugins/lobipanel/lobipanel.min.js" type="text/javascript"></script>
<!-- Pace js -->
<script src="assets/plugins/pace/pace.min.js" type="text/javascript"></script>
<!-- table-export js -->
<script src="assets/plugins/table-export/tableExport.js" type="text/javascript"></script>
<script src="assets/plugins/table-export/jquery.base64.js" type="text/javascript"></script>
<script src="assets/plugins/table-export/html2canvas.js" type="text/javascript"></script>
<script src="assets/plugins/table-export/sprintf.js" type="text/javascript"></script>
<script src="assets/plugins/table-export/jspdf.js" type="text/javascript"></script>
<script src="assets/plugins/table-export/base64.js" type="text/javascript"></script>
<!-- dataTables js -->
<script src="assets/plugins/datatables/dataTables.min.js" type="text/javascript"></script>
<!-- SlimScroll -->
<script src="assets/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<!-- FastClick -->
<script src="assets/plugins/fastclick/fastclick.min.js" type="text/javascript"></script>
<!-- CRMadmin frame -->
<script src="assets/dist/js/custom.js" type="text/javascript"></script>
<!-- End Core Plugins
=====================================================================-->
<!-- Start Theme label Script
=====================================================================-->
<!-- Dashboard js -->
<!-- Notification js -->
<script src="assets/plugins/NotificationStyles/js/modernizr.custom.js" type="text/javascript"></script>
<script src="assets/plugins/NotificationStyles/js/classie.js" type="text/javascript"></script>
<script src="assets/plugins/NotificationStyles/js/notificationFx.js" type="text/javascript"></script>
<script src="assets/plugins/NotificationStyles/js/snap.svg-min.js" type="text/javascript"></script>
<script src="assets/plugins/sweetalert/sweetalert.min.js" type="text/javascript"></script>
<script src="assets/plugins/toastr/toastr.min.html" type="text/javascript"></script>
<script src="assets/dist/js/dashboard.js" type="text/javascript"></script>
<!-- End Theme label Script
=====================================================================-->
</body>
</html>