Skip to content

Commit 5a47d14

Browse files
Version 2.2 Reciept & Fullcalendar bug fixed
1 parent 011367d commit 5a47d14

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

functions/data/get-calendar.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
$calendarData = array();
44

55
$sql = 'SELECT r.*, co.fullname, c.name AS cottage_name
6-
FROM rentals AS r
7-
JOIN cottages AS c ON r.cottage_id = c.id
8-
JOIN transactions AS t ON r.transact_id = t.id
9-
JOIN customers AS co ON t.customer_id = co.id';
6+
FROM rentals AS r
7+
JOIN cottages AS c ON r.cottage_id = c.id
8+
JOIN transactions AS t ON r.transact_id = t.id
9+
JOIN customers AS co ON t.customer_id = co.id
10+
WHERE YEAR(r.created_at) = YEAR(CURDATE())';
1011
$stmt = $db->prepare($sql);
1112
$stmt->execute();
1213
$results = $stmt->fetchAll();
@@ -20,7 +21,6 @@
2021
array_push($calendarData, $event);
2122
}
2223

23-
// Return the calendar data as JSON
2424
header('Content-Type: application/json');
2525
echo json_encode($calendarData);
2626
?>

reciept.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ function getItems(){
4545
$days = $interval->days;
4646
?>
4747
<tr class="font-monospace" style="font-size: 10px;">
48-
<td class="font-monospace" style="font-size: 10px;">ITEM:&nbsp;<strong><?php echo $row['cottage_name'] ?></strong></td>
48+
<td class="font-monospace" style="font-size: 10px;">Cottage:&nbsp;<strong><?php echo $row['cottage_name'] ?></strong></td>
4949
<td class="font-monospace text-end" style="font-size: 10px;"></td>
5050
<td class="font-monospace text-center" style="font-size: 10px;"><strong>[<?php echo $row['start_datetime'] ?>] - [<?php echo $row['end_datetime'] ?>] |</strong>&nbsp;<?php echo $days ?> DAYS</td>
51-
<td class="font-monospace text-end" style="font-size: 10px;"><strong>₱<?php echo $row['price'] ?></strong></td>
51+
<td class="font-monospace text-end" style="font-size: 10px;"><strong>₱<?php echo number_format($row['price'], 2) ?></strong></td>
5252
</tr>
5353
<?php
5454
}
@@ -124,7 +124,7 @@ function getItems(){
124124
<table class="table">
125125
<thead class="font-monospace">
126126
<tr class="font-monospace">
127-
<th class="font-monospace text-end"><strong>TOTAL</strong>&nbsp;<strong>₱<?php echo $total; ?></strong></th>
127+
<th class="font-monospace text-end"><strong>TOTAL</strong>&nbsp;<strong>₱<?php echo number_format($total, 2); ?></strong></th>
128128
</tr>
129129
</thead>
130130
<tbody>

0 commit comments

Comments
 (0)