-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
285 lines (241 loc) · 10.2 KB
/
index.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
282
283
284
285
<?php
require_once('inc/config.php');
require_once('inc/pdoconfig.php');
require_once('inc/pdoFunctions.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="plugins/images/dana-world-logo.png">
<title>Manage Clients - Dana World Cont Co. Wll</title>
<!-- Bootstrap Core CSS -->
<link href="bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="plugins/bower_components/bootstrap-extension/css/bootstrap-extension.css" rel="stylesheet">
<!-- Menu CSS -->
<link href="plugins/bower_components/sidebar-nav/dist/sidebar-nav.min.css" rel="stylesheet">
<link href="plugins/bower_components/custom-select/custom-select.css" rel="stylesheet" type="text/css" />
<!-- animation CSS -->
<link href="css/animate.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/style.css" rel="stylesheet">
<link href="css/dan.css" rel="stylesheet">
<link href="plugins/bower_components/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
<link href="https://cdn.datatables.net/buttons/1.2.2/css/buttons.dataTables.min.css" rel="stylesheet" type="text/css"/>
<!--alerts CSS -->
<link href="plugins/bower_components/sweetalert/sweetalert.css" rel="stylesheet" type="text/css">
<!-- color CSS you can use different color css from css/colors folder -->
<link href="css/colors/blue.css" id="theme" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="https://www.w3schools.com/lib/w3data.js"></script>
</head>
<body>
<!-- Preloader -->
<div class="preloader">
<div class="cssload-speeding-wheel"></div>
</div>
<div id="wrapper">
<!-- Top Navigation -->
<?php include("header.php"); ?>
<!-- Left navbar-header end -->
<!-- Page Content -->
<div id="page-wrapper">
<div class="container-fluid">
<div class="row mana-top">
<div class="col-sm-3 sp-row">
<span class="head-title">Manage Clients</span>
</div>
</div>
<div class="row j-details">
<div class="col-sm-12 p-t-8">
<div class="white-box">
<div class="col-sm-12">
<a href="add-client.php" class="btn btn-danger pull-right m-l-20 btn-rounded btn-outline hidden-xs hidden-sm waves-effect waves-light add">Add New Client</a>
</div>
<h3 class="box-title">Filter By</h3>
<div class="clearfix"></div>
<div class="row m-b-30">
<div class="col-sm-3">
<div class="form-group">
<label>Keyword Search</label>
<input type="text" class="form-control" placeholder="Client Name, Contact Person, Phone, Mobile" onKeyUp="filter_data()" id="filter_key">
</div>
</div>
<div class="col-sm-3">
<label>City</label>
<select class="form-control select2" onChange="filter_data()" id="filter_city">
<option value="">Select City</option>
<option value="AK">Abu Dhabi</option>
<option value="HI">Dubai</option>
<option value="HI">Sharjah</option>
</select>
</div>
<div class="col-sm-3">
<label>State</label>
<select class="form-control select2" onChange="filter_data()" id="filter_state">
<option value="">Select State</option>
<option value="AK">Abu Dhabi</option>
<option value="HI">Dubai</option>
<option value="HI">Sharjah</option>
</select>
</div>
<div class="col-sm-3">
<div class="form-group">
<label>Total No of Projects</label>
<input type="text" class="form-control" id="total_project" placeholder="Total No of Projects" onKeyUp="filter_data()">
</div>
</div>
</div>
<div class="table-responsive bx-shd">
<table id="myTable" class="table table-striped table-bordered act-adjust">
<thead>
<tr>
<th>Client Name</th>
<th>Email</th>
<th>Phone Number</th>
<th>Location</th>
<th>Contact Person</th>
<th>Phone Number</th>
<th class="text-nowrap" style="width:90px;text-align:center;">Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- .right-sidebar -->
<!-- /.right-sidebar -->
</div>
<!-- /.container-fluid -->
<!-- <footer class="footer text-center"> </footer> -->
</div>
<!-- /#page-wrapper -->
<?php include("footer.php"); ?>
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="plugins/bower_components/jquery/dist/jquery.min.js"></script>
<script src="plugins/bower_components/datatables/jquery.dataTables.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="bootstrap/dist/js/tether.min.js"></script>
<script src="bootstrap/dist/js/bootstrap.min.js"></script>
<script src="plugins/bower_components/bootstrap-extension/js/bootstrap-extension.min.js"></script>
<!-- Menu Plugin JavaScript -->
<script src="plugins/bower_components/sidebar-nav/dist/sidebar-nav.min.js"></script>
<!--slimscroll JavaScript -->
<script src="js/jquery.slimscroll.js"></script>
<!--Wave Effects -->
<script src="js/waves.js"></script>
<!-- Custom Theme JavaScript -->
<script src="js/custom.min.js"></script>
<!--select2-->
<script src="plugins/bower_components/custom-select/custom-select.min.js" type="text/javascript"></script>
<!--Style Switcher -->
<script src="plugins/bower_components/styleswitcher/jQuery.style.switcher.js"></script>
<!-- Sweet-Alert -->
<script src="plugins/bower_components/sweetalert/sweetalert.min.js"></script>
<script src="plugins/bower_components/sweetalert/jquery.sweet-alert.custom.js"></script>
<script src="plugins/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
<script>
<?php
if($_COOKIE['err'] !='')
{
echo 'swal("'.$_COOKIE['status'].'", "'.$_COOKIE['title'].'", "'.$_COOKIE['err'].'");';
setcookie('status', $_COOKIE['status'], time()-10);
setcookie('title', $_COOKIE['title'], time()-10);
setcookie('err', $_COOKIE['err'], time()-10);?>
setTimeout(function() {
$(".confirm").trigger('click');
}, 3000);
<?php
}
?>
// For select 2
$(".select2").select2();
$(document).ready(function() {
$('#myTable').DataTable( {
"lengthMenu": [ [25, 50, 100], [25, 50, 100] ],
"processing": true,
"displayLength": 25,
"ajax":{
url :"manage-clients-data.php",
type: "post",
"data": function ( data ) {
data.filter_key = $("#filter_key").val();
data.filter_city = $("#filter_city").val();
data.filter_state = $("#filter_state").val();
data.total_project = $("#total_project").val();
},
complete: function() {
console.log('complete');
$('[data-toggle="tooltip"]').tooltip();
},
error: function(){
$(".form-grid-error").html("");
$("#form-grid").append('<tbody class="form-grid-error"><tr><th colspan="3">No data found in the server</th></tr></tbody>');
$("#form-grid_processing").css("display","none");
}
}
} );
/*DELETE Start*/
$(document).on('click', '.deleteone', function() {
var element = $(this);
var id = element.attr("data-id");
var status = 2;
var ms = 'Delete'
swal({
title: ms,
text: "Are you sure?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, Delete it!",
cancelButtonText: "Cancel",
closeOnConfirm: false,
closeOnCancel: false
}, function(isConfirm){
if (isConfirm) {
$.ajax({
type: "POST",
url: "ajax-status.php",
cache:false,
data: 'id='+id+'&status='+status+'&meth=client-del',
dataType:'json',
success: function(response)
{
swal(response.status, response.msg,response.err);
if(response.result){
$('#myTable').DataTable().ajax.reload();
}
setTimeout(function() {
$(".confirm").trigger('click');
}, 3000);
}
});
}
else
{
swal("Cancelled", "", "error");
}
});
});/*DELETE END*/
});
function filter_data()
{
$('#myTable').DataTable().ajax.reload();
}
</script>
</body>
</html>