-
Notifications
You must be signed in to change notification settings - Fork 0
/
dashboard.php
341 lines (323 loc) · 14.4 KB
/
dashboard.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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<!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">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<title>Dashboard</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/style.css"/>
<link rel="stylesheet" href="css/parsley.css"/>
<link rel="stylesheet" href="css/morris.css"/>
</head>
<!-- Default Bootstrap Navbar -->
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<i class="fa fa-home" style="font-size: 38px;margin-top:4px;" aria-hidden="true"></i>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class=""><a href="/">Home</a></li>
<li class=""><a href="/">About</a></li>
<li class=""><a href="/">Contact</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="https://foodquo.com">FAQ?</a></li>
<li><a href="/">Hello,<strong>Admin</strong></a></li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<div id="__floating_div" class="btn btn-success">
<div id="__floating_child">
</div>
<span style="font-size:10px">Tap to close</span>
</div>
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-12 ">
<div class="row img-hover">
<div class="col-xs-6 col-sm-3">
<center>
<a data-toggle="modal" data-target="#myModal">
<img src="images/postman.jpg" width="200" height="200" class="img-circle" alt="Generic placeholder thumbnail">
</a>
</center>
<br>
<center><h4 class="label label-default dashboard_labels">Send Mail</h4></center>
</div>
<div class="col-xs-6 col-sm-3 ">
<center>
<a href="">
<img src="images/find.jpg" width="200" height="200" class="img-circle" alt="Generic placeholder thumbnail">
</a>
</center>
<br>
<center><h4 class="label label-default dashboard_labels">Find User</h4></center>
</div>
<div class="col-xs-6 col-sm-3 ">
<center>
<a href="">
<img src="images/analysiss.jpg" width="200" height="200" class="img-circle" alt="Generic placeholder thumbnail">
</a>
</center>
<br>
<center><h4 class="label label-default dashboard_labels">Analytics</h4></center>
</div>
<div class="col-xs-6 col-sm-3 ">
<center>
<a href="">
<img src="images/add_user.jpg" width="200" height="200" class="img-circle" alt="Generic placeholder thumbnail">
</a>
</center>
<br>
<center><h4 class="label label-default dashboard_labels">Add User</h4></center>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<fieldset>
<div class="modal-content">
<div class="modal-header">
<button type="button" name="form_modal_close" class="close" data-dismiss="modal">×</button>
<center><h4 class="modal-title">Select Template</h4></center>
</div>
<div class="modal-body">
<div class="row img-hover">
<div class="col-xs-4 col-sm-4">
<a class="template_selection" data-selection="leaving">
<img src="images/user.png" width="120px" height="120px">
</a>
<div class="caption">
<div class="label label-danger template_labels">Leaving Users</div>
</div>
</div>
<div class="col-xs-4 col-sm-4">
<a class="template_selection" data-selection="crying">
<img src="images/user.png" width="120px" height="120px">
<div class="caption">
<div class="label label-warning template_labels">Crying Users</div>
</div>
</a>
</div>
<div class="col-xs-4 col-sm-4">
<a class="template_selection" data-selection="random">
<img src="images/user.png" width="120px" height="120px">
<div class="caption">
<div class="label label-primary template_labels">Random Users</div>
</div>
</a>
</div>
</div>
<br>
<div class="row img-hover">
<div class="col-xs-4 col-sm-4">
<a class="template_selection" data-selection="regular">
<img src="images/user.png" width="120px" height="120px">
<div class="caption">
<div class="label label-success template_labels">Regular Users</div>
</div>
</a>
</div>
<div class="col-xs-4 col-sm-4">
<a class="template_selection" data-selection="unsatisfied">
<img src="images/user.png" width="120px" height="120px">
<div class="caption">
<div class="label label-info template_labels">Unsatisfied Users</div>
</div>
</a>
</div>
</div>
</div>
<br>
<br>
</div>
</fieldset>
<fieldset>
<div class="modal-content">
<form data-parsley-validate method="post">
<div class="modal-header">
<button type="button" name="form_modal_close" class="close" data-dismiss="modal">×</button>
<center><h4 id="form_modal_title" class="modal-title"></h4></center>
</div>
<div id="form_modal_body" class="modal-body">
<input type="text" required="required" required placeholder="Enter the username" value="" name="name" class="txt">
<input type="text" data-parsley-type="email" required placeholder="Enter the email ID" value="" name="email" class="txt">
<textarea placeholder="Extra information,If any?" data-parsley-required="false" name="mess" type="text" class="txt_3"></textarea>
<button type="button" data-color="#0000FF" class="btn btn-default btn-circle"><i class="glyphicon glyphicon-ok"></i></button>
<button type="button" data-color="#FFFFFF" class="btn btn-primary btn-circle"></button>
<button type="button" data-color="#008000" class="btn btn-success btn-circle"></button>
<button type="button" data-color="#00FFFF" class="btn btn-info btn-circle"></button>
<button type="button" data-color="#FFA500" class="btn btn-warning btn-circle"></button>
<button type="button" data-color="#FF0000" class="btn btn-danger btn-circle"></button>
</div>
<div class="modal-footer">
<button type="button" id="previous" class="btn btn-default"><i class="fa fa-angle-double-left" aria-hidden="true"></i>Previous</button>
<button type="submit" id="form_submit" class="btn btn-default btn-success"><span id="send_button">Send</span> <img style="height: 13px;display: none;" id="rolling_gif" src="images/rolling.gif"></button>
</div>
</form>
</div>
</fieldset>
</div>
</div>
<!--modal end-->
</div>
<hr>
</div>
<br>
<div class="row">
<div class="panel panel-default">
<div class="panel-heading"><b><i class="fa fa-line-chart" aria-hidden="true">Traffic</i></b>
</div>
<div class="panel-body">
<div class="col-md-12">
<div id="area-example" style="height: 300px;"></div>
</div>
<div class="col-md-12">
<div id="line-example" style="height: 300px;"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><b><i class="fa fa-pie-chart" aria-hidden="true">Pie Chart</i></b></div>
<div class="panel-body">
<div id="donut-example" style="height: 250px;"></div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><b><i class="fa fa-bar-chart" aria-hidden="true">Bar Chart</i></b></div>
<div class="panel-body">
<div id="bar-example" style="height: 250px;"></div>
</div>
</div>
</div>
</div>
</div>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="parsley.min.js"></script>
<script src="morris.js"></script>
<script>
$().ready(function(){
var color_default=true;
var color_default_button=$('.btn-circle').first();
var selected="";
$('fieldset:first-child').fadeIn('Slow');
$('a.template_selection').on('click',function(e){
e.preventDefault();
selected=$(this).attr('data-selection');
var parent_fieldset = $(this).parents('fieldset');
var next_step = true;
if (next_step) {
parent_fieldset.fadeOut(400, function () {
if(selected=="leaving")
$('#form_modal_title').html('<span class="label label-danger">Leaving Users</span>');
else if(selected=="crying")
$('#form_modal_title').html('<span class="label label-warning">Crying Users</span>');
else if(selected=="unsatisfied")
$('#form_modal_title').html('<span class="label label-info">Unsatisfied Users</span>');
else if(selected=="random")
$('#form_modal_title').html('<span class="label label-primary">Random Users</span>');
else if(selected=="regular")
$('#form_modal_title').html('<span class="label label-success">Regular Users</span>');
$(this).next().fadeIn();
});
}
});
$('#previous').on('click',function(e){
$(this).parents('fieldset').fadeOut(400, function () {
$(this).prev().fadeIn();
});
});
$('button[name="form_modal_close"]').on('click',function(e){
e.preventDefault();
$('#myModal').modal('hide');
$(color_default_button).html('');
$('.btn-circle').first().html('<i class="glyphicon glyphicon-ok"></i>');
$('fieldset:first-child').show();
$('fieldset:first-child').next().hide()
});
$('form').on('submit',function(e){
e.preventDefault();
var data=$(this).serialize();
var color=$(color_default_button).attr('data-color');
data+='&color='+color+'&selected='+selected;
$('#rolling_gif').fadeIn("slow");
$('#send_button').text('Please Wait..');
$.ajax({
url:'backend.php',
data:data,
type:'POST',
dataType:'json',
success:function(data){
$('#rolling_gif').fadeOut("slow");
$('#send_button').text('Send');
if(data.status=="success")
show__floating_div("Mail has been sent to the user!","success");
else if(data.status=="error")
show__floating_div("Mail Sent failed!","danger");
}
});
});
$('.btn-circle').on('click',function(e){
if(color_default){
$('.btn-circle').first().html('');
$(this).html('<i class="glyphicon glyphicon-ok"></i>');
color_default_button=$(this);
}else{
$(color_default_button).html('');
$(this).html('<i class="glyphicon glyphicon-ok"></i>');
color_default_button=$(this);
}
color_default=false;
});
$('#__floating_div').on('click',function(){
$('#__floating_div').hide();
});
show__floating_div=function (data,type){
$('#__floating_child').html(data);
if(type=="success"){
$('#__floating_div').removeClass('btn-warning btn-danger');
$('#__floating_div').addClass('btn-success');
}else if(type=="warning")
{
$('#__floating_div').removeClass('btn-danger btn-success');
$('#__floating_div').addClass('btn-warning');
}else if(type=="danger"){
$('#__floating_div').removeClass('btn-warning btn-success');
$('#__floating_div').addClass('btn-danger');
}
$('#__floating_div').show();
window.setTimeout(function(){
$('#__floating_div').hide();
},3000);
};
});
</script>
</body>
</html>