<?

	if( $_SERVER['HTTP_HOST'] == 'yjs.job1001.com' || $_SERVER['HTTP_HOST'] == 'yjstest.job1001.com'||$_SERVER['HTTP_HOST'] == 'campus.1001.job1001.com'){
	//做特殊判断
		$php_self = $_SERVER['PHP_SELF'];
		//include "/usr/www/job/campusNew".$php_self;
		include "/usr/www/job/campusNew/v/web/v1".$php_self;
		exit;
	}
// print_r(856);exit;
if( $_SERVER['HTTP_HOST'] == 'haizhi.job1001.com'){
	//做特殊判断
		$php_self = $_SERVER['PHP_SELF'];
		//include "/usr/www/job/campusNew".$php_self;
		include "/usr/www/job/campusNew/v1/web/v1".$php_self;
		exit;
	}

	if( substr($_SERVER['HTTP_HOST'],0,4) == 'www.' && substr($_SERVER['HTTP_HOST'],-4,4) == '.com'){
		$http_host_tmpArr 		= explode('.',$_SERVER['HTTP_HOST']);
		$http_host_tmpArr_cnt 	= count($http_host_tmpArr);
		if( count($http_host_tmpArr) >= 4 ){
		//如www.byq.jdjob1001.com
			@header( 'Location:http://'.implode('.',array_slice($http_host_tmpArr,1,$http_host_tmpArr_cnt-1)) );
			exit;
		}
	}

	if( $_SERVER['HTTP_HOST'] == '120.job1001.com' || $_SERVER['HTTP_HOST'] == 'yx.job1001.com'|| $_SERVER['HTTP_HOST'] == 'drug.job1001.com'){
	//做特殊判断
		$host=str_replace('job1001','yl1001',$_SERVER['HTTP_HOST']);
		//	@header( 'Location:http://'.$host );
		exit;
	}



	//首页程序
	//林洪文 2011年10月24日8:55:49
	//修改：1、改版
	session_start();
	if($_GET['nojump']==1){
	//如果有这个参数就不做跳转
		$_SESSION['nojump']  = 1;
	}
	
	$nojump_configArr = array('www.hsrc.gov.cn','baoan1000.job1001.com' , 'hsrc.job1001.com' ,'gongyi.yl1001.com' ,'nanshan.yl1001.com','pingshan.yl1001.com','longhua.yl1001.com','longgang.yl1001.com' ,'longhuatest.yl1001.com');	
	if(in_array($_SERVER['HTTP_HOST'],$nojump_configArr)){
		$_SESSION['nojump']  = 1;
	}
	
	// if($_SERVER['HTTP_HOST'] == 'www.hsrc.gov.cn'||$_SERVER['HTTP_HOST'] == 'baoan1000.job1001.com' || $_SERVER['HTTP_HOST'] == 'hsrc.job1001.com' ||$_SERVER['HTTP_HOST'] == 'gongyi.yl1001.com' ||$_SERVER['HTTP_HOST'] == 'nanshan.yl1001.com' ){//红山的不要手机版
		// $_SESSION['nojump']  = 1;
	// }
	if($_SESSION['nojump']!=1){
		//判断是否手机浏览
		require_once "iswap.php";
	}
	################################################ 运行到这里表示当前访问者不是通过移动设备（特指wap）访问的 ################################################

	//$_SERVER['HTTP_HOST'] == '192.168.60.201' ? error_reporting(7) : error_reporting(0);
	//定义不默认初始化ado的链接
	define('INT_INITADOLINK_CONST',0);
	//导入前台默认的文件
	//包括各行业资源配置
	require_once dirname(__FILE__)."/incjob1001variable/index/config.common.inc.php";

	if ($template == 'region_gongyi' && $tradeid!=50011) {
		#处理公益网站情况
		$trade_class = new Trade("TradeBase");
		$tradeinfo = $trade_class->getTradeItem($tradeid);
		
		$tradeid = $tradeinfo['regionid'];
	}

	//首页标识
	if($_GET['test'] == '056'){
		//echo $whe_Tradezp;
		if($_GET['template']){
			$template = $_GET['template'];
		}
	}
	$nowUrlPath 		= "index";
	//首页导航条标识
	$this_menu_nav_code	= 'index';

	//搜索引擎的VIP版企业的转向
	$urlPathStr = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
	if (strstr($urlPathStr,'.asp')) {
		$urlPathStr = str_replace('.asp','.php',$urlPathStr);
		//重定向至指定的页面
		@header("Location:$urlPathStr");
	}
	if(gp('v')=='2014'){
	  $template = 'trade_2014';
	 }
	 if(gp('v')=='2015'){
	  $template = 'region_2015';
	 }
	 if(gp('v')=='2016'){
	  $template = 'trade_2016';
	 }
	 if(gp('v1')=='2016'){
	  $template = 'region_2016';
	 }

	 if($template=='trade_2014'){
	 //新版行业网站获取网站数据文件
	  include "template/common/trade_getdata.php";
	 }


	if($template!='job1001_2015' and $template!='region_2015'){
		################################################ 导入缓存 ################################################
		require_once "inc/indexCache/trade/index.php";

		################################################ 导入模板 ################################################
		$trade_zw_position_job_index_class = new Trade_zw_position_job_index('Trade_zw_position_job_indexBase');
		$trade_zw_postion_flag = $trade_zw_position_job_index_class->isTradePositionIndex($tradeid);
		if($trade_zw_postion_flag){
			$trade_zw_postion_list = $trade_zw_position_job_index_class->getTradePostionList($tradeid);
			$trade_zw_info_list = $trade_zw_position_job_index_class->getProductListIndex($tradeid,$tradeTotalid);
		}
	}

	if($template=='job1001_2012'){
		//$template = 'job1001_2015';
	}
	if($template=='job1001_2015'){
	  	include_once "template/job1001_2015/job1001_getdate.php";
	}
	if($template=='region_2015'||$template=='region_2016'||$template=="region_gongyi"){
	  	include_once "template/region_2015/job1001_getdate.php";
	}

	if($template=='region_2018'){
	  	include_once "template/region_2018/job1001_getdate.php";
	}
    if($template=='region_2025'){
        include_once "template/region_2025/job1001_getdate.php";
    }
	$dir_url = "template/".$template."/index.html";
	if ($template == "region_gongyi") {
		#公益网站使用region_2015模板
		$dir_url = "template/region_2015/index.html";
	}

	//if(@file_exists($dir_url)){
		require_once $dir_url;
	//}

	if($template!='job1001_2015' && $template!='region_2015' && $template!='trade_2016'&& $template!='region_2016'){
	?>
    <link type="text/css" rel="stylesheet" href="<?=$picPath_global?>/js/weebox/weebox.css" />
	<script src="<?=$picPath_global?>/js/weebox/weebox.js" type="text/javascript"></script>
	<script src="<?=$picPath_global?>/js/weebox/bgiframe.js" type="text/javascript"></script>
    <?
	}
	//################################################ 通过js调用生成程序 ################################################
	if($template!='job1001_2015'||$template!='region_2015' ){
		foreach($cache_netArray as $domainname){
			echo '<script type="text/javascript" src="'.$domainname.'/inc/createCache/index.php?url='.$my_url.'"></script>';
		}
		if(defined('APP_ENV')&&APP_ENV==10){
			echo '<script language="javascript" type="text/javascript" src="http://192.168.60.201/statistics/job1001stat.js"></script>';
		}
	}
	if( !in_array($_SERVER['HTTP_HOST'],$nojump_configArr) ){
		if( time()<strtotime('2021-08-16') ) {
			echo '<div class="policy-ad" style="z-index: 9999;position: fixed;bottom: 26px;left: 10px;">
			  <div class="" style="position: relative;">
				<a href="javascript:;" style="display: block;cursor:default;">
				   <div class="" style="width: 324px;height: 316px;background-image: url(//img3.job1001.com/zhuanti/2021/policy.png?v=1);background-size:100% 100%"></div>
				  <div class="policy-ad-close" style="position: absolute; top:-12px; right: -26px; width: 17px;    height: 17px;    cursor: pointer;    background: url(//img3.job1001.com/zhadui/4.0/images/mondayThreeClock/qr-close.png) repeat center;background-size:100% 100%"></div>
				</a>
			  </div>
			</div>
			<script>
				$(".policy-ad-close").click(function(){
					$(".policy-ad").hide();
				})
			</script>
			';
		}
	}


	//新版地区网站不加载视频
	//380个网站的判断归类--------网站右下角的广告！
	if($tradeid=='1000'){
	//if(($template!='region_2015'||$tradeid=='440300')&& $template!='trade_2016'&&$tradeid!='5' ){ //挂变更网站logo公告的暂时去掉右下角一览视频
		include_once "notice/vedio_index.php";
	}
	
	

?>
