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

50 lines
1.3 KiB
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Membership Database Main home page
*
* @package Membership Database
* @category Controllers/User
* @author Deon George
* @copyright (c) 2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Controller_User_Welcome extends Controller_Welcome {
protected $auth_required = TRUE;
protected $secure_actions = array(
'index'=>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'));
}
}
?>