2010-11-29 22:41:08 +00:00
|
|
|
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class is for access company informaiton.
|
|
|
|
*
|
|
|
|
* @package OSB
|
|
|
|
* @subpackage Page
|
|
|
|
* @category Helpers
|
|
|
|
* @author Deon George
|
|
|
|
* @copyright (c) 2010 Deon George
|
|
|
|
* @license http://dev.leenooks.net/license.html
|
|
|
|
*/
|
|
|
|
class Company {
|
|
|
|
public static function instance() {
|
|
|
|
return new Company;
|
|
|
|
}
|
|
|
|
|
2011-05-02 12:28:17 +00:00
|
|
|
public static function street() {
|
|
|
|
// @todo Details should be obtained from DB
|
|
|
|
return 'PO Box 149';
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function city() {
|
|
|
|
// @todo Details should be obtained from DB
|
|
|
|
return 'Bendigo';
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function state() {
|
|
|
|
// @todo Details should be obtained from DB
|
|
|
|
return 'VIC';
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function pcode() {
|
|
|
|
// @todo Details should be obtained from DB
|
|
|
|
return '3550';
|
|
|
|
}
|
|
|
|
|
2010-11-29 22:41:08 +00:00
|
|
|
public static function address($ln='<br/>') {
|
2011-05-02 12:28:17 +00:00
|
|
|
return implode($ln,array(static::street(),sprintf('%s, %s %s',static::city(),static::state(),static::pcode())));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function phone() {
|
|
|
|
// @todo Company phone should be obtained from db
|
|
|
|
return '03 5410 1135';
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function fax() {
|
|
|
|
// @todo Details should be obtained from DB
|
|
|
|
return '03 5410 1145';
|
2010-11-29 22:41:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function contacts() {
|
2011-05-02 12:28:17 +00:00
|
|
|
return 'Tel: '.static::phone();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function bsb() {
|
|
|
|
// @todo Details should be obtained from DB
|
|
|
|
return Kohana::config('config.bsb');
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function account() {
|
|
|
|
// @todo Details should be obtained from DB
|
|
|
|
return Kohana::config('config.accnum');
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function taxid() {
|
|
|
|
// @todo Details should be obtained from DB
|
|
|
|
return Kohana::config('config.taxid');
|
2010-11-29 22:41:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function render() {
|
|
|
|
echo static::name();
|
|
|
|
echo static::address();
|
|
|
|
echo static::contacts();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the HTML to render the company address
|
|
|
|
*/
|
|
|
|
public function __toString() {
|
|
|
|
try {
|
|
|
|
return static::render();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Display the exception message
|
|
|
|
catch (Exception $e) {
|
|
|
|
Kohana::exception_handler($e);
|
|
|
|
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|