| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- if (!defined('IN_ONLINE')) {
- exit('Access Denied');
- }
- if ($_SESSION['USAI_USER']['is_demo'] == "t") {
- $_DB['host'] = '127.0.0.1';
- $_DB['username'] = 'root';
- $_DB['password'] = '123456';
- $_DB['dbname'] = 'usai_website';
- $_DB['port'] = '5433';
- $_DB['type'] = 'postgres';
- } else {
- $_DB['host'] = '192.168.0.177';
- $_DB['username'] = 'root';
- $_DB['password'] = '123456';
- if (!empty($_GET['_schemas'])) {
- $_DB['dbname'] = 'redant_online_new2';
- } else {
- $_DB['dbname'] = 'redant_online_new2';
- }
- $_DB['port'] = '5433';
- $_DB['type'] = 'postgres';
- // $_DB['host'] = '172.31.2.157';
- // $_DB['username'] = 'ksroot';
- // $_DB['password'] = 'czZ7!HGSGMRPwWbypC9w';
- // if (!empty($_GET['_schemas'])) {
- // $_DB['dbname'] = 'online';
- // } else {
- // $_DB['dbname'] = 'online';
- // }
- // $_DB['port'] = '5432';
- // $_DB['type'] = 'postgres';
- }
- $db_url = "host=" . $_DB['host'] . " port=" . $_DB['port'] . " dbname=" . $_DB['dbname'] . " user=" . $_DB['username'] . " password=" . $_DB['password'];
- $db = NewADOConnection($_DB['type']);
- $db->Connect($db_url) or die('Connect Database Error');
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- //打開詳細頁面時指定模式
- if (!empty($_REQUEST['_schemas'])) {
- $db->Execute("SET search_path TO " . $_REQUEST['_schemas'] . ";");
- } elseif (!empty($_REQUEST['__schemas'])) {//部分report
- $db->Execute("SET search_path TO " . $_REQUEST['__schemas'] . ";");
- } else {
- //超级管理员有没有选择数据库模式
- if (!empty($_SESSION['_current_schemas'])) {
- $db->Execute("SET search_path TO " . $_SESSION['_current_schemas'] . ";");
- } else {
- if (empty($_SESSION['ONLINE_USER']['main_schemas'])) {
- $db->Execute("SET search_path TO public;");
- } else {
- $db->Execute("SET search_path TO " . $_SESSION['ONLINE_USER']['main_schemas'] . ";");
- }
- }
- }
- $_VERSION = 'RAO 1.0.0.8';
- $_COPYRIGHT = 'Copyright @ 2009 United Software Applications,Inc.';
- ?>
|