56 lines
1.3 KiB
PHP
56 lines
1.3 KiB
PHP
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
/**
|
|
* This class provides the Directors Welcome Screen
|
|
*
|
|
* @package Membership Database
|
|
* @category Controllers/Director
|
|
* @author Deon George
|
|
* @copyright (c) 2014 Deon George
|
|
* @license http://dev.leenooks.net/license.html
|
|
*/
|
|
class Controller_Director_Welcome extends Controller_Welcome {
|
|
protected $secure_actions = array(
|
|
'index'=>TRUE,
|
|
);
|
|
|
|
/**
|
|
* Edit a Module Configuration
|
|
*/
|
|
public function action_index() {
|
|
$output = '';
|
|
|
|
$t = strtotime($this->request->query('date'));
|
|
if (! $t)
|
|
$t = time();
|
|
|
|
$so = Company::instance()->so();
|
|
$date = Site::DateStartOfWeek($t);
|
|
$days = 7;
|
|
|
|
$output .= '<form id="select_date">';
|
|
$output .= View::factory('room/availability')
|
|
->set('date',$date)
|
|
->set('days',$days)
|
|
->set('open_dates',$so->open_dates($date,$days))
|
|
->set('total_places',$so->total_places($date,$days))
|
|
->set('r',$so->rooms->find_all())
|
|
->set('uri',$this->request->uri());
|
|
$output .= '</form>';
|
|
|
|
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);
|
|
}
|
|
}
|
|
?>
|