public function add() { $money = intval($_REQUEST['money'] * 100); if ($money <= 0) { die("金额填写不正确."); } $gw = intval($_REQUEST['gw']); if ($gw != 1 && $gw != 2) { die("支付网关不正确"); } load_conf('pub:setting'); if ($gw == 1 && !is_array($GLOBALS['setting_cfg']['ALIPAY_PARTNER'])) { die("没有设置支付参数,请联系管理员"); } $user = getRole('user'); $id = daocall('moneyin', 'add', array($user, $money, $gw)); if (!$id) { die("数据库操作出错.请联系管理员"); } switch ($gw) { case 1: require_once SYS_ROOT . '/../plugin/alipay/pay.php'; break; case 2: require_once SYS_ROOT . '/../plugin/chinabank/Send.php'; break; default: die("暂时不支持该支付网关"); } }
function __construct() { if (!$this->config) { $this->config = load_conf("db"); } $this->_dbconnect($this->config['host'], $this->config['username'], $this->config['password']); }
public function load_config($file) { if (empty($this->config[$file])) { load_conf($file); global $config; $this->config[$file] = $config; } }
/** * @deprecated 请使用product.lib.php接口 * @param unknown_type $id */ public function getVhostProduct($id) { load_conf('pub:vhostproduct'); $vproducts = $GLOBALS['vhostproduct_cfg'][$id]; if (is_array($vproducts)) { return $vproducts; } return false; }
public function set() { @load_conf('pub:settingrule'); $names = $_REQUEST['name']; $sub = $_REQUEST['sub']; foreach ($names as $name) { if ($GLOBALS['settingrule'][$sub][$name]['password']) { if ($_REQUEST[$name] == "") { continue; } } $ret = apicall('tplenv', 'checkEnv', array($name, $_REQUEST[$name], $GLOBALS['settingrule'][$sub])); if ($ret != ENV_CHECK_SUCCESS) { $this->_tpl->assign('msg', '设置:' . $GLOBALS['lang']['zh_CN'][$name] . ' 失败'); $list = daocall('setting', 'getAll'); apicall('utils', 'writeConfig', array($list, 'name', 'setting')); return $this->index(); } daocall('setting', 'add', array($name, $_REQUEST[$name])); } $list = daocall('setting', 'getAll'); apicall('utils', 'writeConfig', array($list, 'name', 'setting')); return $this->index(); }
<?php function load_conf() { $sql = 'SELECT * FROM %s'; $sql = sprintf($sql, $GLOBALS['ecs']->table('yangcong_settings')); return $GLOBALS['db']->getRow($sql); } $GLOBALS['yangcong'] = load_conf();
<?php date_default_timezone_set('Asia/Shanghai'); header("Cache-Control: no-cache, must-revalidate"); header("Content-Type: text/html; charset=utf-8"); define('SYS_ROOT', dirname(dirname(dirname(__FILE__))) . '/framework'); include SYS_ROOT . '/runtime.php'; @load_conf('pub:setting'); if (!is_array($GLOBALS['setting_cfg']['ALIPAY_PARTNER'])) { die("没有正确设置"); } /* *功能:付完款后跳转的页面(页面跳转同步通知页面) *版本:3.1 *日期:2010-10-29 '说明: '以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。 '该代码仅供学习和研究支付宝接口使用,只是提供一个参考。 */ ///////////页面功能说明/////////////// //该页面可在本机电脑测试 //该页面称作“页面跳转同步通知页面”,是由支付宝服务器同步调用,可当作是支付完成后的提示信息页,如“您的某某某订单,多少金额已支付成功”。 //可放入HTML等美化页面的代码和订单交易完成后的数据库更新程序代码 //该页面可以使用PHP开发工具调试,也可以使用写文本函数log_result进行调试,该函数已被默认关闭,见alipay_notify.php中的函数return_verify //TRADE_FINISHED(表示交易已经成功结束,为普通即时到帐的交易状态成功标识); //TRADE_SUCCESS(表示交易已经成功结束,为高级即时到帐的交易状态成功标识); /////////////////////////////////// require_once "class/alipay_notify.php"; //构造通知函数信息 $alipay = new alipay_notify($GLOBALS['setting_cfg']['ALIPAY_PARTNER']['value'], $GLOBALS['setting_cfg']['ALIPAY_KEY']['value'], 'MD5', 'utf-8', strcasecmp($_SERVER['HTTPS'], "ON") == 0 ? "https:" : "http:"); //计算得出通知验证结果
<?php define('KISS', 1); // Front controller define('FC', __FILE__ . '/'); define('APP_ROOT', dirname(__FILE__) . '/'); // Load config load_conf(); // Load conf (keeps variables out of global space) function load_conf() { $conf = array(); $GLOBALS['conf'] =& $conf; // Load default configuration require_once APP_ROOT . "config_default.php"; if ((include_once APP_ROOT . "config.php") !== 1) { fatal(APP_ROOT . "config.php is missing!<br>\n\tUnfortunately, Munkireport does not work without it</p>"); } // Convert auth_config to config item if (isset($auth_config)) { $conf['auth']['auth_config'] = $auth_config; } } /** * Get config item * @param string config item * @param string default value (optional) * @author AvB **/ function conf($cf_item, $default = '') {
public function showProduct() { $product_flag = $_REQUEST['product_flag']; $list = daocall('vhostproduct', 'getProducts', array($product_flag)); $this->_tpl->assign('sum', count($list)); $this->_tpl->assign('list', $list); $this->_tpl->assign('product_flag', $product_flag); @load_conf('pub:node'); if (is_array($GLOBALS['node_cfg'])) { //$this->_tpl->assign('nodes',array_keys($GLOBALS['node_cfg'])); $this->_tpl->assign('nodes', $GLOBALS['node_cfg']); } return $this->_tpl->fetch('vhostproduct/showProduct.html'); }
public function __construct() { @load_conf('pub:node'); }
public function upgradeForm() { $vhost = $_REQUEST['name']; $vhost_info = daocall('vhost', 'getVhost', array($vhost, array('username', 'product_id', 'try_is'))); if (!$vhost_info || $vhost_info['username'] != getRole('user')) { trigger_error('没有找到该虚拟主机'); return false; } if ($vhost_info['try_is'] != 0) { $this->_tpl->assign('msg', '试用产品不能升级'); return $this->_tpl->fetch('vhostproduct/msg.html'); } $this->_tpl->assign("name", $vhost); //$product = apicall('product','newProduct',array('vhost')); //$product_info = $product->getInfo($vhost_info['product_id']); //if(!$product_info || $product_info['upid']==0){ // return "没有其它产品可供升级了"; //} $product_id = $vhost_info['product_id']; @load_conf('pub:vhostproduct'); $upproduct = array(); //取得用户信息,代理ID $userinfo = daocall('user', 'getUser', array(getRole('user'))); if ($GLOBALS['vhostproduct_cfg'][$product_id]['upid'] > 0) { foreach ($GLOBALS['vhostproduct_cfg'] as $product) { if ($product_id == $product['id']) { //相同 continue; } if ($GLOBALS['vhostproduct_cfg'][$product_id]['upid'] != $product['upid']) { //uid不相同 continue; } if ($GLOBALS['vhostproduct_cfg'][$product_id]['price'] > $product['price']) { //价格只能向上升级 continue; } if ($userinfo['agent_id'] > 0) { $arr['agent_id'] = $userinfo['agent_id']; $arr['product_type'] = 0; $arr['product_id'] = $product['id']; $agentinfo = daocall('agentprice', 'getAgentprice', array($arr)); if ($agentinfo && $agentinfo[0]['price'] > 0) { $product['price'] = $agentinfo[0]['price']; } } $upproduct[] = $product; } } if (count($upproduct) <= 0) { //return "没有其它产品可供升级了"; $this->_tpl->assign('msg', '没有其它产品可供升级了'); return $this->_tpl->fetch('vhostproduct/msg.html'); } $this->_tpl->assign('products', $upproduct); return $this->_tpl->fetch('vhostproduct/upgrade.html'); }
public function __construct() { parent::__construct(); @load_conf('pub:tplenv'); }