<?php
error_reporting(0); 
date_default_timezone_set('PRC');
//////////////////判断有木有安装////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$wenjian='../../../../config/houzhi-lock.txt';
if(file_exists($wenjian)){
include("../../../../config/os.php");
//新增功能
include("../../../../config/wxlist.php");
//新增功能
}else{
$str ="<script>location.href='/install/'</script>";
$str2=base64_encode($str);
echo $str2;
exit;
}
//////////////////IP判断跳转////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$ip= getIP();
$type="WHERE ip='$ip'";
$ts=queryall(ts,$type);
if($ts[zt]=='禁止访问'){
$content2 ="<script>location.href='/tserr$dshz'</script>";
$daima2=base64_encode($content2);
echo $daima2;
exit;
}
//////////////////判断来源格式///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$stcode=ubo($_GET['code']);
if (strpos($stcode, 'ubo') !== false) {
$ppp = explode('ubo',$stcode); 
$code=$ppp['0'];
$lx=$ppp['1'];
}
$ddh=substr($code,-10);
$zykey=substr($code,0,32);
if($lx=='gl'){
$zypd='../../../../peizhi/xt/'.$zykey.'.txt'; 
$content = file_get_contents($zypd); 
if (strpos($content, '|ubo|') !== false) {
$pontent = explode('|ubo|',$content); 
$zyid=$pontent[0];
$userid=$pontent[1];
$sj=$pontent[2];
$money=$pontent[3];
$lei=$pontent[4];
}
}else{
$zypd='../../../../peizhi/dl/'.$zykey.'.txt'; 
$content = file_get_contents($zypd); 
if (strpos($content, '|ubo|') !== false) {
$pontent = explode('|ubo|',$content); 
$zyid=$pontent[0];
$userid=$pontent[1];
$sj=$pontent[2];
$money=$pontent[3];
$lei=$pontent[4];
}
}
$type="where userid='$userid'";
$user=queryall(user,$type);
if($user[pb]==1 or $user==null){
$str ="<script>location.href='http://www.baidu.com'</script>";
$str2=base64_encode($str);
echo $str2;
exit;
}
//已经付款跳转播放======================================================
$cgpd=md5($ddh.$userid.$zyid.$ip);
$cgdd='../../../../peizhi/ddh/'.$cgpd.'.txt';
$cgddh = file_get_contents($cgdd); 
if(file_exists($cgdd)){
$geturl='/bofang-'.base64_encode($cgddh.'|ubo|'.$lx).'-'.$user[mb].'.html';
$str ="<script>location.href='$geturl'</script>";
$str2=base64_encode($str);
echo $str2;
exit;
}
//已经付款跳转播放======================================================
$dscs=rand(10,300);
$daliname="代理";
if($lei==0){
if($sjsz==1){
if($sj==$money){
$mo=$money;
}else{
$mo=rand($sj,$money).'.'.rand($sj,$money).rand(1,9);
}
}else{
$mo=$money;
}
$paymoney=$mo;
}else{
if($sjsz==1){
if($sj==$money){
$mo=$money;
}else{
$mo=rand($sj,$money).'.'.rand($sj,$money).rand(1,9);
}
}else{
$mo=$money;
}
$paymoney=$lei;
}
$bjpic="/2019newui/bj/".rand(1,20).".jpg";
$paycode=base64_encode($ddh.'|ubo|'.$paymoney.'|ubo|'.$userid.'|ubo|'.$zyid.'|ubo|'.$lx.'|ubo|'.$ip);
$tx="/2019newui/images/tx.png";
//新增功能
if($kg==1){
$biaoshi=md5($shijian.$paycode);
$link='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$type="(`id`, `wxname`, `code`, `link`, `userid`,`pic`, `openid`, `shijian`, `biaoshi`, `neirong`) VALUES (null,'录入中','录入中','$link','$userid','录入中','录入中','$shijian','$biaoshi','$paycode')"; 
dbinsert(wxlist,$type);
}
//新增功能
$paycodeto=base64_encode($zyid);
$listlink='http://'.$_SERVER['HTTP_HOST'].'/zonglink-'.$paycodeto.$dshz;  
//执行代码
if(file_exists($zypd)){
$str4 ="<!DOCTYPE html>";
$str4.='<html lang="en">';
$str4.="<head>";
$str4.='<meta http-equiv="Content-Type" content="text/html; charset=gb2312">';
$str4.='<meta charset="gb2312">';
$str4.='<meta name="viewport" content="width=device-width,initical-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">';
$str4.='<title>'.iconv("GB2312","UTF-8",'-').'</title>';
$str4.='<script type="text/javascript" src="/2019newui/js/jquery.min.js"></script>';
$str4.='<script type="text/javascript" src="/2019newui/js/ubo.js"></script>';
$str4.='<link rel="stylesheet" href="/moban/ds/3/dashang.css">';
$str4.="</head>";
$str4.="<body>";
$str4.='<div id="background" style="position:absolute;z-index:-1;width:100%;height:100%;top:0px;left:0px;">';
$str4.='<img src="'.$bjpic.'" width="100%" height="100%"/>';
$str4.='</div> ';
$str4.='<div class="content">';
$str4.='<div class="nav"><img src="/moban/ds/3/redbg.png"> ';
$str4.='<p class="p1"></p>';
$str4.='<p class="p2"></p>';
$str4.='<div class="reward" style="">';
$str4.='<div class="button" style="width:100%;font-size:15px;height:40px;line-height:40px;">';
$query = mysql_query("SELECT * FROM hzpay   WHERE   sz='1'");
while($a = mysql_fetch_array($query)) {
$str4.='<a   onClick="pay()"  style="background:#fae2b2;border-radius:10px; color:#d35b4d;display:inline-block;width:100%;height:40px;font-weight:bold;margin-left:1px">'.iconv("GB2312","UTF-8",'立即观看').'</a>';
}
$str4.='</div> ';
$str4.='<a href="'.$listlink.'"><button type="button" class="submit1">'.iconv("GB2312","UTF-8",'更多精彩视频').'</button></a>';
$str4.='</div> ';
$str4.='<div style="text-align:center; color:#fff; font-size:14px; margin-top:10px; padding:10px; "> ';
$str4.=iconv("GB2312","UTF-8",'壹瓶水钱----感谢支持');
$str4.='</div> ';
$str4.='</div> ';
$str4.='</div> ';
$str4.='<div class="footer" ><a href="/ts'.$dshz.'">   &nbsp;&nbsp;&nbsp;'.iconv("GB2312","UTF-8",'投诉').'</a></div>';
$str4.='<div style="width:100%;height:100%;background:#000;position:fixed;top:0; filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity:0.5;" id="touming"></div>';
$query = mysql_query("SELECT * FROM hzpay   WHERE   sz='1'");
while($a = mysql_fetch_array($query)) {
$str4.='<script type="text/javascript">'."\r\n";
$str4.='function pay(){'."\r\n";
$str4.="var _loading = '".'<div class="_loading" style="position:fixed;left:50%;top:40%;margin-left:-40px;width:100px;height:80px;border-radius:5%;background:#000;opacity:0.8;background:#000 url(/2019newui/images/loading.gif) center 12px no-repeat;background-size:25px;z-index:99999;color:#fff;text-align:center;font-size:12px;"><br><br><br>'.iconv("GB2312","UTF-8",'正在提交订单').'</div>'."';"."\r\n";
$str4.="$('body').append(_loading);"."\r\n";
//新处理
if($kg==1){
$str4.="window.location.href='".'/wxlogin-'.$biaoshi.".html';"."\r\n";
}else{
$str4.="window.location.href='".'/topay/'.$a[biaoshi].'/'.$paycode."/';"."\r\n";
}
//新处理
$str4.='}'."\r\n";
$str4.='</script>'."\r\n";
}
$str4.="</body>";
$str4.="</html>";
$str20=base64_encode($str4);
$str ='<script type="text/javascript">';
$str.='var b = new Base64();';
$str.='var str = b.decode('."'".$str20."'".');';
$str.='document.write(str);';
$str.='</script>';
$str2=base64_encode($str);
echo $str2;
}else{
$str4 ='<!DOCTYPE html>';
$str4.='<html>';
$str4.='<head>';
$str4.='<meta charset="gb2312">';
$str4.='<title>'.iconv("GB2312","UTF-8",'找不到视频文件或连接已被删除').'</title>';
$str4.='<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">';
$str4.='<meta name="apple-mobile-web-app-capable" content="yes">';
$str4.='<meta name="apple-mobile-web-app-status-bar-style" content="black">';
$str4.='</head>';
$str4.='<body style="background-color: #f0f0f0;">';
$str4.='<div class="mui-content">';
$str4.='<div class="container" style="text-align: center;margin:7.5rem 0 0">';
$str4.='<div class="tip_img"><img src="/2019newui/images/err.png" alt="404" style="width:2.9rem"></div>';
$str4.='<p style="font-size:0.7rem;margin:1.1rem 0 0;color:#666666;font: 20px/1.5 "Microsoft YaHei",arial,tahoma,\5b8b\4f53,sans-serif;">'.iconv("GB2312","UTF-8",'找不到视频文件或连接已被删除').'</p>';
$str4.='</div>';
$str4.='</div>';
$str4.='</body>';
$str4.='</html>';
$str2=base64_encode($str4);
echo $str2;
exit;
}
?>