-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheventlist.php
94 lines (91 loc) · 3.13 KB
/
eventlist.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
<?php
$records = getBookingRecords();
$utype = '';
$type = $_SESSION['calendar_fd_user']['type'];
if($type == 'admin') {
$utype = 'on';
}
?>
<div class="col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Event Booking Details</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<table class="table table-bordered">
<tr>
<th style="width: 10px">#</th>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Booking Date</th>
<th style="width: 140px">Number of People</th>
<th style="width: 100px">Status</th>
<?php if($utype == 'on') { ?>
<th >Action</th>
<?php } ?>
</tr>
<?php
$idx = 1;
foreach($records as $rec) {
extract($rec);
$stat = '';
if($status == "PENDING") {$stat = 'warning';}
else if ($status == "APPROVED") {$stat = 'success';}
else if($status == "DENIED") {$stat = 'danger';}
?>
<tr>
<td><?php echo $idx++; ?></td>
<td><a href="<?php echo WEB_ROOT; ?>views/?v=USER&ID=<?php echo $user_id; ?>"><?php echo strtoupper($user_name); ?></a></td>
<td><?php echo $user_email; ?></td>
<td><?php echo $user_phone; ?></td>
<td><?php echo $res_date; ?></td>
<td><?php echo $count; ?></td>
<td><span class="label label-<?php echo $stat; ?>"><?php echo $status; ?></span></td>
<?php if($utype == 'on') { ?>
<td><?php if($status == "PENDING") {?>
<a href="javascript:approve('<?php echo $user_id ?>');">Approve</a> /
<a href="javascript:decline('<?php echo $user_id ?>');">Denied</a> /
<a href="javascript:deleteUser('<?php echo $user_id ?>');">Delete</a>
<?php } else { ?>
<a href="javascript:deleteUser('<?php echo $user_id ?>');">Delete</a>
<?php }//else ?>
</td>
<?php } ?>
</tr>
<?php } ?>
</table>
</div>
<!-- /.box-body -->
<div class="box-footer clearfix">
<!--
<ul class="pagination pagination-sm no-margin pull-right">
<li><a href="#">«</a></li>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">»</a></li>
</ul>
-->
<?php echo generatePagination(); ?> </div>
</div>
<!-- /.box -->
</div>
<script language="javascript">
function approve(userId) {
if(confirm('Are you sure you wants to Approve it ?')) {
window.location.href = '<?php echo WEB_ROOT; ?>api/process.php?cmd=regConfirm&action=approve&userId='+userId;
}
}
function decline(userId) {
if(confirm('Are you sure you wants to Decline the Booking ?')) {
window.location.href = '<?php echo WEB_ROOT; ?>api/process.php?cmd=regConfirm&action=denide&userId='+userId;
}
}
function deleteUser(userId) {
if(confirm('Deleting user will also delete it\'s booking from calendar.\n\nAre you sure you want to priceed ?')) {
window.location.href = '<?php echo WEB_ROOT; ?>api/process.php?cmd=delete&userId='+userId;
}
}
</script>