TRUE, 'list'=>TRUE, ); /** * Show Directory Main Page */ public function action_availability() { $output = ''; $t = strtotime($this->request->query('date')); if (! $t) $t = time(); $so = Company::instance()->so(); $date = Site::DateStartOfWeek($t); $days = 7; $output .= '
'; Style::factory() ->type('file') ->data('media/theme/bootstrap/css/bootstrap.datepicker.css'); Script::factory() ->type('file') ->data('media/theme/bootstrap/js/bootstrap.datepicker.js'); Block::factory() ->title(sprintf('Availability for %s',Site::date($date))) ->title_icon('icon-cog') ->body($output); } /** * List Children in a Room */ public function action_list() { $days = 1; if (substr_count($this->request->param('id'),':') == 2) list($id,$date_start,$code) = explode(':',$this->request->param('id')); elseif (substr_count($this->request->param('id'),':') == 3) list($id,$date_start,$code,$days) = explode(':',$this->request->param('id')); else HTTP::redirect(URL::link('director','welcome')); $ro = ORM::factory('Rooms',$id); $result = array(); foreach ($ro->child_list_date($date_start,$days,$code) as $date => $children) foreach ($children as $co) if (! Object::in_array('id',$co->id,$result)) array_push($result,$co); Block::factory() ->title(sprintf('%s Room List for %s',$ro->display('name'),Site::date($date_start).($days > 1 ? ' to '.Site::date($date_start+$days*86400) : ''))) ->title_icon('fa-list-ol') ->body(Table::factory() ->data($result) ->columns(array( 'id'=>'ID', 'name()'=>'Name', 'age()'=>'Age', "days($ro->id,$date_start,$days,'$code',TRUE)"=>'Days', 'date_orig'=>'Register Date', )) ->prepend(array( 'id'=>array('url'=>URL::link('director','child/edit/')), )) ); } } ?>