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/classes/Controller/Director/Welcome.php
2014-10-22 22:22:47 +11:00

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);
}
}
?>