File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 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 ();
2021 array_push ($ calendarData , $ event );
2122}
2223
23- // Return the calendar data as JSON
2424header ('Content-Type: application/json ' );
2525echo json_encode ($ calendarData );
2626?>
Original file line number Diff line number Diff 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 : <strong><?php echo $ row ['cottage_name ' ] ?> </strong></td>
48+ <td class="font-monospace" style="font-size: 10px;">Cottage : <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> <?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> <strong>₱<?php echo $ total ; ?> </strong></th>
127+ <th class="font-monospace text-end"><strong>TOTAL</strong> <strong>₱<?php echo number_format ( $ total, 2 ) ; ?> </strong></th>
128128 </tr>
129129 </thead>
130130 <tbody>
You can’t perform that action at this time.
0 commit comments