<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
|	['hostname'] The hostname of your database server.
|	['username'] The username used to connect to the database
|	['password'] The password used to connect to the database
|	['database'] The name of the database you want to connect to
|	['dbdriver'] The database type. ie: mysql.  Currently supported:
	mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
|	['dbprefix'] You can add an optional prefix, which will be added
|	to the table name when using the  Active Record class
|	['pconnect'] TRUE/FALSE - Whether to use a persistent connection
|	['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
|	['cache_on'] TRUE/FALSE - Enables/disables query caching
|	['cachedir'] The path to the folder where cache files should be stored
|	['char_set'] The character set used in communicating with the database
|	['dbcollat'] The character collation used in communicating with the database
|	NOTE: For MySQL and MySQLi databases, this setting is only used
| 	as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
|	(and in table creation queries made with DB Forge).
| 	There is an incompatibility in PHP with mysql_real_escape_string() which
| 	can make your site vulnerable to SQL injection if you are using a
| 	multi-byte character set and are running versions lower than these.
| 	Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
|	['swap_pre'] A default table prefix that should be swapped with the dbprefix
|	['autoinit'] Whether or not to automatically initialize the database.
|	['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
|	- good for ensuring strict SQL while developing
|
| The $active_group variable lets you choose which connection group to
| make active.  By default there is only one group (the 'default' group).
|
| The $active_record variables lets you determine whether or not to load
| the active record class
*/
$IpHostAllow =explode('.',GetIp());
$server_ip = $_SERVER['SERVER_ADDR'];
//if($IpHostAllow['0']=='192' || $IpHostAllow['0']=='127')
if( IS_ENV_TEST || $server_ip =='192.168.105.107')
{
    $host_city_nj = '192.168.105.243';
	if(GB_CITY=='nj')
	{
		
		$active_group = 'db';
		$active_record = TRUE;

		//主库
		//$db['db']['hostname'] = '172.17.1.50';
		$db['db']['hostname'] = '172.17.1.50';
		$db['db']['username'] = 'root';
		$db['db']['password'] = 'idontcare';
		$db['db']['database'] = 'house';
		$db['db']['dbdriver'] = 'mysql';
		$db['db']['dbprefix'] = '';
		$db['db']['pconnect'] = FALSE;//长连接
		$db['db']['db_debug'] = FALSE;//上线关闭FALSE
		$db['db']['cache_on'] = FALSE;
		$db['db']['cachedir'] = '';
		$db['db']['char_set'] = 'gbk';
		$db['db']['dbcollat'] = 'gbk';
		$db['db']['swap_pre'] = '';
		$db['db']['autoinit'] = TRUE;
		$db['db']['stricton'] = FALSE;//上线关闭FALSE
		
		//从库轮询
		$nowtime = date('G');
		$db_rand = rand(1,2);

		switch($db_rand)
		{
			case 1: $dbback_hostname = '172.17.1.50';break;
			case 2: $dbback_hostname = '172.17.1.50';break;
			default: $dbback_hostname = '172.17.1.50';break;
		}

		//从库
		$db['dbback']['hostname'] = $dbback_hostname;
		$db['dbback']['username'] = 'root';
		$db['dbback']['password'] = 'idontcare';
		$db['dbback']['database'] = 'house';
		$db['dbback']['dbdriver'] = 'mysql';
		$db['dbback']['dbprefix'] = '';
		$db['dbback']['pconnect'] = FALSE;//长连接
		$db['dbback']['db_debug'] = FALSE;//上线关闭FALSE
		$db['dbback']['cache_on'] = FALSE;
		$db['dbback']['cachedir'] = '';
		$db['dbback']['char_set'] = 'gbk';
		$db['dbback']['dbcollat'] = 'gbk';
		$db['dbback']['swap_pre'] = '';
		$db['dbback']['autoinit'] = FALSE;
		$db['dbback']['stricton'] = FALSE;//上线关闭FALSE

		//广告库
		$db['dbmain']['hostname'] = 'master_nj_db';
		$db['dbmain']['username'] = 'root';
		$db['dbmain']['password'] = 'idontcare';
		$db['dbmain']['database'] = 'njhouse';
		$db['dbmain']['dbdriver'] = 'mysql';
		$db['dbmain']['dbprefix'] = '';
		$db['dbmain']['pconnect'] = FALSE;//长连接
		$db['dbmain']['db_debug'] = TRUE;//上线关闭FALSE
		$db['dbmain']['cache_on'] = FALSE;
		$db['dbmain']['cachedir'] = '';
		$db['dbmain']['char_set'] = 'gbk';
		$db['dbmain']['dbcollat'] = 'gbk';
		$db['dbmain']['swap_pre'] = '';
		$db['dbmain']['autoinit'] = FALSE;
		$db['dbmain']['stricton'] = false;//上线关闭FALSE

		//系统库
		$db['dbsystem']['hostname'] = '172.17.1.50';
		$db['dbsystem']['username'] = 'root';
		$db['dbsystem']['password'] = 'idontcare';
		$db['dbsystem']['database'] = 'esf_admin';
		$db['dbsystem']['dbdriver'] = 'mysql';
		$db['dbsystem']['dbprefix'] = '';
		$db['dbsystem']['pconnect'] = FALSE;//长连接
		$db['dbsystem']['db_debug'] = TRUE;//上线关闭FALSE
		$db['dbsystem']['cache_on'] = FALSE;
		$db['dbsystem']['cachedir'] = '';
		$db['dbsystem']['char_set'] = 'gbk';
		$db['dbsystem']['dbcollat'] = 'gbk';
		$db['dbsystem']['swap_pre'] = '';
		$db['dbsystem']['autoinit'] = FALSE;
		$db['dbsystem']['stricton'] = false;//上线关闭FALSE


    }
	elseif(GB_CITY=='hf')
	{
		$active_group = 'db';
		$active_record = TRUE;

		$db_hostname = $host_city_nj;
		$db_database =GB_CITY.'_house';

		//主库
		$db['db']['hostname'] = $db_hostname;
		//$db['db']['hostname'] = 'master_nj_esf';
		$db['db']['username'] = 'root';
		$db['db']['password'] = 'idontcare';
		$db['db']['database'] = $db_database;
		$db['db']['dbdriver'] = 'mysql';
		$db['db']['dbprefix'] = '';
		$db['db']['pconnect'] = FALSE;//长连接
		$db['db']['db_debug'] = FALSE;//上线关闭FALSE
		$db['db']['cache_on'] = FALSE;
		$db['db']['cachedir'] = '';
		$db['db']['char_set'] = 'gbk';
		$db['db']['dbcollat'] = 'gbk';
		$db['db']['swap_pre'] = '';
		$db['db']['autoinit'] = TRUE;
		$db['db']['stricton'] = FALSE;//上线关闭FALSE

		//从库轮询
		$nowtime = date('G');
		$dbback_hostname = $host_city_nj;
		
		//从库
		$db['dbback']['hostname'] = $dbback_hostname;
		$db['dbback']['username'] = 'root';
		$db['dbback']['password'] = 'idontcare';
		$db['dbback']['database'] = $db_database;
		$db['dbback']['dbdriver'] = 'mysql';
		$db['dbback']['dbprefix'] = '';
		$db['dbback']['pconnect'] = FALSE;//长连接
		$db['dbback']['db_debug'] = FALSE;//上线关闭FALSE
		$db['dbback']['cache_on'] = FALSE;
		$db['dbback']['cachedir'] = '';
		$db['dbback']['char_set'] = 'gbk';
		$db['dbback']['dbcollat'] = 'gbk';
		$db['dbback']['swap_pre'] = '';
		$db['dbback']['autoinit'] = FALSE;
		$db['dbback']['stricton'] = FALSE;//上线关闭FALSE

		//广告库
		$db['dbmain']['hostname'] = '172.17.1.210';
		$db['dbmain']['username'] = 'root';
		$db['dbmain']['password'] = 'idontcare';
		$db['dbmain']['database'] = 'house365';
		$db['dbmain']['dbdriver'] = 'mysql';
		$db['dbmain']['dbprefix'] = '';
		$db['dbmain']['pconnect'] = FALSE;//长连接
		$db['dbmain']['db_debug'] = TRUE;//上线关闭FALSE
		$db['dbmain']['cache_on'] = FALSE;
		$db['dbmain']['cachedir'] = '';
		$db['dbmain']['char_set'] = 'gbk';
		$db['dbmain']['dbcollat'] = 'gbk';
		$db['dbmain']['swap_pre'] = '';
		$db['dbmain']['autoinit'] = FALSE;
		$db['dbmain']['stricton'] = false;//上线关闭FALSE


		//系统库
		$db['dbsystem']['hostname'] = $host_city_nj;
		$db['dbsystem']['username'] = 'root';
		$db['dbsystem']['password'] = 'idontcare';
		$db['dbsystem']['database'] = 'esf_admin';
		$db['dbsystem']['dbdriver'] = 'mysql';
		$db['dbsystem']['dbprefix'] = '';
		$db['dbsystem']['pconnect'] = FALSE;//长连接
		$db['dbsystem']['db_debug'] = TRUE;//上线关闭FALSE
		$db['dbsystem']['cache_on'] = FALSE;
		$db['dbsystem']['cachedir'] = '';
		$db['dbsystem']['char_set'] = 'gbk';
		$db['dbsystem']['dbcollat'] = 'gbk';
		$db['dbsystem']['swap_pre'] = '';
		$db['dbsystem']['autoinit'] = FALSE;
		$db['dbsystem']['stricton'] = false;//上线关闭FALSE
	}
	elseif(GB_CITY=='wx')
	{
		$active_group = 'db';
		$active_record = TRUE;

		$db_hostname = $host_city_nj;
		$db_database =GB_CITY.'_house';

		//主库
		$db['db']['hostname'] = $db_hostname;
		//$db['db']['hostname'] = 'master_nj_esf';
		$db['db']['username'] = 'root';
		$db['db']['password'] = 'idontcare';
		$db['db']['database'] = $db_database;
		$db['db']['dbdriver'] = 'mysql';
		$db['db']['dbprefix'] = '';
		$db['db']['pconnect'] = FALSE;//长连接
		$db['db']['db_debug'] = FALSE;//上线关闭FALSE
		$db['db']['cache_on'] = FALSE;
		$db['db']['cachedir'] = '';
		$db['db']['char_set'] = 'gbk';
		$db['db']['dbcollat'] = 'gbk';
		$db['db']['swap_pre'] = '';
		$db['db']['autoinit'] = TRUE;
		$db['db']['stricton'] = FALSE;//上线关闭FALSE

		//从库轮询
		$nowtime = date('G');
		$dbback_hostname = '172.17.1.50';
		
		//从库
		$db['dbback']['hostname'] = $dbback_hostname;
		$db['dbback']['username'] = 'root';
		$db['dbback']['password'] = 'idontcare';
		$db['dbback']['database'] = $db_database;
		$db['dbback']['dbdriver'] = 'mysql';
		$db['dbback']['dbprefix'] = '';
		$db['dbback']['pconnect'] = FALSE;//长连接
		$db['dbback']['db_debug'] = FALSE;//上线关闭FALSE
		$db['dbback']['cache_on'] = FALSE;
		$db['dbback']['cachedir'] = '';
		$db['dbback']['char_set'] = 'gbk';
		$db['dbback']['dbcollat'] = 'gbk';
		$db['dbback']['swap_pre'] = '';
		$db['dbback']['autoinit'] = FALSE;
		$db['dbback']['stricton'] = FALSE;//上线关闭FALSE

		//广告库
		$db['dbmain']['hostname'] = '172.17.1.210';
		$db['dbmain']['username'] = 'root';
		$db['dbmain']['password'] = 'idontcare';
		$db['dbmain']['database'] = 'house365';
		$db['dbmain']['dbdriver'] = 'mysql';
		$db['dbmain']['dbprefix'] = '';
		$db['dbmain']['pconnect'] = FALSE;//长连接
		$db['dbmain']['db_debug'] = TRUE;//上线关闭FALSE
		$db['dbmain']['cache_on'] = FALSE;
		$db['dbmain']['cachedir'] = '';
		$db['dbmain']['char_set'] = 'gbk';
		$db['dbmain']['dbcollat'] = 'gbk';
		$db['dbmain']['swap_pre'] = '';
		$db['dbmain']['autoinit'] = FALSE;
		$db['dbmain']['stricton'] = false;//上线关闭FALSE


		//系统库
		$db['dbsystem']['hostname'] = '172.17.1.50';
		$db['dbsystem']['username'] = 'root';
		$db['dbsystem']['password'] = 'idontcare';
		$db['dbsystem']['database'] = 'esf_admin';
		$db['dbsystem']['dbdriver'] = 'mysql';
		$db['dbsystem']['dbprefix'] = '';
		$db['dbsystem']['pconnect'] = FALSE;//长连接
		$db['dbsystem']['db_debug'] = TRUE;//上线关闭FALSE
		$db['dbsystem']['cache_on'] = FALSE;
		$db['dbsystem']['cachedir'] = '';
		$db['dbsystem']['char_set'] = 'gbk';
		$db['dbsystem']['dbcollat'] = 'gbk';
		$db['dbsystem']['swap_pre'] = '';
		$db['dbsystem']['autoinit'] = FALSE;
		$db['dbsystem']['stricton'] = false;//上线关闭FALSE
		
	}
    elseif(GB_CITY=='fz')
    {
        $active_group = 'db';
        $active_record = TRUE;

        $db_hostname = '192.168.105.107';
        $db_database =GB_CITY.'_house';

        //主库
        $db['db']['hostname'] = $db_hostname;
        //$db['db']['hostname'] = 'master_nj_esf';
        $db['db']['username'] = 'root';
        $db['db']['password'] = 'd53b21ffb24d9c34';
        $db['db']['database'] = $db_database;
        $db['db']['dbdriver'] = 'mysql';
        $db['db']['dbprefix'] = '';
        $db['db']['pconnect'] = FALSE;//长连接
        $db['db']['db_debug'] = FALSE;//上线关闭FALSE
        $db['db']['cache_on'] = FALSE;
        $db['db']['cachedir'] = '';
        $db['db']['char_set'] = 'gbk';
        $db['db']['dbcollat'] = 'gbk';
        $db['db']['swap_pre'] = '';
        $db['db']['autoinit'] = TRUE;
        $db['db']['stricton'] = FALSE;//上线关闭FALSE

        //从库轮询
        $nowtime = date('G');
        $dbback_hostname = '192.168.105.107';

        //从库
        $db['dbback']['hostname'] = $dbback_hostname;
        $db['dbback']['username'] = 'root';
        $db['dbback']['password'] = 'd53b21ffb24d9c34';
        $db['dbback']['database'] = $db_database;
        $db['dbback']['dbdriver'] = 'mysql';
        $db['dbback']['dbprefix'] = '';
        $db['dbback']['pconnect'] = FALSE;//长连接
        $db['dbback']['db_debug'] = FALSE;//上线关闭FALSE
        $db['dbback']['cache_on'] = FALSE;
        $db['dbback']['cachedir'] = '';
        $db['dbback']['char_set'] = 'gbk';
        $db['dbback']['dbcollat'] = 'gbk';
        $db['dbback']['swap_pre'] = '';
        $db['dbback']['autoinit'] = FALSE;
        $db['dbback']['stricton'] = FALSE;//上线关闭FALSE

        //广告库
        $db['dbmain']['hostname'] = '172.17.1.210';
        $db['dbmain']['username'] = 'root';
        $db['dbmain']['password'] = 'idontcare';
        $db['dbmain']['database'] = 'house365';
        $db['dbmain']['dbdriver'] = 'mysql';
        $db['dbmain']['dbprefix'] = '';
        $db['dbmain']['pconnect'] = FALSE;//长连接
        $db['dbmain']['db_debug'] = TRUE;//上线关闭FALSE
        $db['dbmain']['cache_on'] = FALSE;
        $db['dbmain']['cachedir'] = '';
        $db['dbmain']['char_set'] = 'gbk';
        $db['dbmain']['dbcollat'] = 'gbk';
        $db['dbmain']['swap_pre'] = '';
        $db['dbmain']['autoinit'] = FALSE;
        $db['dbmain']['stricton'] = false;//上线关闭FALSE


        //系统库
        $db['dbsystem']['hostname'] = '192.168.105.243';
        $db['dbsystem']['username'] = 'root';
        $db['dbsystem']['password'] = 'idontcare';
        $db['dbsystem']['database'] = 'esf_admin';
        $db['dbsystem']['dbdriver'] = 'mysql';
        $db['dbsystem']['dbprefix'] = '';
        $db['dbsystem']['pconnect'] = FALSE;//长连接
        $db['dbsystem']['db_debug'] = TRUE;//上线关闭FALSE
        $db['dbsystem']['cache_on'] = FALSE;
        $db['dbsystem']['cachedir'] = '';
        $db['dbsystem']['char_set'] = 'gbk';
        $db['dbsystem']['dbcollat'] = 'gbk';
        $db['dbsystem']['swap_pre'] = '';
        $db['dbsystem']['autoinit'] = FALSE;
        $db['dbsystem']['stricton'] = false;//上线关闭FALSE

    }
	else
	{
		$active_group = 'db';
		$active_record = TRUE;

		$db_hostname = $host_city_nj;
		$db_database =GB_CITY.'_house';

		//主库
		$db['db']['hostname'] = $db_hostname;
		//$db['db']['hostname'] = 'master_nj_esf';
		$db['db']['username'] = 'root';
		$db['db']['password'] = 'idontcare';
		$db['db']['database'] = $db_database;
		$db['db']['dbdriver'] = 'mysql';
		$db['db']['dbprefix'] = '';
		$db['db']['pconnect'] = FALSE;//长连接
		$db['db']['db_debug'] = FALSE;//上线关闭FALSE
		$db['db']['cache_on'] = FALSE;
		$db['db']['cachedir'] = '';
		$db['db']['char_set'] = 'gbk';
		$db['db']['dbcollat'] = 'gbk';
		$db['db']['swap_pre'] = '';
		$db['db']['autoinit'] = TRUE;
		$db['db']['stricton'] = FALSE;//上线关闭FALSE

		//从库轮询
		$nowtime = date('G');
		$dbback_hostname = '192.168.105.243';// 172.17.1.50无法连接
		
		//从库
		$db['dbback']['hostname'] = $dbback_hostname;
		$db['dbback']['username'] = 'root';
		$db['dbback']['password'] = 'idontcare';
		$db['dbback']['database'] = $db_database;
		$db['dbback']['dbdriver'] = 'mysql';
		$db['dbback']['dbprefix'] = '';
		$db['dbback']['pconnect'] = FALSE;//长连接
		$db['dbback']['db_debug'] = FALSE;//上线关闭FALSE
		$db['dbback']['cache_on'] = FALSE;
		$db['dbback']['cachedir'] = '';
		$db['dbback']['char_set'] = 'gbk';
		$db['dbback']['dbcollat'] = 'gbk';
		$db['dbback']['swap_pre'] = '';
		$db['dbback']['autoinit'] = FALSE;
		$db['dbback']['stricton'] = FALSE;//上线关闭FALSE

		//广告库
		$db['dbmain']['hostname'] = '172.17.1.210';
		$db['dbmain']['username'] = 'root';
		$db['dbmain']['password'] = 'idontcare';
		$db['dbmain']['database'] = 'house365';
		$db['dbmain']['dbdriver'] = 'mysql';
		$db['dbmain']['dbprefix'] = '';
		$db['dbmain']['pconnect'] = FALSE;//长连接
		$db['dbmain']['db_debug'] = TRUE;//上线关闭FALSE
		$db['dbmain']['cache_on'] = FALSE;
		$db['dbmain']['cachedir'] = '';
		$db['dbmain']['char_set'] = 'gbk';
		$db['dbmain']['dbcollat'] = 'gbk';
		$db['dbmain']['swap_pre'] = '';
		$db['dbmain']['autoinit'] = FALSE;
		$db['dbmain']['stricton'] = false;//上线关闭FALSE


		//系统库
		$db['dbsystem']['hostname'] = '172.17.1.50';
		$db['dbsystem']['username'] = 'root';
		$db['dbsystem']['password'] = 'idontcare';
		$db['dbsystem']['database'] = 'esf_admin';
		$db['dbsystem']['dbdriver'] = 'mysql';
		$db['dbsystem']['dbprefix'] = '';
		$db['dbsystem']['pconnect'] = FALSE;//长连接
		$db['dbsystem']['db_debug'] = TRUE;//上线关闭FALSE
		$db['dbsystem']['cache_on'] = FALSE;
		$db['dbsystem']['cachedir'] = '';
		$db['dbsystem']['char_set'] = 'gbk';
		$db['dbsystem']['dbcollat'] = 'gbk';
		$db['dbsystem']['swap_pre'] = '';
		$db['dbsystem']['autoinit'] = FALSE;
		$db['dbsystem']['stricton'] = false;//上线关闭FALSE
		
	}
}
else
{
	if(GB_CITY=='nj')
	{
		
		$active_group = 'db';
		$active_record = TRUE;

		//主库
		//$db['db']['hostname'] = '172.17.1.50';
		$db['db']['hostname'] = 'master_nj_esf';
		$db['db']['username'] = 'root';
		$db['db']['password'] = 'idontcare';
		$db['db']['database'] = 'house';
		$db['db']['dbdriver'] = 'mysql';
		$db['db']['dbprefix'] = '';
		$db['db']['pconnect'] = FALSE;//长连接
		$db['db']['db_debug'] = FALSE;//上线关闭FALSE
		$db['db']['cache_on'] = FALSE;
		$db['db']['cachedir'] = '';
		$db['db']['char_set'] = 'gbk';
		$db['db']['dbcollat'] = 'gbk';
		$db['db']['swap_pre'] = '';
		$db['db']['autoinit'] = TRUE;
		$db['db']['stricton'] = FALSE;//上线关闭FALSE

		//从库轮询
		$nowtime = date('G');
		$db_rand = rand(1,2);

		switch($db_rand)
		{
			case 1: $dbback_hostname = '172.17.1.90';break;
			case 2: $dbback_hostname = '172.17.1.90';break;
			default: $dbback_hostname = '172.17.1.90';break;
		}

		//从库
		$db['dbback']['hostname'] = $dbback_hostname;
		$db['dbback']['username'] = 'root';
		$db['dbback']['password'] = 'idontcare';
		$db['dbback']['database'] = 'house';
		$db['dbback']['dbdriver'] = 'mysql';
		$db['dbback']['dbprefix'] = '';
		$db['dbback']['pconnect'] = FALSE;//长连接
		$db['dbback']['db_debug'] = FALSE;//上线关闭FALSE
		$db['dbback']['cache_on'] = FALSE;
		$db['dbback']['cachedir'] = '';
		$db['dbback']['char_set'] = 'gbk';
		$db['dbback']['dbcollat'] = 'gbk';
		$db['dbback']['swap_pre'] = '';
		$db['dbback']['autoinit'] = FALSE;
		$db['dbback']['stricton'] = FALSE;//上线关闭FALSE

		//广告库
		$db['dbmain']['hostname'] = 'master_nj_db';
		$db['dbmain']['username'] = 'root';
		$db['dbmain']['password'] = 'idontcare';
		$db['dbmain']['database'] = 'njhouse';
		$db['dbmain']['dbdriver'] = 'mysql';
		$db['dbmain']['dbprefix'] = '';
		$db['dbmain']['pconnect'] = FALSE;//长连接
		$db['dbmain']['db_debug'] = TRUE;//上线关闭FALSE
		$db['dbmain']['cache_on'] = FALSE;
		$db['dbmain']['cachedir'] = '';
		$db['dbmain']['char_set'] = 'gbk';
		$db['dbmain']['dbcollat'] = 'gbk';
		$db['dbmain']['swap_pre'] = '';
		$db['dbmain']['autoinit'] = FALSE;
		$db['dbmain']['stricton'] = false;//上线关闭FALSE

		//系统库
		$db['dbsystem']['hostname'] = 'wdnjesfdbmastervip.house365.com';
		$db['dbsystem']['username'] = 'root';
		$db['dbsystem']['password'] = 'idontcare';
		$db['dbsystem']['database'] = 'esf_admin';
		$db['dbsystem']['dbdriver'] = 'mysql';
		$db['dbsystem']['dbprefix'] = '';
		$db['dbsystem']['pconnect'] = FALSE;//长连接
		$db['dbsystem']['db_debug'] = TRUE;//上线关闭FALSE
		$db['dbsystem']['cache_on'] = FALSE;
		$db['dbsystem']['cachedir'] = '';
		$db['dbsystem']['char_set'] = 'gbk';
		$db['dbsystem']['dbcollat'] = 'gbk';
		$db['dbsystem']['swap_pre'] = '';
		$db['dbsystem']['autoinit'] = FALSE;
		$db['dbsystem']['stricton'] = false;//上线关闭FALSE
	}
	elseif(GB_CITY=='hf')
	{
		$active_group = 'db';
		$active_record = TRUE;

		$db_hostname ='172.17.1.176';
		$db_database =GB_CITY.'_house';

		//主库
		$db['db']['hostname'] = $db_hostname;
		//$db['db']['hostname'] = 'master_nj_esf';
		$db['db']['username'] = 'root';
		$db['db']['password'] = 'idontcare';
		$db['db']['database'] = $db_database;
		$db['db']['dbdriver'] = 'mysql';
		$db['db']['dbprefix'] = '';
		$db['db']['pconnect'] = FALSE;//长连接
		$db['db']['db_debug'] = FALSE;//上线关闭FALSE
		$db['db']['cache_on'] = FALSE;
		$db['db']['cachedir'] = '';
		$db['db']['char_set'] = 'gbk';
		$db['db']['dbcollat'] = 'gbk';
		$db['db']['swap_pre'] = '';
		$db['db']['autoinit'] = TRUE;
		$db['db']['stricton'] = FALSE;//上线关闭FALSE

		//从库轮询
		$nowtime = date('G');
		//$nowm = intval(date('i')) % 2;
		//$db_rand = $nowtime > 12 ? rand(0,1) : ($nowm == 1 ? 1 : 3);
		//$db_rand = $nowtime > 12 ? 1 : rand(1,2);

		//master_nj_esf_back = 172.17.1.95
		if(GB_CITY=='nj'){
			$db_rand = rand(0,2);
			switch($db_rand)
			{
				case 0: $dbback_hostname = '172.17.1.50';break;
				case 1: $dbback_hostname = '172.17.1.50';break;
				default: $dbback_hostname = '172.17.1.50';break;
			}
		}else{
			//$dbback_hostname = '172.17.1.86';
			$dbback_hostname = '172.17.1.176';
		}




		/*
		switch($db_rand)
		{
			case 0: $dbback_hostname = '172.17.1.50';break;
			case 1: $dbback_hostname = '172.17.1.50';break;
			default: $dbback_hostname = '172.17.1.50';break;
		}
		*/
		//从库
		$db['dbback']['hostname'] = $dbback_hostname;
		$db['dbback']['username'] = 'root';
		$db['dbback']['password'] = 'idontcare';
		$db['dbback']['database'] = $db_database;
		$db['dbback']['dbdriver'] = 'mysql';
		$db['dbback']['dbprefix'] = '';
		$db['dbback']['pconnect'] = FALSE;//长连接
		$db['dbback']['db_debug'] = FALSE;//上线关闭FALSE
		$db['dbback']['cache_on'] = FALSE;
		$db['dbback']['cachedir'] = '';
		$db['dbback']['char_set'] = 'gbk';
		$db['dbback']['dbcollat'] = 'gbk';
		$db['dbback']['swap_pre'] = '';
		$db['dbback']['autoinit'] = FALSE;
		$db['dbback']['stricton'] = FALSE;//上线关闭FALSE

		//广告库
		$db['dbmain']['hostname'] = '172.17.1.210';
		$db['dbmain']['username'] = 'root';
		$db['dbmain']['password'] = 'idontcare';
		$db['dbmain']['database'] = 'house365';
		$db['dbmain']['dbdriver'] = 'mysql';
		$db['dbmain']['dbprefix'] = '';
		$db['dbmain']['pconnect'] = FALSE;//长连接
		$db['dbmain']['db_debug'] = TRUE;//上线关闭FALSE
		$db['dbmain']['cache_on'] = FALSE;
		$db['dbmain']['cachedir'] = '';
		$db['dbmain']['char_set'] = 'gbk';
		$db['dbmain']['dbcollat'] = 'gbk';
		$db['dbmain']['swap_pre'] = '';
		$db['dbmain']['autoinit'] = FALSE;
		$db['dbmain']['stricton'] = false;//上线关闭FALSE


		//系统库
		$db['dbsystem']['hostname'] = 'wdnjesfdbmastervip.house365.com';
		$db['dbsystem']['username'] = 'root';
		$db['dbsystem']['password'] = 'idontcare';
		$db['dbsystem']['database'] = 'esf_admin';
		$db['dbsystem']['dbdriver'] = 'mysql';
		$db['dbsystem']['dbprefix'] = '';
		$db['dbsystem']['pconnect'] = FALSE;//长连接
		$db['dbsystem']['db_debug'] = TRUE;//上线关闭FALSE
		$db['dbsystem']['cache_on'] = FALSE;
		$db['dbsystem']['cachedir'] = '';
		$db['dbsystem']['char_set'] = 'gbk';
		$db['dbsystem']['dbcollat'] = 'gbk';
		$db['dbsystem']['swap_pre'] = '';
		$db['dbsystem']['autoinit'] = FALSE;
		$db['dbsystem']['stricton'] = false;//上线关闭FALSE
	}
	else
	{
		$active_group = 'db';
		$active_record = TRUE;

		$db_hostname ='wdnjesfdbmastervip.house365.com';
		$db_database =GB_CITY.'_house';

		//主库
		$db['db']['hostname'] = $db_hostname;
		//$db['db']['hostname'] = 'master_nj_esf';
		$db['db']['username'] = 'root';
		$db['db']['password'] = 'idontcare';
		$db['db']['database'] = $db_database;
		$db['db']['dbdriver'] = 'mysql';
		$db['db']['dbprefix'] = '';
		$db['db']['pconnect'] = FALSE;//长连接
		$db['db']['db_debug'] = FALSE;//上线关闭FALSE
		$db['db']['cache_on'] = FALSE;
		$db['db']['cachedir'] = '';
		$db['db']['char_set'] = 'gbk';
		$db['db']['dbcollat'] = 'gbk';
		$db['db']['swap_pre'] = '';
		$db['db']['autoinit'] = TRUE;
		$db['db']['stricton'] = FALSE;//上线关闭FALSE

		//从库轮询
		$nowtime = date('G');
		//$nowm = intval(date('i')) % 2;
		//$db_rand = $nowtime > 12 ? rand(0,1) : ($nowm == 1 ? 1 : 3);
		//$db_rand = $nowtime > 12 ? 1 : rand(1,2);


		//master_nj_esf_back = 172.17.1.95
		
		$dbback_hostname = 'wdnjesfdbslave01.house365.com';
        $db_rand = rand(1,2);
        switch($db_rand)
        {
            case 1: $dbback_hostname = 'wdnjesfdbslave01.house365.com';break;
            case 2: $dbback_hostname = 'wdnjesfdbslave01.house365.com';break;
            default: $dbback_hostname = 'wdnjesfdbslave01.house365.com';break;
        }
		//从库
		$db['dbback']['hostname'] = $dbback_hostname;
		$db['dbback']['username'] = 'root';
		$db['dbback']['password'] = 'idontcare';
		$db['dbback']['database'] = $db_database;
		$db['dbback']['dbdriver'] = 'mysql';
		$db['dbback']['dbprefix'] = '';
		$db['dbback']['pconnect'] = FALSE;//长连接
		$db['dbback']['db_debug'] = FALSE;//上线关闭FALSE
		$db['dbback']['cache_on'] = FALSE;
		$db['dbback']['cachedir'] = '';
		$db['dbback']['char_set'] = 'gbk';
		$db['dbback']['dbcollat'] = 'gbk';
		$db['dbback']['swap_pre'] = '';
		$db['dbback']['autoinit'] = FALSE;
		$db['dbback']['stricton'] = FALSE;//上线关闭FALSE

		//广告库
		$db['dbmain']['hostname'] = '172.17.1.210';
		$db['dbmain']['username'] = 'root';
		$db['dbmain']['password'] = 'idontcare';
		$db['dbmain']['database'] = 'house365';
		$db['dbmain']['dbdriver'] = 'mysql';
		$db['dbmain']['dbprefix'] = '';
		$db['dbmain']['pconnect'] = FALSE;//长连接
		$db['dbmain']['db_debug'] = TRUE;//上线关闭FALSE
		$db['dbmain']['cache_on'] = FALSE;
		$db['dbmain']['cachedir'] = '';
		$db['dbmain']['char_set'] = 'gbk';
		$db['dbmain']['dbcollat'] = 'gbk';
		$db['dbmain']['swap_pre'] = '';
		$db['dbmain']['autoinit'] = FALSE;
		$db['dbmain']['stricton'] = false;//上线关闭FALSE


		//系统库
		$db['dbsystem']['hostname'] = 'wdnjesfdbmastervip.house365.com';
		$db['dbsystem']['username'] = 'root';
		$db['dbsystem']['password'] = 'idontcare';
		$db['dbsystem']['database'] = 'esf_admin';
		$db['dbsystem']['dbdriver'] = 'mysql';
		$db['dbsystem']['dbprefix'] = '';
		$db['dbsystem']['pconnect'] = FALSE;//长连接
		$db['dbsystem']['db_debug'] = TRUE;//上线关闭FALSE
		$db['dbsystem']['cache_on'] = FALSE;
		$db['dbsystem']['cachedir'] = '';
		$db['dbsystem']['char_set'] = 'gbk';
		$db['dbsystem']['dbcollat'] = 'gbk';
		$db['dbsystem']['swap_pre'] = '';
		$db['dbsystem']['autoinit'] = FALSE;
		$db['dbsystem']['stricton'] = false;//上线关闭FALSE
	}
}


/* End of file database.php */
/* Location: ./application/config/database.php */