<?php 
error_reporting(0); 
include("../../../config/os.php");
$id=base64_decode($_GET[id]);
$type="where id='$id'";
$daili=queryall(daili,$type);
if(!$daili){
echo err();exit;
}
$type="where userid='$daili[userid]'";
$user=queryall(user,$type);
if($user[pb]==1 or $user==null){
$str ="<script>location.href='http://www.baidu.com'</script>";
echo $str;
exit;
}
$lurl='/tzzonglink-'.$_GET[id].'-'.$user[mb].$dshz;
$fhurl=base64_encode($lurl);
$pdurl='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
if (strpos($pdurl, '?id=') !== false) {
$p = explode('?id=',$pdurl); 
$pdid=$p[1];
}else{
$pdid='0';
}
?>
<!DOCTYPE html>
<html lang="zh"><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta content="width=device-width, initial-scale=1.0, user-scalable=0" name="viewport">
<title>-</title>
<link href="/mb/8/bootstrap.css" rel="stylesheet">
<link href="/mb/8/font-awesome.min.css" rel="stylesheet">
<link href="/mb/8/home.css" rel="stylesheet">
<script src="/2019newui/js/jquery.min.js"></script>
<script src="/layui/layui.js" charset="utf-8"></script> 
<style>
.btn{padding:3px 12px;}
#qrbg {width: 320px; height:480px; }
#domain2 {position: absolute; color:#000000; font-weight:900;z-index: 2;font-size:20px; left: 160px; top: 365px; }
#domain1{ position: absolute; color:#000000; font-weight:900; z-index: 2; font-size:20px; left: 160px; top: 336px; }
#domain3 {position: absolute; color:#000000; font-weight:900;z-index: 2;font-size:13px; left: 143px; top: 399px; }
#saveBtn { position: absolute; width: 218px; height: 40px; z-index: 2; left: 49px; top: 405px;cursor:pointer }
</style>
</head>
<body>
<header id="header">
<div class="header-container">
<nav class="path_bar">
<div class="word_wrapper">
<ul class="menu_container">
<li class="menu_items"><a href="<?php echo $pdurl?>" class="type home status_show">首页</a></li>
<li class="menu_items"><a href="/new-<?php echo $daili[userid]?>-<?php echo $fhurl?><?php echo $dshz?>" class="type apen">今日更新</a></li>
<li class="menu_items"><a href="/dsyzf-<?php echo $user[mb]?>-<?php echo $fhurl?><?php echo $dshz?>" class="type">我的打赏</a></li>
<?php
$query = mysql_query("SELECT * FROM dlfl WHERE userid='$daili[userid]' and yc='1' ");
while($a = mysql_fetch_array($query)) {
?> 
<li class="menu_items"><div><a href="/flshow-<?php echo $daili[userid]?>-<?php echo $fhurl?>-<?php echo $a[id]?><?php echo $dshz?>" class="type home"><?php echo $a[name]?></a></div></li>
<?php }?>
</ul>
<div class="arrow_right_mobile">
</div>
</div>
</nav></header>
<div id="container">
<section class="sectionContent">
<?php
$query = mysql_query("SELECT * FROM dlfl WHERE userid='$daili[userid]' and yc='1' ");
while($a = mysql_fetch_array($query)) {
$sql = mysql_query("SELECT * FROM daili where flid='$a[id]'");
$bs = mysql_num_rows($sql);
?> 
<?php if($bs>0){?>
<div class="videoGroup">
<div class="section-title grayBorder">
<h2><?php echo $a[name]?></h2>
<div class="cat_select_wrap"><button class="btn btn-info"  onClick="list('<?php echo $a[id]?>')"><i class="fa fa-refresh fa-spin"></i> 换一批</button></div>
</div>
<div class="video-wrapper index_M" id='list<?php echo $a[id]?>'>
<div id="loading<?php echo $a[id]?>" class="loader" style="display: none;">
<div class="loader-inner ball-beat">
<div></div>
<div></div>
<div></div>
</div>
</div>
<?php
$query2 = mysql_query("SELECT * FROM daili where flid='$a[id]'   order by id asc   limit 6");
while($ab = mysql_fetch_array($query2)) {
?> 		
<div class="col-style d-4 m-2 lazy loaded">
<a href="<?php echo $ab[link]?>"  class="videoBox">
<div class="videoBox_wrap">
<div class="videoBox-cover" style="background-image: url(<?php if($ab[pic]){?><?php echo $ab[pic]?><?php }else{?>/2019newui/images/nopic.jpg<?php }?>);">
</div>
<span class="video-tag free"><?php if($ab[lx]==1){?>打赏<?php }else{?>免费<?php }?></span>
</div>
<div class="videoBox-info"><span class="title"><?php echo $ab[name]?></span></div>
<div class="videoBox-action">
<span class="views"><i class="fa fa-eye"></i><span class="number"><script>document.write(parseInt(Math.random()*(6000-3000)+3000)); </script></span></span><!--<span class="likes"><i class="fa fa- heart"></i><span class="number"><script>document.write(parseInt(Math.random()*(9000-3000)+3000)); </script></span>--></span>
</div>
</a>
</div>
<?php }?>
</div>
</div>
<?php }?>
<?php }?>
</section>
</div>
<script>
function list(id){
$("#loading"+id+"").show();
$.ajax({
type : "post",
url : "/mbpost/",
dataType: "json",  
async: true,
data: {flid: id,userid: '<?php echo $daili[userid]?>',lx: 'shouye'},		
timeout: 10000 ,
success: function(data){

if(data.zt=='true'){  
$("#loading"+id+"").hide();
if (data.data.length > 0) {
appendData(data.data,id);
}else{
$("#loading"+id+"").hide();
layer.msg('没有更多了');
}
}
}
	
});
}
function appendData(data,id) {
$("#list"+id+"").html('<div id="loading'+id+'" class="loader" style="display: none;"><div class="loader-inner ball-beat"><div></div><div></div><div></div></div></div>');
for (var i in data) {
var hit=parseInt(Math.random()*(9000-300)+300);
var str = '<div class="col-style d-4 m-2 lazy loaded"><a  href="'+data[i].url+'"  class="videoBox">'+
'<div class="videoBox_wrap"><div class="videoBox-cover" style="background-image: url('+data[i].pic+');"></div>'+
'<span class="video-tag free">'+data[i].lx+'</span></div><div class="videoBox-info"><span class="title">'+data[i].name+'</span></div><div class="videoBox-action"><span class="views"><i class="fa fa-eye"></i><span class="number">'+data[i].cs+'</span></span></span></div>'+'</a></div>';
var li = $(str);
$("#list"+id+"").append(li);
}
}
</script>
<script>
layui.use(['form', 'layedit', 'laydate', 'element', 'jquery', 'upload', 'layer'], function(){
var form = layui.form
,layer   = layui.layer
,layedit = layui.layedit
,element = layui.element
,upload  = layui.upload
,$       = layui.jquery
,laydate = layui.laydate;
});
</script>
<script>
function onBridgeReady(){
WeixinJSBridge.call('hideOptionMenu');
}
if (typeof WeixinJSBridge == "undefined"){
if( document.addEventListener ){
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
}else if (document.attachEvent){
document.attachEvent('WeixinJSBridgeReady', onBridgeReady); 
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
}
}else{
onBridgeReady();
}
document.oncontextmenu = function(){
    event.returnValue = false;
}
</script>
</body>
</html>