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
2015-09-29 15:58:41 +10:00

147 lines
4.7 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>
<!-- Available Places -->
<tr class="info">
<th colspan="2">Availability</th>
<th>&nbsp;</th>
<?php foreach (array_keys($available_places) as $day) : ?>
<td class="text-right"><?php echo $available_places[$day]; ?></td>
<?php endforeach ?>
<th>&nbsp;</th>
</tr>
<!-- Unprocessed Waitlists -->
<tr class="danger">
<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>
<?php foreach (array(
'P'=>'Permanent',
'a'=>'Absent',
'C'=>'Casual',
) as $code => $title) : ?>
<tr>
<td>&nbsp;</td>
<td><?php echo HTML::anchor(URL::link('director',sprintf('room/list/%s:%s:%s:7',$ro->id,$date,$code)),$title); ?></td>
<td>&nbsp;</td>
<?php foreach ($ro->child_list_date($date,$days,$code) as $day=>$x) : ?>
<td class="text-right"><?php echo HTML::anchor(URL::link('director',sprintf('room/list/%s:%s:%s:1',$ro->id,$day,$code)),count($x)); ?></td>
<?php endforeach ?>
<th>&nbsp;</th>
</tr>
<?php endforeach ?>
<tr><th colspan="<?php echo $days+4; ?>">&nbsp;</th></tr>
<!-- Waitlist -->
<tr class="danger">
<td>&nbsp;</td>
<td><?php echo HTML::anchor(URL::link('director','room/list/'.$ro->id.':'.$date.':w:7'),'Waitlist'); ?></td>
<td>&nbsp;</td>
<?php foreach ($ro->child_list_date($date,$days,'w') as $day=>$x) : ?>
<td class="text-right"><?php echo HTML::anchor(URL::link('director','room/list/'.$ro->id.':'.$day.':w:1'),count($x)); ?></td>
<?php endforeach ?>
<th>&nbsp;</th>
</tr>
<tr>
<td>&nbsp;</td>
<td><?php echo HTML::anchor(URL::link('director','room/list/'.$ro->id.':'.$date.':w:7'),'Casual Request'); ?></td>
<td>&nbsp;</td>
<?php foreach ($ro->child_list_date($date,$days,'c') as $day=>$x) : ?>
<td class="text-right"><?php echo HTML::anchor(URL::link('director','room/list/'.$ro->id.':'.$day.':c:1'),count($x)); ?></td>
<?php endforeach ?>
<th>&nbsp;</th>
</tr>
<!-- Availability -->
<tr class="info">
<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>