本文整理汇总了PHP中Core::config方法的典型用法代码示例。如果您正苦于以下问题:PHP Core::config方法的具体用法?PHP Core::config怎么用?PHP Core::config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core
的用法示例。
在下文中一共展示了Core::config方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDanhsachhoso
function getDanhsachhoso($iddv)
{
$luongcoban = Core::config('cbcc/luong/luongcoban');
$bhxh = Core::config('cbcc/luong/phantrambhxh') / 100;
$bhyt = Core::config('cbcc/luong/phantrambhyt') / 100;
$db = JFactory::getDbo();
$query = 'select hosochinh_id, hoten, congtac_chucvu,congtac_donvi_id, congtac_donvi,congtac_phong_id, congtac_phong, luong_mangach,
luong_heso, congtac_chucvu_heso ,luong_vuotkhung, luong_phucap_trachnhiem, hs.e_code , ht.name, ht.s_name
from hosochinh_quatrinhhientai as hsht
INNER JOIN hosochinh as hs ON hs.id = hsht.hosochinh_id
INNER JOIN bc_hinhthuc as ht ON ht.id = hsht.bienche_hinhthuc_id
WHERE hsht.hoso_trangthai = "00" and congtac_donvi_id = ' . $db->quote($iddv) . ' ORDER BY congtac_phong_id ASC, congtac_chucvutuongduong ASC';
// -- , luong_phucap_trachnhiem;
$db->setQuery($query);
$data = $db->loadAssocList();
// var_dump($data); exit;
for ($i = 0; $i < count($data); $i++) {
$ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']] = $data[$i];
$ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['tongheso'] = $data[$i]['luong_heso'] + $data[$i]['congtac_chucvu_heso'] + $data[$i]['luong_phucap_trachnhiem'] + $data[$i]['luong_vuotkhung'];
$ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['luong_tt'] = $data[$i]['luong_heso'] * $luongcoban;
$ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['chucvu_tt'] = $data[$i]['congtac_chucvu_heso'] * $luongcoban;
$ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['trachnhiem_tt'] = $data[$i]['luong_phucap_trachnhiem'] * $luongcoban;
$ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['vuotkhung_tt'] = $data[$i]['luong_vuotkhung'] * $luongcoban * $data[$i]['luong_heso'] / 100;
$ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['tongthanhtien'] = ($data[$i]['luong_heso'] + $data[$i]['congtac_chucvu_heso'] + $data[$i]['luong_phucap_trachnhiem']) * $luongcoban + $ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['vuotkhung_tt'];
$ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['bhxh'] = $ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['tongthanhtien'] * $bhxh;
$ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['bhyt'] = $ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['tongthanhtien'] * $bhyt;
$ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['cong_truluong'] = $ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['bhxh'] + $ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['bhyt'];
$ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['tongtienluongnhan'] = $ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['tongthanhtien'] - $ar_data[$data[$i]['congtac_phong_id']]['data'][$data[$i]['hosochinh_id']]['cong_truluong'];
$ar_data[$data[$i]['congtac_phong_id']]['name'] = $data[$i]['congtac_phong'];
}
// var_dump($ar_data); exit;
return $ar_data;
}
示例2: action_form
/**
* [action_form] generates the form to pay at paypal
*/
public function action_form()
{
$this->auto_render = FALSE;
$order_id = $this->request->param('id');
$order = new Model_Order();
$order->where('id_order', '=', $order_id)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
if ($order->loaded()) {
// dependant on product we have different names
if ($order->id_product == Paypal::to_featured) {
$item_name = __('Advertisement to featured');
} else {
if ($order->id_product == Paypal::to_top) {
$item_name = __('Advertisement to top');
} else {
$item_name = $order->description . __(' category');
}
}
$paypal_url = Core::config('payment.sandbox') ? Paypal::url_sandbox_gateway : Paypal::url_gateway;
$paypal_data = array('order_id' => $order_id, 'amount' => number_format($order->amount, 2, '.', ''), 'site_name' => core::config('general.site_name'), 'site_url' => URL::base(TRUE), 'paypal_url' => $paypal_url, 'paypal_account' => core::config('payment.paypal_account'), 'paypal_currency' => core::config('payment.paypal_currency'), 'item_name' => $item_name);
$this->template = View::factory('paypal', $paypal_data);
$this->response->body($this->template->render());
} else {
Alert::set(Alert::INFO, __('Order could not be loaded'));
$this->request->redirect(Route::url('default'));
}
}
示例3: button
/**
* generates HTML for apy buton
* @param Model_Order $order
* @return string
*/
public static function button(Model_Order $order)
{
if (Core::config('payment.stripe_private') != '' and Core::config('payment.stripe_public') != '' and Theme::get('premium') == 1) {
return View::factory('pages/stripe/button', array('order' => $order));
}
return '';
}
示例4: initialise
public static function initialise()
{
self::$tplHandler = new TemplateLoader('db', 'default');
self::$preloadHandler = new PreloadFunctions('db');
include_once dirname(__FILE__) . '/config.php';
self::$config = $_CONFIG;
}
示例5: __construct
private function __construct() {
self::init();
self::$log = new Log();
self::log()->info = 'Starting, PID is '.getmypid();
if (VERBOSE > 5) {
self::log()->info = ' (__) ';
self::log()->info = ' (oo) ';
self::log()->info = ' /------\/ ';
self::log()->info = ' / | || ';
self::log()->info = ' * /\---/\ ';
self::log()->info = ' ~~ ~~ ';
self::log()->info = '...."Have you mooed today?"...';
}
self::$config = new Config();
self::$permission = new Permission();
self::$language = new Language(LANGUAGE);
if (VERBOSE > 0) self::log()->info = 'Loaded Config';
self::$bot = new Bot();
$modules = self::config()->config['modules'];
// load default modules
if (VERBOSE > 0) self::log()->info = 'Loading Modules';
foreach ($modules as $module) {
self::loadModule($module);
}
self::bot()->work();
}
示例6: action_pay
/**
* [action_form] generates the form to pay at paypal
*/
public function action_pay()
{
$this->auto_render = FALSE;
$order_id = $this->request->param('id');
$order = new Model_Order();
$order->where('id_order', '=', $order_id)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
if ($order->loaded()) {
// case when selling advert
if ($order->id_product == Model_Order::PRODUCT_AD_SELL) {
$paypal_account = $order->ad->paypal_account();
$currency = i18n::get_intl_currency_symbol();
if (isset($order->ad->cf_shipping) and Valid::numeric($order->ad->cf_shipping) and $order->ad->cf_shipping > 0) {
$order->amount = $order->amount + $order->ad->cf_shipping;
}
} else {
$paypal_account = core::config('payment.paypal_account');
$currency = core::config('payment.paypal_currency');
}
$paypal_url = Core::config('payment.sandbox') ? Paypal::url_sandbox_gateway : Paypal::url_gateway;
$paypal_data = array('order_id' => $order_id, 'amount' => number_format($order->amount, 2, '.', ''), 'site_name' => core::config('general.site_name'), 'site_url' => URL::base(TRUE), 'paypal_url' => $paypal_url, 'paypal_account' => $paypal_account, 'paypal_currency' => $currency, 'item_name' => $order->description);
$this->template = View::factory('paypal', $paypal_data);
$this->response->body($this->template->render());
} else {
Alert::set(Alert::INFO, __('Order could not be loaded'));
$this->redirect(Route::url('default'));
}
}
示例7: create
/**
* 创建Session
*
* @return void
*/
public function create()
{
session_name(Session::$config['name']);
$this->destroy();
$cookie_config = Core::config('cookie');
# 这里对IP+非80端口的需要特殊处理下,经试验,当这种情况下,设置session id的cookie的话会失败
if (preg_match('#^([0-9]+.[0-9]+.[0-9]+.[0-9]+):[0-9]+$#', $cookie_config['domain'], $m)) {
# IP:PORT 方式
$cookie_config['domain'] = $m[1];
}
$s_name = session_name();
if (Session::$config['type'] == 'url') {
$old_sid = HttpIO::COOKIE($s_name);
} else {
$old_sid = HttpIO::COOKIE($s_name);
}
if ($old_sid) {
# 校验Session ID
if (!Session::check_session_id($old_sid)) {
# 如果检验的Session ID不合法,则重新生成一个
session_id(Session::create_session_id());
}
} else {
# 设置Session ID
session_id(Session::create_session_id());
}
# Session ID 通过uri传递
if (Session::$config['type'] == 'url') {
@ini_set('session.use_cookies', 0);
@ini_set('session.use_only_cookies', 0);
} else {
session_set_cookie_params($cookie_config['httponly'] ? 0 : Session::$config['expiration'], $cookie_config['path'], $cookie_config['domain'], $cookie_config['secure'], $cookie_config['httponly']);
}
session_start();
}
示例8: start
public static function start()
{
// Gets current time, next update, and expiration.
// Note: i'm making the last two digits to zero. for rounding purposes.
self::$_NOW = BMK;
self::$_TTU = (int) substr((string) self::$_NOW + self::$_TTU, 0, -2) . '00';
self::$_EXP = (int) substr((string) self::$_NOW + self::$_EXP, 0, -2) . '00';
// set the session id with the IP, User-agent and the fingerkey
// TODO: Add username for login based frameworks
session_id(self::$_ID = md5($_SERVER['SERVER_ADDR'] . $_SERVER['HTTP_USER_AGENT'] . Core::config('sess_finger')));
// set the XML dom document, or create it if non existent.
if (file_exists(SESS . 'session')) {
XML::load(SESS . 'session');
} else {
XML::set(SESS . 'session');
}
// if we can't find the ID set, create it in the index..
if (!($element = XML::get_id(self::$_ID))) {
XML::append(array('tagname' => 'session', 'id' => self::$_ID, 'exp' => self::$_EXP));
}
// remove all expired sessions
self::gc(0);
// start session
session_start();
}
示例9: action_export
/**
* 导出项目为独立项目,并优化加载速度
*/
public function action_export()
{
$this->output('请选择你的项目:');
$i = 0;
$arr = array();
foreach (Core::config('core.projects') as $item) {
$i++;
$arr[$i] = $item;
$this->output($i . ':' . $item['name']);
}
$id = $this->input();
if (!isset($arr[$id])) {
$this->output('指定的项目错误');
return;
}
$this->output('请输入待导出的路径');
$str = $this->input();
if (is_dir($str)) {
$this->output('指定的路径已存在,是否将文件导出到此文件夹?yes or no');
$str = strtolower($this->input());
if ($str == 'no' || $str == 'n') {
$this->output('操作已取消');
return;
}
}
$this->output('now reading files...');
//TODO
}
示例10: action_default
/**
* 权限组列表
*/
public function action_default()
{
$this->quick_menu = array('administrator/group/add' => '添加权限组', 'administrator/' => '管理员列表', 'administrator/add' => '添加管理员');
if (!$this->session()->member()->perm()->is_own('administrator.view_group_info')) {
if ($this->session()->member()->perm()->is_own('administrator.can_edit_group')) {
$groups = $this->session()->member()->groups();
} else {
$this->message('抱歉,您无此权限');
}
}
$view = new View('admin/administrator/group_list');
if (isset($groups)) {
$view->list = $groups;
$view->group_manager = true;
} else {
if ($this->session()->member()->perm()->is_super_perm()) {
# 超级管理员列出所有组
$project = null;
} else {
$project = Core::$project;
}
$model_administrator = new Model_Admin_Administrator();
$count = $model_administrator->total_group_count($project);
if ($count) {
$pageconfig = Core::config('admin/pagination');
$pageconfig['total_items'] = $count;
$pagination = new Pagination($pageconfig);
$list = $model_administrator->get_group_list($project, $pagination->get_offset(), $pagination->get_items_per_page());
$view->list = $list;
$view->pagehtml = $pagination->render();
}
}
$view->render();
}
示例11: __construct
public function __construct($lang = null)
{
if (null === $lang) {
$core_lang = Core::config('core.lang');
if ($core_lang == 'auto') {
$core_lang = null;
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$accept = explode(';', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
foreach ($accept as $item) {
if (false !== ($pos = strpos($item, ','))) {
$item = substr($item, $pos + 1);
}
if (preg_match('#^[a-z\\-]+$#', $item)) {
# 尝试寻找语言包
if (Core::find_file('i18n', $item, 'lang')) {
$core_lang = $item;
break;
}
}
}
}
}
if (!$core_lang) {
$core_lang = Core_I18n::$default_lang;
}
$lang = $core_lang;
}
$this->lang = $lang;
}
示例12: action_pay
/**
* [action_form] generates the form to pay at paypal
*/
public function action_pay()
{
$this->auto_render = FALSE;
//sandobx doesnt do the x_receipt_link_url redirect so in sanbbox instead we put the order id
$id_order = Core::config('payment.twocheckout_sandbox') == 1 ? Core::request('x_receipt_link_url') : $this->request->param('id');
//retrieve info for the item in DB
$order = new Model_Order();
$order = $order->where('id_order', '=', $id_order)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
if ($order->loaded()) {
//its a fraud...lets let him know
if ($order->is_fraud() === TRUE) {
Alert::set(Alert::ERROR, __('We had, issues with your transaction. Please try paying with another paymethod.'));
$this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
}
if (($order_id = twocheckout::validate_passback($order)) !== FALSE) {
//mark as paid
$order->confirm_payment('2checkout', $order_id);
//redirect him to his ads
Alert::set(Alert::SUCCESS, __('Thanks for your payment!'));
$this->redirect(Route::url('oc-panel', array('controller' => 'profile', 'action' => 'orders')));
} else {
Alert::set(Alert::INFO, __('Please fill your card details.'));
$this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
}
} else {
Alert::set(Alert::INFO, __('Order could not be loaded'));
$this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
}
}
示例13: __construct
public function __construct($request, $response)
{
ignore_user_abort(TRUE);
parent::__construct($request, $response);
self::$db_prefix = Database::instance('default')->table_prefix();
self::$db_charset = Core::config('database.default.charset');
}
示例14: _construct
public static final function _construct()
{
self::$_CHR = Core::config('charset');
self::$_VER = Core::config('xml_version');
self::$_PWS = Core::config('xml_white_spaces');
self::$_FOU = Core::config('xml_format_output');
}
示例15: button
/**
* generates HTML for apy buton
* @param Model_Order $order
* @return string
*/
public static function button(Model_Order $order)
{
if (Core::config('payment.paymill_private') != '' and Core::config('payment.paymill_public') != '' and Theme::get('premium') == 1 and $order->loaded()) {
return View::factory('pages/paymill/button', array('order' => $order));
}
return '';
}