67 lines
3.0 KiB
PHP
67 lines
3.0 KiB
PHP
<tr>
|
|
<?php $allowed_updates = array('w','c'); ?>
|
|
|
|
<?php echo Form::hidden(sprintf('room[%s][id]',$row),in_array($rco->code,$allowed_updates) ? $rco->id : NULL); ?>
|
|
|
|
<td><?php
|
|
switch ($type) {
|
|
case 'a':
|
|
case 'c':
|
|
case 'r':
|
|
case 'w':
|
|
echo ' ';
|
|
break;
|
|
|
|
default:
|
|
echo ($rco->id) ? $rco->room->display('name') : Form::select(sprintf('room[%s][room_id]',$row),ORM::factory('Rooms')->list_select(TRUE),$rco->room_id,array('class'=>'form-control','nocg'=>TRUE));
|
|
}
|
|
?></td>
|
|
|
|
<td><?php
|
|
switch ($type) {
|
|
case 'a':
|
|
case 'c':
|
|
case 'r':
|
|
case 'w':
|
|
echo StaticList_Room_Children::get($type);
|
|
echo Form::hidden(sprintf('room[%s][code]',$row),$type);
|
|
break;
|
|
default:
|
|
echo ($rco->id) ? StaticList_Room_Children::get($rco->code) : StaticList_Room_Children::form(sprintf('room[%s][code]',$row),$rco->code,FALSE,array('class'=>'form-control','nocg'=>TRUE));
|
|
}
|
|
?></td>
|
|
|
|
<?php foreach ($so->open_days() as $d => $open) : ?>
|
|
<td class="text-center <?php echo $open ? 'bg-success' : 'bg-danger'; ?>">
|
|
<?php if ($rco->loaded()) : ?>
|
|
<?php if (! $open) : ?>
|
|
<i class="fa fa-times text-danger"></i>
|
|
<?php elseif ($rco->day($d)): ?>
|
|
<?php if (in_array($rco->code,$allowed_updates)) : ?>
|
|
<?php echo Form::checkbox(sprintf('room[%s][d_%s]',$row,$d),TRUE,$rco->day($d) ? TRUE : FALSE,array('nocg'=>TRUE,($open ? '': 'disabled'))); ?>
|
|
<?php else : ?>
|
|
<i class="fa fa-check text-success"></i>
|
|
<?php endif ?>
|
|
<?php else : ?>
|
|
|
|
<?php endif ?>
|
|
|
|
<?php else : ?>
|
|
<?php echo Form::checkbox(sprintf('room[%s][d_%s]',$row,$d),TRUE,$rco->day($d) ? TRUE : FALSE,array('nocg'=>TRUE,($open ? '': 'disabled'))); ?>
|
|
<?php endif ?>
|
|
</td>
|
|
<?php endforeach ?>
|
|
|
|
<td>
|
|
<div class="input-group date" id="date_start" data-date-format="dd-mm-yyyy" data-provide="datepicker" data-date-start-view="year" data-date-autoclose="true" data-date-today-highlight="true" data-date-start-date="<?php echo $o->display('dob'); ?>" data-date-end-date="<?php echo $o->date_enrol_max(TRUE); ?>" data-date-today-btn="true">
|
|
<?php echo Form::input(sprintf('room[%s][date_start]',$row),$rco->date_start ? $rco->display('date_start') : Site::Date(time()),array('class'=>'form-control','placeholder'=>'Start','nocg'=>TRUE,'readonly')); ?>
|
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
|
</td>
|
|
<td>
|
|
<div class="input-group date" id="date_stop" data-date-format="dd-mm-yyyy" data-provide="datepicker" data-date-start-view="year" data-date-autoclose="true" data-date-today-highlight="true" data-date-start-date="<?php echo $o->display('dob'); ?>" data-date-end-date="<?php echo $o->date_enrol_max(TRUE); ?>" data-date-today-btn="true">
|
|
<?php echo Form::input(sprintf('room[%s][date_stop]',$row),$rco->date_stop ? $rco->display('date_stop') : '',array('class'=>'form-control','placeholder'=>'End','nocg'=>TRUE,'readonly')); ?>
|
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
|
</div>
|
|
</td>
|
|
</tr>
|