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.
khosb/application/classes/company.php

92 lines
1.9 KiB
PHP
Raw Normal View History

2010-11-29 22:41:08 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class is for access company information.
2010-11-29 22:41:08 +00:00
*
* @package OSB
* @subpackage System
2010-11-29 22:41:08 +00:00
* @category Helpers
* @author Deon George
* @copyright (c) 2010 Open Source Billing
* @license http://dev.osbill.net/license.html
2010-11-29 22:41:08 +00:00
*/
class Company {
public static function instance() {
return new Company;
}
public static function name() {
return Config::sitename();
}
2011-05-02 12:28:17 +00:00
public static function street() {
return Config::instance()->so->display('site_address');
2011-05-02 12:28:17 +00:00
}
public static function city() {
return Config::instance()->so->display('site_city');
2011-05-02 12:28:17 +00:00
}
public static function state() {
return Config::instance()->so->display('site_state');
2011-05-02 12:28:17 +00:00
}
public static function pcode() {
return Config::instance()->so->display('site_zip');
2011-05-02 12:28:17 +00:00
}
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() {
return Config::instance()->so->display('site_phone');
2011-05-02 12:28:17 +00:00
}
public static function fax() {
return Config::instance()->so->display('site_fax');
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 '';
}
}
}
?>