-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage-booking.php
694 lines (474 loc) · 17.2 KB
/
manage-booking.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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
<?php include('header.php'); ?>
<script type="text/javascript" src="fancybox/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.0.pack.js"></script>
<link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.0.css" media="screen" />
<script type="text/javascript" src="fancybox/popup.js"></script>
<script>
function suggest(inputString){
if(inputString.length == 0) {
$('#suggestions').fadeOut();
} else {
$('#keyword').addClass('load');
$.post("autosuggest.php", {queryString: ""+inputString+""}, function(data){
if(data.length >0) {
$('#suggestions').fadeIn();
$('#suggestionsList').html(data);
$('#keyword').removeClass('load');
}
});
}
}
function fill(thisValue) {
$('#keyword').val(thisValue);
//$('#keyword_h').val(thisValue);
setTimeout("$('#suggestions').fadeOut();", 400);
}
</script>
<style>
#result {
height:20px;
font-size:16px;
font-family:Arial, Helvetica, sans-serif;
color:#0000CC;
padding:5px;
margin-bottom:10px;
background-color:#FFFFFF;
}
#country{
padding:3px;
border:1px #CCC solid;
font-size:17px;
}
.suggestionsBox {
position: absolute;
left: 575px;
top:140px;
margin: 26px 0px 0px 0px;
width: 355px;
padding:0px;
background-color: #EBEBEB;
border-top: 3px solid #0099FF;
color: #000033;
z-index:902;
border-radius:8px;
padding-left:3px;
}
.suggestionList {
margin: 0px;
padding: 0px;
}
.uls{
list-style:none;
margin: 0px;
padding: 6px;
border-bottom:1px dotted #666;
cursor: pointer;
color:#333333;
font-weight:500;
font-size:14px;
}
.lis {
list-style:none;
margin: 0px;
padding: 6px;
border-bottom:1px dotted #666;
cursor: pointer;
color:#333333;
font-weight:500;
font-size:14px;
}
.uls :hover {
list-style:none;
background-color: #0099FF;
color:#000;
}
.lis:hover {
list-style:none;
background-color: #0099FF;
color:#000;
}
uls {
list-style:none;
font-family:Arial, Helvetica, sans-serif;
font-size:11px;
color:#FFF;
padding:0;
margin:0;
}
.load{
background-image:url(images/loader.gif);
background-position:right;
background-repeat:no-repeat;
}
.suggest {
position:relative;
}
.show_info{
position: absolute;
margin: 0px 10px 0px 0px;
right:200px;
width: 220px;
height:100px;
padding:5px;
padding-top:15px;
background-color: #CCCCCC;
color: #FFFFFF;
border:ridge;
border-color:#FFFFFF;
border-radius:5px;
}
</style>
<script>
function find_emp(st){
window.location="manage-employe.php?state=" + st + "<?php if(!empty($_REQUEST['dept'])){?>&dept=<?=$_REQUEST['dept']?><?php }?>";
}
</script>
<script>
function find_by_dept(str){
window.location="manage-employe.php?dept=" + str + "<?php if(!empty($_REQUEST['state'])){?>&state=<?=$_REQUEST['state']?><?php }?>";
}
</script>
<script>
function change_status(eid,v){
c=confirm("Are you sure ?");
if(c==true){
window.location="manage-employe.php?new_status=" + v +"&eid="+eid;
}
else{
window.location="manage-employe.php";
}
}
</script>
<!-- TO SELECT MULTIPLE CHECKBOX -->
<script>
checked=false;
function checkall(frm1){
var aa= frm1;
if(checked == false){
checked = true
}
else{
checked = false
}
for (var i =0; i < aa.elements.length; i++){
aa.elements[i].checked = checked;
}
}
</script>
<?php
if(!empty($_REQUEST['val'])){
$arr_ids = $_REQUEST['arr_ids'];
if(is_array($arr_ids)) {
$str_ids = implode(',', $arr_ids);
if(isset($_REQUEST['Resign'])) {
db_query("update tbl_emp set emp_status = 'Resign' where emp_reg_id in ($str_ids)");
} else if(isset($_REQUEST['Working']) ){
db_query("update tbl_emp set emp_status = 'WORKING' where emp_reg_id in ($str_ids)");
} else if(isset($_REQUEST['delete']) ){
db_query("delete from tbl_emp where emp_reg_id in ($str_ids)");
db_query("delete from tbl_registration where reg_id in ($str_ids)");
}
}
}
?>
<?php
if(!empty($_REQUEST['eid'])){
if($_REQUEST['new_status']=='WORKING'){
$sql="update tbl_emp set emp_status='$_REQUEST[new_status]',emp_rejoin_date=now() where emp_id='$_REQUEST[eid]'";
}else{
$sql="update tbl_emp set emp_status='$_REQUEST[new_status]',emp_res_date=now() where emp_id='$_REQUEST[eid]'";
}
$res=db_query($sql);
if($res>0){
header("location:$_SERVER[HTTP_REFERER]");
}
}
?>
<tr>
<td valign="top" width="17%" style="border-right: #284c93 solid 3px; height:505px;" >
<?php include('left-menu.php'); ?>
</td>
<td valign="top" width="83%">
<?php
$cond="";
if(isset($_REQUEST['submitSearch']))
{
$sear_by=$_REQUEST['search_by'];
if($sear_by=="document")
{
$cond="and shipment_type='$sear_by' ";
}
if($sear_by=="non_document")
{
$cond="and shipment_type='$sear_by' ";
}
if($sear_by=="docket_num")
{
$d_no=$_REQUEST['docket_no'];
$cond="and docket_number='$d_no' ";
}
}
?>
<form action="">
<p class=" xlarge mt10px ml10px"><span class="b " style="font-size:12px"><i class="fa fa-list"></i> Manage Booking » <span style="color:#999999"><?/* if(!empty($_REQUEST['state'])){?>
<?=ucfirst(strtolower($_REQUEST['state']))?><? }?> Employee</span></span>
*/?>
<!-- <select name="search_by" onchange='CheckSearch(this.value);' style="padding:3px;">
<option>Search By</option>
<option value="docket_num">Docket Number</option>
<option value="document">Document</option>
<option value="non_document">Non Document</option>
</select>-->
<input type="text" name="docket_no" id="docket_no" placeholder="Enter Docket Number" style='display:none;'/>
<script type="text/javascript">
function CheckSearch(val){
var rec=document.getElementById('docket_no');
if(val=='docket_num')
{
rec.style.display='inline';
}else
{ rec.style.display='none';}
}
</script>
<!--<input type="submit" value="Search" name="submitSearch" id="submitSearch">
-->
</form>
<a href="add-booking.php" class="btn btn-default pull-right mr15px font-black"><i class="fa fa-plus"></i> Add Booking</a>
<span class="fr mr20px b black" style="font-size:12px;">
<?/*
<select name="state" id="st" title="Choose to search by employee status" class="sc vam" style="width:130px; height:36px;border:#E8E8E8 solid 1px;color:#999999;margin-left:10px;"
onchange="find_emp(this.value)">
<option selected="selected" value="0" > Select Status</option>
<option value="RESIGN" <?php if($_REQUEST['state']=='RESIGN'){?> selected="selected"<?php }?> >Resign</option>
<option value="WORKING" <?php if($_REQUEST['state']=='WORKING'){?> selected="selected"<?php }?> >Working</option>
<option value="ALL" <?php if($_REQUEST['state']=='ALL'){?> selected="selected"<?php }?> >All</option>
</select>*/?>
</span>
<span >
<?/*
<select name="dept" title="Choose to search by department" onchange="find_by_dept(this.value)" class="sc vam" style="width:150px; height:36px;border:#E8E8E8 solid 1px;color:#999999">
<option value="0">Select Department</option>
<option value="Marketing" <?php if($_REQUEST['dept']=='Marketing'){?> selected="selected"<?php }?> >Marketing</option>
<option value="Back Office" <?php if($_REQUEST['dept']=='Back Office'){?> selected="selected"<?php }?>>Back Office</option>
<option value="H.R." <?php if($_REQUEST['dept']=='H.R.'){?> selected="selected"<?php }?> >H.R.</option>
<option value="Accounts" <?php if($_REQUEST['dept']=='Accounts'){?> selected="selected"<?php }?> >Accounts</option>
<option value="Admin" <?php if($_REQUEST['dept']=='Admin'){?> selected="selected"<?php }?> >Admin</option>
<option value="0">All</option>
</select>*/?>
</span><span class="ml1px">
<?/*
<input class="txt vam" name="keyword" id="keyword" placeholder="Enter employee name/code to Search" autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true" style="height: 36px;border: #E8E8E8 solid 1px;color: #000000;width: 300px;" onkeyup="suggest(this.value);" onblur="fill(this.value);" >
*/?>
<input type="hidden" id="keyword" value="" />
</span>
<span>
<?/*<input type="submit" value="Search" name="Search" class="bbnt3 vam" style="height:34px;width:70px;font-size:12px"/>*/?></span>
<br>
<br>
<div class="suggestionsBox" id="suggestions" style="display: none;color:#000000;">
<div class="suggestionList" id="suggestionsList"> </div>
</div>
</p>
<p class="bdr0 m5px mr30px"></p>
<?php
if(!empty($_REQUEST['dept'])){
$cond1="and emp_dpt='$_REQUEST[dept]'";
}
if(isset($_REQUEST['Search'])){
if(stripos($keyword,"WKN000") !== false){
$keyword=substr($keyword,6,strlen($keyword)-1);
$cond2="and emp_code='$keyword'";
}else{
$cond3="and emp_name like '%$keyword%'";
}
}
if(!empty($_REQUEST['state'])){
if($_REQUEST['state']=="ALL"){
$sql="select * from tbl_emp where 1 ";
}else{
$sql="select * from tbl_emp where 1 and emp_status='$_REQUEST[state]' $cond1 $cond2 $cond3";
}
}else{
$sql="select * from tbl_emp where 1 and emp_status='WORKING' $cond1 $cond2 $cond3 ";
}
$start = intval($_REQUEST['start']);
$pagesize = intval($pagesize)==0?$pagesize=DEF_PAGE_SIZE:$pagesize;
$order_by == '' ? $order_by = 'emp_code' : true;
$order_by2 == '' ? $order_by2 = '' : true;
$sql .= " order by $order_by $order_by2 ";
if(empty($cond3)){
$sql .= " limit $start, $pagesize ";
}
$pager = new midas_pager_sql($sql, $pagesize, $start);
if($pager->total_records) {
$data_new= db_query($sql);
}
?>
<?/* if($pager->total_records==0) {?>
<div class="msg" align="center" style="padding:10px;">Sorry, no records found.</div>
<? } else { ?>
<div style="padding-top:20px;">
<span style="float:left;font-weight:bold;">
<? $pager->show_displaying()?>
</span>
<span style="float:right;font-weight:bold;">Records Per Page:
<?=pagesize_dropdown('pagesize', $pagesize);?></span>
</div>
*/?>
<form action="" method="post" enctype="multipart/form-data" >
<table border="0" cellpadding="0" cellspacing="0" width="99%" align="center" class="mt10px bdrAll">
<tr class="bg6">
<td width="3%" align="center"><p class="b p10px blue ac">S.N.</p></td>
<td style="width:70px;"><p class="b p10px blue ac">Airway Bill Number </p></td>
<td style="width:70px;"><p class="b p10px blue ac">Shipper Name/Code </p></td>
<td style="width:100px;"><p class="b p10px blue ac">Transit Mode</p></td>
<td style="width:9px;"><p class="b p10px blue ac">Type N/V</p></td>
<td style="width:100px;"><p class="b p10px blue ac">No. of Package</p></td>
<td style="width:30px;"><p class="b p10px blue ac">Booking Date</p></td>
<?php /* if(strstr($access,'reg_action')){ ?>
<td style="width:30px;"><p class="b p10px blue ac">Action</p></td>
<?php }*/?>
<?php /*if(strstr($access,'reg_edit')){ ?>
<td style="width:30px;"><p class="b p10px blue ac">Edit</p></td>
<?php }*/?>
<td style="width:30px;"><p class="b p10px blue ac">
Action
<!-- <input type="checkbox" name="checkbox" onclick="checkall(this.form)" />
--></p></td>
</tr>
<?php
$i = 0;
$sql=db_query("select * from tbl_package where 1 order by package_id desc");
while($res=mysql_fetch_array($sql))
{
?>
<tr>
<td style="width:100px;"><p class=" p10px ac"><?php echo ++$i;?></p></td>
<td style="width:100px;"><p class=" p10px ac">
<a style="text-decoration: none; color: #bf0000;" href='#'>
<strong>
<?=$res['airway_bill_no']?>
</strong>
</p>
</td>
<td style="width:100px;">
<p class=" p10px ac">
<?=$res['shipper_name']?> / <?=db_scalar("select shipper_code from tbl_shipper where shipper_id='$res[shipper_id]'");?>
</p>
</td>
<td style="width:100px;"><p class=" p10px ac"><?=$res['transit_mode']?></p></td>
<td style="width:100px;"><p class=" p10px ac"><?=$res['type_nv']?></p></td>
<td style="width:100px;"><p class=" p10px ac"><?=$res['no_of_package']?></p></td>
<td style="width:100px;"><p class=" p10px ac"><?=$res['booking_date']?></p></td>
<td style="width:100px;"><p class=" p10px ac"><a href="add-booking.php?pack_id=<?=$res[package_id]?>" style="color:green; font-weight:bold;">Edit</a>
<!--<a href="manage-booking.php?dock_no=<?=$res['docket_number']?>" style="color:red; font-weight:bold;">Delete</a>--></p></td>
<!-- <td style="width:100px;"><p class=" p10px ac">Receiver Code & Name</p></td>
<td style="width:100px;"><p class=" p10px ac">Receiver Code & Name</p></td> -->
</tr>
<?}?>
<?php
//$j=0;
//while($record_emp = mysql_fetch_array($result)){
//$j++;
?>
<?php
$j=0;
while($record_emp=mysql_fetch_array($data_new)){
$j++;
$line = ms_display_value($line_raw);
@extract($line);
?>
<tr >
<!--<td width="3%" align="center"><?=$j?></td>
<td style="width:100px;"> <p class=" p10px b black al" ><a class="pop1" href="emp_detail.php?dis_id=<?=$record_emp['emp_id']?>" title="" >
<?=ucfirst($record_emp['emp_name'])?> <img src="images/arr.png" height="13" width="13" style="vertical-align:middle" /></a></p>
</td>
<td style="width:100px;"><p class=" p10px black ac"><?="BI".$record_emp['emp_code']?></p></td>
<td style="width:100px;"><p class=" p10px black ac"><?=$record_emp['emp_desination']?></p></td>
<td style="width:100px;"><p class="p10px black ac"><?=$record_emp['emp_dpt']?></p></td>
<td style="width:100px;"><p class=" p10px black ac">
<?=db_scalar("select reg_uname from tbl_registration where 1 and reg_id='$record_emp[emp_reg_id]'")?>
<br />
<span style="color:#993300;font-weight:bold"> <?=db_scalar("select reg_pass from tbl_registration where 1 and reg_id='$record_emp[emp_reg_id]'")?></span>
</p></td>
<td style="width:30px;"><p class=" p5px ac b" style="color:<? if($record_emp['emp_status']=="RESIGN"){ echo "#990000";}else{echo "#006600";}?>" ><?=ucfirst(strtolower($record_emp['emp_status']))?></p>
<p class="green ac">
<?php
if($_REQUEST['state']=="RESIGN"){
echo date("d-M-Y",strtotime($record_emp['emp_res_date']));
}else if($record_emp['emp_rejoin_date']!='0000-00-00'){
echo date("d-M-Y",strtotime($record_emp['emp_rejoin_date']));
}else{
echo date("d-M-Y",strtotime($record_emp['emp_join_date']));
}
?>
</p>
</td>
<?php if(strstr($access,'reg_action') ){?>
<td style="width:10px;" align="center">
<!--<div id='PopUp' style='display: none; position: absolute; left: 100px; top: 50px; border: solid black 1px; padding: 10px; background-color:#CCCCCC; text-align: justify; font-size: 12px; width: 135px;' onmouseout="document.getElementById('PopUp').style.display = 'none' ">
-->
<!--
<?php
$status=mysql_fetch_array(db_query("select emp_status from tbl_emp where emp_id='$record_emp[emp_id]'"));
if($status['emp_status']=='RESIGN' ){
?>
<input type="button" name="WORKING" style="background-color:#FFFFFF;border:#F4F4F4 1px outset;border-radius:5px;font-weight:700;color:#666666;width:70px;" onmouseover="this.style.background='#999999';this.style.color='#fff'" onmouseout="this.style.background='#FFFFFF';this.style.color='#666666'" value="Working" onclick="javascript:void window.open('resign-rejoin-emp.php?empid=<?=$record_emp['emp_id']?>&curr_status=WORKING','1408352108354','width=400,height=120,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=500,top=200');return false;" />
<?php
}else{
?>
<input type="button" name="RESIGN" value="Resign" style="background-color:#FFFFFF;border:#F4F4F4 1px outset;border-radius:5px;font-weight:700;color:#666666;width:70px;" onmouseover="this.style.background='#999999';this.style.color='#fff'" onmouseout="this.style.background='#FFFFFF';this.style.color='#666666'" onclick="javascript:void window.open('resign-rejoin-emp.php?empid=<?=$record_emp['emp_id']?>&curr_status=RESIGN','1408352108354','width=400,height=120,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=500,top=200');return false;" />
<?php }?>
<?php /*?>change_status(<?=$record_emp['emp_id']?>,'RESIGN');<?php */?>
</p>
</td>
<?php }?>
<?php if(strstr($access,'reg_edit')){ ?>
<td style="width:30px;"><p class=" p10px ac">
<a href="edit-employe.php?empid=<?=$record_emp['emp_reg_id']?>"><img src="images/edit.gif" /></a>
<a href="../html-link.htm" target="popup" onclick="window.open('../html-link.htm','name','width=1000,height=800')">
<img src="images/edit.gif" style="background-color:red"/>
</a>
</p></td>
<?php }?>
<td style="width:30px;"><p class="b p10px blue ac">
<input type="hidden" value="yes" name="val" />
<input name="arr_ids[]" type="checkbox" id="arr_ids[]" value="<?=$record_emp['emp_reg_id']?>" />
</p></td>
-->
</tr>
<?php
}
?>
<tr>
<?php if(strstr($access,'reg_action') and $access_level['reg_type']=='ADMIN'){ ?>
<td colspan="10">
<p class="p10px fr">
<?php if($_REQUEST['status']=='ALL' || $_REQUEST['status']=='WORKING' || $_REQUEST['status']=="" ){ ?>
<!--
<span style="margin-left:5px;">
<input type="submit" name="Resign" value="Resign" title="Click here to make rasign" style="width:80px; height:28px;font-size:14px" />
</span>-->
<?php }?>
<?php if($_REQUEST['status']=='ALL' || $_REQUEST['status']=='RESIGN' ){ ?>
<span style="margin-left:5px;">
<input type="submit" name="Working" value="Working" title="Click here to make working" style="width:80px; height:28px;font-size:14px" />
</span>
<?php }?>
<?php if($access_level['reg_type']=='ADMIN'){ ?>
<span style="margin-left:5px;">
<!-- <input type="submit" name="delete" value="Delete" title="Click here to delete" onclick="return confirm('Are you sure ?');" style="width:80px; height:28px;font-size:14px" />
--></span>
<?php }?>
</p>
</td><?php }//}?>
</tr>
</form>
</table>
<?php// $pager->show_pager(); ?>
</td>
</tr>
</table>
<?php include('footer.php'); ?>
</body>
</html>