This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
memberdb/application/views/room/availability.php
2014-10-22 22:22:47 +11:00

141 lines
4.1 KiB
PHP

<fieldset>
<legend>Room Summary next <?php echo $days; ?> Days</legend>
<div class="form-group">
<label class="col-md-2 control-label" for="Title">Select Date</label>
<div class="col-md-2">
<div class="input-group date" id="date" data-date="<?php echo $x=Site::date($date); ?>" data-date-format="dd-mm-yyyy" data-date-autoclose="true" data-provide="datepicker">
<?php echo Form::input('date',$x,array('id'=>'caldate','class'=>'form-control','required','nocg'=>TRUE,'readonly','onchange'=>'submit()')); ?>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<br/>
<table class="table table-striped table-condensed table-hover">
<thead>
<tr>
<th colspan="2">&nbsp;</th>
<th><?php echo HTML::anchor(sprintf('%s?date=%s',$uri,date('d-m-Y',$date-86400*7)),'<<'); ?></th>
<?php foreach (array_keys($open_dates) as $day) : ?>
<th class="text-right"><?php printf('%s (%s)',Site::date($day),date('D',$day)); ?></th>
<?php endforeach ?>
<th><?php echo HTML::anchor(sprintf('%s?date=%s',$uri,date('d-m-Y',$date+86400*7)),'>>'); ?></th>
</tr>
</thead>
<tbody>
<!-- Site Open -->
<tr>
<th colspan="2">Open</th>
<th>&nbsp;</th>
<?php foreach (array_keys($open_dates) as $day) : ?>
<td class="text-right"><?php echo StaticList_YesNo::factory()->get(isset($open_dates[$day]) ? $open_dates[$day] : FALSE,TRUE); ?></td>
<?php endforeach ?>
<th>&nbsp;</th>
</tr>
<!-- Total Places -->
<tr>
<th colspan="2">Total</th>
<th>&nbsp;</th>
<?php foreach (array_keys($total_places) as $day) : ?>
<td class="text-right"><?php echo $total_places[$day]; ?></td>
<?php endforeach ?>
<th>&nbsp;</th>
</tr>
<!-- Unprocessed Waitlists -->
<tr>
<th colspan="2">New Applications</th>
<th>&nbsp;</th>
<?php foreach (array_values(ORM::factory('Rooms')->child_list_date($date,$days,'W')) as $x) : ?>
<td class="text-right"><?php echo count($x); ?></td>
<?php endforeach ?>
<th>&nbsp;</th>
</tr>
<!-- Breakdown for each Room -->
<?php foreach ($r as $ro) : ?>
<tr><th colspan="<?php echo $days+4; ?>">&nbsp;</th></tr>
<tr><th colspan="2"><?php echo $ro->display('name'); ?></th><th colspan="<?php echo $days+2; ?>">&nbsp;</th></tr>
<!-- Capacity -->
<tr>
<td>&nbsp;</td>
<td>Capacity</td>
<td>&nbsp;</td>
<td class="text-right"><?php echo join('</td><td class="text-right">',array_values($ro->availability_dates($date,$days))); ?></td>
<th>&nbsp;</th>
</tr>
<!-- Permanents -->
<tr>
<td>&nbsp;</td>
<td>Permanent</td>
<td>&nbsp;</td>
<?php foreach (array_values($ro->child_list_date($date,$days)) as $x) : ?>
<td class="text-right"><?php echo count($x); ?></td>
<?php endforeach ?>
<th>&nbsp;</th>
</tr>
<!-- Absent -->
<tr>
<td>&nbsp;</td>
<td>Absent</td>
<td>&nbsp;</td>
<?php foreach (array_values($ro->child_list_date($date,$days,'a')) as $x) : ?>
<td class="text-right"><?php echo count($x); ?></td>
<?php endforeach ?>
<th>&nbsp;</th>
</tr>
<!-- Casual -->
<tr>
<td>&nbsp;</td>
<td>Casual</td>
<td>&nbsp;</td>
<?php foreach (array_values($ro->child_list_date($date,$days,'C')) as $x) : ?>
<td class="text-right"><?php echo count($x); ?></td>
<?php endforeach ?>
<th>&nbsp;</th>
</tr>
<tr><th colspan="<?php echo $days+4; ?>">&nbsp;</th></tr>
<!-- Waitlist -->
<tr>
<td>&nbsp;</td>
<td>Waitlist</td>
<td>&nbsp;</td>
<?php foreach (array_values($ro->child_list_date($date,$days,'W')) as $x) : ?>
<td class="text-right"><?php echo count($x); ?></td>
<?php endforeach ?>
<th>&nbsp;</th>
</tr>
<!-- Availability -->
<tr>
<td>&nbsp;</td>
<td>Availability</td>
<td>&nbsp;</td>
<?php foreach (array_values($ro->room_availablity($date,$days)) as $x) : ?>
<td class="text-right"><?php echo $x; ?></td>
<?php endforeach ?>
<th>&nbsp;</th>
</tr>
<?php endforeach ?>
</tbody>
</table>
</fieldset>