<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/*
|--------------------------------------------------------------------------
| File and Directory Modes
|--------------------------------------------------------------------------
|
| These prefs are used when checking and setting modes when working
| with the file system.  The defaults are fine on servers with proper
| security, but you may wish (or even need) to change the values in
| certain environments (Apache running a separate process for each
| user, PHP under CGI with Apache suEXEC, etc.).  Octal values should
| always be used to set the mode correctly.
|
*/
define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0666);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0777);

/*
|--------------------------------------------------------------------------
| File Stream Modes
|--------------------------------------------------------------------------
|
| These modes are used when working with fopen()/popen()
|
*/

define('FOPEN_READ','rb');
define('FOPEN_READ_WRITE','r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE','wb'); // truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE','w+b'); // truncates existing file data, use with care
define('FOPEN_WRITE_CREATE','ab');
define('FOPEN_READ_WRITE_CREATE','a+b');
define('FOPEN_WRITE_CREATE_STRICT','xb');
define('FOPEN_READ_WRITE_CREATE_STRICT','x+b');

/*********** ���۱�ϵͳ�������� *************/
//���б�ʶ��


preg_match("#^([a-z]+).zsb.house365.com$#", $_SERVER['HTTP_HOST'], $matches);
if($matches) {
    //$conf_city = $matches[1];
    define('GB_CITY',$matches[1]);
} else{
    if($_SERVER['HTTP_HOST']=='njtest.zsb.house365.com')
    {
        define('GB_CITY','nj');
    }elseif($_SERVER['HTTP_HOST']=='wxtest.zsb.house365.com')
    {
        define('GB_CITY','wx');
    }elseif($_SERVER['HTTP_HOST']=='whtest.zsb.house365.com')
    {
        define('GB_CITY','wh');
    }elseif($_SERVER['HTTP_HOST']=='wlmq.zsb.house365.com')
    {
        define('GB_CITY','wlmq');
    }elseif($_SERVER['HTTP_HOST']=='mianyang.zsb.house365.com')
    {
        define('GB_CITY','mianyang');
    }elseif($_SERVER['HTTP_HOST']=='lyg.zsb.house365.com')
    {
        define('GB_CITY','lyg');
    }elseif($_SERVER['HTTP_HOST']=='fcg.zsb.house365.com')
    {
        define('GB_CITY','fcg');
    }
    elseif($_SERVER['HTTP_HOST']=='mas.zsb.house365.com')
    {
        define('GB_CITY','mas');
    }
    else
    {
        define('GB_CITY','hf');
    }
}
//define('GB_CITY','nj');

/***********  ȫվϵͳURL��ַ���� *************/
define('GB_SITE_URL' , 'http://www.house365.com');
//���ַ�
define('GB_SELL_URL' , 'http://'.GB_CITY.'.sell.house365.com');
//�ⷿ
define('GB_RENT_URL' , 'http://'.GB_CITY.'.rent.house365.com');
//С����ҳ
define('GB_XIAOQU_INDEX_URL', GB_SELL_URL.'/community/');
//С����ַ
define('GB_XIAOQU_URL' , GB_SELL_URL.'/community_id');
//�Ͼ�վ������
define('GB_BROKER_URL' , 'http://agent.house365.com');
//�Ͼ�վ���۱���ַ



if($_SERVER['HTTP_HOST']=='njtest.zsb.house365.com')
{
    define('GB_WO_URL' , 'http://'.GB_CITY.'test'.'.zsb.house365.com');
}elseif($_SERVER['HTTP_HOST']=='wxtest.zsb.house365.com')
{
    define('GB_WO_URL' , 'http://'.GB_CITY.'test'.'.zsb.house365.com');
}elseif($_SERVER['HTTP_HOST']=='whtest.zsb.house365.com')
{
    define('GB_WO_URL' , 'http://'.GB_CITY.'test'.'.zsb.house365.com');
}else
{
    define('GB_WO_URL' , 'http://'.GB_CITY.'.zsb.house365.com');
}
//��ȡIP
function GetIpNew() {

    $ip = $_SERVER["REMOTE_ADDR"];
    if (!empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
        $tip = split(",", $_SERVER["HTTP_X_FORWARDED_FOR"]);
        $ip = $tip[0];
    }
    return(trim($ip));
}

$IpHostAllow =explode('.',GetIpNew());
if($IpHostAllow['0']=='192' || $IpHostAllow['0']=='127')
{
    define("NewStatisticsUrl","http://zjj182.house365.com:2093/xxx-sell-count-api");
}
else
{
    define("NewStatisticsUrl","http://zjj182.house365.com:2093/xxx-sell-count-api");
}
define("WebsiteVersion","4.4.9");

//echo NewStatisticsUrl;die;

//�Ͼ�վ���۱���������
if(GB_CITY == 'nj')
{
    define('STATIC_SOURCE_URL', 'http://nj.zsb.house365.com/source');

    define('GB_WO_HELP', "http://zsb.house365.com/help/nj/");
}
else
{
    $base_url = $http = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' :'http://';
    $base_url .= $_SERVER['HTTP_HOST'];
    $base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
    //define('STATIC_SOURCE_URL', 'http://esf.fz.house365.com');
    if(isset($_GET['test'])){
        echo $base_url;
        echo "<pre>";
        print_r($_SERVER);
        exit;
    }
    define('STATIC_SOURCE_URL', $http.$_SERVER['HTTP_HOST'].'/source');
    define('GB_WO_HELP', "http://zsb.house365.com/help/");
}



//�Ͼ�վ�ŵ�����ַ
//define('GB_WS_URL' , "http://gl.zsb.house365.com");
//��������
define('GB_CITY_ABOUT' , GB_SITE_URL."/about/aboutus.php");
//��ϵ����
define('GB_CITY_CONTACT' , GB_SITE_URL."/about/contactus.php?city=".GB_CITY);
//��Ƹ��Ϣ
define('GB_CITY_JOB' , GB_SITE_URL."/about/joinus.php?pid=1&city=".GB_CITY);
//��������
define('GB_CITY_LINKS' , GB_SITE_URL."/about/friendlink.php?city=".GB_CITY);
//�������
define('GB_CITY_HZHB' , GB_SITE_URL."/about/partner.php?city=".GB_CITY);
//��������
define('GB_CITY_FLSM' , GB_SITE_URL."/about/statement.php");
//IM�ӿڵ�ַ
define('GB_IM_PATH' , "http://kfadmin.house365.com/api/");
//���۱��˺�ע��
//define('GB_BROKER_REG' , "http://agent.house365.com/application.php");
//���۱��ͻ���
define("GB_ZSB_APP","http://app.house365.com/zsb/download.html");
//���۱��ͻ���
define("GB_BROKER_SHOP","http://".GB_CITY.".sell.house365.com/agent_bk(*)/");
//���ַ�����ҳ
define("SELL_DETAIL","http://".GB_CITY.".sell.house365.com/s_");
//�ⷿ����ҳ
define("RENT_DETAIL","http://".GB_CITY.".rent.house365.com/r_");
//�����û�����URL
define("USER_CENTER","http://user.house365.com/");
//�����˳ɳ���ϵ�������úͼ��أ�
define('VENDOR',BASEPATH . '/../vendor/');
define('GROWTH_DIR',VENDOR.'house365/esfadmin/esfadmin/module/growth_nj/');
if(file_exists(GROWTH_DIR.'base.inc.php'))
{
    include_once GROWTH_DIR.'base.inc.php';
}


/*
|--------------------------------------------------------------------------
| User session key
|--------------------------------------------------------------------------
|
| Use this session key in each App local area.
|
*/
define('USER_SESSION_KEY', 'zsb_user');


/*
|--------------------------------------------------------------------------
| Page static source URL
|--------------------------------------------------------------------------
|
| Page static source URL for each site.
|
*/
define('STATIC_BADWORD_URL', 'http://esf.fz.house365.com'.'/common/banwords/banwords.txt');
$IpHostAllow =explode('.',GetIp());
if($IpHostAllow['0']=='192' || $IpHostAllow['0']=='127')
{
    if(GB_CITY=='nj')
    {
        //LUC��ַ����
        define('NS_SELL','192.168.105.243:96');
        define('NS_RENT','202.102.83.182:98/rent');

        //�м��ˢ�·�Դ��ַ
        define('REFRESH_URL', "http://192.168.105.243:100/Housenew/API?city=NJ");
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_HOUSE_S_URL', "http://192.168.105.243:100/Housenew/BAPI?city=NJ");
    }
    elseif(GB_CITY=='hf')
    {
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_URL', "http://192.168.105.243:100/Housenew/API?city=HF");
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_HOUSE_S_URL', "http://192.168.105.243:100/Housenew/BAPI?city=HF");

        //���ַ�LUC��ַ
        //define('NS_SELL','zjj182.house365.com:1096');
        define('NS_SELL','192.168.105.106:99');

        //�ⷿLUC��ַ
        define('NS_RENT','202.102.83.187:99');
    }
    elseif(GB_CITY=='wx')
    {
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_URL', "http://192.168.105.243:100/Housenew/API?city=WX");
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_HOUSE_S_URL', "http://192.168.105.243:100/Housenew/BAPI?city=WX");

        //���ַ�LUC��ַ
        //define('NS_SELL','zjj182.house365.com:1096');
        define('NS_SELL','172.17.1.106:99');

        //�ⷿLUC��ַ
        define('NS_RENT','202.102.83.187:99');
    }
    elseif(GB_CITY=='wlmq') {
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_URL', "http://192.168.105.243:100/Housenew/API?city=WLMQ");
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_HOUSE_S_URL', "http://192.168.105.243:100/Housenew/BAPI?city=WLMQ");

        //���ַ�LUC��ַ
        //define('NS_SELL','zjj182.house365.com:1096');
        define('NS_SELL', '192.168.105.106:96');

        //�ⷿLUC��ַ
        define('NS_RENT', '202.102.94.178:70');
    }
    elseif(GB_CITY=='mianyang')
    {
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_URL', "http://192.168.105.243:100/Housenew/API?city=MIANYANG");
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_HOUSE_S_URL', "http://192.168.105.243:100/Housenew/BAPI?city=MIANYANG");

        //���ַ�LUC��ַ
        define('NS_SELL','192.168.105.106:96');

        //�ⷿLUC��ַ
        define('NS_RENT','202.102.94.178:70');
    }
    else{
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_URL', "http://192.168.105.243:100/Housenew/API?city=".strtoupper(GB_CITY));
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_HOUSE_S_URL', "http://192.168.105.243:100/Housenew/BAPI?city=".strtoupper(GB_CITY));

        //���ַ�LUC��ַ
        //define('NS_SELL','zjj182.house365.com:1096');
        define('NS_SELL','172.17.1.106:99');

        //�ⷿLUC��ַ
        define('NS_RENT','202.102.83.187:99');



    }
}
else
{
    if(GB_CITY=='nj')
    {
        //LUC��ַ����
        define('NS_SELL','zjj182.house365.com:96');
        define('NS_RENT','zjj182.house365.com:96');

        //�м��ˢ�·�Դ��ַ
        define('REFRESH_URL', "http://zjj182.house365.com:100/Housenew/API?city=NJ");
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_HOUSE_S_URL', "http://zjj182.house365.com:100/Housenew/BAPI?city=NJ");
    }
    elseif(GB_CITY=='hf')
    {
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_URL', "http://zjj182.house365.com:100/Housenew/API?city=HF");
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_HOUSE_S_URL', "http://zjj182.house365.com:100/Housenew/BAPI?city=HF");

        //���ַ�LUC��ַ
        //define('NS_SELL','zjj182.house365.com:1096');
        define('NS_SELL','zjj182.house365.com:1096');

        //�ⷿLUC��ַ
        define('NS_RENT','zjj182.house365.com:1096');
    }
    elseif(GB_CITY=='wx')
    {
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_URL', "http://zjj182.house365.com:100/Housenew/API?city=WX");
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_HOUSE_S_URL', "http://zjj182.house365.com:100/Housenew/BAPI?city=WX");

        //���ַ�LUC��ַ
        //define('NS_SELL','zjj182.house365.com:1096');
        define('NS_SELL','zjj182.house365.com:1096');

        //�ⷿLUC��ַ
        define('NS_RENT','zjj182.house365.com:1096');
    }elseif(GB_CITY=='wlmq')
    {
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_URL', "http://zjj182.house365.com:100/Housenew/API?city=WLMQ");
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_HOUSE_S_URL', "http://zjj182.house365.com:100/Housenew/BAPI?city=WLMQ");

        //���ַ�LUC��ַ
        //define('NS_SELL','zjj182.house365.com:1096');
        define('NS_SELL','zjj182.house365.com:1096');

        //�ⷿLUC��ַ
        define('NS_RENT','zjj182.house365.com:70');
    }
    elseif(GB_CITY=='mianyang')
    {
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_URL', "http://zjj182.house365.com:100/Housenew/API?city=MIANYANG");
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_HOUSE_S_URL', "http://zjj182.house365.com:100/Housenew/BAPI?city=MIANYANG");

        //���ַ�LUC��ַ
        //define('NS_SELL','zjj182.house365.com:1096');
        define('NS_SELL','zjj182.house365.com:1096');

        //�ⷿLUC��ַ
        define('NS_RENT','zjj182.house365.com:1096');
    }elseif(GB_CITY=='ph')
    {
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_URL', "http://zjj182.house365.com:100/Housenew/API?city=PH");
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_HOUSE_S_URL', "http://zjj182.house365.com:100/Housenew/BAPI?city=PH");

        //���ַ�LUC��ַ
        //define('NS_SELL','zjj182.house365.com:1096');
        define('NS_SELL','zjj182.house365.com:1096');

        //�ⷿLUC��ַ
        define('NS_RENT','zjj182.house365.com:1096');
    }elseif(GB_CITY=='tx')
    {
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_URL', "http://zjj182.house365.com:100/Housenew/API?city=TX");
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_HOUSE_S_URL', "http://zjj182.house365.com:100/Housenew/BAPI?city=TX");

        //���ַ�LUC��ַ
        //define('NS_SELL','zjj182.house365.com:1096');
        define('NS_SELL','zjj182.house365.com:1096');

        //�ⷿLUC��ַ
        define('NS_RENT','zjj182.house365.com:1096');
    }
    else
    {
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_URL', "http://zjj182.house365.com:100/Housenew/API?city=".strtoupper(GB_CITY));
        //�м��ˢ�·�Դ��ַ
        define('REFRESH_HOUSE_S_URL', "http://zjj182.house365.com:100/Housenew/BAPI?city=".strtoupper(GB_CITY));

        //���ַ�LUC��ַ
        //define('NS_SELL','zjj182.house365.com:1096');
        define('NS_SELL','zjj182.house365.com:1096');

        //�ⷿLUC��ַ
        define('NS_RENT','zjj182.house365.com:1096');
    }

}

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