diff --git a/.gitmodules b/.gitmodules index 21d719d..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +0,0 @@ -[submodule "includes/kohana"] - path = includes/kohana - url = git@dev.leenooks.net:deon/lnkohana.git -[submodule "modules/lnapp"] - path = modules/lnapp - url = git@dev.leenooks.net:deon/lnapp.git -[submodule "modules/lnauth"] - path = modules/lnauth - url = git@dev.leenooks.net:deon/lnauth.git diff --git a/.htaccess b/.htaccess deleted file mode 100644 index c8dada9..0000000 --- a/.htaccess +++ /dev/null @@ -1,21 +0,0 @@ -# Turn on URL rewriting -RewriteEngine On - -# Installation directory -RewriteBase / - -# Protect hidden files from being viewed - - Order Deny,Allow - Deny From All - - -# Protect application and system files from being viewed -RewriteRule ^(?:application|modules|includes/kohana)\b.* index.php/$0 [L] - -# Allow any files or directories that exist to be displayed directly -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d - -# Rewrite all other URLs to index.php/URL -RewriteRule .* index.php/$0 [PT] diff --git a/application/bootstrap.php b/application/bootstrap.php deleted file mode 100644 index 0404d43..0000000 --- a/application/bootstrap.php +++ /dev/null @@ -1,205 +0,0 @@ -" - */ - -/** - * Set the environment status by the domain. - */ -Kohana::$environment = Kohana::PRODUCTION; - -if (isset($_SERVER['KOHANA_ENV'])) -{ - Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV'])); -} - -/** - * Initialize Kohana, setting the default options. - * - * The following options are available: - * - * - string base_url path, and optionally domain, of your application NULL - * - string index_file name of your index file, usually "index.php" index.php - * - string charset internal character set used for input and output utf-8 - * - string cache_dir set the internal cache directory APPPATH/cache - * - integer cache_life lifetime, in seconds, of items cached 60 - * - boolean errors enable or disable error handling TRUE - * - boolean profile enable or disable internal profiling TRUE - * - boolean caching enable or disable internal caching FALSE - * - boolean expose set the X-Powered-By header FALSE - */ -Kohana::init(array( - 'base_url' => '/', - 'caching' => Kohana::$environment === Kohana::PRODUCTION, - 'profile' => Kohana::$environment !== Kohana::PRODUCTION, - 'index_file' => FALSE, -)); - -/** - * Attach the file write to logging. Multiple writers are supported. - */ -Kohana::$log->attach(new Log_File(APPPATH.'logs')); - -/** - * Attach a file reader to config. Multiple readers are supported. - */ -Kohana::$config->attach(new Config_File); - -/** - * Enable modules. Modules are referenced by a relative or absolute path. - */ -Kohana::modules(array( - 'lnauth' => MODPATH.'lnauth', // lnAuth Base Authentication Tools - 'lnapp' => MODPATH.'lnapp', // lnApp Base Application Tools - // 'oauth' => MODPATH.'oauth', // OAuth Module for External Authentication - 'auth' => SMDPATH.'auth', // Basic authentication - // 'cache' => SMDPATH.'cache', // Caching with multiple backends - // 'cron' => SMDPATH.'cron', // Kohana Cron Module - // 'codebench' => SMDPATH.'codebench', // Benchmarking tool - 'database' => SMDPATH.'database', // Database access - // 'gchart' => MODPATH.'gchart', // Google Chart Module - // 'highchart' => MODPATH.'highchart', // Highcharts Chart Module - // 'image' => SMDPATH.'image', // Image manipulation - 'khemail' => SMDPATH.'khemail', // Email module for Kohana 3 PHP Framework - // 'minion' => SMDPATH.'minion', // CLI Tasks - 'orm' => SMDPATH.'orm', // Object Relationship Mapping - 'pagination' => SMDPATH.'pagination', // Kohana Pagination module for Kohana 3 PHP Framework - // 'unittest' => SMDPATH.'unittest', // Unit testing - // 'userguide' => SMDPATH.'userguide', // User guide and API documentation - // 'xml' => SMDPATH.'xml', // XML module for Kohana 3 PHP Framework - )); - -/** - * Cookie Salt - * @see http://kohanaframework.org/3.3/guide/kohana/cookies - * - * If you have not defined a cookie salt in your Cookie class then - * uncomment the line below and define a preferrably long salt. - */ -// Cookie::$salt = NULL; - -/** - * Load our modules defined in the DB - */ -Kohana::modules(array_merge(Kohana::modules(),Config::modules())); - -/** - * Enable specalised interfaces - */ -Route::set('sections', '/(/(/(/)))', - array( - 'directory' => '('.implode('|',array_values(URL::$method_directory)).')' - )) - ->defaults(array( - 'action' => 'index', - )); - -// Static file serving (CSS, JS, images) -Route::set('default/media', 'media(/)', array('file' => '.+')) - ->defaults(array( - 'controller' => 'media', - 'action' => 'get', - )); - -/** - * Set the routes. Each route must have a minimum of a name, a URI and a set of - * defaults for the URI. - */ -Route::set('default', '((/(/)))', array('id'=>'[a-zA-Z0-9_.:-]+')) - ->defaults(array( - 'controller' => 'login', - 'action' => 'index', - )); - -/** - * If APC is enabled, and we need to clear the cache - */ -if (file_exists(APPPATH.'cache/CLEAR_APC_CACHE') AND function_exists('apc_clear_cache') AND (PHP_SAPI !== 'cli')) { - if (! apc_clear_cache() OR ! unlink(APPPATH.'cache/CLEAR_APC_CACHE')) - throw new Kohana_Exception('Unable to clear the APC cache.'); -} - -// If we are a CLI, set our session dir -if (PHP_SAPI === 'cli') - session_save_path('tmp/'); -?> diff --git a/application/classes/Company.php b/application/classes/Company.php deleted file mode 100644 index 87b96a0..0000000 --- a/application/classes/Company.php +++ /dev/null @@ -1,122 +0,0 @@ -so = $so; - - if (! $this->so->loaded()) - throw new Kohana_Exception(_('Site [:site] not defined in DB?'),array(':site'=>URL::base('http'))); - - Kohana::$environment = (int)$this->so->status; - } - - public static function instance() { - $x = URL::base('http'); - - if (! isset(Company::$instance[$x])) - Company::$instance[$x] = new Company(ORM::factory('Setup',array('url'=>$x))); - - return Company::$instance[$x]; - } - - public function admin() { - return $this->so->account; - } - - public function address($ln='
') { - return implode($ln,array($this->street($ln),sprintf('%s, %s %s',$this->city(),$this->state(),$this->pcode()))); - } - - public function city() { - return $this->so->site_details('city'); - } - - public function contacts() { - return 'Tel: '.$this->phone(); - } - - public function country() { - return $this->so->country; - } - - public function date_format() { - return $this->so->date_format; - } - - public function decimals() { - return $this->so->decimal_place; - } - - public function email() { - return $this->so->site_details('email'); - } - - public function fax() { - return $this->so->site_details('fax'); - } - - public function faq() { - return $this->so->site_details('faqurl'); - } - - public function language() { - return $this->so->language; - } - - public function logo_file() { - list ($path,$suffix) = explode('.',Config::$logo); - - return ($x=Kohana::find_file(sprintf('media/site/%s',$this->site()),$path,$suffix)) ? $x : Kohana::find_file('media',$path,$suffix); - } - - public function name() { - return $this->so->site_details('name'); - } - - public function module_config($item,array $value=NULL) { - return $this->so->module_config($item,$value); - } - - public function pcode() { - return $this->so->site_details('pcode'); - } - - public function phone() { - return $this->so->site_details('phone'); - } - - public function site($format=FALSE) { - return $format ? sprintf('%02s',$this->so->id) : $this->so->id; - } - - public function so() { - return $this->so; - } - - public function state() { - return $this->so->site_details('state'); - } - - public function street($ln='
') { - return $this->so->site_details('address2') ? implode($ln,array($this->so->site_details('address1'),$this->so->site_details('address2'))) : $this->so->site_details('address1'); - } - - public function time_format() { - return $this->so->time_format; - } -} -?> diff --git a/application/classes/Config.php b/application/classes/Config.php deleted file mode 100644 index 243e41d..0000000 --- a/application/classes/Config.php +++ /dev/null @@ -1,101 +0,0 @@ -list_external() as $mo) - $result[$mo->name] = MODPATH.$mo->name; - } - - return $result; - } - - public static function module_config($item,array $value=NULL) { - return Company::instance()->module_config($item,$value); - } - - public static function module_exist($module) { - return array_key_exists(strtolower($module),self::modules()) ? TRUE : FALSE; - } - - /** - * See if our emails for the template should be sent to configured admin(s) - * - * @param string template - Template to test for - * @return mixed|array - Email to send test emails to - */ - public static function testmail($template) { - $config = Kohana::$config->load('debug')->email_admin_only; - - if (is_null($config) OR ! is_array($config) OR empty($config[$template])) - return FALSE; - else - return $config[$template]; - } -} -?> diff --git a/application/classes/Controller/Admin/Site/Date.php b/application/classes/Controller/Admin/Site/Date.php deleted file mode 100644 index 92b1473..0000000 --- a/application/classes/Controller/Admin/Site/Date.php +++ /dev/null @@ -1,77 +0,0 @@ -TRUE, - 'edit'=>TRUE, - 'list'=>TRUE, - ); - - protected $icon = 'fa fa-calendar'; - - /** - * Add a new site dates - */ - public function action_add() { - Block::factory() - ->type('form-horizontal') - ->title('New Site Date') - ->title_icon($this->icon) - ->body($this->add_edit()); - } - - private function add_edit($id=NULL,$output='') { - $o = ORM::factory('Site_Dates',$id); - - if ($this->request->post() AND $o->values($this->request->post())->changed()) { - // Some validation - if ($o->code == 'S') { - $o->date_stop = NULL; - $o->date_start = strtotime(date('Y',$o->date_start).'-01-01'); - $o->date_stop = strtotime(date('Y',$o->date_start).'-12-31'); - } - - if (! $this->save($o)) - $o->reload(); - } - - $this->meta->title = $o->loaded() ? sprintf('Site Date: %s',$o->id) : 'New Site Date'; - - return View::factory('site/date/admin/add_edit') - ->set('o',$o); - } - - /** - * Edit a Module Configuration - */ - public function action_edit() { - Block::factory() - ->type('form-horizontal') - ->title('Update Site Date') - ->title_icon($this->icon) - ->body($this->add_edit($this->request->param('id'))); - } - - /** - * List site dates - */ - public function action_list() { - $this->meta->title = 'A|List Site Dates'; - - Block::factory() - ->title('Site Dates') - ->title_icon($this->icon) - ->body(View::factory('site/date/list')->set('o',ORM::factory('Site_Dates')->find_all())); - } -} -?> diff --git a/application/classes/Controller/Child.php b/application/classes/Controller/Child.php deleted file mode 100644 index 0e01cdf..0000000 --- a/application/classes/Controller/Child.php +++ /dev/null @@ -1,3 +0,0 @@ -TRUE, - 'ajaxlist'=>FALSE, - 'list'=>TRUE, - ); - - /** - * Add an Account - */ - public function action_add() { - Block::factory() - ->type('form-horizontal') - ->title('Add/Edit Record') - ->title_icon('fa-wrench') - ->body($this->add_edit()); - } - - public function action_ajaxlist() { - $result = array(); - - if ($this->request->query('query')) - $result = Arr::merge($result,ORM::factory('Account')->list_autocomplete($this->request->query('query'),'id','id',array('%s: %s'=>array('id','name(TRUE)')))); - - $this->response->headers('Content-Type','application/json'); - $this->response->body(json_encode(array_values($result))); - } - - /** - * List Accounts - */ - public function action_list() { - $output = __METHOD__; - - Block::factory() - ->title('List Families') - ->body($output); - } - - private function add_edit($id=NULL) { - $co = ORM::factory('Child',$id); - - if ($this->request->post() AND $co->values($this->request->post())->changed() AND (! $this->save($co))) - $co->reload()->values($this->request->post()); - - // If there are no room records, we'll create a waitlist one that can be completed. - if (! $co->subitems()) - $co->subitem_add($co->room->values(array('child_id'=>$co->id,'code'=>'W'))); - - Style::factory() - ->type('file') - ->data('media/theme/bootstrap/css/bootstrap.datepicker.css'); - - Script::factory() - ->type('file') - ->data('media/theme/bootstrap/js/bootstrap.datepicker.js'); - - return View::factory('account/user/add_edit') - ->set('o',$co) - ->set('so',Company::instance()->so()); - } -} -?> diff --git a/application/classes/Controller/Director/Child.php b/application/classes/Controller/Director/Child.php deleted file mode 100644 index 12012d5..0000000 --- a/application/classes/Controller/Director/Child.php +++ /dev/null @@ -1,176 +0,0 @@ -TRUE, - 'ajaxroomrow'=>FALSE, - 'edit'=>TRUE, - 'list'=>TRUE, - ); - - /** - * Add a Child - */ - public function action_add() { - Block::factory() - ->type('form-horizontal') - ->title('Add/Edit Record') - ->title_icon('fa-wrench') - ->body($this->add_edit()); - } - - public function action_ajaxroomrow() { - $this->response->body( - View::factory('child/director/add_roomrow') - ->set('o',ORM::factory('Child',$this->request->query('cid'))) - ->set('so',Company::instance()->so()) - ->set('rco',ORM::factory('Room_Children')) - ->set('row',$this->request->query('id')) - ->set('type',$this->request->query('type'))); - } - - /** - * Edit a Child - */ - public function action_edit() { - Block::factory() - ->type('form-horizontal') - ->title('Add/Edit Record') - ->title_icon('fa-wrench') - ->body($this->add_edit($this->request->param('id'))); - } - - public function action_list() { - Block::factory() - ->title('Children List') - ->title_icon('fa-list-ol') - ->body(Table::factory() - ->data(ORM::factory('Child')->find_all()) - ->columns(array( - 'id'=>'ID', - 'name()'=>'Name', - 'age()'=>'Age', - "days(NULL,".Site::DateStartOfWeek(time()).",7,'P',TRUE)"=>'Perm Days', - "days(NULL,".Site::DateStartOfWeek(time()).",7,'w',TRUE)"=>'Wait Days', - 'date_orig'=>'Date Registered' - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('director','child/edit/')), - )) - ); - } - - private function add_edit($id=NULL) { - $co = ORM::factory('Child',$id); - - if ($this->request->post()) { - foreach ($this->request->post('room') as $index=>$room) { - $new = FALSE; - - if (! $room['id'] OR ! $rco=$co->subitem_get('id',$room['id'])) { - $new = TRUE; - $rco = $co->room; - $rco->child_id = $co->id; - } - - $rco->values($room); - - if ($new) - $co->subitem_add($rco); - } - - $co->values($this->request->post()); - - if (! $this->save($co)) - $co->reload()->values($this->request->post()); - } - - Style::factory() - ->type('file') - ->data('media/theme/bootstrap/css/bootstrap.datepicker.css'); - - Script::factory() - ->type('file') - ->data('media/theme/bootstrap/js/bootstrap.datepicker.js'); - - Script::factory() - ->type('stdin') - ->data(' -$(document).ready(function() { - var x = '.count($co->subitems()).'; - - $("button[name=add]").click(function() { - // Send the request and get a new room row - $.ajax({ - type: "GET", - data: "cid='.$co->id.'&type="+$(this).val()+"&id="+x++, - dataType: "html", - cache: false, - url: "'.URL::link('director','child/ajaxroomrow',TRUE).'", - timeout: 2000, - error: function(x) { - alert("Failed to submit"); - }, - success: function(data) { - $("table[name=room] tr:last").after(data); - } - }); - }); - - $("#dob").datepicker().on("hide",function(e) { - var x = $("#dob").datepicker("getDate").getTime()/1000; - - // Send the request and update sub category dropdown - $.ajax({ - type: "GET", - data: "date="+x, - dataType: "html", - cache: false, - url: "'.URL::link('user','child/ajaxage',TRUE).'", - timeout: 2000, - error: function(x) { - alert("Failed to submit"); - }, - success: function(data) { - $("div[id=age]").empty().append(data); - } - }); - -// This code has been disabled as it pollutes datepicker. -/* - $.ajax({ - type: "GET", - data: "date="+x, - dataType: "html", - cache: false, - url: "'.URL::link('user','child/ajaxagemax',TRUE).'", - timeout: 2000, - error: function(x) { - alert("Failed to submit"); - }, - success: function(data) { -// $(".date input:not(#dob)").each(function(){$(this).datepicker("setEndDate",new Date(data*1000))}); -// $(".input-daterange input").each(function(){alert(new Date(data*1000));$(this).datepicker("setEndDate",new Date(data*1000))}); - $(".input-daterange").each(function(){alert(data);$(this).datepicker("setEndDate",data)}); - } - }); -*/ - }); -}); - '); - - return View::factory('child/director/add_edit') - ->set('o',$co) - ->set('so',Company::instance()->so()); - } -} -?> diff --git a/application/classes/Controller/Director/Room.php b/application/classes/Controller/Director/Room.php deleted file mode 100644 index c80bd37..0000000 --- a/application/classes/Controller/Director/Room.php +++ /dev/null @@ -1,96 +0,0 @@ -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 .= '
'; - $output .= View::factory('room/availability') - ->set('date',$date) - ->set('days',$days) - ->set('available_places',$so->available_places($date,$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 .= '
'; - - 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/')), - )) - ); - } -} -?> diff --git a/application/classes/Controller/Director/Welcome.php b/application/classes/Controller/Director/Welcome.php deleted file mode 100644 index 2fa53e3..0000000 --- a/application/classes/Controller/Director/Welcome.php +++ /dev/null @@ -1,23 +0,0 @@ -TRUE, - ); - - /** - * Show Directory Main Page - */ - public function action_index() { - } -} -?> diff --git a/application/classes/Controller/Enrol.php b/application/classes/Controller/Enrol.php deleted file mode 100644 index b8d4047..0000000 --- a/application/classes/Controller/Enrol.php +++ /dev/null @@ -1,63 +0,0 @@ -request->post('year') ? ORM::factory('Site_Dates',$this->request->post('year')) : ORM::factory('Site_Dates')->where_year($this->request->param('id')); - if (! $sdo->loaded()) { - Block::factory() - ->type('form-horizontal') - ->title('Choose year of enrolment') - ->title_icon('fa fa-calendar') - ->body(View::factory('enrol/selectyear')); - - return; - } - - $ao = ORM::factory('Account'); - $co = ORM::factory('Child'); - - $this->meta->title = 'Enrol'; - - if ($this->request->post('account') AND $this->request->post('child') AND $this->request->post('room.id')) { - $ao->values($this->request->post('account')); - $co->values($this->request->post('child')); - $ro = ORM::factory('Rooms',$this->request->post('room.id')); - - // First we need to make an account - try { - if ($ao->save() AND $co->save()) { - $co->account_id = $ao; - $co->status = 'PEND'; - $co->save(); - - $co->add('rooms',$ro); - } - - } catch (ORM_Validation_Exception $e) { - SystemMessage::factory() - ->title('Record NOT created') - ->type('danger') - ->body(join('
',array_values($e->errors('register')))); - - } - } - - Block::factory() - ->type('form-horizontal') - ->title('Register enrolment for: '.$sdo->year()) - ->title_icon('fa fa-university') - ->body(View::factory('enrol/child')->set('ao',$ao)->set('co',$co)->set('room_id',$this->request->post('room.id'))->set('year',$sdo->id)); - } -} -?> diff --git a/application/classes/Controller/Room.php b/application/classes/Controller/Room.php deleted file mode 100644 index 5095616..0000000 --- a/application/classes/Controller/Room.php +++ /dev/null @@ -1,3 +0,0 @@ -TRUE, - 'ajaxage'=>FALSE, - 'ajaxagemax'=>FALSE, - 'edit'=>TRUE, - ); - - public function action_add() { - Block::factory() - ->type('form-horizontal') - ->title('Add/Edit Record') - ->title_icon('fa-wrench') - ->body($this->add_edit()); - } - - public function action_ajaxage() { - $x = ORM::factory('Child'); - $x->dob = $this->request->query('date'); - $this->template->content = $x->age(); - } - - public function action_ajaxagemax() { - $x = ORM::factory('Child'); - $x->dob = $this->request->query('date'); - $this->template->content = $x->date_enrol_max(TRUE); - } - - public function action_edit() { - Block::factory() - ->type('form-horizontal') - ->title('Add/Edit Record') - ->title_icon('fa-wrench') - ->body($this->add_edit($this->request->param('id'))); - } - - private function add_edit($id=NULL) { - $co = ORM::factory('Child',$id); - - if ($this->request->post()) { - foreach ($this->request->post('room') as $index=>$room) { - $new = FALSE; - - if (! $room['id'] OR ! $rco=$co->subitem_get('id',$room['id'])) { - $new = TRUE; - $rco = $co->room; - $rco->child_id = $co->id; - } - - $rco->values($room); - - if ($new) - $co->subitem_add($rco); - } - - $co->values($this->request->post()); - - if (! $this->save($co)) - $co->reload()->values($this->request->post()); - } - - Style::factory() - ->type('file') - ->data('media/theme/bootstrap/css/bootstrap.datepicker.css'); - - Script::factory() - ->type('file') - ->data('media/theme/bootstrap/js/bootstrap.datepicker.js'); - - // Set our maximum date, that children can stay - Script::factory() - ->type('stdin') - ->data(' -$(document).ready(function() { - var x = '.count($co->subitems()).'; - - $("button[name=add]").click(function() { - // Send the request and get a new room row - $.ajax({ - type: "GET", - data: "cid='.$co->id.'&type="+$(this).val()+"&id="+x++, - dataType: "html", - cache: false, - url: "'.URL::link('director','child/ajaxroomrow',TRUE).'", - timeout: 2000, - error: function(x) { - alert("Failed to submit"); - }, - success: function(data) { - $("table[name=room] tr:last").after(data); - } - }); - }); - - $("#dob").datepicker().on("hide",function(e) { - var x = $("#dob").datepicker("getDate").getTime()/1000; - - // Send the request and update sub category dropdown - $.ajax({ - type: "GET", - data: "date="+x, - dataType: "html", - cache: false, - url: "'.URL::link('user','child/ajaxage',TRUE).'", - timeout: 2000, - error: function(x) { - alert("Failed to submit"); - }, - success: function(data) { - $("div[id=age]").empty().append(data); - } - }); - - $.ajax({ - type: "GET", - data: "date="+x, - dataType: "html", - cache: false, - url: "'.URL::link('user','child/ajaxagemax',TRUE).'", - timeout: 2000, - error: function(x) { - alert("Failed to submit"); - }, - success: function(data) { - $(".date input:not(#dob)").each(function(){$(this).datepicker("setEndDate",data)}); - } - }); - }); -}); - '); - - return View::factory('child/user/add_edit') - ->set('o',$co) - ->set('so',Company::instance()->so()); - } -} -?> diff --git a/application/classes/Controller/User/Welcome.php b/application/classes/Controller/User/Welcome.php deleted file mode 100644 index c33191c..0000000 --- a/application/classes/Controller/User/Welcome.php +++ /dev/null @@ -1,49 +0,0 @@ -TRUE, - ); - - public function action_index() { - $output = ''; - - if (! $this->ao->list_children()->count()) - $output .= 'You have no currently registered children, would you like to '.HTML::anchor(URL::link('user','child/add'),'Register').' a child?'; - else - $output = Table::factory() - ->data($this->ao->list_children()) - ->columns(array( - 'id'=>'ID', - 'first_name'=>'First Name', - 'family_name'=>'Family Name', - 'dob'=>'DOB', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','child/edit/')), - )); - - Block::factory() - ->title(sprintf('Membership details for : %s',$this->ao->name())) - ->title_icon('icon-info-sign') - ->span(9) - ->body($output); - - Block::factory() - ->title('Quick Shortcuts') - ->title_icon('icon-bookmark') - ->span(3) - ->body(View::factory('welcome/user/shortcuts')); - } -} -?> diff --git a/application/classes/Controller/Welcome.php b/application/classes/Controller/Welcome.php deleted file mode 100644 index 23b53fa..0000000 --- a/application/classes/Controller/Welcome.php +++ /dev/null @@ -1,23 +0,0 @@ -type('file') - ->data('media/css/pages/welcome.css'); - - $this->template->content = View::factory('pages/welcome'); - } -} -?> diff --git a/application/classes/Cookie.php b/application/classes/Cookie.php deleted file mode 100644 index 7ca3852..0000000 --- a/application/classes/Cookie.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/application/classes/Database.php b/application/classes/Database.php deleted file mode 100644 index d5e697f..0000000 --- a/application/classes/Database.php +++ /dev/null @@ -1,18 +0,0 @@ -_config['caching']) ? $this->_config['caching'] : FALSE; - } -} -?> diff --git a/application/classes/Kohana.php b/application/classes/Kohana.php deleted file mode 100644 index 9bdd9b6..0000000 --- a/application/classes/Kohana.php +++ /dev/null @@ -1,72 +0,0 @@ - diff --git a/application/classes/Model/Account.php b/application/classes/Model/Account.php deleted file mode 100644 index 43b1616..0000000 --- a/application/classes/Model/Account.php +++ /dev/null @@ -1,24 +0,0 @@ -array('far_key'=>'id'), - 'email_log'=>array('far_key'=>'id'), - 'group'=>array('through'=>'account_group'), - ); - - public function list_children() { - return $this->child->find_all(); - } -} -?> diff --git a/application/classes/Model/Child.php b/application/classes/Model/Child.php deleted file mode 100644 index 1efc8aa..0000000 --- a/application/classes/Model/Child.php +++ /dev/null @@ -1,165 +0,0 @@ -array('through'=>'room_children'), - ); - - public function filters() { - return Arr::merge(parent::filters(),array( - 'dob'=>array(array(array($this,'date'), array(':value'))), - )); - } - - protected $_display_filters = array( - 'date_orig'=>array( - array('Site::Date',array(':value')), - ), - 'date_last'=>array( - array('Site::Date',array(':value')), - ), - 'dob'=>array( - array('Site::Date',array(':value')), - ), - ); - - protected $_sub_items_load = array( - 'rooms'=>array('date_start','date_stop'), - ); - - private function _dob() { - $x = new DateTime(); - - return $x->setTimestamp($this->dob); - } - - public function age($asat=NULL,$format='%Yy%Mm') { - if (is_null($asat)) - $asat = time(); - - $dob = $this->_dob(); - - $today = new DateTime(); - $today->setTimestamp($asat); - - return $format == '%w' ? sprintf('%02dw',$dob->diff($today)->days/7) : $dob->diff($today)->format($format); - } - - public function date($value) { - return is_numeric($value) ? $value : strtotime($value); - } - - public function date_enrol_min() { - $dob = $this->_dob(); - $dob->add(new DateInterval('P'.$this->_start)); - - return $format ? $result->format(Kohana::$config->load('config')->date_format) : $result->format('U'); - } - - public function date_enrol_max($format=FALSE) { - $dob = $this->_dob(); - $dob->add(new DateInterval('P'.$this->_max)); - - $last = new DateTime(sprintf('%s-%s',$dob->format('Y'),$this->_max_date)); - $x = $dob->diff($last); - - $result = new DateTime(sprintf('%s-%s',$dob->format('Y')+($x->invert ? 1 : 0),$this->_max_return)); - - return $format ? $result->format(Company::instance()->date_format()) : $result->format('U'); - } - - public function days($room_id,$date_start,$days,$code,$markup=FALSE) { - $result = ''; - - $date_end = $date_start+$days*86400; - $open_dates = Company::instance()->so()->open_dates($date_start,$days); - - $o = $this->room->where('code','=',$code); - $o->where_startstop($date_start,$date_end); - if (! is_null($room_id)) - $o->where('room_id','=',$room_id); - - // Set all open dayes to 0 - foreach ($open_dates as $k=>$v) - if ($v === TRUE) - $open_dates[$k] = 0; - - foreach ($o->find_all() as $date => $rco) { - foreach ($open_dates as $day=>$open) { - if ($open === FALSE or $rco->date_start > $day OR $rco->date_stop < $day) - continue; - - $open_dates[$day] = $rco->day(date('w',$day)); - } - } - - foreach ($open_dates as $day=>$open) { - $dayname = substr(date('D',$day),0,1); - - if ($open === FALSE) - $result .= $markup ? sprintf('%s',$dayname) : '-'; - elseif ($open) - $result .= $markup ? sprintf('%s',($code=='P' ? 'fa-circle' : 'fa-circle-o'),($code=='P' ? 'white' : 'black'),$dayname) : $dayname; - else - $result .= $markup ? sprintf('%s',$dayname) : strtolower($dayname); - } - - return $result; - } - - public function name() { - return sprintf('%s, %s',strtoupper($this->family_name),$this->first_name); - } - - public function save(Validation $validation=NULL) { - $changed = $this->changed(); - - parent::save($validation); - - // Process our Sub-Items and Validate them. - Sort::MASort($this->_sub_items,array('code','room_id','date_start','date_stop')); - $last = NULL; - foreach ($this->_sub_items as $rco) { - // If no dates are selected, clear this record. - if (! $rco->have_days()) { - if ($rco->loaded()) - $rco->delete(); - - continue; - } - - // If there is no last item, we'll accept this as is. - if (is_null($last) OR ($last->date_stop <= $rco->date_start)) { - $rco->save($validation); - $last = $rco; - - continue; - } - - // @todo: If our dates overlap, fix that - // @todo: Check that casual days dont overlap with permanent days - // @todo: Check that absent days are attending days - // @todo: Check that waitlist days dont overlap with permanent days - - if ($rco->changed() AND (! $rco->save())) - $rco->reload(); - } - - return $this->reload(); - } -} -?> diff --git a/application/classes/Model/Room/Children.php b/application/classes/Model/Room/Children.php deleted file mode 100644 index 49af1ad..0000000 --- a/application/classes/Model/Room/Children.php +++ /dev/null @@ -1,115 +0,0 @@ -array(), - 'room'=>array('model'=>'Rooms'), - ); - - public function filters() { - return Arr::merge(parent::filters(),array( - 'date_start'=>array( - array('strtotime', array(':value')), - array('ORM::tostring', array(':value')), - ), - 'date_stop'=>array( - array('strtotime', array(':value')), - array('ORM::tostring', array(':value')), - ), - )); - } - - public function rules() { - $x = parent::rules(); - - unset($x['id']); - - return Arr::merge($x,array( - 'date_start'=>array( - array('not_empty'), - ), - 'date_stop'=>array( - array('not_empty'), - array(array($this,'validate_datestop'),array(':validation')), - ), - 'code' => array( - array(array($this,'validate_absentnoshow'),array(':validation',':value')), - array(array($this,'validate_absentnotice'),array(':validation',':value')), - array(array($this,'validate_casualrequest'),array(':validation',':value')), - ), - )); - } - - protected $_display_filters = array( - 'date_start'=>array( - array('Site::Date',array(':value')), - ), - 'date_stop'=>array( - array('Site::Date',array(':value')), - ), - ); - - public function day($day) { - return $this->{'d_'.$day}; - } - - /** - * Has a day been selected - */ - public function have_days() { - for ($i=0;$i<7;$i++) - if ($this->day($i)) - return TRUE; - - return FALSE; - } - - /** - * No show date cannot be in the future - */ - public function validate_absentnoshow($array,$code) { - return ($code != 'A') OR ($array['date_start'] < time()); - } - - /** - * Notice date cannot be in the past - */ - public function validate_absentnotice($array,$code) { - return ($code != 'a') OR ($array['date_start'] > time()); - } - - /** - * Casual Request cannot be in the past - */ - public function validate_casualrequest($array,$code) { - return ($code != 'c') OR ($array['date_start'] > time()); - } - - /** - * End date cannot be earlier than start date - */ - public function validate_datestop($array) { - return $array['date_start'] <= $array['date_stop']; - } - - /** - * Since we use checkboxes for dates, we need to unselect dates not selected - */ - public function values(array $values, array $expected = NULL) { - for ($i=0;$i<7;$i++) - if ($this->day($i) AND empty($values['d_'.$i])) - $this->{'d_'.$i} = NULL; - - return parent::values($values,$expected); - } -} -?> diff --git a/application/classes/Model/Room/Dates.php b/application/classes/Model/Room/Dates.php deleted file mode 100644 index 872f837..0000000 --- a/application/classes/Model/Room/Dates.php +++ /dev/null @@ -1,19 +0,0 @@ -{'d_'.$day} ? $this->{'d_'.$day} : 0; - } -} -?> diff --git a/application/classes/Model/Rooms.php b/application/classes/Model/Rooms.php deleted file mode 100644 index af17def..0000000 --- a/application/classes/Model/Rooms.php +++ /dev/null @@ -1,145 +0,0 @@ -array('model'=>'Setup'), - ); - protected $_has_many = array( - 'dates'=>array('model'=>'Room_Dates','far_key'=>'id','foreign_key'=>'room_id'), - 'children'=>array('model'=>'Room_Children','far_key'=>'id','foreign_key'=>'room_id'), - ); - - protected $_form = array('id'=>'id','value'=>'name'); - - public function availability_dates($date,$days=0,$code='A') { - $result = array(); - $x = $date; - - $date_end = $date+$days*86400; - $open_dates = $this->site->open_dates($date,$days); - foreach ($this->dates->where('code','=',$code)->where_startstop($date,$date_end)->find_all() as $o) { - $x = $date; - - while ($x<$date_end) { - if (($o->date_start <= $x AND (is_null($o->date_stop) OR $o->date_stop >= $x)) - OR ($o->date_stop >= $x AND (is_null($o->date_start) OR $o->date_start <= $x)) - OR (is_null($o->date_start) AND is_null($o->date_start))) { - - $result[$x] = $o->avail(date('w',$x)); - - $x += 86400; - continue; - } - - if (! isset($result[$x]) OR ! $result[$x]) - $result[$x] = 0; - - $x += 86400; - } - } - - // If we broke out and our date $days hasnt ben evaluated, we are closed - while ($x<$date_end) { - if (! isset($result[$x]) OR ! $result[$x]) - $result[$x] = 0; - - $x += 86400; - } - - return $result; - } - - // 'P' - Permanent - public function child_list_date($date,$days,$code='P') { - $result = array(); - $x = $date; - - // We need to set this, so that unassigned room records are found. - if (! $this->loaded()) - $this->site_id = Company::instance()->site(); - - $date_end = $date+$days*86400; - $open_dates = $this->site->open_dates($date,$days); - foreach ($this->children->where('code','=',$code)->where_startstop($date,$date_end)->find_all() as $o) { - $x = $date; - - while ($x<$date_end) { - // If we havent made the start date yet, we need to advance - if (! $open_dates[$x] - OR ($o->date_start > $x AND (is_null($o->date_stop) OR $o->date_stop > $date_end)) - OR ((is_null($o->date_start) OR $o->date_start > $x) AND $o->date_stop > $date_end)) { - - if (! isset($result[$x]) OR ! $result[$x]) - $result[$x] = array(); - - $x += 86400; - continue; - } - - // Check that this record covers our current date - if ($o->date_stop < $x AND ! is_null($o->date_stop)) - break; - - if (! isset($result[$x])) - $result[$x] = array(); - - if ($o->day(date('w',$x))) - array_push($result[$x],$o->child); - - $x += 86400; - } - } - - // If we broke out and our date $days hasnt ben evaluated, we are closed - while ($x<$date_end) { - if (! isset($result[$x]) OR ! $result[$x]) - $result[$x] = array(); - - $x += 86400; - } - - return $result; - } - - public function room_availablity($date,$days) { - // We start with our availablity - $result = $this->availability_dates($date,$days); - - // Less Permanents - foreach ($this->child_list_date($date,$days) as $k => $v) - $result[$k] -= count($v); - - // Add Absent - foreach ($this->child_list_date($date,$days,'a') as $k => $v) - $result[$k] += count($v); - - // Less Casuals - foreach ($this->child_list_date($date,$days,'C') as $k => $v) - $result[$k] -= count($v); - - // Less Waitlist - foreach ($this->child_list_date($date,$days,'W') as $k => $v) - $result[$k] -= count($v); - - return $result; - } - - /** - * Rooms marked with the internal flag are the actual rooms that children are assigned in - * but cannot have an enrolment application for (there may be multiple rooms for the program). - * Thus a non "internal" room should be used for enrolments for the program. - */ - public function where_external() { - return $this->where_open()->where('internal','is',NULL)->or_where('internal','=',0)->where_close(); - } -} -?> diff --git a/application/classes/Model/Setup.php b/application/classes/Model/Setup.php deleted file mode 100644 index 9ccb574..0000000 --- a/application/classes/Model/Setup.php +++ /dev/null @@ -1,192 +0,0 @@ -array('foreign_key'=>'id','far_key'=>'admin_id'), - 'country'=>array('foreign_key'=>'id','far_key'=>'country_id'), - 'language'=>array('foreign_key'=>'id','far_key'=>'language_id'), - ); - - protected $_has_many = array( - 'dates'=>array('model'=>'Site_Dates','far_key'=>'id','foreign_key'=>'site_id'), - 'rooms'=>array('far_key'=>'id','foreign_key'=>'site_id'), - ); - - protected $_compress_column = array( - 'module_config', - 'site_details', - ); - - // Validation rules - public function rules() { - $x = Arr::merge(parent::rules(), array( - 'url' => array( - array('not_empty'), - array('min_length', array(':value', 8)), - array('max_length', array(':value', 127)), - array('url'), - ), - )); - - // This module doesnt use site_id. - unset($x['site_id']); - - return $x; - } - - /** - * Get/Set Module Configuration - * - * @param $key Module name. - * @param $value Values to store. If NULL, retrieves the value stored, otherwise stores value. - */ - public function module_config($key,array $value=NULL) { - // If we are not loaded, we dont have any config. - if (! $this->loaded() OR (is_null($value) AND ! $this->module_config)) - return array(); - - $mo = ORM::factory('Module',array('name'=>$key)); - - if (! $mo->loaded()) - throw new Kohana_Exception('Unknown module :name',array(':name'=>$key)); - - $mc = $this->module_config ? $this->module_config : array(); - - // If $value is NULL, we are a getter - if ($value === NULL) - return empty($mc[$mo->id]) ? array() : $mc[$mo->id]; - - // Store new value - $mc[$mo->id] = $value; - $this->module_config = $mc; - - return $this; - } - - public function available_places($date_start,$days=0) { - $result = array(); - - foreach ($this->rooms->find_all() as $ro) { - foreach ($ro->room_availablity($date_start,$days) as $date => $total) { - if (! isset($result[$date])) - $result[$date] = 0; - - $result[$date] += $total; - } - } - - return $result; - } - - public function module_config_id($key=NULL) { - $result = array(); - - foreach (array_keys($this->module_config) as $mid) { - if (is_null($key) OR $key == $mid) { - $result[$mid] = array( - 'object'=>ORM::factory('Module',$mid), - 'data'=>$this->module_config[$mid], - ); - - // If we are just after our key, we can continue here - if ($key AND $key==$mid) - break; - } - } - - return $result; - } - - public function open_days() { - $result = array(); - - //@todo this needs to change to node have any dates, since the current date may be closed, or a public holiday - foreach ($this->open_dates(Site::DateStartOfWeek(time()),7) as $date => $open) - $result[date('w',$date)] = $open; - - ksort($result); - - return $result; - } - - public function open_dates($date,$days=0,$code='O') { - $result = array(); - - $date_end = $date+$days*86400; - foreach ($this->dates->where('code','=',$code)->where_startstop($date,$date_end)->find_all() as $o) - while ($date<$date_end) { - // If we havent made the start date yet, we need to advance - if ($o->date_start > $date AND $o->date_stop > $date_end) { - $result[$date] = FALSE; - $date += 86400; - continue; - } - - // Check that this record covers our current date - if ($o->date_stop < $date) - break; - - $result[$date] = $o->open(date('w',$date)) ? TRUE : FALSE; - $date += 86400; - } - - // If we broke out and our date $days hasnt ben evaluated, we are closed - while ($date<$date_end) { - $result[$date] = FALSE; - $date += 86400; - } - - return $result; - } - - /** - * Get/Set our Site Configuration from the DB - * - * @param $key Key - * @param $value Values to store. If NULL, retrieves the value stored, otherwise stores value. - */ - public function site_details($key,array $value=NULL) { - if (! in_array($key,array('name','address1','address2','city','state','pcode','phone','fax','email','faqurl'))) - throw new Kohana_Exception('Unknown Site Configuration Key :key',array(':key'=>$key)); - - // If $value is NULL, we are a getter - if ($value === NULL) - return empty($this->site_details[$key]) ? '' : $this->site_details[$key]; - - // Store new value - $sc[$key] = $value; - - return $this; - } - - public function total_places($date_start,$days=0) { - $result = array(); - - foreach ($this->rooms->find_all() as $ro) { - foreach ($ro->availability_dates($date_start,$days) as $date => $total) { - if (! isset($result[$date])) - $result[$date] = 0; - - $result[$date] += $total; - } - } - - return $result; - } -} -?> diff --git a/application/classes/Model/Site/Dates.php b/application/classes/Model/Site/Dates.php deleted file mode 100644 index 40b1b18..0000000 --- a/application/classes/Model/Site/Dates.php +++ /dev/null @@ -1,79 +0,0 @@ -array( - array('Site::date',array(':value')), - ), - 'date_stop'=>array( - array('Site::date',array(':value')), - ), - ); - - /** - * List our codes - * CODE: - * + O (open) - site is open for business (start/end cannot overlap) - * + S (school year) - this is a year for school terms @see mdb_term_dates (only year is used from start) - * @todo: Code O (open) start/end dates cannot overlap with existing records - put in validation that it cannot be saved. - */ - public function codes() { - return [ - 'O'=>'Open', - 'S'=>'School Year', - ]; - } - - /** - * Return if this day is open - */ - public function open($day) { - return $this->{'d_'.$day}; - } - - public function where_year($year) { - $id = 0; - foreach ($this->list_years() as $k => $v) - if ($v == $year) { - $id = $k; - break; - } - - // If we get hear, we didnt find the years - return ORM::factory('Site_Dates',$id ? $id : NULL); - } - - /** - * Return the year this record peratins to - * @note: Only valid for School Years (code S) - */ - public function year() { - if ($this->code != 'S') - throw HTTP_Exception::factory(501,'Invalid call to :method, code [:code] is incorrect',[':method'=>__METHOD__,':code'=>$this->code]); - - return $this->date_start ? date('Y',$this->date_start) : NULL; - } - - public function list_years() { - $result = array(); - - foreach (ORM::factory('Site_Dates')->where('code','=','S')->where('date_stop','>',time())->find_all()->as_array() as $sdo) - $result[$sdo->id] = $sdo->year(); - - return $result; - } -} -?> diff --git a/application/classes/ORM.php b/application/classes/ORM.php deleted file mode 100644 index 40c96f5..0000000 --- a/application/classes/ORM.php +++ /dev/null @@ -1,58 +0,0 @@ -module_config($this->_object_name); - - return empty($mc[$key]) ? '' : $mc[$key]; - } - - /** - * Function help to find records that are active - */ - public function list_active($active=TRUE) { - $x=($active ? $this->where_active() : $this); - - return $x->find_all(); - } - - public function list_count($active=TRUE) { - $x=($active ? $this->where_active() : $this); - - return $x->find_all()->count(); - } - - public function where_active() { - return $this->where($this->_table_name.'.active','=',TRUE); - } - - public function where_startstop($date,$date_end,$start='date_start',$stop='date_stop') { - if (array_key_exists('priority',$this->table_columns())) - $this->order_by('priority','ASC'); - - return $this - ->where_open() - ->where_open()->where($start,'<=',$date)->and_where($stop,'>=',$date)->where_close() - ->or_where_open()->where($start,'<=',$date_end)->and_where($stop,'>=',$date_end)->where_close() - ->or_where_open()->where($start,'is',NULL)->where_open()->where($stop,'is',NULL)->or_where($stop,'>=',$date)->where_close()->where_close() - ->or_where_open()->where($stop,'is',NULL)->where_open()->where($start,'is',NULL)->or_where($start,'<=',$date_end)->where_close()->where_close() - ->where_close() - ->order_by($start,'ASC') - ->order_by($stop,'ASC'); - } -} -?> diff --git a/application/classes/Request.php b/application/classes/Request.php deleted file mode 100644 index f881439..0000000 --- a/application/classes/Request.php +++ /dev/null @@ -1,28 +0,0 @@ -request_mmo($this)); - } -} -?> diff --git a/application/classes/Site.php b/application/classes/Site.php deleted file mode 100644 index 2f1780d..0000000 --- a/application/classes/Site.php +++ /dev/null @@ -1,50 +0,0 @@ -date_format(),$date); - } - - public static function DateEndOfWeek($date) { - return strtotime(self::$_weekend.' this week',$date); - } - - public static function DateStartOfWeek($date) { - return strtotime(self::$_weekstart.' this week',$date); - } - - /** - * Work out our site ID for multihosting - */ - public static function ID($format=FALSE) { - return Company::instance()->site($format); - } - - public static function Theme() { - // If we are using user admin pages (and login), we'll choose the admin theme. - return 'theme/'.(URL::admin_url() ? Kohana::$config->load('config')->theme_admin : Kohana::$config->load('config')->theme); - } - - /** - * Show a date using a site configured format - */ - public static function Time($date) { - return date(Company::instance()->time_format(),($date ? $date : time())); - } -} -?> diff --git a/application/classes/StaticList/Room/Children.php b/application/classes/StaticList/Room/Children.php deleted file mode 100644 index aa0c826..0000000 --- a/application/classes/StaticList/Room/Children.php +++ /dev/null @@ -1,31 +0,0 @@ -_('Absent NoShow'), - 'a'=>_('Absent Notice'), - 'C'=>_('Casual Placement'), - 'c'=>_('Casual Request'), - 'r'=>_('Reduce Days'), - 'P'=>_('Permanent'), - 'w'=>_('Waitlist'), - ); - } - - public static function get($value) { - return self::factory()->_get($value); - } -} -?> diff --git a/application/classes/URL.php b/application/classes/URL.php deleted file mode 100644 index c6d6a67..0000000 --- a/application/classes/URL.php +++ /dev/null @@ -1,44 +0,0 @@ -'a', - 'director'=>'d', - 'committee'=>'c', - 'user'=>'u', - ); - - public static function navbar() { - $result = array(); - - foreach (array_reverse(self::$method_directory) as $k=>$v) - switch ($k) { - case 'admin': $result[$k] = array('name'=>'Administrator','icon'=>'fa-globe'); - break; - - case 'director': $result[$k] = array('name'=>'Director','icon'=>'fa-th-list'); - break; - - case 'committee': $result[$k] = array('name'=>'Committee','icon'=>'fa-th-list'); - break; - - case 'user': $result[$k] = array('name'=>Auth::instance()->get_user()->name(),'icon'=>'fa-user'); - break; - - default: $result[$k] = array('name'=>$k,'icon'=>'fa-question'); - } - - return $result; - } -} -?> diff --git a/application/config/config.php b/application/config/config.php deleted file mode 100644 index ba892e8..0000000 --- a/application/config/config.php +++ /dev/null @@ -1,9 +0,0 @@ - 'Membership Database', - 'language' => 'en_AU', - 'theme' => 'focusbusiness', - 'theme_admin' => 'baseadmin', -); diff --git a/application/config/database.php b/application/config/database.php deleted file mode 100644 index feeb115..0000000 --- a/application/config/database.php +++ /dev/null @@ -1,31 +0,0 @@ - array - ( - 'type' => 'MySQL', - 'connection' => array( - /** - * The following options are available for MySQL: - * - * string hostname server hostname, or socket - * string database database name - * string username database username - * string password database password - * boolean persistent use persistent connections? - * array variables system variables as "key => value" pairs - * - * Ports and sockets may be appended to the hostname. - */ - 'hostname' => 'mysql.leenooks.vpn', - 'database' => 'weblnebcccmdb', - 'username' => 'ln-ebccc', - 'password' => 'ebccc', - 'persistent' => TRUE, - ), - 'table_prefix' => 'mdb_', - 'charset' => 'utf8', - 'caching' => TRUE, - ), -); diff --git a/application/messages/models/room_children.php b/application/messages/models/room_children.php deleted file mode 100644 index 77c20e5..0000000 --- a/application/messages/models/room_children.php +++ /dev/null @@ -1,27 +0,0 @@ -array( - 'not_empty'=>'End Date cannot be empty', - ), - 'date_stop'=>array( - 'not_empty'=>'End Date cannot be empty', - 'validate_datestop'=>'End Date cannot be earlier than Start Date', - ), - 'code'=>array( - 'validate_absentnoshow'=>'Absent No Show date cant be in the future', - 'validate_absentnotice'=>'Absent Notice date cant be in the past', - 'validate_casualrequest'=>'Casual Request date cant be in the past', - ), -); -?> diff --git a/application/views/child/director/add_edit.php b/application/views/child/director/add_edit.php deleted file mode 100644 index 35c8efc..0000000 --- a/application/views/child/director/add_edit.php +++ /dev/null @@ -1,65 +0,0 @@ -
- id); ?> - -
- -
-
- display('first_name'),array('class'=>'form-control','placeholder'=>'First Name','required','nocg'=>TRUE)); ?> -
-
- display('family_name'),array('class'=>'form-control','placeholder'=>'Family Name','required','nocg'=>TRUE)); ?> -
-
-
- -
- -
-
- display('dob'),array('class'=>'form-control','placeholder'=>'DOB','required','nocg'=>TRUE,'readonly')); ?> - -
-
-
- Age:
dob ? $o->age() : ''; ?>

-
-
- -
- -
- - - - - - open_days() as $d => $open) : ?> - - - - - - - - subitems() as $rco) echo View::factory('child/director/add_roomrow')->set('o',$o)->set('so',$so)->set('rco',$rco)->set('row',$x++)->set('type',$rco->code); ?> - -
RoomP/C/WStart and End Dates
-
- - - - - - - -
-
-
- -
-
- - -
-
diff --git a/application/views/child/director/add_roomrow.php b/application/views/child/director/add_roomrow.php deleted file mode 100644 index 417e115..0000000 --- a/application/views/child/director/add_roomrow.php +++ /dev/null @@ -1,64 +0,0 @@ - - id); ?> - - 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)); - } - ?> - - id) ? StaticList_Room_Children::get($rco->code) : StaticList_Room_Children::form(sprintf('room[%s][code]',$row),$rco->code ? $rco->code : $type,FALSE,array('class'=>'form-control','nocg'=>TRUE)); - } - ?> - - open_days() as $d => $open) : ?> - - loaded()) : ?> - - - day($d)): ?> - code,array('a','P','w','c'))) : ?> - day($d) ? TRUE : FALSE,array('nocg'=>TRUE,($open ? '': 'disabled'))); ?> - - - - - code,array('C'))) : ?> - day($d) ? TRUE : FALSE,array('nocg'=>TRUE,($open ? '': 'disabled'))); ?> - -   - - - - - day($d) ? TRUE : FALSE,array('nocg'=>TRUE,($open ? '': 'disabled'))); ?> - - - - - -
loaded()) : ?>data-date-start-date="display('dob'); ?>" data-date-end-date="date_enrol_max(TRUE); ?>" data-date-today-btn="true"> -
- date_start ? $rco->display('date_start') : Site::Date(time()),array('class'=>'form-control','placeholder'=>'Start','nocg'=>TRUE,'readonly')); ?> - to - date_stop ? $rco->display('date_stop') : '',array('class'=>'form-control','placeholder'=>'End','nocg'=>TRUE,'readonly')); ?> -
- - diff --git a/application/views/child/user/add_edit.php b/application/views/child/user/add_edit.php deleted file mode 100644 index 470a395..0000000 --- a/application/views/child/user/add_edit.php +++ /dev/null @@ -1,65 +0,0 @@ -
- Register Child - - id); ?> - -
- -
-
- display('first_name'),array('class'=>'form-control','placeholder'=>'First Name','required','nocg'=>TRUE)); ?> -
-
- display('family_name'),array('class'=>'form-control','placeholder'=>'Family Name','required','nocg'=>TRUE)); ?> -
-
-
- -
- -
-
- display('dob'),array('class'=>'form-control','placeholder'=>'DOB','required','nocg'=>TRUE,'readonly')); ?> - -
-
-
- Age:
dob ? $o->age() : ''; ?>

-
-
- -
- -
- - - - - - open_days() as $d => $open) : ?> - - - - - - - - - subitems() as $rco) echo View::factory('child/user/add_roomrow')->set('o',$o)->set('so',$so)->set('rco',$rco)->set('row',$x++)->set('type',$rco->code); ?> - -
RoomP/C/WStart DateEnd Date
-
- - - - -
-
-
- -
-
- - -
-
diff --git a/application/views/child/user/add_roomrow.php b/application/views/child/user/add_roomrow.php deleted file mode 100644 index 13fd1e8..0000000 --- a/application/views/child/user/add_roomrow.php +++ /dev/null @@ -1,66 +0,0 @@ - - - - code,$allowed_updates) ? $rco->id : NULL); ?> - - 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)); - } - ?> - - 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)); - } - ?> - - open_days() as $d => $open) : ?> - - loaded()) : ?> - - - day($d)): ?> - code,$allowed_updates)) : ?> - day($d) ? TRUE : FALSE,array('nocg'=>TRUE,($open ? '': 'disabled'))); ?> - - - - -   - - - - day($d) ? TRUE : FALSE,array('nocg'=>TRUE,($open ? '': 'disabled'))); ?> - - - - - -
- date_start ? $rco->display('date_start') : Site::Date(time()),array('class'=>'form-control','placeholder'=>'Start','nocg'=>TRUE,'readonly')); ?> - - - -
- date_stop ? $rco->display('date_stop') : '',array('class'=>'form-control','placeholder'=>'End','nocg'=>TRUE,'readonly')); ?> - -
- - diff --git a/application/views/enrol/child.php b/application/views/enrol/child.php deleted file mode 100644 index 6cda4a8..0000000 --- a/application/views/enrol/child.php +++ /dev/null @@ -1,44 +0,0 @@ -
- -set('data',['field'=>'room[id]','value'=>ORM::factory('Rooms')->where_external()->list_select(),'default'=>$room_id,'text'=>'Program','class'=>'col-md-4']); -?> -
- Child Details - -set('data',['field'=>'child[first_name]','value'=>$co->first_name,'text'=>'First Name','class'=>'col-md-5']); - echo View::factory('field/text')->set('data',['field'=>'child[family_name]','value'=>$co->family_name,'text'=>'Last Name','class'=>'col-md-5']); - echo View::factory('field/date')->set('data',['field'=>'child[dob]','value'=>$co->dob ? $co->dob : time(),'text'=>'Date of Birth','enddate'=>'new Date()']); -?> - -
- -
- Parent Details - -set('data',['field'=>'account[first_name]','value'=>$ao->first_name,'text'=>'First Name','class'=>'col-md-5']); - echo View::factory('field/text')->set('data',['field'=>'account[last_name]','value'=>$ao->last_name,'text'=>'Last Name','class'=>'col-md-5']); - echo View::factory('field/text')->set('data',['field'=>'account[email]','value'=>$ao->email,'text'=>'Email','class'=>'col-md-5']); - echo View::factory('field/text')->set('data',['field'=>'account[address1]','value'=>$ao->address1,'text'=>'Address','class'=>'col-md-5']); - echo View::factory('field/text')->set('data',['field'=>'account[address2]','value'=>$ao->address2,'text'=>'Address','class'=>'col-md-5']); - echo View::factory('field/text')->set('data',['field'=>'account[city]','value'=>$ao->city,'text'=>'City','class'=>'col-md-5']); - echo View::factory('field/text')->set('data',['field'=>'account[state]','value'=>$ao->state ? $ao->state : 'Vic','text'=>'State','class'=>'col-md-1']); - echo View::factory('field/text')->set('data',['field'=>'account[zip]','value'=>$ao->zip,'text'=>'Post Code','class'=>'col-md-1']); -?> - - - - -
- - -
-

Thank you for your enrolment. An enrolment application of $10 will be invoiced to the email address you have included above.

-

This fee must be paid within 2 days for your application to be accepted. Paying this fee via the method in the email will also confirm that your email address is correct.

-

We send all correspondence via email, so if you change your email, or dont recieve the enrolment application invoice via email, please contact us.

-

This application will be automatically deleted in 2 days if your payment has not been received. - - -

diff --git a/application/views/enrol/selectyear.php b/application/views/enrol/selectyear.php deleted file mode 100644 index 61c46ca..0000000 --- a/application/views/enrol/selectyear.php +++ /dev/null @@ -1,8 +0,0 @@ -
- -set('data',['field'=>'year','value'=>ORM::factory('Site_Dates')->list_years(),'default'=>date('Y',time()),'text'=>'Year','class'=>'col-md-4']); -?> - - -
diff --git a/application/views/room/availability.php b/application/views/room/availability.php deleted file mode 100644 index b5d37bf..0000000 --- a/application/views/room/availability.php +++ /dev/null @@ -1,146 +0,0 @@ -
- Room Summary next Days - -
- -
-
- 'caldate','class'=>'form-control','required','nocg'=>TRUE,'readonly','onchange'=>'submit()')); ?> - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - child_list_date($date,$days,'w')) as $x) : ?> - - - - - - - - - - - - - - - - - - - - - - 'Permanent', - 'a'=>'Absent', - 'C'=>'Casual', - ) as $code => $title) : ?> - - - - - - child_list_date($date,$days,$code) as $day=>$x) : ?> - - - - - - - - - - - - - - child_list_date($date,$days,'w') as $day=>$x) : ?> - - - - - - - - - - child_list_date($date,$days,'c') as $day=>$x) : ?> - - - - - - - - - - - room_availablity($date,$days)) as $x) : ?> - - - - - - -
 >'); ?>
Open get(isset($open_dates[$day]) ? $open_dates[$day] : FALSE,TRUE); ?> 
Total  
Availability  
New Applications  
 
display('name'); ?> 
 Capacity ',array_values($ro->availability_dates($date,$days))); ?> 
 id,$date,$code)),$title); ?> id,$day,$code)),count($x)); ?> 
 
 id.':'.$date.':w:7'),'Waitlist'); ?> id.':'.$day.':w:1'),count($x)); ?> 
 id.':'.$date.':w:7'),'Casual Request'); ?> id.':'.$day.':c:1'),count($x)); ?> 
 Availability  
-
diff --git a/application/views/site/date/admin/add_edit.php b/application/views/site/date/admin/add_edit.php deleted file mode 100644 index 60bb17d..0000000 --- a/application/views/site/date/admin/add_edit.php +++ /dev/null @@ -1,15 +0,0 @@ -
- -
- Configure New Date Parameters - -set('data',['field'=>'code','value'=>Arr::Merge([''=>''],$o->codes()),'text'=>'Code','default'=>$o->code,'class'=>'col-md-4']); - echo View::factory('field/date')->set('data',['field'=>'date_start','value'=>$o->date_start ? $o->date_start : time(),'text'=>'Date Start']); - echo View::factory('field/date')->set('data',['field'=>'date_stop','value'=>$o->date_stop ? $o->date_stop : time(),'text'=>'Date Stop']); -?> - -
- - -
diff --git a/application/views/site/date/list.php b/application/views/site/date/list.php deleted file mode 100644 index ce7acc3..0000000 --- a/application/views/site/date/list.php +++ /dev/null @@ -1,14 +0,0 @@ - -page_items(50) - ->data($o) - ->columns(array( - 'id'=>'ID', - 'code'=>'Code', - 'date_start'=>'Date Start', - 'date_stop'=>'Date End', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('admin','site_date/edit/')), - )); -?> diff --git a/application/views/welcome/user/shortcuts.php b/application/views/welcome/user/shortcuts.php deleted file mode 100644 index d299138..0000000 --- a/application/views/welcome/user/shortcuts.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/includes/kohana b/includes/kohana deleted file mode 160000 index 898371c..0000000 --- a/includes/kohana +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 898371c849356932afe44d00f29f881430792c46 diff --git a/index.php b/index.php deleted file mode 100644 index c7bb26f..0000000 --- a/index.php +++ /dev/null @@ -1,131 +0,0 @@ -= 5.3, it is recommended to disable - * deprecated notices. Disable with: E_ALL & ~E_DEPRECATED - */ -error_reporting(E_ALL | E_STRICT); - -/** - * End of standard configuration! Changing any of the code below should only be - * attempted by those with a working knowledge of Kohana internals. - * - * @link http://kohanaframework.org/guide/using.configuration - */ - -// Set the full path to the docroot -define('DOCROOT', realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR); - -// Make the application relative to the docroot, for symlink'd index.php -if ( ! is_dir($application) AND is_dir(DOCROOT.$application)) - $application = DOCROOT.$application; - -// Make the modules relative to the docroot, for symlink'd index.php -if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules)) - $modules = DOCROOT.$modules; - -// Make the system relative to the docroot, for symlink'd index.php -if ( ! is_dir($sysmodules) AND is_dir(DOCROOT.$sysmodules)) - $sysmodules = DOCROOT.$sysmodules; - -// Make the system relative to the docroot, for symlink'd index.php -if ( ! is_dir($system) AND is_dir(DOCROOT.$system)) - $system = DOCROOT.$system; - -// Define the absolute paths for configured directories -define('APPPATH', realpath($application).DIRECTORY_SEPARATOR); -define('MODPATH', realpath($modules).DIRECTORY_SEPARATOR); -define('SMDPATH', realpath($sysmodules).DIRECTORY_SEPARATOR); -define('SYSPATH', realpath($system).DIRECTORY_SEPARATOR); - -// Clean up the configuration vars -unset($application, $modules, $sysmodules, $system); - -if (file_exists('install'.EXT)) -{ - // Load the installation check - return include 'install'.EXT; -} - -/** - * Define the start time of the application, used for profiling. - */ -if ( ! defined('KOHANA_START_TIME')) -{ - define('KOHANA_START_TIME', microtime(TRUE)); -} - -/** - * Define the memory usage at the start of the application, used for profiling. - */ -if ( ! defined('KOHANA_START_MEMORY')) -{ - define('KOHANA_START_MEMORY', memory_get_usage()); -} - -// Bootstrap the application -require APPPATH.'bootstrap'.EXT; - -if (PHP_SAPI == 'cli') // Try and load minion -{ - class_exists('Minion_Task') OR die('Please enable the Minion module for CLI support.'); - set_exception_handler(array('Minion_Exception', 'handler')); - - Minion_Task::factory(Minion_CLI::options())->execute(); -} -else -{ - /** - * Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO']. - * If no source is specified, the URI will be automatically detected. - */ - echo Request::factory(TRUE, array(), FALSE) - ->execute() - ->send_headers(TRUE) - ->body(); -} diff --git a/modules/lnapp b/modules/lnapp deleted file mode 160000 index f5bc5df..0000000 --- a/modules/lnapp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f5bc5dfa296a1517ebdb29b2dd0f81b09f136b6a diff --git a/modules/lnauth b/modules/lnauth deleted file mode 160000 index ceb8159..0000000 --- a/modules/lnauth +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ceb8159826a20dc11e4df61e036dfa9a2d2e3d73