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

56 lines
1.3 KiB
PHP
Raw Normal View History

2014-09-05 12:19:22 +00:00
<?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 = '';
2014-10-22 11:22:47 +00:00
$t = strtotime($this->request->query('date'));
if (! $t)
$t = time();
2014-09-05 12:19:22 +00:00
$so = Company::instance()->so();
2014-10-22 11:22:47 +00:00
$date = Site::DateStartOfWeek($t);
2014-09-05 12:19:22 +00:00
$days = 7;
2014-10-22 11:22:47 +00:00
$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>';
2014-09-05 12:19:22 +00:00
2014-10-22 11:22:47 +00:00
Style::factory()
->type('file')
->data('media/theme/bootstrap/css/bootstrap.datepicker.css');
2014-09-05 12:19:22 +00:00
2014-10-22 11:22:47 +00:00
Script::factory()
->type('file')
->data('media/theme/bootstrap/js/bootstrap.datepicker.js');
2014-09-05 12:19:22 +00:00
Block::factory()
2014-10-22 11:22:47 +00:00
->title(sprintf('Availability for %s',Site::date($date)))
2014-09-05 12:19:22 +00:00
->title_icon('icon-cog')
->body($output);
}
}
?>