-
Notifications
You must be signed in to change notification settings - Fork 0
/
eventreport.php
129 lines (122 loc) · 4.68 KB
/
eventreport.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
<style>
table{
width : 100%;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
table tr th,
table tr td {
padding : 10px;
text-align : left;
}
.sub_heading{
margin-bottom : 15px;
font-size : 22px;
}
</style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Event Report</title>
</head>
<body>
<div>
<?php
$eventname = $result['name'];
$startdate = $result['start_date'];
$enddate = $result['end_date'];
?>
<div style="text-align:center;"><img src="<?php echo $logo; ?>" width="500"></div>
<h1><?php echo $eventname.' ('.date("m-d-y", strtotime($startdate)).' to '.date("m-d-y", strtotime($enddate)).')';?></h1>
<?php
while (strtotime($startdate) <= strtotime($enddate)) {
$arriving = getBooking(['eventid' => $result['id'],'check_in'=> $startdate]);
$outgoing = getBooking(['eventid' => $result['id'],'check_out'=> $startdate]);
?>
<div>
<h4 class="sub_heading">Arrival Report (<?php echo date("m-d-y", strtotime($startdate));?>)</h4>
<table>
<thead>
<tr>
<th width="40%">Horse Owner</th>
<th width="30%">Stalls Reserved</th>
<th width="30%">Rv Reserved</th>
<th width="30%">Feed Reserved</th>
<th width="30%">Shavings Reserved</th>
<th width="30%">Contact Phone Number</th>
</tr>
</thead>
<tbody>
<?php if (!empty(array_filter($arriving))) { ?>
<?php foreach ($arriving as $data) { ?>
<tr>
<td><?php echo $data['firstname'].' '.$data['lastname'];?></td>
<td><?php
$barnstall = (array_column($data['barnstall'], 'stallname')) ? implode(', ', array_column($data['barnstall'], 'stallname')) : 'No Stalls available.';
echo $barnstall; ?></td>
<td><?php
$rvlots = (array_column($data['rvbarnstall'], 'stallname')) ? implode(', ', array_column($data['rvbarnstall'], 'stallname')) : 'No RV lots available.';
echo $rvlots; ?></td>
<td><?php if(!empty($data['feed'])){
foreach($data['feed'] as $feed){
$quantity = $feed['quantity'];
}
$feed = (array_column($data['feed'], 'productname')) ? implode(', ', array_column($data['feed'], 'productname')) : 'No Feed inventory available.';
echo $feed.'('. $quantity .')';
} else{
echo 'No Feed inventory available.';
}?>
</td>
<td><?php if(!empty($data['shaving'])){
foreach($data['shaving'] as $shaving){
$quantity = $shaving['quantity'];
}
$shavings = (array_column($data['shaving'], 'productname')) ? implode(', ', array_column($data['shaving'], 'productname')) : 'No Shavings inventory available.';
echo $shavings.'('. $quantity .')';
}else{ echo 'No Shavings inventory available.';}?></td>
<td><?php echo $data['mobile'];?></td>
</tr>
<?php } ?>
<?php }else{ ?>
<tr><td colspan="3">No Arrival Report on <?php echo date("m-d-y", strtotime($startdate));?></td></tr>
<?php } ?>
</tbody>
</table>
<h4 class="sub_heading">Outgoing (<?php echo date("m-d-y", strtotime($startdate));?>)</h4>
<table>
<thead>
<tr>
<th width="40%">Horse Owner</th>
<th width="30%">Stalls Reserved</th>
<th width="30%">RV Reserved</th>
<th width="30%">Feed Reserved</th>
<th width="30%">Shavings Reserved</th>
<th width="30%">Contact Phone Number</th>
</tr>
</thead>
<tbody>
<?php if (!empty(array_filter($outgoing))) { ?>
<?php foreach ($outgoing as $data) { ?>
<tr>
<td><?php echo $data['firstname'].' '.$data['lastname'];?></td>
<td><?php echo implode(', ', array_column($data['barnstall'], 'stallname')); ?></td>
<td><?php echo implode(', ', array_column($data['rvbarnstall'], 'stallname')); ?></td>
<td><?php echo implode(', ', array_column($data['feed'], 'productname')); ?></td>
<td><?php echo implode(', ', array_column($data['shaving'], 'productname')); ?></td>
<td><?php echo $data['mobile'];?></td>
</tr>
<?php } ?>
<?php }else{ ?>
<tr><td colspan="3">No Outgoing on <?php echo date("m-d-y", strtotime($startdate));?></td></tr>
<?php } ?>
</tbody>
</table>
</div>
<?php $startdate = date("Y-m-d", strtotime("+1 day", strtotime($startdate))); ?>
<?php } ?>
</div>
</body>
</html>