-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainPage.php
363 lines (340 loc) · 9.25 KB
/
MainPage.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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0">
<title>Managers Dashboard</title>
<style>
* {
box-sizing: border-box;
}
body {
font-family: Roboto,Roboto Draft,Arial,Open Sans;
font-size: 14px;
line-height: 1.42857143;
color:#0e1703;
background-color: #efffee !important;
min-height: 100%;
top: 0px;
margin: 0px;
}
#leftsidebar {
position: fixed;
background-color: #eee;
border-right: 1px solid #ccc;
width:16.4%;
padding-right: 0px;
height: auto;
max-width: 270px;
overflow: hidden;
border: none;
top: 0;
bottom: 0;
left: 0;
z-index:-999;
}
#menu {
background-color: #2c3e50;
position: absolute;
padding: 0;
width:16.4%;
top: 112px;
bottom: 0;
left: 0;
width:100%;
max-width: 270px;
height: 100%;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
z-index: 10000;
transform: translate(0%, 0px);
transition: all 200ms ease-in-out;
}
#menu ul {
color: white;
margin: 0;
padding: 0;
list-style: none;
}
#menu ul li {
padding: 10px 20px 15px 10px;
transition: all 500ms ease-in-out;
border-bottom: 0;
}
#menu ul li:hover {
color: #bdc3c7;
cursor: pointer;
}
#menu ul li.active{
border-left:3px solid #fff;
border-radius:none;
transition: all 100ms ease-out;
-webkit-transform: translate(0.6%, 0px);
transform: translate(0.6%, 0px);
}
#menu ul li a {
display: block;
color:#fff;
height: 100%;
padding: 10px 12px;
font-weight: bold;
text-decoration: none;
}
#menu.active {
-webkit-transform: translate(0%, 0px);
transform: translate(-150%, 0px);
transition: all 200ms ease-in-out;
}
.fixed {
top:0 !important;
}
#container {
background-color: #efffee !important;
position: relative;
width: 83.33333333%;
height: auto;
min-height: 530px;
float: left;
overflow: hidden;
display: table;
padding: 20px;
margin: 0;
margin-left: 16.5%;
z-index: -1;
}
.navbar {
background-color: #efefef;
padding: 10px;
border-bottom: 1px solid #eee;
min-height: 50px !important;
width: 100%;
}
.container-fluid {
background-color: #0091EA;
padding: 7px;
height: 70px !important;
}
#cnfmbox {
display:none;
position: absolute;
background:#f9edbe;
border: 1px solid #F0C369;
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
width: 400px;
max-width: 450px;
padding: 5px;
top: .5%;
left: 27.5%;
border-radius: 2px;
}
#cnfmbox p {
margin: 0;
line-height: 1.2;
color: #222;
text-align: center;
font-weight: 700;
}
#ajaxContent {
background-color:#efffee !important;
padding: 12px;
min-height: 520px;
margin-top: 1%;
margin: -1%;
}
.loading {
position: absolute;
top: 40%;
left: 42.5%;
opacity: 0.6;
}
.navbar-header {
overflow: auto;
width: 20%;
float: left;
margin-top: -12px;
}
.navbar-brand {
font-size: 24px;
font-weight: bold;
color: #fff !important;
text-decoration: none;
}
input#s {
position: relative;
line-height: 25px;
z-index: 1;
box-sizing: border-box;
width: 530px;
font-size: 15px;
padding: 7px 60px 7px 10px;
color: rgba(0,0,0,0.54);
margin: 0 !important;
border: none;
box-shadow: 0 1px 0 1px rgba(0, 0, 0, 0.2);
-webkit-appearance: none !important;
border-radius: 2px;
font-family: Roboto,RobotoDraft,open sans,Arial;
height: 35px;
font-weight:bold;
}
.search-input.form-search {
overflow: auto;
width: 40%;
float: left;
left: 300px;
position: absolute;
top: 1%;
overflow-x: hidden;
}
#livesearch {
display:none;
z-index: 1;
width: 530px;
padding: 10px;
background: #fff;
border: 1px solid #ccc;
border-top-color: #d9d9d9;
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
-webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.2);
cursor: default;
border-radius: 2px;
}
#livesearch a {
text-decoration:none;
font-weight:bold;
color:#000;
}
#livesearch a:hover {
text-decoration:none;
font-weight:bold;
color:#000;
background-color:#eee;
}
.search-input.form-search .fa-search { margin-left: -28px; z-index: 10; position: relative; font-size: 16px; }
#search {overflow:hidden;}
</style>
<script src="jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="jquery.min.js"></script>
<script>
$(document).ready(function(){
loadPage('activityPage.php',1);
$(".sidebar-toggle").click(function() {
$("#menu").toggleClass("active");
});
$(".sidebar-toggle").click(function() {
$("#trigger").toggleClass("active");
});
});
$(document).scroll(function () {
var y = $(document).scrollTop(),
header = $("#menu");
if (y >= 110) {
header.addClass('fixed');
} else {
header.removeClass('fixed');
}
});
</script>
<script>
function loadPage(urlToLoad,index) {
// Load Page Fragment using AJAX Request
$.ajax({
type: 'POST',
url:urlToLoad,
beforeSend:function(){
// Show loading image while it is fetching Data from Serverc
$('#ajaxContent').html('<div class="loading"><img src="http://localhost/xampp/ProjectX/Flip%20Flop.gif" alt="Loading..." /></div>');
},
success:function(data){
// On Successful request; do something with the data
$('#ajaxContent').empty();
$('#ajaxContent').html(data); // I am Just Displaying Data here
$('#cnfmbox').fadeIn("fast").delay(300).fadeOut("fast"); // Confirming things with the Manager
$('.msg').html("Page Loading Successful ... "); // Status Message to the Manager
$('.msg').append('<span class="close_box" style="font-weight:500">[close]</span>'); // Adding Close Button ...
$(document).on('click','.close_box',function(){$('.msg').parent().toggle();}); // Close the Msg ...
$("#menu ul li:nth-child("+index+")").addClass("active").siblings().removeClass('active'); //On Click Tab Change Event
},
error:function(xhr,status){
// If failed request; give feedback to user
$('#cnfmbox').fadeIn("fast").delay(1500).fadeOut("fast"); // Confirming things with the Manager
$('.msg').html("Oops "+xhr.status+"-"+xhr.statusText+" Please Try Again ..."); // Status Message to the Manager
$('.msg').append('<span class="close_box" style="font-weight:500">[close]</span>'); // Adding Close Button ...
$(document).on('click','.close_box',function(){$('.msg').parent().remove();}); // Close the Msg ...
}
});
}
</script>
<script>
function showResult(str) {
if (str.length==0) {
$(function(){
$("#livesearch").hide();}); // Hide the Live Results if Length is Zero
document.getElementById("livesearch").innerHTML="";
document.getElementById("livesearch").style.border="0px";
return;
}
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("livesearch").innerHTML=xmlhttp.responseText;
document.getElementById("livesearch").style.border="1px solid #A5ACB2";
$(function(){$("#livesearch").show();}); // Show Live Results Only if Successful ...
}
}
xmlhttp.open("GET","livesearch.php?q="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>
<!-- HEADER -->
<div class="container-fluid">
<div class="navbar-header">
<h2 ><a style="position: absolute;left: 12px;top: 2%;" class="navbar-brand" href="http://localhost/xampp/ProjectX/MainPage.php">Garage Connect</a></h2>
</div>
<div style='margin-left:85%;'>
click here to <a href="SignoutPage.php">LogOut</a>
</div>
</div>
<!-- NAVBAR -->
<div class="navbar">
<a class="sidebar-toggle" href="#"><img style="margin-left: 10px;" src="http://localhost/xampp/ProjectX/hamburger.svg" alt="Slider" /></a>
</div>
<!--MainPage Wrapper -->
<div id="Wrapper">
<!-- SIDEBAR Wrapper-->
<div id="leftsidebar">
<div id="menu">
<ul>
<li><a onclick="loadPage('activityPage.php',1);" href="javascript:void(0)">List of Activity </a></li>
<li><a onclick="loadPage('updatePage.php',2);" href="javascript:void(0)">Update Information</a></li>
<li><a onclick="loadPage('statusPage.php',3);" href="javascript:void(0)">Status Information</a></li>
<li><a onclick="loadPage('breakdownPage.php',4);" href="javascript:void(0)">Breakdown Request</a></li>
<li><a onclick="loadPage('sparecheckPage.php',5);" href="javascript:void(0)">Spare Availability</a></li>
<li><a onclick="loadPage('manpowerPage.php',6);" href="javascript:void(0)">Manpower Activity</a></li>
<li><a onclick="loadPage('paymentPage.php',7);" href="javascript:void(0)">Payment Settings</a></li>
<li><a onclick="loadPage('ProfilePage.php',8);" href="javascript:void(0)">Profile Settings</a></li>
</ul>
</div>
</div>
<!-- CONTENT Wrapper-->
<div id="container">
<div id="ajaxContent">
</div>
<div id="cnfmbox"><p class="msg"></p></div>
</div>
<div>
</body>
<!-- SEARCHBAR -->
<div class='search-input form-search'>
<form action='/search' method='get'>
<input id='s' name='q' onblur='if (this.value == '') {this.value = 'Search Managers Dashboard';}' onfocus='if (this.value == 'Search Managers Dashboard') {this.value = '';}' type='text' value='Search Managers Dashboard' onkeyup="showResult(this.value)" autocomplete="off" />
<div id="livesearch" style="background:#fff;clear:both;max-height: 295px;overflow-y: hidden;"></div>
</form>
</div>
</html>