<?php
error_reporting(0);
include("../../config/ht.php");
include("aqm.php");
session_start();
if(!isset($_SESSION['adminname'])){echo "<script>alert('请重新登录!')</script><script>top.location.href='/$htlj/'</script>";exit;}
$adminname=$_SESSION['adminname'];
$type="where name='$adminname'";
$adminpd=queryall(admin,$type);
if(!$adminpd){echo "<script>alert('请重新登录!')</script><script>top.location.href='/$htlj/'</script>";exit;}
if($_POST){
$appid=ubo(iconv("UTF-8","GB2312",$_POST["appid"]));
$key=ubo(iconv("UTF-8","GB2312",$_POST["key"]));
$mchid=ubo(iconv("UTF-8","GB2312",$_POST["mchid"]));
$appsecret=ubo(iconv("UTF-8","GB2312",$_POST["appsecret"]));
$partner=ubo(iconv("UTF-8","GB2312",$_POST["partner"]));
$htlj1=ubo(iconv("UTF-8","GB2312",$_POST["htlj"]));
$lx=ubo($_POST[lx]);
$kg=ubo(iconv("UTF-8","GB2312",$_POST["kg"]));
$playxs1=ubo(iconv("UTF-8","GB2312",$_POST["playxs"]));
$playts1=ubo(iconv("UTF-8","GB2312",$_POST["playts"]));
$playms1=ubo(iconv("UTF-8","GB2312",$_POST["playms"]));
$bjlx=ubo($_POST[bjlx]);
$dwzjk1=ubo(iconv("UTF-8","GB2312",$_POST["dwzjk"]));
$pic1=ubo(iconv("UTF-8","GB2312",$_POST["pic"]));
$mb1=ubo(iconv("UTF-8","GB2312",$_POST["mb"]));
$sjsz1=ubo(iconv("UTF-8","GB2312",$_POST["sjsz"]));
$wx1=ubo(iconv("UTF-8","GB2312",$_POST["wx"]));
$ymjc1=ubo(iconv("UTF-8","GB2312",$_POST["ymjc"]));
$lm1=ubo(iconv("UTF-8","GB2312",$_POST["lm"]));
$zxm1=ubo(iconv("UTF-8","GB2312",$_POST["zxm"]));
$zdm1=ubo(iconv("UTF-8","GB2312",$_POST["zdm"]));
$payid=ubo(iconv("UTF-8","GB2312",$_POST["payid"]));
$paywg=ubo(iconv("UTF-8","GB2312",$_POST["paywg"]));
$paykey=ubo(iconv("UTF-8","GB2312",$_POST["paykey"]));
$name1=ubo(iconv("UTF-8","GB2312",$_POST["name"]));
$reg1=ubo(iconv("UTF-8","GB2312",$_POST["reg"]));
$yqmkg1=ubo(iconv("UTF-8","GB2312",$_POST["yqmkg"]));
$fl1=ubo(iconv("UTF-8","GB2312",$_POST["fl"]));
$dshz1=ubo(iconv("UTF-8","GB2312",$_POST["dshz"]));
$shipinsj1=ubo(iconv("UTF-8","GB2312",$_POST["shipinsj"]));
$yqm1=ubo(iconv("UTF-8","GB2312",$_POST["yqm"]));
$sh1=ubo(iconv("UTF-8","GB2312",$_POST["sh"]));
$url1=ubo(iconv("UTF-8","GB2312",$_POST["url"]));
$gg1=ubo(iconv("UTF-8","GB2312",$_POST["hezigg"]));
$hezi1=ubo(iconv("UTF-8","GB2312",$_POST["hezi"]));
$txcs1=ubo(iconv("UTF-8","GB2312",$_POST["txcs"]));
$tipto=ubo(iconv("UTF-8","GB2312",$_POST["tip"]));
$tipto1=ubo(iconv("UTF-8","GB2312",$_POST["tip1"]));
$tipto2=ubo(iconv("UTF-8","GB2312",$_POST["tip2"]));
$yulan1=ubo(iconv("UTF-8","GB2312",$_POST["yulan"]));
$shipin1=ubo(iconv("UTF-8","GB2312",$_POST["shipin"]));
$txmoney1=ubo(iconv("UTF-8","GB2312",$_POST["txmoney"]));
$yye1=ubo(iconv("UTF-8","GB2312",$_POST["yye"]));
$daymoney1=ubo(iconv("UTF-8","GB2312",$_POST["daymoney"]));
$weixin1=ubo(iconv("UTF-8","GB2312",$_POST["weixin"]));
$js1=ubo(iconv("UTF-8","GB2312",$_POST["js"]));
$kl1=ubo(iconv("UTF-8","GB2312",$_POST["kl"]));
$fy1=ubo(iconv("UTF-8","GB2312",$_POST["fy"]));
$tz1=ubo(iconv("UTF-8","GB2312",$_POST["tz"]));
$gb1=ubo(iconv("UTF-8","GB2312",$_POST["gb"]));
$pcurl1=ubo(iconv("UTF-8","GB2312",$_POST["pcurl"]));
$pc1=ubo(iconv("UTF-8","GB2312",$_POST["pc"]));
$lei1=ubo(iconv("UTF-8","GB2312",$_POST["lei"]));
$ewm1=ubo(iconv("UTF-8","GB2312",$_POST["ewm"]));
$squrl=ubo(iconv("UTF-8","GB2312",$_POST["squrl"]));
$postid=ubo($_POST['id']);
$userid=iconv("UTF-8","GB2312",ubo($_POST['userid']));
$postaqm=ubo(md5($_POST[aqm]));
$postname=iconv("UTF-8","GB2312",ubo($_POST[name]));
$code=iconv("UTF-8","GB2312",ubo($_POST[code]));
$biaoti=iconv("UTF-8","GB2312",ubo($_POST['biaoti']));
$zt=iconv("UTF-8","GB2312",ubo($_POST['zt']));
$neirong=iconv("UTF-8","GB2312",ubo($_POST['neirong']));
if($lx=='yqmsc'){
$spoststr=rtrim($postid, ','); 
$spoststrArray = explode(",",$spoststr);
foreach ($spoststrArray as $spostid){
$type="id='$spostid'";
dbdel(yqm,$type);
} 
echo json_encode(array('zt'=>"1"));
}elseif($lx=='jspb'){
$type="zt='已支付'   where id='$postid'";
upalldt(pay,$type);
$errstr = array ('zt'=>"1");   
echo json_encode($errstr);
}elseif($lx=='yqmtj'){
if($userid==null){
$err=iconv("GB2312","UTF-8","代理ID不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}elseif($code==null){
$err=iconv("GB2312","UTF-8","邀请码标识不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="where yqm='$code'";
$yqm=queryall(yqm,$type);
if($yqm){
$err=iconv("GB2312","UTF-8","邀请码已存在");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="(`id`, `userid`, `yqm`, `shijian`, `name`, `zt`, `lx`) VALUES (null,'$userid','$code','$shijian','','未使用','dl')"; 
dbinsert(yqm,$type);
echo json_encode(array('zt'=>"1"));
}
}
}elseif($lx=='wzsc'){
$spoststr=rtrim($postid, ','); 
$spoststrArray = explode(",",$spoststr);
foreach ($spoststrArray as $spostid){
$type="where id='$spostid'";
$wangzhan=queryall(wangzhan,$type);
$biaoshi=$wangzhan['biaoshi'];
$type="biaoshi='$biaoshi'";
dbdel(tglink,$type);
$type="id='$spostid'";
dbdel(wangzhan,$type);
} 
echo json_encode(array('zt'=>"1"));
}elseif($lx=='dlrzsc'){
$spoststr=rtrim($postid, ','); 
$spoststrArray = explode(",",$spoststr);
foreach ($spoststrArray as $spostid){
$type="id='$spostid'";
dbdel(userrz,$type);
} 
echo json_encode(array('zt'=>"1"));
}elseif($lx=='glrzsc'){
$spoststr=rtrim($postid, ','); 
$spoststrArray = explode(",",$spoststr);
foreach ($spoststrArray as $spostid){
$type="id='$spostid'";
dbdel(adminip,$type);
} 
echo json_encode(array('zt'=>"1"));
}elseif($lx=='djzt'){
if($zt=='true'){
$type="zt='true' where id='$postid'";
upalldt(user,$type);
$err=iconv("GB2312","UTF-8","激活成功");
echo json_encode(array('zt'=>"1",'msg'=>$err));
}else{
$type="zt='false' where id='$postid'";
upalldt(user,$type);
$err=iconv("GB2312","UTF-8","锁定成功");
echo json_encode(array('zt'=>"1",'msg'=>$err));
}
}elseif($lx=='plqc'){
if($postaqm==$aqm){
$type="txmoney='0'";
upalldt(user,$type);
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='plfl'){
$txfl=ubo($_POST['txfl']);
$ids=rtrim($postid, ','); 
$idsArray = explode(",",$ids);
foreach ($idsArray as $id){
$type="txfl='$txfl' where id='$id'";
upalldt(user,$type);
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='plzt'){
$plzt=ubo($_POST['plzt']);
if($plzt=='True'){
$zth='true';
}else{
$zth='false';
}
$ids=rtrim($postid, ','); 
$idsArray = explode(",",$ids);
foreach ($idsArray as $id){
$type="zt='$zth' where id='$id'";
upalldt(user,$type);
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='tj'){
$sqlt="select sum(money) from user";
if ($res=mysql_query($sqlt)){
list($money)=mysql_fetch_row($res);
mysql_free_result($res);
} 
$sqlt="select sum(txmoney) from user";
if ($res=mysql_query($sqlt)){
list($money2)=mysql_fetch_row($res);
mysql_free_result($res);
} 
echo json_encode(array('zt'=>"1",'money'=>$money,'money2'=>$money2));
}elseif($lx=='qc'){
if($postaqm==$aqm){
$query = mysql_query("select * from   user");  
while($a=mysql_fetch_array($query)){  
if($a[money]==0){
}else{
$wjm="../../backup/usermoney.txt";
$neirong='会员ID:'.$a[userid]."      会员账户余额:".$a[money].'      操作时间：'.$shijian  ."\r\n";
file_put_contents($wjm,$neirong,FILE_APPEND);
}
}
$type="money='0'";
upalldt(user,$type);
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='fpiansc'){
$type="id='$postid'";
dbdel(fapian,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='plfpsc'){
$type="id='$postid'";
dbdel(pian,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='usersc'){
$type="where id='$postid'";
$user=queryall(user,$type);
$type="userid='$user[userid]'";
dbdel(yqm,$type);
$type="userid='$user[userid]'";
dbdel(daili,$type);
$type="userid='$user[userid]'";
dbdel(dingdan,$type);
$type="tjr='$user[userid]'";
dbdel(fanyong,$type);
$type="userid='$user[userid]'";
dbdel(gonggao,$type);
$type="userid='$user[userid]'";
dbdel(userrz,$type);
$type="userid='$user[userid]'";
dbdel(kl,$type);
$type="userid='$user[userid]'";
dbdel(link,$type);
$type="userid='$user[userid]'";
dbdel(lishi,$type);
$type="name='$user[name]'";
dbdel(userip,$type);
$type="userid='$user[userid]'";
dbdel(pay,$type);
$type="userid='$user[userid]'";
dbdel(tlink,$type);
$type="userid='$user[userid]'";
dbdel(wangzhan,$type);
$type="id='$postid'";
dbdel(user,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='fpianxg'){
$pass=iconv("UTF-8","GB2312",ubo($_POST['pass']));  
$name=iconv("UTF-8","GB2312",ubo($_POST['name']));  
if($pass==null){
$err=iconv("GB2312","UTF-8","密码不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}elseif($name==null){
$err=iconv("GB2312","UTF-8","用户名不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="name='$name',pass='$pass' where id='$postid'";
upalldt(fapian,$type);
echo json_encode(array('zt'=>"1"));
}
}elseif($lx=='userxg'){
$pass=md5(iconv("UTF-8","GB2312",ubo($_POST['pass'])));  
$ypass=iconv("UTF-8","GB2312",ubo($_POST['pass']));  
if($ypass==null){
$err=iconv("GB2312","UTF-8","密码不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$nikname=iconv("UTF-8","GB2312",ubo($_POST['nikname']));  
$txname=iconv("UTF-8","GB2312",ubo($_POST['txname']));  
$weixin=iconv("UTF-8","GB2312",ubo($_POST['weixin']));  
$qq=iconv("UTF-8","GB2312",ubo($_POST['qq']));  
$tixian=iconv("UTF-8","GB2312",ubo($_POST['tixian']));  
$txfl=iconv("UTF-8","GB2312",ubo($_POST['txfl']));  
$fy=iconv("UTF-8","GB2312",ubo($_POST['fy']));  
$zym=iconv("UTF-8","GB2312",ubo($_POST['zym']));  
$type="nikname='$nikname',txname='$txname',weixin='$weixin',qq='$qq',tixian='$tixian',pass='$pass',txfl='$txfl',ypass='$ypass',fy='$fy',url='$zym'  where id='$postid'";
upalldt(user,$type);
echo json_encode(array('zt'=>"1"));
}
}elseif($lx=='fpianadd'){
$postname=iconv("UTF-8","GB2312",ubo($_POST['name']));
$postpass=iconv("UTF-8","GB2312",ubo($_POST['pass']));
if($postname==null){
$err=iconv("GB2312","UTF-8","用户名不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}elseif($postpass==null){
$err=iconv("GB2312","UTF-8","密码不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="(`id`, `name`, `pass`) VALUES (null,'$postname','$postpass')"; 
dbinsert(fapian,$type);
echo json_encode(array('zt'=>"1"));
}
}elseif($lx=='useradd'){
$postname=iconv("UTF-8","GB2312",ubo($_POST['name']));
$postpass=md5(iconv("UTF-8","GB2312",ubo($_POST['pass'])));
$postypass=iconv("UTF-8","GB2312",ubo($_POST['pass']));
$nikname=iconv("UTF-8","GB2312",ubo($_POST['nikname']));
$qq=iconv("UTF-8","GB2312",ubo($_POST['qq']));
$weixin=iconv("UTF-8","GB2312",ubo($_POST['weixin']));
$txname=iconv("UTF-8","GB2312",ubo($_POST['txname']));
$tixian=iconv("UTF-8","GB2312",ubo($_POST['tixian']));
$txfl=iconv("UTF-8","GB2312",ubo($_POST['txfl']));
$fy=iconv("UTF-8","GB2312",ubo($_POST['fy']));
$shijian=date('Y-m-d H:i:s' ,time());
$type="where zt='正常' and qx='1'  order by rand() limit 1";
$zym=queryall(zym,$type);
if($zym[url]){
$zymurl=$zym[url];
}else{
$zymurl=$url;
}

if($postname=='admin'){
$err=iconv("GB2312","UTF-8","这个账户不允许添加");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}elseif($postname==null){
$err=iconv("GB2312","UTF-8","用户名不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}elseif($postypass==null){
$err=iconv("GB2312","UTF-8","密码不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
if($nikname){
$nikname=iconv("UTF-8","GB2312",ubo($_POST['nikname']));
}else{
$nikname="代理用户";
}
$type="WHERE name='$postname'";
$row=queryall(user,$type); 
$type = "order by id DESC limit 0,1";
$user=queryall(user,$type);
$userid=$user[userid];
if ($userid==null){
$userid="10000";
}else{
$userid=$user[userid]+1;
}
if($row){
$err=iconv("GB2312","UTF-8","会员已存在");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$pic='/2019newui/images/tx.png'; 
$type="(`id`, `userid`, `name`, `tx`, `pass`,`tixian`, `qq`, `weixin`, `txname`, `shijian`,`money`,`zt`,`tjr`,`nikname`,`txmoney`,`txfl`,`yqm`,`ypass`,`pb`,`mb`,`hzmb`,`dsmb`,`skm`,`fy`,`fs`,`url`) VALUES (null,'$userid','$postname','$pic','$postpass','$tixian','$qq','$weixin','$txname','$shijian', '0','true','admin','$nikname', '0', '$txfl','admin','$postypass', '0', '$linkmb','$hezimb','$dsmb','0','$fy','1', '$zymurl')"; 
dbinsert(user,$type);
$type="(`id`, `userid`, `cs`, `ns`) VALUES (null, '$userid', '30', '10')";
dbinsert(link,$type);
$biaoshi=random(100);
$bjs=randColor();
$type="(`id`, `userid`, `name`, `biaoshi`,`bjs`) VALUES (null,'$userid','默认站点','$biaoshi','$bjs')"; 
dbinsert(wangzhan,$type);
echo json_encode(array('zt'=>"1"));
}
}
}elseif($lx=='tlinksc'){
$idsstr=rtrim($postid, ','); 
$idsstrArray = explode(",",$idsstr);
foreach ($idsstrArray as $idsid){
$type="id='$idsid'";
dbdel(tlink,$type);
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='biaoti'){
$postname=ubo(iconv("UTF-8","GB2312",$_POST['name']));  
$type="name='$postname' where id='$postid'";
upalldt(tglink,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='userpb'){
$type="pb='1' where id='$postid'";
upalldt(user,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='userpbjc'){
$type="pb='0' where id='$postid'";
upalldt(user,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='shanchu'){
$idsid=rtrim($postid, ','); 
$idsidArray = explode(",",$idsid);
foreach ($idsidArray as $id){
$bgg="id='$id'";
dbdel(tglink,$bgg);
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='peizhi1'){
$lj="../../config/config.php";  
$nr = '<?php'."\r\n";
$nr .='error_reporting(0); '."\r\n";
$nr .='$name='."'".$name."';"."\r\n";
$nr .='$reg='."'".$reg."';"."\r\n";
$nr .='$yqmkg='."'".$yqmkg."';"."\r\n";
$nr .='$fl='."'".$fl1."';"."\r\n";
$nr .='$dshz='."'".$dshz."';"."\r\n";
$nr .='$shipinsj='."'".$shipinsj."';"."\r\n";
$nr .='$yqm='."'".$yqm1."';"."\r\n";
$nr .='$sh='."'".$sh."';"."\r\n";
$nr .='$url='."'".$url."';"."\r\n";
$nr .='$gg='."'".$gg."';"."\r\n";
$nr .='$hezi='."'".$hezi."';"."\r\n";
$nr .='$txcs='."'".$txcs1."';"."\r\n";
$nr .='$tip2='."'".$tip2."';"."\r\n";
$nr .='$tip1='."'".$tip1."';"."\r\n";
$nr .='$tip='."'".$tip."';"."\r\n";
$nr .='$yulan='."'".$yulan."';"."\r\n";
$nr .='$shipin='."'".$shipin."';"."\r\n";
$nr .='$txmoney='."'".$txmoney1."';"."\r\n";
$nr .='$yye='."'".$yye1."';"."\r\n";
$nr .='$daymoney='."'".$daymoney1."';"."\r\n";
$nr .='$weixin='."'".$weixin."';"."\r\n";
$nr .='$js='."'".$js1."';"."\r\n";
$nr .='$kl='."'".$kl."';"."\r\n";
$nr .='$fy='."'".$fy1."';"."\r\n";
$nr .='$tz='."'".$tz."';"."\r\n";
$nr .='$gb='."'".$gb."';"."\r\n";
$nr .='$pcurl='."'".$pcurl."';"."\r\n";
$nr .='$pc='."'".$pc."';"."\r\n";
$nr .='$lei='."'".$lei."';"."\r\n";
$nr .='$ewm='."'".$ewm."';"."\r\n";
$nr .='$zxm='."'".$zxm1."';"."\r\n";
$nr .='$zdm='."'".$zdm1."';"."\r\n";
$nr .='$lm='."'".$lm1."';"."\r\n";
$nr .='$wx='."'".$wx."';"."\r\n";
$nr .='$ymjc='."'".$ymjc."';"."\r\n";
$nr .='$ymsj='."'".$ymsj."';"."\r\n";
$nr .='$sjsz='."'".$sjsz."';"."\r\n";
$nr .='$dwzjk='."'".$dwzjk."';"."\r\n";
$nr .='$mb='."'".$mb."';"."\r\n";
$nr .='$pic='."'".$pic."';"."\r\n";
$nr .='$dsmb='."'".$dsmb."';"."\r\n";
$nr .='$hezimb='."'".$hezimb."';"."\r\n";
$nr .='$linkmb='."'".$linkmb."';"."\r\n";
$nr .='$htlj='."'".$htlj."';"."\r\n";
$nr .='$playxs='."'".$playxs."';"."\r\n";
$nr .='$playts='."'".$playts."';"."\r\n";
$nr .='$playms='."'".$playms."';"."\r\n";
$nr .='?>';
writefile($lj,$nr);  
$json_data = array ('status'=>"true");   
echo json_encode($json_data);
}elseif($lx=='peizhi2'){
//if (strpos($dshz1, ".") !== false) {

$lj="../../config/config.php";  
$nr = '<?php'."\r\n";
$nr .='error_reporting(0); '."\r\n";
$nr .='$name='."'".$name."';"."\r\n";
$nr .='$reg='."'".$reg."';"."\r\n";
$nr .='$yqmkg='."'".$yqmkg1."';"."\r\n";
$nr .='$fl='."'".$fl."';"."\r\n";
$nr .='$dshz='."'".$dshz1."';"."\r\n";
$nr .='$shipinsj='."'".$shipinsj1."';"."\r\n";
$nr .='$yqm='."'".$yqm."';"."\r\n";
$nr .='$sh='."'".$sh1."';"."\r\n";
$nr .='$url='."'".$url."';"."\r\n";
$nr .='$gg='."'".$gg."';"."\r\n";
$nr .='$hezi='."'".$hezi."';"."\r\n";
$nr .='$txcs='."'".$txcs."';"."\r\n";
$nr .='$tip2='."'".$tip2."';"."\r\n";
$nr .='$tip1='."'".$tip1."';"."\r\n";
$nr .='$tip='."'".$tip."';"."\r\n";
$nr .='$yulan='."'".$yulan1."';"."\r\n";
$nr .='$shipin='."'".$shipin1."';"."\r\n";
$nr .='$txmoney='."'".$txmoney."';"."\r\n";
$nr .='$yye='."'".$yye."';"."\r\n";
$nr .='$daymoney='."'".$daymoney."';"."\r\n";
$nr .='$weixin='."'".$weixin."';"."\r\n";
$nr .='$js='."'".$js."';"."\r\n";
$nr .='$kl='."'".$kl."';"."\r\n";
$nr .='$fy='."'".$fy."';"."\r\n";
$nr .='$tz='."'".$tz."';"."\r\n";
$nr .='$gb='."'".$gb."';"."\r\n";
$nr .='$pcurl='."'".$pcurl."';"."\r\n";
$nr .='$pc='."'".$pc."';"."\r\n";
$nr .='$lei='."'".$lei1."';"."\r\n";
$nr .='$ewm='."'".$ewm."';"."\r\n";
$nr .='$zxm='."'".$zxm."';"."\r\n";
$nr .='$zdm='."'".$zdm."';"."\r\n";
$nr .='$lm='."'".$lm."';"."\r\n";
$nr .='$wx='."'".$wx."';"."\r\n";
$nr .='$ymjc='."'".$ymjc."';"."\r\n";
$nr .='$ymsj='."'".$ymsj."';"."\r\n";
$nr .='$sjsz='."'".$sjsz1."';"."\r\n";
$nr .='$dwzjk='."'".$dwzjk1."';"."\r\n";
$nr .='$mb='."'".$mb1."';"."\r\n";
$nr .='$pic='."'".$pic1."';"."\r\n";
$nr .='$dsmb='."'".$dsmb."';"."\r\n";
$nr .='$hezimb='."'".$hezimb."';"."\r\n";
$nr .='$linkmb='."'".$linkmb."';"."\r\n";
$nr .='$htlj='."'".$htlj1."';"."\r\n";
$nr .='$playxs='."'".$playxs."';"."\r\n";
$nr .='$playts='."'".$playts."';"."\r\n";
$nr .='$playms='."'".$playms."';"."\r\n";
$nr .='?>';
writefile($lj,$nr);  
$htaccess="../../.htaccess";  
$htaccesscontent = '<IfModule mod_rewrite.c>'."\r\n";
$htaccesscontent .='Options +FollowSymlinks'."\r\n";
$htaccesscontent .='RewriteEngine On'."\r\n";
$htaccesscontent .='RewriteCond %{REQUEST_FILENAME} !-d'."\r\n";
$htaccesscontent .='RewriteCond %{REQUEST_FILENAME} !-f'."\r\n";
$htaccesscontent .='ErrorDocument 404 /404.html'."\r\n";
$htaccesscontent .='#代理PC端前台'."\r\n";
$htaccesscontent .='ReWriteRule ^index'.$dshz1.'  /xitong/qiantai/i.php'."\r\n";
$htaccesscontent .='ReWriteRule ^pc'.$dshz1.'  /xitong/qiantai/i.php'."\r\n";
$htaccesscontent .='ReWriteRule ^loginpost'.$dshz1.'  /xitong/qiantai/loginpost.php'."\r\n";
$htaccesscontent .='ReWriteRule ^reg'.$dshz1.'  /xitong/qiantai/reg.php'."\r\n";
$htaccesscontent .='ReWriteRule ^regpost'.$dshz1.'  /xitong/qiantai/regpost.php'."\r\n";
$htaccesscontent .='ReWriteRule ^home'.$dshz1.'  /xitong/qiantai/home.php'."\r\n";
$htaccesscontent .='ReWriteRule ^main'.$dshz1.'  /xitong/qiantai/main.php'."\r\n";
$htaccesscontent .='ReWriteRule ^xinxi'.$dshz1.'  /xitong/qiantai/xinxi.php'."\r\n";
$htaccesscontent .='ReWriteRule ^tui'.$dshz1.'  /xitong/qiantai/tui.php'."\r\n";
$htaccesscontent .='ReWriteRule ^gonggao'.$dshz1.'  /xitong/qiantai/gonggao.php'."\r\n";
$htaccesscontent .='ReWriteRule ^upgg'.$dshz1.'  /xitong/qiantai/gg.php'."\r\n";
$htaccesscontent .='ReWriteRule ^xitong'.$dshz1.'  /xitong/qiantai/xitong.php'."\r\n";
$htaccesscontent .='ReWriteRule ^shipin'.$dshz1.'  /xitong/qiantai/shipin.php'."\r\n";
$htaccesscontent .='ReWriteRule ^fabushipin'.$dshz1.'  /xitong/qiantai/fabushipin.php'."\r\n";
$htaccesscontent .='ReWriteRule ^tjshipin'.$dshz1.'  /xitong/qiantai/tjshipin.php'."\r\n";
$htaccesscontent .='ReWriteRule ^dingdan'.$dshz1.'  /xitong/qiantai/dingdan.php'."\r\n";
$htaccesscontent .='ReWriteRule ^pay'.$dshz1.'  /xitong/qiantai/pay.php'."\r\n";
$htaccesscontent .='ReWriteRule ^user'.$dshz1.'  /xitong/qiantai/user.php'."\r\n";
$htaccesscontent .='ReWriteRule ^xiauser'.$dshz1.'  /xitong/qiantai/xiauser.php'."\r\n";
$htaccesscontent .='ReWriteRule ^yqm'.$dshz1.'  /xitong/qiantai/yqm.php'."\r\n";
$htaccesscontent .='ReWriteRule ^fanyong'.$dshz1.'  /xitong/qiantai/fanyong.php'."\r\n";
$htaccesscontent .='ReWriteRule ^tx'.$dshz1.'  /xitong/qiantai/tx.php'."\r\n";
$htaccesscontent .='ReWriteRule ^userip'.$dshz1.'  /xitong/qiantai/userip.php'."\r\n";
$htaccesscontent .='ReWriteRule ^wangzhan'.$dshz1.'  /xitong/qiantai/wangzhan.php'."\r\n";
$htaccesscontent .='ReWriteRule ^shipintj'.$dshz1.'  /xitong/qiantai/shipintj.php'."\r\n";
$htaccesscontent .='ReWriteRule ^scjilu'.$dshz1.'  /xitong/qiantai/scjilu.php'."\r\n";
$htaccesscontent .='ReWriteRule ^post'.$dshz1.' /xitong/qiantai/post.php'."\r\n";
$htaccesscontent .='ReWriteRule ^wztj'.$dshz1.' /xitong/qiantai/wztj.php'."\r\n";
$htaccesscontent .='ReWriteRule ^pic([a-zA-Z0-9]*)'.$dshz1.'  /xitong/qiantai/pic.php?zykey=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^wzpage/([0-9]*)/$   /xitong/qiantai/wangzhan.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^rzpage/([0-9]*)/$   /xitong/qiantai/userip.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^ggpage/([0-9]*)/$   /xitong/qiantai/gonggao.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^xtpage/([0-9]*)/$   /xitong/qiantai/xitong.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^sppage/([0-9]*)/$   /xitong/qiantai/shipin.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^ddpage/([0-9]*)/$   /xitong/qiantai/dingdan.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^txjlpage/([0-9]*)/$   /xitong/qiantai/pay.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^txjlpagesotime/([0-9]*)/(.*)/   /xitong/qiantai/pay.php?page=$1&btime=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^xxpage/([0-9]*)/$   /xitong/qiantai/xiauser.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^yqmpage/([0-9]*)/   /xitong/qiantai/yqm.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^yqmpageso/([0-9]*)/(.*)/   /xitong/qiantai/yqm.php?page=$1&cz=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^fypage/([0-9]*)/$   /xitong/qiantai/fanyong.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^fypagesotime/([0-9]*)/(.*)/   /xitong/qiantai/fanyong.php?page=$1&btime=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^dlfenlei'.$dshz1.'   /xitong/qiantai/fenlei.php'."\r\n";
$htaccesscontent .='ReWriteRule ^dlflpage/([0-9]*)/$   /xitong/qiantai/fenlei.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^dlfledit/(.*)/$  /xitong/qiantai/fledit.php?ids=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^hezi'.$dshz1.'   /xitong/qiantai/hezi.php'."\r\n";
$htaccesscontent .='ReWriteRule ^linkmb'.$dshz1.'   /xitong/qiantai/linkmb.php'."\r\n";
$htaccesscontent .='ReWriteRule ^dsmb'.$dshz1.'    /xitong/qiantai/dsmb.php'."\r\n";
$htaccesscontent .='ReWriteRule ^pcshoukuan'.$dshz1.'  /xitong/qiantai/shoukuan.php'."\r\n";
$htaccesscontent .='ReWriteRule ^skm'.$dshz1.'   /xitong/qiantai/skm.php'."\r\n";
$htaccesscontent .='#公共配置'."\r\n";
$htaccesscontent .='ReWriteRule ^upload'.$dshz1.'  /xitong/upload.php'."\r\n";
$htaccesscontent .='ReWriteRule ^ts'.$dshz1.' /xitong/ts.php'."\r\n";
$htaccesscontent .='ReWriteRule ^tserr'.$dshz1.' /xitong/tserr.php'."\r\n";
$htaccesscontent .='ReWriteRule ^tserrto'.$dshz1.' /xitong/tserrto.php'."\r\n";
$htaccesscontent .='ReWriteRule ^jubao'.$dshz1.' /xitong/jubao.php'."\r\n";
$htaccesscontent .='ReWriteRule ^play_([0-9]*)_(.*)'.$dshz1.'  /xitong/play.php?playid=$1&lx=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^sjplay_([0-9]*)_(.*)'.$dshz1.'  /xitong/sjplay.php?playid=$1&lx=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^fplay_([0-9]*)'.$dshz1.' /xitong/fplay.php?playid=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^sjpost/  /xitong/sjpost.php'."\r\n";
$htaccesscontent .='ReWriteRule ^wxlogin-(.*)'.$dshz1.'  /wxlogin.php?code=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^wxapi'.$dshz1.'   /wxapi.php'."\r\n";
$htaccesscontent .='ReWriteRule ^wx(.*)/(.*)  /xitong/url.php?code=$2'."\r\n";
$htaccesscontent .='#手机端配置'."\r\n";
$htaccesscontent .='ReWriteRule ^mtx'.$dshz1.'   /xitong/m/tx.php'."\r\n";
$htaccesscontent .='ReWriteRule ^m'.$dshz1.'   /xitong/m/i.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mloginpost'.$dshz1.'   /xitong/m/loginpost.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mreg'.$dshz1.'   /xitong/m/reg.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mregpost'.$dshz1.'   /xitong/m/regpost.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mtui'.$dshz1.'   /xitong/m/tui.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mmain'.$dshz1.'   /xitong/m/main.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mpay'.$dshz1.'   /xitong/m/pay.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mxitong'.$dshz1.'   /xitong/m/xitong.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mshipin'.$dshz1.'   /xitong/m/shipin.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mshipinsc'.$dshz1.'   /xitong/m/shipinsc.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mxiauser'.$dshz1.'   /xitong/m/xiauser.php'."\r\n";
$htaccesscontent .='ReWriteRule ^myqm'.$dshz1.'   /xitong/m/yqm.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mfanyong'.$dshz1.'   /xitong/m/fanyong.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mtjshipin'.$dshz1.'   /xitong/m/tjshipin.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mfabushipin'.$dshz1.'   /xitong/m/fabushipin.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mgg'.$dshz1.'   /xitong/m/gg.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mxinxi'.$dshz1.'   /xitong/m/xinxi.php'."\r\n";
$htaccesscontent .='ReWriteRule ^muser'.$dshz1.'   /xitong/m/user.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mdingdan'.$dshz1.'   /xitong/m/dingdan.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mpost'.$dshz1.'  /xitong/m/post.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mxtpage/([0-9]*)/$   /xitong/m/xitong.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^msppage/([0-9]*)/$   /xitong/m/shipin.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^mscpage/([0-9]*)/$   /xitong/m/shipinsc.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^mpic([a-zA-Z0-9]*)'.$dshz1.'   /xitong/m/pic.php?zykey=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^mxxpage/([0-9]*)/$   /xitong/m/xiauser.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^myqmpage/([0-9]*)/$   /xitong/m/yqm.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^mfypage/([0-9]*)/$   /xitong/m/fanyong.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^mshow_(.*)'.$dshz1.'   /xitong/m/show.php?id=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^mtxpage/([0-9]*)/$   /xitong/m/pay.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^mddpage/([0-9]*)/$   /xitong/m/dingdan.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^shoukuan'.$dshz1.'    /xitong/m/shoukuan.php'."\r\n";
$htaccesscontent .='ReWriteRule ^mskm'.$dshz1.'   /xitong/m/skm.php'."\r\n";
$htaccesscontent .='#支付配置'."\r\n";
$htaccesscontent .='ReWriteRule ^hztpay/([a-zA-Z0-9]*)/(.*)/  /hzpay/$1/pay.php?code=$2&lx=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^wxgzhpay-(.*)-(.*)'.$dshz1.'   /hzpay/wxgzh/$1/pay.php?code=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^check-(.*)'.$dshz1.'   /xitong/check.php?ddh=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^topay/([a-zA-Z0-9]*)/(.*)/  /xitong/pd.php?lx=$1&code=$2'."\r\n";
$htaccesscontent .='#后台配置'."\r\n";
$htaccesscontent .='ReWriteRule ^'.$htlj1.'/  /xitong/houtai/i.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htpost'.$dshz1.'   /xitong/houtai/post.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htlogin'.$dshz1.'   /xitong/houtai/login.php'."\r\n";
$htaccesscontent .='ReWriteRule ^hthome'.$dshz1.'   /xitong/houtai/home.php'."\r\n";
$htaccesscontent .='ReWriteRule ^ht/main/  /xitong/houtai/main.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htlogout'.$dshz1.'   /xitong/houtai/logout.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htyqm'.$dshz1.'   /xitong/houtai/yqm.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htwzlist'.$dshz1.'   /xitong/houtai/wzlist.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htdlrz'.$dshz1.'   /xitong/houtai/dlrz.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htglrz'.$dshz1.'   /xitong/houtai/glrz.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htuserlist'.$dshz1.'   /xitong/houtai/userlist.php'."\r\n";
$htaccesscontent .='ReWriteRule ^hthost'.$dshz1.'   /xitong/houtai/host.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htlinklist'.$dshz1.'   /xitong/houtai/tlink.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htwxlist'.$dshz1.'   /xitong/houtai/wxlist.php'."\r\n";
$htaccesscontent .='ReWriteRule ^httglist'.$dshz1.'   /xitong/houtai/tg.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htewm'.$dshz1.'   /xitong/houtai/ewm.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htspup'.$dshz1.'   /xitong/houtai/shipinup.php'."\r\n";
$htaccesscontent .='ReWriteRule ^spupload'.$dshz1.'   /xitong/spupload.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htsptj'.$dshz1.'   /xitong/houtai/tjshipin.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htdllist'.$dshz1.'   /xitong/houtai/dllist.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htgllist'.$dshz1.'   /xitong/houtai/gllist.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htpeizhi'.$dshz1.'   /xitong/houtai/peizhi.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htyjs'.$dshz1.'   /xitong/houtai/yjs.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htwjs'.$dshz1.'   /xitong/houtai/wjs.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htadmin'.$dshz1.'   /xitong/houtai/admin.php '."\r\n";
$htaccesscontent .='ReWriteRule ^htpass'.$dshz1.'   /xitong/houtai/pass.php '."\r\n";
$htaccesscontent .='ReWriteRule ^htkl'.$dshz1.'  /xitong/houtai/kl.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htklpz'.$dshz1.'   /xitong/houtai/klpz.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htlishilist'.$dshz1.'   /xitong/houtai/lishi.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htglyqm'.$dshz1.'   /xitong/houtai/glyqm.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htgonggao'.$dshz1.'   /xitong/houtai/gonggao.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htbeifen'.$dshz1.'   /xitong/houtai/beifen.php  '."\r\n";
$htaccesscontent .='ReWriteRule ^htdingdan'.$dshz1.'   /xitong/houtai/dingdan.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htad'.$dshz1.'   /xitong/houtai/ad.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htfpian'.$dshz1.'   /xitong/houtai/fpian.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htfshipin'.$dshz1.'   /xitong/houtai/fshipin.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htsppltj'.$dshz1.'  /xitong/houtai/plshipin.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htwlpltxt'.$dshz1.'  /xitong/houtai/wltxt.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htaddhosturl/  /xitong/houtai/addhosturl.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htaddzymurl/  /xitong/houtai/addzymurl.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htplzym/   /xitong/houtai/plzym.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htpladdhosturl/  /xitong/houtai/pladdhosturl.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htpldrhosturl/  /xitong/houtai/pldrhosturl.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htplurl/   /xitong/houtai/plurl.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htfenlei'.$dshz1.'   /xitong/houtai/fenlei.php'."\r\n";
$htaccesscontent .='ReWriteRule ^adpic'.$dshz1.'   /xitong/houtai/adpic.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htlinkmb'.$dshz1.'   /xitong/houtai/linkmb.php'."\r\n";
$htaccesscontent .='ReWriteRule ^hthezimb'.$dshz1.'    /xitong/houtai/hezimb.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htdsmb'.$dshz1.'   /xitong/houtai/dsmb.php'."\r\n";
$htaccesscontent .='ReWriteRule ^linkmbpic'.$dshz1.'   /xitong/houtai/linkmbpic.php'."\r\n";
$htaccesscontent .='ReWriteRule ^dsmbpic'.$dshz1.'   /xitong/houtai/dsmbpic.php'."\r\n";
$htaccesscontent .='ReWriteRule ^hzmbpic'.$dshz1.'    /xitong/houtai/hzmbpic.php'."\r\n";
$htaccesscontent .='ReWriteRule ^hzzym'.$dshz1.'    /xitong/houtai/zym.php'."\r\n";
$htaccesscontent .='ReWriteRule ^hthzpay'.$dshz1.'   /xitong/houtai/hzpay.php'."\r\n";
$htaccesscontent .='ReWriteRule ^ht-hzpay-(.*)-(.*)'.$dshz1.'  /xitong/houtai/hzpayto.php?id=$1&lx=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^ht-hzpaylist-(.*)'.$dshz1.'  /xitong/houtai/hzpaylist.php?id=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^hzpaylist'.$dshz1.'   /xitong/houtai/hzpaylist.php'."\r\n";
$htaccesscontent .='ReWriteRule ^httousu'.$dshz1.'    /xitong/houtai/tousu.php'."\r\n";
$htaccesscontent .='ReWriteRule ^htyqmpage/([0-9]*)/$  /xitong/houtai/yqm.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htwzlistpage/([0-9]*)/$  /xitong/houtai/wzlist.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htwzlistpageso/([0-9]*)/([a-zA-Z0-9]*)/$  /xitong/houtai/wzlist.php?page=$1&userid=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^htdlrzpage/([0-9]*)/$  /xitong/houtai/dlrz.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htglrzpage/([0-9]*)/$  /xitong/houtai/glrz.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htuserlistpage/([0-9]*)/$  /xitong/houtai/userlist.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htuserlistpageso/([0-9]*)/([a-zA-Z0-9]*)/$  /xitong/houtai/userlist.php?page=$1&userid=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^httglistpageso/([0-9]*)/([a-zA-Z0-9]*)/$  /xitong/houtai/tlink.php?page=$1&userid=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^httglistpage/([0-9]*)/$  /xitong/houtai/tlink.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htwxlistpage/([0-9]*)/$  /xitong/houtai/wxlist.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^httgpage/([0-9]*)/$  /xitong/houtai/tg.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htgllistpage/([0-9]*)/$  /xitong/houtai/gllist.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htgllistpageso/([0-9]*)/([a-zA-Z0-9]*)/$  /xitong/houtai/gllist.php?page=$1&name=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^htdllistpage/([0-9]*)/$  /xitong/houtai/dllist.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htdllistpageso/([0-9]*)/([a-zA-Z0-9]*)/$  /xitong/houtai/dllist.php?page=$1&name=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^htyjspage/([0-9]*)/$  /xitong/houtai/yjs.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htwjspage/([0-9]*)/$  /xitong/houtai/wjs.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htwjspageso/([0-9]*)/(.*)/   /xitong/houtai/wjs.php?page=$1&btime=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^htyjspageso/([0-9]*)/(.*)/   /xitong/houtai/yjs.php?page=$1&btime=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^htklpage/([0-9]*)/$  /xitong/houtai/kl.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htklpzpage/([0-9]*)/$  /xitong/houtai/klpz.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htlishilistpage/([0-9]*)/$  /xitong/houtai/lishi.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htpic([a-zA-Z0-9]*)'.$dshz1.'   /xitong/houtai/picup.php?zykey=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^httpup([a-zA-Z0-9]*)'.$dshz1.'   /xitong/houtai/pic.php?zykey=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htglyqmpage/([0-9]*)/$  /xitong/houtai/glyqm.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htgonggaopage/([0-9]*)/$  /xitong/houtai/gonggao.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htdingdanpage/([0-9]*)/$  /xitong/houtai/dingdan.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htfpianpage/([0-9]*)/$  /xitong/houtai/fpian.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htfshipinpage/([0-9]*)/$  /xitong/houtai/fshipin.php?page=$1'."\r\n";
$htaccesscontent .='RewriteRule ^hthostpage/([0-9]*)/$ /xitong/houtai/host.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^htgllistpagefl/([0-9]*)/([0-9]*)/   /xitong/houtai/gllist.php?page=$1&flid=$2'."\r\n";
$htaccesscontent .='#发片员'."\r\n";
$htaccesscontent .='ReWriteRule ^fapian/  /xitong/fapian/i.php'."\r\n";
$htaccesscontent .='ReWriteRule ^flogin'.$dshz1.'  /xitong/fapian/login.php'."\r\n";
$htaccesscontent .='ReWriteRule ^fmain'.$dshz1.'  /xitong/fapian/main.php'."\r\n";
$htaccesscontent .='ReWriteRule ^fshipin'.$dshz1.'  /xitong/fapian/shipin.php'."\r\n";
$htaccesscontent .='ReWriteRule ^ftui'.$dshz1.'  /xitong/fapian/tui.php'."\r\n";
$htaccesscontent .='ReWriteRule ^fup'.$dshz1.' /xitong/fapian/spupload.php'."\r\n";
$htaccesscontent .='ReWriteRule ^fshipinpage/([0-9]*)/$   /xitong/fapian/shipin.php?page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^fplay_([0-9]*)'.$dshz1.'  /xitong/fplay.php?playid=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^fpost'.$dshz1.' /xitong/fapian/post.php'."\r\n";
$htaccesscontent .='#模板配置'."\r\n";
$htaccesscontent .='RewriteRule ^hezishow-(.*)'.$dshz1.'  /xitong/hezi.php?biaoshi=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^hezimoban-(.*)-(.*)-(.*)'.$dshz1.'   /xitong/moban/hezi/$3/peizhi.php?biaoshi=$2&lx=$1'."\r\n";
$htaccesscontent .='RewriteRule ^zonglink-(.*).html  /xitong/zonglink.php?id=$1'."\r\n";
$htaccesscontent .='RewriteRule ^tzzonglink-(.*)-([0-9]*).html  /xitong/mb/$2/peizhi.php?id=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^ds-(.*)-(.*)-([0-9]*).html   /xitong/moban/dsmb/$3/peizhi.php?code=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^do-(.*)-(.*)-([0-9]*).html   /xitong/moban/dsmb/$3/do.php?code=$2'."\r\n";
$htaccesscontent .='RewriteRule ^dsyzf-([0-9]*)-(.*)'.$dshz1.'  /xitong/mb/$1/yzf.php?fhurl=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^bofang-(.*)-([0-9]*)'.$dshz1.'   /xitong/mb/$2/bfq.php?code=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^myds-([0-9]*)-(.*)'.$dshz1.'  /xitong/mb/$1/myds.php?fhurl=$2'."\r\n";
$htaccesscontent .='ReWriteRule ^fenlei-([0-9]*)-(.*)'.$dshz1.'   /xitong/mb/7/fenlei.php?fhurl=$2&userid=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^mbpost/  /xitong/mbpost.php'."\r\n";
$htaccesscontent .='ReWriteRule ^new-([0-9]*)-(.*)'.$dshz1.'    /xitong/mb/8/new.php?fhurl=$2&userid=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^flshow-([0-9]*)-(.*)-(.*)'.$dshz1.'     /xitong/mb/8/fenlei.php?fhurl=$2&userid=$1&flid=$3'."\r\n";
$htaccesscontent .='ReWriteRule ^zonglinkpage-(.*)-(.*)'.$dshz1.'   /xitong/mb/9/peizhi.php?id=$2&page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^fenleilist-([0-9]*)-(.*)-(.*)'.$dshz1.'   /xitong/mb/9/fenlei.php?fhurl=$2&id=$1&userid=$3'."\r\n";
$htaccesscontent .='ReWriteRule ^fenleilistpage-(.*)-(.*)-(.*)-(.*)'.$dshz1.'   /xitong/mb/9/fenlei.php?fhurl=$4&id=$2&userid=$3&page=$1'."\r\n";
$htaccesscontent .='ReWriteRule ^listzonglinkpage-(.*)-(.*)'.$dshz1.'   /xitong/mb/9/list.php?userid=$2&page=$1'."\r\n";
$htaccesscontent .='</IfModule>'."\r\n";
writefile($htaccess,$htaccesscontent);  
$html="../../index.html";  
$htmlcontent = '<!DOCTYPE html>'."\r\n";
$htmlcontent .='<html>'."\r\n";
$htmlcontent .='<head>'."\r\n";
$htmlcontent .='<meta charset="gb2312">'."\r\n";
$htmlcontent .='<meta name="viewport" content="width=device-width,initical-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />'."\r\n";
$htmlcontent .='<title>跳转中...</title>'."\r\n";
$htmlcontent .='<style>*,body,div{padding:0px;margin:0px;}body,html{height:100%;}</style>'."\r\n";
$htmlcontent .='</head>'."\r\n";
$htmlcontent .='<body>'."\r\n";
$htmlcontent .='<script type="text/javascript">'."window.location.href='pc" .$dshz1."';</script>" ."\r\n";
$htmlcontent .='</body>'."\r\n";
$htmlcontent .='</html>'."\r\n";
writefile($html,$htmlcontent);  
$json_data = array ('status'=>"true");   
echo json_encode($json_data);
}elseif($lx=='peizhi3'){
$lj="../../config/config.php";  
$nr = '<?php'."\r\n";
$nr .='error_reporting(0); '."\r\n";
$nr .='$name='."'".$name."';"."\r\n";
$nr .='$reg='."'".$reg."';"."\r\n";
$nr .='$yqmkg='."'".$yqmkg."';"."\r\n";
$nr .='$fl='."'".$fl."';"."\r\n";
$nr .='$dshz='."'".$dshz."';"."\r\n";
$nr .='$shipinsj='."'".$shipinsj."';"."\r\n";
$nr .='$yqm='."'".$yqm."';"."\r\n";
$nr .='$sh='."'".$sh."';"."\r\n";
$nr .='$url='."'".$url1."';"."\r\n";
$nr .='$gg='."'".$gg."';"."\r\n";
$nr .='$hezi='."'".$hezi."';"."\r\n";
$nr .='$txcs='."'".$txcs."';"."\r\n";
$nr .='$tip2='."'".$tip2."';"."\r\n";
$nr .='$tip1='."'".$tip1."';"."\r\n";
$nr .='$tip='."'".$tip."';"."\r\n";
$nr .='$yulan='."'".$yulan."';"."\r\n";
$nr .='$shipin='."'".$shipin."';"."\r\n";
$nr .='$txmoney='."'".$txmoney."';"."\r\n";
$nr .='$yye='."'".$yye."';"."\r\n";
$nr .='$daymoney='."'".$daymoney."';"."\r\n";
$nr .='$weixin='."'".$weixin."';"."\r\n";
$nr .='$js='."'".$js."';"."\r\n";
$nr .='$kl='."'".$kl."';"."\r\n";
$nr .='$fy='."'".$fy."';"."\r\n";
$nr .='$tz='."'".$tz1."';"."\r\n";
$nr .='$gb='."'".$gb."';"."\r\n";
$nr .='$pcurl='."'".$pcurl."';"."\r\n";
$nr .='$pc='."'".$pc."';"."\r\n";
$nr .='$lei='."'".$lei."';"."\r\n";
$nr .='$ewm='."'".$ewm."';"."\r\n";
$nr .='$zxm='."'".$zxm."';"."\r\n";
$nr .='$zdm='."'".$zdm."';"."\r\n";
$nr .='$lm='."'".$lm."';"."\r\n";
$nr .='$wx='."'".$wx1."';"."\r\n";
$nr .='$ymjc='."'".$ymjc."';"."\r\n";
$nr .='$ymsj='."'".$ymsj."';"."\r\n";
$nr .='$sjsz='."'".$sjsz."';"."\r\n";
$nr .='$dwzjk='."'".$dwzjk."';"."\r\n";
$nr .='$mb='."'".$mb."';"."\r\n";
$nr .='$pic='."'".$pic."';"."\r\n";
$nr .='$dsmb='."'".$dsmb."';"."\r\n";
$nr .='$hezimb='."'".$hezimb."';"."\r\n";
$nr .='$linkmb='."'".$linkmb."';"."\r\n";
$nr .='$htlj='."'".$htlj."';"."\r\n";
$nr .='$playxs='."'".$playxs."';"."\r\n";
$nr .='$playts='."'".$playts."';"."\r\n";
$nr .='$playms='."'".$playms."';"."\r\n";
$nr .='?>';
writefile($lj,$nr);  
$json_data = array ('status'=>"true");   
echo json_encode($json_data);
}elseif($lx=='peizhi4'){
$lj="../../config/config.php";  
$nr = '<?php'."\r\n";
$nr .='error_reporting(0); '."\r\n";
$nr .='$name='."'".$name1."';"."\r\n";
$nr .='$reg='."'".$reg1."';"."\r\n";
$nr .='$yqmkg='."'".$yqmkg."';"."\r\n";
$nr .='$fl='."'".$fl."';"."\r\n";
$nr .='$dshz='."'".$dshz."';"."\r\n";
$nr .='$shipinsj='."'".$shipinsj."';"."\r\n";
$nr .='$yqm='."'".$yqm."';"."\r\n";
$nr .='$sh='."'".$sh."';"."\r\n";
$nr .='$url='."'".$url."';"."\r\n";
$nr .='$gg='."'".$gg."';"."\r\n";
$nr .='$hezi='."'".$hezi."';"."\r\n";
$nr .='$txcs='."'".$txcs."';"."\r\n";
$nr .='$tip2='."'".$tip2."';"."\r\n";
$nr .='$tip1='."'".$tip1."';"."\r\n";
$nr .='$tip='."'".$tip."';"."\r\n";
$nr .='$yulan='."'".$yulan."';"."\r\n";
$nr .='$shipin='."'".$shipin."';"."\r\n";
$nr .='$txmoney='."'".$txmoney."';"."\r\n";
$nr .='$yye='."'".$yye."';"."\r\n";
$nr .='$daymoney='."'".$daymoney."';"."\r\n";
$nr .='$weixin='."'".$weixin1."';"."\r\n";
$nr .='$js='."'".$js."';"."\r\n";
$nr .='$kl='."'".$kl1."';"."\r\n";
$nr .='$fy='."'".$fy."';"."\r\n";
$nr .='$tz='."'".$tz."';"."\r\n";
$nr .='$gb='."'".$gb1."';"."\r\n";
$nr .='$pcurl='."'".$pcurl1."';"."\r\n";
$nr .='$pc='."'".$pc1."';"."\r\n";
$nr .='$lei='."'".$lei."';"."\r\n";
$nr .='$ewm='."'".$ewm."';"."\r\n";
$nr .='$zxm='."'".$zxm."';"."\r\n";
$nr .='$zdm='."'".$zdm."';"."\r\n";
$nr .='$lm='."'".$lm."';"."\r\n";
$nr .='$wx='."'".$wx."';"."\r\n";
$nr .='$ymjc='."'".$ymjc1."';"."\r\n";
$nr .='$ymsj='."'".$ymsj."';"."\r\n";
$nr .='$sjsz='."'".$sjsz."';"."\r\n";
$nr .='$dwzjk='."'".$dwzjk."';"."\r\n";
$nr .='$mb='."'".$mb."';"."\r\n";
$nr .='$pic='."'".$pic."';"."\r\n";
$nr .='$dsmb='."'".$dsmb."';"."\r\n";
$nr .='$hezimb='."'".$hezimb."';"."\r\n";
$nr .='$linkmb='."'".$linkmb."';"."\r\n";
$nr .='$htlj='."'".$htlj."';"."\r\n";
$nr .='$playxs='."'".$playxs."';"."\r\n";
$nr .='$playts='."'".$playts."';"."\r\n";
$nr .='$playms='."'".$playms."';"."\r\n";
$nr .='?>';
writefile($lj,$nr);  
$json_data = array ('status'=>"true");   
echo json_encode($json_data);
}elseif($lx=='peizhi5'){
$lj="../../config/config.php";  
$nr = '<?php'."\r\n";
$nr .='error_reporting(0); '."\r\n";
$nr .='$name='."'".$name."';"."\r\n";
$nr .='$reg='."'".$reg."';"."\r\n";
$nr .='$yqmkg='."'".$yqmkg."';"."\r\n";
$nr .='$fl='."'".$fl."';"."\r\n";
$nr .='$dshz='."'".$dshz."';"."\r\n";
$nr .='$shipinsj='."'".$shipinsj."';"."\r\n";
$nr .='$yqm='."'".$yqm."';"."\r\n";
$nr .='$sh='."'".$sh."';"."\r\n";
$nr .='$url='."'".$url."';"."\r\n";
$nr .='$gg='."'".$gg."';"."\r\n";
$nr .='$hezi='."'".$hezi."';"."\r\n";
$nr .='$txcs='."'".$txcs."';"."\r\n";
$nr .='$tip2='."'".$tipto2."';"."\r\n";
$nr .='$tip1='."'".$tipto1."';"."\r\n";
$nr .='$tip='."'".$tipto."';"."\r\n";
$nr .='$yulan='."'".$yulan."';"."\r\n";
$nr .='$shipin='."'".$shipin."';"."\r\n";
$nr .='$txmoney='."'".$txmoney."';"."\r\n";
$nr .='$yye='."'".$yye."';"."\r\n";
$nr .='$daymoney='."'".$daymoney."';"."\r\n";
$nr .='$weixin='."'".$weixin."';"."\r\n";
$nr .='$js='."'".$js."';"."\r\n";
$nr .='$kl='."'".$kl."';"."\r\n";
$nr .='$fy='."'".$fy."';"."\r\n";
$nr .='$tz='."'".$tz."';"."\r\n";
$nr .='$gb='."'".$gb."';"."\r\n";
$nr .='$pcurl='."'".$pcurl."';"."\r\n";
$nr .='$pc='."'".$pc."';"."\r\n";
$nr .='$lei='."'".$lei."';"."\r\n";
$nr .='$ewm='."'".$ewm."';"."\r\n";
$nr .='$zxm='."'".$zxm."';"."\r\n";
$nr .='$zdm='."'".$zdm."';"."\r\n";
$nr .='$lm='."'".$lm."';"."\r\n";
$nr .='$wx='."'".$wx."';"."\r\n";
$nr .='$ymjc='."'".$ymjc."';"."\r\n";
$nr .='$ymsj='."'".$ymsj."';"."\r\n";
$nr .='$sjsz='."'".$sjsz."';"."\r\n";
$nr .='$dwzjk='."'".$dwzjk."';"."\r\n";
$nr .='$mb='."'".$mb."';"."\r\n";
$nr .='$pic='."'".$pic."';"."\r\n";
$nr .='$dsmb='."'".$dsmb."';"."\r\n";
$nr .='$hezimb='."'".$hezimb."';"."\r\n";
$nr .='$linkmb='."'".$linkmb."';"."\r\n";
$nr .='$htlj='."'".$htlj."';"."\r\n";
$nr .='$playxs='."'".$playxs."';"."\r\n";
$nr .='$playts='."'".$playts."';"."\r\n";
$nr .='$playms='."'".$playms."';"."\r\n";
$nr .='?>';
writefile($lj,$nr);  
$json_data = array ('status'=>"true");   
echo json_encode($json_data);
}elseif($lx=='peizhi6'){
$lj="../../config/config.php";  
$nr = '<?php'."\r\n";
$nr .='error_reporting(0); '."\r\n";
$nr .='$name='."'".$name."';"."\r\n";
$nr .='$reg='."'".$reg."';"."\r\n";
$nr .='$yqmkg='."'".$yqmkg."';"."\r\n";
$nr .='$fl='."'".$fl."';"."\r\n";
$nr .='$dshz='."'".$dshz."';"."\r\n";
$nr .='$shipinsj='."'".$shipinsj."';"."\r\n";
$nr .='$yqm='."'".$yqm."';"."\r\n";
$nr .='$sh='."'".$sh."';"."\r\n";
$nr .='$url='."'".$url."';"."\r\n";
$nr .='$gg='."'".$gg1."';"."\r\n";
$nr .='$hezi='."'".$hezi1."';"."\r\n";
$nr .='$txcs='."'".$txcs."';"."\r\n";
$nr .='$tip2='."'".$tip2."';"."\r\n";
$nr .='$tip1='."'".$tip1."';"."\r\n";
$nr .='$tip='."'".$tip."';"."\r\n";
$nr .='$yulan='."'".$yulan."';"."\r\n";
$nr .='$shipin='."'".$shipin."';"."\r\n";
$nr .='$txmoney='."'".$txmoney."';"."\r\n";
$nr .='$yye='."'".$yye."';"."\r\n";
$nr .='$daymoney='."'".$daymoney."';"."\r\n";
$nr .='$weixin='."'".$weixin."';"."\r\n";
$nr .='$js='."'".$js."';"."\r\n";
$nr .='$kl='."'".$kl."';"."\r\n";
$nr .='$fy='."'".$fy."';"."\r\n";
$nr .='$tz='."'".$tz."';"."\r\n";
$nr .='$gb='."'".$gb."';"."\r\n";
$nr .='$pcurl='."'".$pcurl."';"."\r\n";
$nr .='$pc='."'".$pc."';"."\r\n";
$nr .='$lei='."'".$lei."';"."\r\n";
$nr .='$ewm='."'".$ewm."';"."\r\n";
$nr .='$zxm='."'".$zxm."';"."\r\n";
$nr .='$zdm='."'".$zdm."';"."\r\n";
$nr .='$lm='."'".$lm."';"."\r\n";
$nr .='$wx='."'".$wx."';"."\r\n";
$nr .='$ymjc='."'".$ymjc."';"."\r\n";
$nr .='$ymsj='."'".$ymsj."';"."\r\n";
$nr .='$sjsz='."'".$sjsz."';"."\r\n";
$nr .='$dwzjk='."'".$dwzjk."';"."\r\n";
$nr .='$mb='."'".$mb."';"."\r\n";
$nr .='$pic='."'".$pic."';"."\r\n";
$nr .='$dsmb='."'".$dsmb."';"."\r\n";
$nr .='$hezimb='."'".$hezimb."';"."\r\n";
$nr .='$linkmb='."'".$linkmb."';"."\r\n";
$nr .='$htlj='."'".$htlj."';"."\r\n";
$nr .='$playxs='."'".$playxs."';"."\r\n";
$nr .='$playts='."'".$playts."';"."\r\n";
$nr .='$playms='."'".$playms."';"."\r\n";
$nr .='?>';
writefile($lj,$nr);  
$json_data = array ('status'=>"true");   
echo json_encode($json_data);
}elseif($lx=='peizhi7'){
$lj="../../config/config.php";  
$nr = '<?php'."\r\n";
$nr .='error_reporting(0); '."\r\n";
$nr .='$name='."'".$name."';"."\r\n";
$nr .='$reg='."'".$reg."';"."\r\n";
$nr .='$yqmkg='."'".$yqmkg."';"."\r\n";
$nr .='$fl='."'".$fl."';"."\r\n";
$nr .='$dshz='."'".$dshz."';"."\r\n";
$nr .='$shipinsj='."'".$shipinsj."';"."\r\n";
$nr .='$yqm='."'".$yqm."';"."\r\n";
$nr .='$sh='."'".$sh."';"."\r\n";
$nr .='$url='."'".$url."';"."\r\n";
$nr .='$gg='."'".$gg."';"."\r\n";
$nr .='$hezi='."'".$hezi."';"."\r\n";
$nr .='$txcs='."'".$txcs."';"."\r\n";
$nr .='$tip2='."'".$tip2."';"."\r\n";
$nr .='$tip1='."'".$tip1."';"."\r\n";
$nr .='$tip='."'".$tip."';"."\r\n";
$nr .='$yulan='."'".$yulan."';"."\r\n";
$nr .='$shipin='."'".$shipin."';"."\r\n";
$nr .='$txmoney='."'".$txmoney."';"."\r\n";
$nr .='$yye='."'".$yye."';"."\r\n";
$nr .='$daymoney='."'".$daymoney."';"."\r\n";
$nr .='$weixin='."'".$weixin."';"."\r\n";
$nr .='$js='."'".$js."';"."\r\n";
$nr .='$kl='."'".$kl."';"."\r\n";
$nr .='$fy='."'".$fy."';"."\r\n";
$nr .='$tz='."'".$tz."';"."\r\n";
$nr .='$gb='."'".$gb."';"."\r\n";
$nr .='$pcurl='."'".$pcurl."';"."\r\n";
$nr .='$pc='."'".$pc."';"."\r\n";
$nr .='$lei='."'".$lei."';"."\r\n";
$nr .='$ewm='."'".$ewm."';"."\r\n";
$nr .='$zxm='."'".$zxm."';"."\r\n";
$nr .='$zdm='."'".$zdm."';"."\r\n";
$nr .='$lm='."'".$lm."';"."\r\n";
$nr .='$wx='."'".$wx."';"."\r\n";
$nr .='$ymjc='."'".$ymjc."';"."\r\n";
$nr .='$ymsj='."'".$ymsj."';"."\r\n";
$nr .='$sjsz='."'".$sjsz."';"."\r\n";
$nr .='$dwzjk='."'".$dwzjk."';"."\r\n";
$nr .='$mb='."'".$mb."';"."\r\n";
$nr .='$pic='."'".$pic."';"."\r\n";
$nr .='$dsmb='."'".$dsmb."';"."\r\n";
$nr .='$hezimb='."'".$hezimb."';"."\r\n";
$nr .='$linkmb='."'".$linkmb."';"."\r\n";
$nr .='$htlj='."'".$htlj."';"."\r\n";
$nr .='$playxs='."'".$playxs1."';"."\r\n";
$nr .='$playts='."'".$playts1."';"."\r\n";
$nr .='$playms='."'".$playms1."';"."\r\n";
$nr .='?>';
writefile($lj,$nr);  
$json_data = array ('status'=>"true");   
echo json_encode($json_data);
//视频外链添加
}elseif($lx=='tjwl'){
$zykey=iconv("UTF-8","GB2312",ubo($_POST["zykey"]));
$posturl=iconv("UTF-8","GB2312",ubo($_POST["url"]));
$name=iconv("UTF-8","GBK",ubo($_POST["name"]));
$fl=iconv("UTF-8","GBK",ubo($_POST["fl"]));
if($fl=='请选择'){
$err=iconv("GB2312","UTF-8","分类未选择");
$errstr= array ('status'=>"0",'msg'=>$err);   
echo json_encode($errstr);
exit;
}
$sjmoney=ubo($_POST['sj']);
$gdmoney=ubo($_POST['money']);
$type="where name='$name'";
$row=queryall(shipin,$type);
if($row){
$err=iconv("GB2312","UTF-8","视频已存在");
$errstr= array ('status'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="order by id DESC limit 0,1";
$shipin=queryall(shipin,$type);
if ($shipin['id']==null){
$shipinid="1";
}else{
$shipinid=$shipin['id']+1;
}
$type="(`id`, `money`, `sj`, `cs`, `url`, `name`, `zykey`, `shijian`, `pic`, `flid`) VALUES ('$shipinid','$gdmoney','$sjmoney','0','$posturl','$name','$zykey','$shijian','','$fl')"; 
dbinsert(shipin,$type);
$lujing="../../peizhi/xt/".$zykey.".txt";
$neir =$shipinid."|ubo|".'admin'."|ubo|".$sjmoney."|ubo|".$gdmoney."|ubo|"."0";
writefile($lujing,$neir);
$ddhtz2=md5($zykey);
$ddhtz=substr($ddhtz2,0,10);
$longurl='http://'.$url."/wx".random($size)."/".$zykey.$ddhtz.'ubogl';
$long=urlencode($longurl);
$link=dwz($long,$dwzjk);   
$type="(`id`,`name`,`link`,`code`) VALUES (null,'$name','$link','$zykey')"; 
dbinsert(tglink,$type);
$errstr = array ('status'=>"1");   
echo json_encode($errstr);
}
}elseif($lx=='dlspxg'){
$postname=ubo(iconv("UTF-8","GB2312",$_POST['name'])); 
$postcs=ubo(iconv("UTF-8","GB2312",$_POST['cs'])); 
$postsj=ubo(iconv("UTF-8","GB2312",$_POST['sj'])); 
$postmoney=ubo(iconv("UTF-8","GB2312",$_POST['money'])); 
if($postname==null){
$err=iconv("GB2312","UTF-8","资源名称不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}elseif($postcs==null){
$err=iconv("GB2312","UTF-8","打赏人数不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}elseif($postsj==null or $postmoney==null ){
$err=iconv("GB2312","UTF-8","金额不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="name='$postname',cs='$postcs',money='$postmoney',sj='$postsj' where id='$postid'";
upalldt(daili,$type);
$type="where id='$postid'";
$shipin=queryall(daili,$type);
$lujing="../../peizhi/dl/".$shipin[zykey].".txt";
$neir =$postid."|ubo|".$shipin[userid]."|ubo|".$postsj."|ubo|".$postmoney."|ubo|".$shipin[lei];
writefile($lujing,$neir);
echo json_encode(array('zt'=>"1"));
}
}elseif($lx=='dlspsc'){
$idsstr=rtrim($postid, ','); 
$idsstrArray = explode(",",$idsstr);
foreach ($idsstrArray as $idsid){
$type="where id='$idsid'";
$shipin=queryall(daili,$type);
unlink('../../'.$shipin[url]); 
unlink('../../peizhi/dl/'.$shipin[zykey].".txt"); 
$type="id='$idsid'";
dbdel(daili,$type);
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='dlgg'){
$sjmoney=ubo($_POST['sjmoney']);
$gdmoney=ubo($_POST['gdmoney']);
$ids=rtrim($postid, ','); 
$idsArray = explode(",",$ids);
foreach ($idsArray as $id){
$type="money='$gdmoney',sj='$sjmoney' where id='$id'";
upalldt(daili,$type);
$type="where id='$id'";
$shipin=queryall(daili,$type);
$lujing="../../peizhi/dl/".$shipin[zykey].".txt";
$neir =$id."|ubo|".$shipin[userid]."|ubo|".$sjmoney."|ubo|".$gdmoney."|ubo|".$shipin[lei];
writefile($lujing,$neir);
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='lei'){
$lei=ubo($_POST['lei']);
$ids=rtrim($postid, ','); 
$idsArray = explode(",",$ids);
foreach ($idsArray as $id){
$type="lei='$lei' where id='$id'";
upalldt(daili,$type);
$type="where id='$id'";
$shipin=queryall(daili,$type);
$lujing="../../peizhi/dl/".$shipin[zykey].".txt";
$neir =$id."|ubo|".$shipin[userid]."|ubo|".$shipin[sj]."|ubo|".$shipin[money]."|ubo|".$lei;
writefile($lujing,$neir);
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='dlrs'){
$cs=ubo($_POST['cs']);
$ids=rtrim($postid, ','); 
$idsArray = explode(",",$ids);
foreach ($idsArray as $id){
$type="cs='$cs' where id='$id'";
upalldt(daili,$type);
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='dlsp'){
if($postaqm==$aqm){
$installfile='../../dlsp';
if(file_exists($installfile)){
fRenamet('../../dlsp','dlsp');
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","目录下没有视频");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='plfpzt'){
$type="lx='已录入' where id='$postid'";
upalldt(pian,$type);
$type="where id='$postid'";
$pian=queryall(pian,$type);
$type="where url='$pian[url]'";
$sp=queryall(shipin,$type);
$type="order by id DESC limit 0,1";
$shipin=queryall(shipin,$type);
$shipinid=$shipin['id']+1;
if(!$sp){
$sjm=random(300);
$zykey=md5($sjm.$shijian);
$type="(`id`, `money`, `sj`, `cs`, `url`, `name`, `zykey`, `shijian`, `pic`, `flid`) VALUES ('$shipinid','5','3','0','$pian[url]','$pian[name]','$zykey','$shijian','0','$fl')"; 
dbinsert(shipin,$type);
$lujing="../../peizhi/xt/".$zykey.".txt";
$neir =$shipinid."|ubo|".'admin'."|ubo|".'3'."|ubo|".'5'."|ubo|".'0';
writefile($lujing,$neir);
echo json_encode(array('zt'=>"1"));
}
}elseif($lx=='plfplr'){
$idsstr=rtrim($postid, ','); 
$idsstrArray = explode(",",$idsstr);
foreach ($idsstrArray as $idsid){
$type="lx='已录入' where id='$idsid'";
upalldt(pian,$type);
$type="where id='$idsid'";
$pian=queryall(pian,$type);
$type="where url='$pian[url]'";
$sp=queryall(shipin,$type);
$type="order by id DESC limit 0,1";
$shipin=queryall(shipin,$type);
$shipinid=$shipin['id']+1;
if(!$sp){
$sjm=random(300);
$zykey=md5($sjm.$shijian);
$type="(`id`, `money`, `sj`, `cs`, `url`, `name`, `zykey`, `shijian`, `pic`, `flid`) VALUES ('$shipinid','5','3','0','$pian[url]','$pian[name]','$zykey','$shijian','0','$fl')"; 
dbinsert(shipin,$type);
$lujing="../../peizhi/xt/".$zykey.".txt";
$neir =$shipinid."|ubo|".'admin'."|ubo|".'3'."|ubo|".'5'."|ubo|".'0';
writefile($lujing,$neir);
}
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='dlzt'){
if($zt=='true'){
$type="zt='已审核' where id='$postid'";
upalldt(daili,$type);
$type="where id='$postid'";
$shipin=queryall(daili,$type);
$lujing="../../peizhi/dl/".$shipin[zykey].".txt";
$neir =$shipin[id]."|ubo|".$shipin[userid]."|ubo|".$shipin[sj]."|ubo|".$shipin[money]."|ubo|".'0';
writefile($lujing,$neir);
$err=iconv("GB2312","UTF-8","已审核");
echo json_encode(array('zt'=>"1",'msg'=>$err));
}else{
$type="zt='待审核' where id='$postid'";
upalldt(daili,$type);
$type="where id='$postid'";
$shipin=queryall(daili,$type);
unlink('../../peizhi/dl/'.$shipin[zykey].".txt"); 
$err=iconv("GB2312","UTF-8","待审核");
echo json_encode(array('zt'=>"1",'msg'=>$err));
}
}elseif($lx=='glspxg'){
$postname=ubo(iconv("UTF-8","GB2312",$_POST['name'])); 
$postcs=ubo(iconv("UTF-8","GB2312",$_POST['cs'])); 
$postsj=ubo(iconv("UTF-8","GB2312",$_POST['sj'])); 
$postmoney=ubo(iconv("UTF-8","GB2312",$_POST['money'])); 
if($postname==null){
$err=iconv("GB2312","UTF-8","资源名称不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}elseif($postcs==null){
$err=iconv("GB2312","UTF-8","打赏人数不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}elseif($postsj==null or $postmoney==null ){
$err=iconv("GB2312","UTF-8","金额不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="name='$postname',cs='$postcs',money='$postmoney',sj='$postsj' where id='$postid'";
upalldt(shipin,$type);
$type="where id='$postid'";
$shipin=queryall(shipin,$type);
$lujing="../../peizhi/xt/".$shipin[zykey].".txt";
$neir =$postid."|ubo|".$shipin[userid]."|ubo|".$postsj."|ubo|".$postmoney."|ubo|"."0";
writefile($lujing,$neir);
echo json_encode(array('zt'=>"1"));
}
}elseif($lx=='glspsc'){
$idsstr=rtrim($postid, ','); 
$idsstrArray = explode(",",$idsstr);
foreach ($idsstrArray as $idsid){
$type="where id='$idsid'";
$shipin=queryall(shipin,$type);
unlink('../../'.$shipin[url]); 
unlink('../../peizhi/xt/'.$shipin[zykey].".txt"); 
$type="name='$shipin[name]'";
dbdel(tglink,$type);
$type="id='$idsid'";
dbdel(shipin,$type);
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='gllink'){
$idsstr=rtrim($postid, ','); 
$idsstrArray = explode(",",$idsstr);
foreach ($idsstrArray as $idsid){
$type="where id='$idsid'";
$shipin=queryall(shipin,$type);
$zykey=md5($shipin[zykey]);
$zykeyto=substr($zykey,0,10);
$longurl='http://'.$url."/wx".random($size)."/".$shipin[zykey].$zykeyto.'ubogl';
$long=urlencode($longurl);
$zl =dwz($long,$dwzjk); 
$type="(`id`,`name`,`link`,`code`) VALUES (null,'$shipin[name]','$zl','$shipin[zykey]')"; 
dbinsert(tglink,$type);
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='glgg'){
$sjmoney=ubo($_POST['sjmoney']);
$gdmoney=ubo($_POST['gdmoney']);
$ids=rtrim($postid, ','); 
$idsArray = explode(",",$ids);
foreach ($idsArray as $id){
$type="money='$gdmoney',sj='$sjmoney' where id='$id'";
upalldt(shipin,$type);
$type="where id='$id'";
$shipin=queryall(shipin,$type);
$lujing="../../peizhi/xt/".$shipin[zykey].".txt";
$neir =$id."|ubo|"."admin"."|ubo|".$sjmoney."|ubo|".$gdmoney."|ubo|"."0";
writefile($lujing,$neir);
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='glrs'){
$cs=ubo($_POST['cs']);
$ids=rtrim($postid, ','); 
$idsArray = explode(",",$ids);
foreach ($idsArray as $id){
$type="cs='$cs' where id='$id'";
upalldt(shipin,$type);
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='glsp'){
if($postaqm==$aqm){
$installfile='../../dlsp';
if(file_exists($installfile)){
fRenamet('../../shipin','glsp');
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","目录下没有视频");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='paysc'){
if($postaqm==$aqm){
$ids=rtrim($postid, ','); 
$idsArray = explode(",",$ids);
foreach ($idsArray as $id){
$type="id='$id'";
dbdel(pay,$type);
}
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='payjs'){
if($postaqm==$aqm){
$idsstr=rtrim($postid, ','); 
$idsstrArray = explode(",",$idsstr);
foreach ($idsstrArray as $idsid){
mysql_query("UPDATE pay set zt='已支付' where  id='$idsid'"); 
}
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='gllistsc'){
$type="id='$postid'";
dbdel(admin,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='mbsc'){
$type="where id='$postid'";
$mb=queryall(mb,$type);
unlink($mb[pic]); 
$type="id='$postid'";
dbdel(mb,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='dsmbsc'){
$type="where id='$postid'";
$dsmb=queryall(dsmb,$type);
unlink($dsmb[pic]); 
$type="id='$postid'";
dbdel(dsmb,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='hzmbsc'){
$type="where id='$postid'";
$hzmb=queryall(hzmb,$type);
unlink($hzmb[pic]); 
$type="id='$postid'";
dbdel(hzmb,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='flsc'){
$type="id='$postid'";
dbdel(fenlei,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='mbadd'){
$type="where name='$postname'";
$mb=queryall(mb,$type);
if($mb){
$err=iconv("GB2312","UTF-8","模板名称已存在");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="name='$postname'  where id='$postid'";
upalldt(mb,$type);
$errstr = array ('zt'=>"1");   
echo json_encode($errstr);
}
}elseif($lx=='dsmbadd'){
$type="where mbmc='$postname'";
$dsmb=queryall(dsmb,$type);
if($dsmb){
$err=iconv("GB2312","UTF-8","模板名称已存在");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="mbmc='$postname'  where id='$postid'";
upalldt(dsmb,$type);
$errstr = array ('zt'=>"1");   
echo json_encode($errstr);
}
}elseif($lx=='hzmbadd'){
$type="where mbmc='$postname'";
$hzmb=queryall(hzmb,$type);
if($hzmb){
$err=iconv("GB2312","UTF-8","模板名称已存在");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="mbmc='$postname'  where id='$postid'";
upalldt(hzmb,$type);
$errstr = array ('zt'=>"1");   
echo json_encode($errstr);
}
}elseif($lx=='fladd'){
$postname=iconv("UTF-8","GB2312",ubo($_POST['name']));
$type="WHERE name='$postname'";
$fenlei=queryall(fenlei,$type); 
if($fenlei){
$err=iconv("GB2312","UTF-8","分类名称已存在");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="(`id`, `name`, `yc`) VALUES (null,'$postname','1')"; 
dbinsert(fenlei,$type);
echo json_encode(array('zt'=>"1"));
}
}elseif($lx=='gllistadd'){
$postname=iconv("UTF-8","GB2312",ubo($_POST['name']));
$pass=md5(iconv("UTF-8","GB2312",ubo($_POST['pass'])));
$ypass=iconv("UTF-8","GB2312",ubo($_POST['pass']));
$qx=iconv("UTF-8","GB2312",ubo($_POST['qx']));
$type="WHERE name='$postname'";
$admin=queryall(admin,$type); 
if($admin){
$err=iconv("GB2312","UTF-8","管理员已存在");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="(`id`, `name`, `pass`, `qx`, `ypass`) VALUES (null,'$postname','$pass','$qx','$ypass')"; 
dbinsert(admin,$type);
echo json_encode(array('zt'=>"1"));
}

}elseif($lx=='gllistxg'){
$ypass=iconv("UTF-8","GB2312",ubo($_POST['pass']));  
$pass=md5(iconv("UTF-8","GB2312",ubo($_POST['pass'])));  
$qx=iconv("UTF-8","GB2312",ubo($_POST['qx'])); 
$type="pass='$pass',qx='$qx',ypass='$ypass' where id='$postid'";
upalldt(admin,$type);
echo json_encode(array('zt'=>"1"));

}elseif($lx=='pass'){
$username=iconv("UTF-8","GB2312",ubo($_POST['username']));  
$pass=md5(iconv("UTF-8","GB2312",ubo($_POST['password']))); 
$ypass=iconv("UTF-8","GB2312",ubo($_POST['password'])); 

if($username==null){
$err=iconv("GB2312","UTF-8","账号不能为空");
$errstr = array ('status'=>"false",'msg'=>$err);   
echo json_encode($errstr);
}elseif($ypass==null){
$err=iconv("GB2312","UTF-8","密码不能为空");
$errstr = array ('status'=>"false",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="name='$username',pass='$pass',ypass='$ypass'   where id='$postid'";
upalldt(admin,$type);
$errstr = array ('status'=>"true");   
echo json_encode($errstr);
}
}elseif($lx=='klsy'){
if($postaqm==$aqm){
$sql="delete from kl ";
mysql_query($sql);
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='klyy'){
if($postaqm==$aqm){
$qt=date("Y-m-d",strtotime("-31 day"));
$sql="delete  from kl where shijian between '$qt' and '$day'";  
mysql_query($sql);
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='klsc'){
if($postaqm==$aqm){
$ids=rtrim($postid, ','); 
$idsArray = explode(",",$ids);
foreach ($idsArray as $id){
$type="id='$id'";
dbdel(kl,$type);
}
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='ddqt'){
if($postaqm==$aqm){
$qt=date("Y-m-d",strtotime("-8 day"));
$sql="delete  from kl where shijian between '$qt' and '$day'";  
mysql_query($sql);
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='ddzr'){
if($postaqm==$aqm){
$type="shijian  like '%".$zuori."%'";
dbdel(kl,$type);
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='ddsc'){
if($postaqm==$aqm){
$ids=rtrim($postid, ','); 
$idsArray = explode(",",$ids);
foreach ($idsArray as $id){
$type="id='$id'";
dbdel(dingdan,$type);
}
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='ddzr'){
if($postaqm==$aqm){
$type="shijian  like '%".$zuori."%'";
dbdel(dingdan,$type);
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='ddqt'){
if($postaqm==$aqm){
$qt=date("Y-m-d",strtotime("-8 day"));
$sql="delete  from dingdan where shijian between '$qt' and '$day'";  
mysql_query($sql);
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='ddyy'){
if($postaqm==$aqm){
$qt=date("Y-m-d",strtotime("-31 day"));
$sql="delete  from dingdan where shijian between '$qt' and '$day'";  
mysql_query($sql);
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='ddsy'){
if($postaqm==$aqm){
$sql="delete from dingdan ";
mysql_query($sql);
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='klpzsc'){
$type="id='$postid'";
dbdel(link,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='klpzxg'){
$postns=ubo(iconv("UTF-8","GB2312",$_POST['ns']));
$postcs=ubo(iconv("UTF-8","GB2312",$_POST['cs']));
$type="ns='$postns',cs='$postcs'   where id='$postid'";
upalldt(link,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='klpzadd'){
$cs=iconv("UTF-8","GB2312",ubo($_POST['cs']));
$type="WHERE userid='$userid'";
$link=queryall(link,$type);
if($link){
$err=iconv("GB2312","UTF-8","代理ID已存在");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="(`id`, `userid`, `cs`, `ns`) VALUES (null, '$userid', '$cs', '$cs')";
dbinsert(link,$type);
echo json_encode(array('zt'=>"1"));
}
}elseif($lx=='lishisc'){
if($postaqm==$aqm){
$idsstr=rtrim($postid, ','); 
$idsstrArray = explode(",",$idsstr);
foreach ($idsstrArray as $idsid){
$type="id='$idsid'";
dbdel(lishi,$type);
}
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='scsg'){
for($i =1; $i<=10; $i++){
$sjm=random(8).$i.random(4);
$type="where yqm='$sjm'";
$sjmts=queryall(yqm,$type);
if($sjmts){
}else{
$type="(`id`, `userid`, `yqm`, `shijian`, `name`, `zt`, `lx`) VALUES (null,'admin','$sjm','$shijian','','未使用','gl')"; 
dbinsert(yqm,$type);
}
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='scws'){
for($i =1; $i<=50; $i++){
$sjm=random(8).$i.random(4);
$type="where yqm='$sjm'";
$sjmts=queryall(yqm,$type);
if($sjmts){
}else{
$type="(`id`, `userid`, `yqm`, `shijian`, `name`, `zt`, `lx`) VALUES (null,'admin','$sjm','$shijian','','未使用','gl')"; 
dbinsert(yqm,$type);
}
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='scyb'){
for($i =1; $i<=100; $i++){
$sjm=random(8).$i.random(4);
$type="where yqm='$sjm'";
$sjmts=queryall(yqm,$type);
if($sjmts){
}else{
$type="(`id`, `userid`, `yqm`, `shijian`, `name`, `zt`, `lx`) VALUES (null,'admin','$sjm','$shijian','','未使用','gl')"; 
dbinsert(yqm,$type);
}
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='sclb'){
for($i =1; $i<=200; $i++){
$sjm=random(8).$i.random(4);
$type="where yqm='$sjm'";
$sjmts=queryall(yqm,$type);
if($sjmts){
}else{
$type="(`id`, `userid`, `yqm`, `shijian`, `name`, `zt`, `lx`) VALUES (null,'admin','$sjm','$shijian','','未使用','gl')"; 
dbinsert(yqm,$type);
}
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='sczdy'){
$sl=ubo($_POST['sl']);
for($i =1; $i<=$sl; $i++){
$sjm=random(8).$i.random(4);
$type="where yqm='$sjm'";
$sjmts=queryall(yqm,$type);
if($sjmts){
}else{
$type="(`id`, `userid`, `yqm`, `shijian`, `name`, `zt`, `lx`) VALUES (null,'admin','$sjm','$shijian','','未使用','gl')"; 
dbinsert(yqm,$type);
}
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='yjsc'){
$type="userid='admin'";
dbdel(yqm,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='yjysy'){
$type="userid='admin' and zt='已使用'";
dbdel(yqm,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='yqmplsc'){
$ids=rtrim($postid, ','); 
$idsArray = explode(",",$ids);
foreach ($idsArray as $id){
$type="id='$id'";
dbdel(yqm,$type);
}
echo json_encode(array('zt'=>"1"));
}elseif($lx=='gonggaosc'){
if($postaqm==$aqm){
$idsstr=rtrim($postid, ','); 
$idsstrArray = explode(",",$idsstr);
foreach ($idsstrArray as $idsid){
$type="id='$idsid'";
dbdel(gonggao,$type);
}
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='gonggaoadd'){
$type="WHERE biaoti='$biaoti'";
$gonggao=queryall(gonggao,$type);
if($biaoti==null){
$err=iconv("GB2312","UTF-8","标题不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}elseif($neirong==null){
$err=iconv("GB2312","UTF-8","内容不能为空");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}elseif($gonggao){
$err=iconv("GB2312","UTF-8","公告已经存在");
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}else{
$type="(`id`, `biaoti`, `neirong`,`shijian`,`zt`,`tz`,`userid`) VALUES (null, '$biaoti', '$neirong', '$shijian', '$zt', '未读', '$userid')";
dbinsert(gonggao,$type);
echo json_encode(array('zt'=>"1"));
}
}elseif($lx=='beifen'){
$lj=ubo(iconv("UTF-8","GB2312",$_POST["lj"]));
$targetDir = '../../'.$lj;
if (!file_exists($targetDir)) {
@mkdir($targetDir);
}
$cfg_db_language = 'gbk';
$path ='../../'.$lj.'/';//你要保证这个文件夹存在，并且可写
$to_file_name =$path. $database . date('Ymjgi') . ".sql";
$link = mysql_connect($localhost,$root,$password);
mysql_select_db($database);
mysql_query("set names ".$cfg_db_language);
$tables = mysql_list_tables($database);
$tabList = array();
while($row = mysql_fetch_row($tables)){
$tabList[] = $row[0];
}
foreach($tabList as $val){
$sql = "show create table ".$val;
$res = mysql_query($sql,$link);
$row = mysql_fetch_array($res);
$info = "-- ----------------------------\r\n";
$info .= "-- Table structure for `".$val."`\r\n";
$info .= "-- ----------------------------\r\n";
$info .= "DROP TABLE IF EXISTS `".$val."`;\r\n";
$sqlStr = $info.$row[1].";\r\n\r\n";
file_put_contents($to_file_name,$sqlStr,FILE_APPEND);
mysql_free_result($res);
}
foreach($tabList as $val){
$sql = "select * from ".$val;
$res = mysql_query($sql,$link);
if(mysql_num_rows($res)<1) continue;
while($row = mysql_fetch_row($res)){
$sqlStr = "INSERT INTO `".$val."` VALUES (";
foreach($row as $zd){
$sqlStr .= "'".$zd."', ";
}
$sqlStr = substr($sqlStr,0,strlen($sqlStr)-2);
$sqlStr .= ");\r\n";
file_put_contents($to_file_name,$sqlStr,FILE_APPEND);
}
mysql_free_result($res);
file_put_contents($to_file_name,"\r\n",FILE_APPEND);
}
$json_data = array ('status'=>"true");   
echo json_encode($json_data);
}elseif($lx=='adsc'){
if($postaqm==$aqm){
$$plstr=rtrim($postid, ','); 
$$plstrArray = explode(",",$$plstr);
foreach ($$plstrArray as $plid){
$type="where id='$plid'";
$liebiao=queryall(adlist,$type);
unlink('../../'.$liebiao[pic]); 
$type="id='$plid'";
dbdel(adlist,$type);
}
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='adadd'){
$url=ubo($_POST[url]);
$type="url='$url',name='$postname'  where id='$postid'";
upalldt(adlist,$type);
$errstr = array ('zt'=>"1");   
echo json_encode($errstr);

}elseif($lx=='api'){
$url= trim($_POST['url']);  
$fl= $_POST['fl'];  
if($fl=='请选择'){
$err=iconv("GB2312","UTF-8","分类未选择");
$errstr= array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
exit;
}
if($url){
$data = trim($url);  
$groupData= explode("\n", $data);
foreach($groupData as $videolist){
$urllist = preg_replace("/(\r\n|\n|\r|\t)/i", '', $videolist);
if (strpos($urllist, '$') !== false) {
$p = explode('$',$urllist); 
$shipinname=iconv("UTF-8","GBK",$p[0]);
$shipinurl=iconv("UTF-8","GBK",$p[1]);
$shipinpic=iconv("UTF-8","GBK",$p[2]);
}
$zykey=md5($urllist);
$sjmoney='2';
$gdmoney='5';
$type="where name='$shipinname'";
$row=queryall(shipin,$type);
if(!$row){
$type="order by id DESC limit 0,1";
$shipin=queryall(shipin,$type);
if ($shipin['id']==null){
$shipinid="1";
}else{
$shipinid=$shipin['id']+1;
}
$type="(`id`, `money`, `sj`, `cs`, `url`, `name`, `zykey`, `shijian`, `pic`, `flid`) VALUES ('$shipinid','$gdmoney','$sjmoney','0','$shipinurl','$shipinname','$zykey','$shijian','$shipinpic','$fl')"; 
dbinsert(shipin,$type);
$lujing="../../peizhi/xt/".$zykey.".txt";
$neir =$shipinid."|ubo|".'admin'."|ubo|".$sjmoney."|ubo|".$gdmoney."|ubo|"."0";
writefile($lujing,$neir);
}
}
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","外链链接不能为空");  
$errstr = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errstr);
}
}elseif($lx=='addzurl'){
$url=ubo(iconv("UTF-8","GB2312",$_POST["url"]));
$str="/^(?:[A-za-z0-9-]+\.)+[A-za-z]{2,4}(?:[\/\?#][\/=\?%\-&~`@[\]\':+!\.#\w]*)?$/";  
if (!preg_match($str,$url)){  
$err=iconv("GB2312","UTF-8","域名格式错误,请勿带http://或https://");
$json_data = array ('zt'=>"0",'msg'=>$err);  
echo json_encode($json_data);
}else{
$type="WHERE url='$url'";
$row=queryall(zurl,$type);  
if($row){
$err=iconv("GB2312","UTF-8","域名已经存在");
$errtip = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errtip);
}else{
$type="(`id`, `url`, `cs`, `zt`, `qx`, `shijian`) VALUES (null,'$url','0','正常','1','$shijian')"; 
dbinsert(zurl,$type);
$errtip = array ('zt'=>"1");   
echo json_encode($errtip);
}
}
}elseif($lx=='hostzt'){
$qx=iconv("UTF-8","GB2312",$_POST['qx']);
$type="qx='$qx'   where id='$postid'";
upalldt(zurl,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='hostsz'){
$fs=iconv("UTF-8","GB2312",$_POST['fs']);
$lj="../../config/config.php";  
$nr = '<?php'."\r\n";
$nr .='error_reporting(0); '."\r\n";
$nr .='$name='."'".$name."';"."\r\n";
$nr .='$reg='."'".$reg."';"."\r\n";
$nr .='$yqmkg='."'".$yqmkg."';"."\r\n";
$nr .='$fl='."'".$fl."';"."\r\n";
$nr .='$dshz='."'".$dshz."';"."\r\n";
$nr .='$shipinsj='."'".$shipinsj."';"."\r\n";
$nr .='$yqm='."'".$yqm."';"."\r\n";
$nr .='$sh='."'".$sh."';"."\r\n";
$nr .='$url='."'".$url."';"."\r\n";
$nr .='$gg='."'".$gg."';"."\r\n";
$nr .='$hezi='."'".$hezi."';"."\r\n";
$nr .='$txcs='."'".$txcs."';"."\r\n";
$nr .='$tip2='."'".$tip2."';"."\r\n";
$nr .='$tip1='."'".$tip1."';"."\r\n";
$nr .='$tip='."'".$tip."';"."\r\n";
$nr .='$yulan='."'".$yulan."';"."\r\n";
$nr .='$shipin='."'".$shipin."';"."\r\n";
$nr .='$txmoney='."'".$txmoney."';"."\r\n";
$nr .='$yye='."'".$yye."';"."\r\n";
$nr .='$daymoney='."'".$daymoney."';"."\r\n";
$nr .='$weixin='."'".$weixin."';"."\r\n";
$nr .='$js='."'".$js."';"."\r\n";
$nr .='$kl='."'".$kl."';"."\r\n";
$nr .='$fy='."'".$fy."';"."\r\n";
$nr .='$tz='."'".$tz."';"."\r\n";
$nr .='$gb='."'".$gb."';"."\r\n";
$nr .='$pcurl='."'".$pcurl."';"."\r\n";
$nr .='$pc='."'".$pc."';"."\r\n";
$nr .='$lei='."'".$lei."';"."\r\n";
$nr .='$ewm='."'".$ewm."';"."\r\n";
$nr .='$zxm='."'".$zxm."';"."\r\n";
$nr .='$zdm='."'".$zdm."';"."\r\n";
$nr .='$lm='."'".$lm."';"."\r\n";
$nr .='$wx='."'".$wx."';"."\r\n";
$nr .='$ymjc='."'".$ymjc."';"."\r\n";
$nr .='$ymsj='."'".$ymsj."';"."\r\n";
$nr .='$sjsz='."'".$sjsz."';"."\r\n";
$nr .='$dwzjk='."'".$dwzjk."';"."\r\n";
$nr .='$mb='."'".$mb."';"."\r\n";
$nr .='$pic='."'".$pic."';"."\r\n";
$nr .='$dsmb='."'".$dsmb."';"."\r\n";
$nr .='$hezimb='."'".$hezimb."';"."\r\n";
$nr .='$linkmb='."'".$linkmb."';"."\r\n";
$nr .='$htlj='."'".$htlj."';"."\r\n";
$nr .='$playxs='."'".$playxs."';"."\r\n";
$nr .='$playts='."'".$playts."';"."\r\n";
$nr .='$playms='."'".$playms."';"."\r\n";
$nr .='?>';
writefile($lj,$nr);  
$errstr = array ('zt'=>"1");   
echo json_encode($errstr);
}elseif($lx=='hostsc'){
$type="id='$postid'";
dbdel(zurl,$type);
echo json_encode(array('zt'=>"1"));

}elseif($lx=='jc'){
$posturl=ubo(iconv("GB2312","UTF-8",$_POST["url"]));
$turl=$posturl;
$jczt=ubourljc($turl);
if($jczt==0){
$err=iconv("GB2312","UTF-8","域名已被拦截");
$errstr= array ('msg'=>$err);   
echo json_encode($errstr);
$type="zt='被封' where id='$postid'";
upalldt(zurl,$type);
}else{
$err=iconv("GB2312","UTF-8","域名正常");
$errstr = array ('msg'=>$err,'zt'=>'1');   
echo json_encode($errstr);
}
}elseif($lx=='zymjc'){
$posturl=ubo(iconv("GB2312","UTF-8",$_POST["url"]));
$turl=$posturl;
$jczt=ubourljc($turl);
if($jczt==0){
$err=iconv("GB2312","UTF-8","域名已被拦截");
$errstr= array ('msg'=>$err);   
echo json_encode($errstr);
$type="zt='被封' where id='$postid'";
upalldt(zym,$type);
$type="(`id`, `url`) VALUES (null,'$posturl')"; 
dbinsert(hmd,$type);
}else{
$err=iconv("GB2312","UTF-8","域名正常");
$errstr = array ('msg'=>$err,'zt'=>'1');   
echo json_encode($errstr);
}
}elseif($lx=='plurl'){
$url= trim($_POST['url']);  
if(!$url){
$err=iconv("GB2312","UTF-8","域名不能为空");  
$errstr = array ('status'=>"false",'msg'=>$err);   
echo json_encode($errstr);
exit;
}
$data = trim($url);  
$groupData= explode("\n", $data);
$sl=count($groupData);
if($sl>50){
$err=iconv("GB2312","UTF-8","每次最多设置50条链接");  
$errstr = array ('status'=>"false",'msg'=>$err);   
echo json_encode($errstr);
exit;
}
foreach($groupData as $videolist){
$urllist = preg_replace("/(\r\n|\n|\r|\t)/i", '', $videolist);
$type="WHERE url='$urllist'";
$row=queryall(zurl,$type);  
if(!$row){
$type="(`id`, `url`, `cs`, `zt`, `qx`, `shijian`) VALUES (null,'$urllist','0','正常','1','$shijian')"; 
dbinsert(zurl,$type);
}
}
echo json_encode(array('status'=>"true"));
}elseif($lx=='yjscdlpk'){
if($postaqm==$aqm){
$sql= "WHERE 1=1";
$query = mysql_query("select * from  daili  ".$sql."");
while ($a=mysql_fetch_array($query)) { 
unlink('../../peizhi/dl/'.$a[zykey].".txt"); 
$type="id='$a[id]'";
dbdel(daili,$type);
}
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}elseif($lx=='flname'){
$type="name='$name1'   where id='$postid'";
upalldt(fenlei,$type);
$json_data = array ('zt'=>"1");   
echo json_encode($json_data);
}elseif($lx=='mbname'){
$type="name='$name1'   where id='$postid'";
upalldt(mb,$type);
$json_data = array ('zt'=>"1");   
echo json_encode($json_data);
}elseif($lx=='dsmbname'){
$type="mbmc='$name1'   where id='$postid'";
upalldt(dsmb,$type);
$json_data = array ('zt'=>"1");   
echo json_encode($json_data);
}elseif($lx=='hzmbname'){
$type="mbmc='$name1'   where id='$postid'";
upalldt(hzmb,$type);
$json_data = array ('zt'=>"1");   
echo json_encode($json_data);
}elseif($lx=='flsz'){
$type="yc='$zt'   where id='$postid'";
upalldt(fenlei,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='linkmbsz'){
$lj="../../config/config.php";  
$nr = '<?php'."\r\n";
$nr .='error_reporting(0); '."\r\n";
$nr .='$name='."'".$name."';"."\r\n";
$nr .='$reg='."'".$reg."';"."\r\n";
$nr .='$yqmkg='."'".$yqmkg."';"."\r\n";
$nr .='$fl='."'".$fl."';"."\r\n";
$nr .='$dshz='."'".$dshz."';"."\r\n";
$nr .='$shipinsj='."'".$shipinsj."';"."\r\n";
$nr .='$yqm='."'".$yqm."';"."\r\n";
$nr .='$sh='."'".$sh."';"."\r\n";
$nr .='$url='."'".$url."';"."\r\n";
$nr .='$gg='."'".$gg."';"."\r\n";
$nr .='$hezi='."'".$hezi."';"."\r\n";
$nr .='$txcs='."'".$txcs."';"."\r\n";
$nr .='$tip2='."'".$tip2."';"."\r\n";
$nr .='$tip1='."'".$tip1."';"."\r\n";
$nr .='$tip='."'".$tip."';"."\r\n";
$nr .='$yulan='."'".$yulan."';"."\r\n";
$nr .='$shipin='."'".$shipin."';"."\r\n";
$nr .='$txmoney='."'".$txmoney."';"."\r\n";
$nr .='$yye='."'".$yye."';"."\r\n";
$nr .='$daymoney='."'".$daymoney."';"."\r\n";
$nr .='$weixin='."'".$weixin."';"."\r\n";
$nr .='$js='."'".$js."';"."\r\n";
$nr .='$kl='."'".$kl."';"."\r\n";
$nr .='$fy='."'".$fy."';"."\r\n";
$nr .='$tz='."'".$tz."';"."\r\n";
$nr .='$gb='."'".$gb."';"."\r\n";
$nr .='$pcurl='."'".$pcurl."';"."\r\n";
$nr .='$pc='."'".$pc."';"."\r\n";
$nr .='$lei='."'".$lei."';"."\r\n";
$nr .='$ewm='."'".$ewm."';"."\r\n";
$nr .='$zxm='."'".$zxm."';"."\r\n";
$nr .='$zdm='."'".$zdm."';"."\r\n";
$nr .='$lm='."'".$lm."';"."\r\n";
$nr .='$wx='."'".$wx."';"."\r\n";
$nr .='$ymjc='."'".$ymjc."';"."\r\n";
$nr .='$ymsj='."'".$ymsj."';"."\r\n";
$nr .='$sjsz='."'".$sjsz."';"."\r\n";
$nr .='$dwzjk='."'".$dwzjk."';"."\r\n";
$nr .='$mb='."'".$mb."';"."\r\n";
$nr .='$pic='."'".$pic."';"."\r\n";
$nr .='$dsmb='."'".$dsmb."';"."\r\n";
$nr .='$hezimb='."'".$hezimb."';"."\r\n";
$nr .='$linkmb='."'".$postid."';"."\r\n";
$nr .='$htlj='."'".$htlj."';"."\r\n";
$nr .='$playxs='."'".$playxs."';"."\r\n";
$nr .='$playts='."'".$playts."';"."\r\n";
$nr .='$playms='."'".$playms."';"."\r\n";
$nr .='?>';
writefile($lj,$nr);  
$json_data = array ('zt'=>"1");   
echo json_encode($json_data);
}elseif($lx=='hzmbsz'){
$lj="../../config/config.php";  
$nr = '<?php'."\r\n";
$nr .='error_reporting(0); '."\r\n";
$nr .='$name='."'".$name."';"."\r\n";
$nr .='$reg='."'".$reg."';"."\r\n";
$nr .='$yqmkg='."'".$yqmkg."';"."\r\n";
$nr .='$fl='."'".$fl."';"."\r\n";
$nr .='$dshz='."'".$dshz."';"."\r\n";
$nr .='$shipinsj='."'".$shipinsj."';"."\r\n";
$nr .='$yqm='."'".$yqm."';"."\r\n";
$nr .='$sh='."'".$sh."';"."\r\n";
$nr .='$url='."'".$url."';"."\r\n";
$nr .='$gg='."'".$gg."';"."\r\n";
$nr .='$hezi='."'".$hezi."';"."\r\n";
$nr .='$txcs='."'".$txcs."';"."\r\n";
$nr .='$tip2='."'".$tip2."';"."\r\n";
$nr .='$tip1='."'".$tip1."';"."\r\n";
$nr .='$tip='."'".$tip."';"."\r\n";
$nr .='$yulan='."'".$yulan."';"."\r\n";
$nr .='$shipin='."'".$shipin."';"."\r\n";
$nr .='$txmoney='."'".$txmoney."';"."\r\n";
$nr .='$yye='."'".$yye."';"."\r\n";
$nr .='$daymoney='."'".$daymoney."';"."\r\n";
$nr .='$weixin='."'".$weixin."';"."\r\n";
$nr .='$js='."'".$js."';"."\r\n";
$nr .='$kl='."'".$kl."';"."\r\n";
$nr .='$fy='."'".$fy."';"."\r\n";
$nr .='$tz='."'".$tz."';"."\r\n";
$nr .='$gb='."'".$gb."';"."\r\n";
$nr .='$pcurl='."'".$pcurl."';"."\r\n";
$nr .='$pc='."'".$pc."';"."\r\n";
$nr .='$lei='."'".$lei."';"."\r\n";
$nr .='$ewm='."'".$ewm."';"."\r\n";
$nr .='$zxm='."'".$zxm."';"."\r\n";
$nr .='$zdm='."'".$zdm."';"."\r\n";
$nr .='$lm='."'".$lm."';"."\r\n";
$nr .='$wx='."'".$wx."';"."\r\n";
$nr .='$ymjc='."'".$ymjc."';"."\r\n";
$nr .='$ymsj='."'".$ymsj."';"."\r\n";
$nr .='$sjsz='."'".$sjsz."';"."\r\n";
$nr .='$dwzjk='."'".$dwzjk."';"."\r\n";
$nr .='$mb='."'".$mb."';"."\r\n";
$nr .='$pic='."'".$pic."';"."\r\n";
$nr .='$dsmb='."'".$dsmb."';"."\r\n";
$nr .='$hezimb='."'".$postid."';"."\r\n";
$nr .='$linkmb='."'".$linkmb."';"."\r\n";
$nr .='$htlj='."'".$htlj."';"."\r\n";
$nr .='$playxs='."'".$playxs."';"."\r\n";
$nr .='$playts='."'".$playts."';"."\r\n";
$nr .='$playms='."'".$playms."';"."\r\n";
$nr .='?>';
writefile($lj,$nr);  
$json_data = array ('zt'=>"1");   
echo json_encode($json_data);
}elseif($lx=='dsmbsz'){
$lj="../../config/config.php";  
$nr = '<?php'."\r\n";
$nr .='error_reporting(0); '."\r\n";
$nr .='$name='."'".$name."';"."\r\n";
$nr .='$reg='."'".$reg."';"."\r\n";
$nr .='$yqmkg='."'".$yqmkg."';"."\r\n";
$nr .='$fl='."'".$fl."';"."\r\n";
$nr .='$dshz='."'".$dshz."';"."\r\n";
$nr .='$shipinsj='."'".$shipinsj."';"."\r\n";
$nr .='$yqm='."'".$yqm."';"."\r\n";
$nr .='$sh='."'".$sh."';"."\r\n";
$nr .='$url='."'".$url."';"."\r\n";
$nr .='$gg='."'".$gg."';"."\r\n";
$nr .='$hezi='."'".$hezi."';"."\r\n";
$nr .='$txcs='."'".$txcs."';"."\r\n";
$nr .='$tip2='."'".$tip2."';"."\r\n";
$nr .='$tip1='."'".$tip1."';"."\r\n";
$nr .='$tip='."'".$tip."';"."\r\n";
$nr .='$yulan='."'".$yulan."';"."\r\n";
$nr .='$shipin='."'".$shipin."';"."\r\n";
$nr .='$txmoney='."'".$txmoney."';"."\r\n";
$nr .='$yye='."'".$yye."';"."\r\n";
$nr .='$daymoney='."'".$daymoney."';"."\r\n";
$nr .='$weixin='."'".$weixin."';"."\r\n";
$nr .='$js='."'".$js."';"."\r\n";
$nr .='$kl='."'".$kl."';"."\r\n";
$nr .='$fy='."'".$fy."';"."\r\n";
$nr .='$tz='."'".$tz."';"."\r\n";
$nr .='$gb='."'".$gb."';"."\r\n";
$nr .='$pcurl='."'".$pcurl."';"."\r\n";
$nr .='$pc='."'".$pc."';"."\r\n";
$nr .='$lei='."'".$lei."';"."\r\n";
$nr .='$ewm='."'".$ewm."';"."\r\n";
$nr .='$zxm='."'".$zxm."';"."\r\n";
$nr .='$zdm='."'".$zdm."';"."\r\n";
$nr .='$lm='."'".$lm."';"."\r\n";
$nr .='$wx='."'".$wx."';"."\r\n";
$nr .='$ymjc='."'".$ymjc."';"."\r\n";
$nr .='$ymsj='."'".$ymsj."';"."\r\n";
$nr .='$sjsz='."'".$sjsz."';"."\r\n";
$nr .='$dwzjk='."'".$dwzjk."';"."\r\n";
$nr .='$mb='."'".$mb."';"."\r\n";
$nr .='$pic='."'".$pic."';"."\r\n";
$nr .='$dsmb='."'".$postid."';"."\r\n";
$nr .='$hezimb='."'".$hezimb."';"."\r\n";
$nr .='$linkmb='."'".$linkmb."';"."\r\n";
$nr .='$htlj='."'".$htlj."';"."\r\n";
$nr .='$playxs='."'".$playxs."';"."\r\n";
$nr .='$playts='."'".$playts."';"."\r\n";
$nr .='$playms='."'".$playms."';"."\r\n";
$nr .='?>';
writefile($lj,$nr);  
$json_data = array ('zt'=>"1");   
echo json_encode($json_data);
}elseif($lx=='mbszxs'){
$type="sz='1'   where id='$postid'";
upalldt(mb,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='mbszyc'){
$type="sz='0'   where id='$postid'";
upalldt(mb,$type);
echo json_encode(array('zt'=>"1"));

}elseif($lx=='hzmbszxs'){
$type="sz='1'   where id='$postid'";
upalldt(hzmb,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='hzmbszyc'){
$type="sz='0'   where id='$postid'";
upalldt(hzmb,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='dsmbszxs'){
$type="sz='1'   where id='$postid'";
upalldt(dsmb,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='dsmbszyc'){
$type="sz='0'   where id='$postid'";
upalldt(dsmb,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='plzym'){
$posturl= trim($_POST['url']);  
if(!$posturl){
$err=iconv("GB2312","UTF-8","域名不能为空");  
$errstr = array ('status'=>"false",'msg'=>$err);   
echo json_encode($errstr);
exit;
}
$data = trim($posturl);  
$groupData= explode("\n", $data);
$sl=count($groupData);
if($sl>50){
$err=iconv("GB2312","UTF-8","每次最多设置50条链接");  
$errstr = array ('status'=>"false",'msg'=>$err);   
echo json_encode($errstr);
exit;
}
foreach($groupData as $videolist){
$urllist = preg_replace("/(\r\n|\n|\r|\t)/i", '', $videolist);
$type="WHERE url='$urllist'";
$row=queryall(zym,$type);  
if(!$row){
$type="(`id`, `url`, `cs`, `zt`, `qx`, `shijian`) VALUES (null,'$urllist','0','正常','1','$shijian')"; 
dbinsert(zym,$type);
}
}
echo json_encode(array('status'=>"true"));
}elseif($lx=='zymjc'){
$posturl=ubo(iconv("GB2312","UTF-8",$_POST["url"]));
$turl=$posturl;
$jczt=ubourljc($turl);
if($jczt==0){
$err=iconv("GB2312","UTF-8","域名已被拦截");
$errstr= array ('msg'=>$err);   
echo json_encode($errstr);
$type="zt='被封' where id='$postid'";
upalldt(zym,$type);
$type="(`id`, `url`) VALUES (null,'$posturl')"; 
dbinsert(hmd,$type);
}else{
$err=iconv("GB2312","UTF-8","域名正常");
$errstr = array ('msg'=>$err,'zt'=>'1');   
echo json_encode($errstr);
}
}elseif($lx=='zymsc'){
$type="id='$postid'";
dbdel(zym,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='zymzt'){
$qx=iconv("UTF-8","GB2312",$_POST['qx']);
$type="qx='$qx'   where id='$postid'";
upalldt(zym,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='addzym'){
$posturl=ubo(iconv("UTF-8","GB2312",$_POST["url"]));
$str="/^(?:[A-za-z0-9-]+\.)+[A-za-z]{2,4}(?:[\/\?#][\/=\?%\-&~`@[\]\':+!\.#\w]*)?$/";  
if (!preg_match($str,$posturl)){  
$err=iconv("GB2312","UTF-8","域名格式错误,请勿带http://或https://");
$json_data = array ('zt'=>"0",'msg'=>$err);  
echo json_encode($json_data);
}else{
$type="WHERE url='$posturl'";
$row=queryall(zym,$type);  
if($row){
$err=iconv("GB2312","UTF-8","域名已经存在");
$errtip = array ('zt'=>"0",'msg'=>$err);   
echo json_encode($errtip);
}else{
$type="(`id`, `url`, `cs`, `zt`, `qx`, `shijian`) VALUES (null,'$posturl','0','正常','1','$shijian')"; 
dbinsert(zym,$type);
$errtip = array ('zt'=>"1");   
echo json_encode($errtip);
}
}
}elseif($lx=='toususc'){
$type="id='$postid'";
dbdel(ts,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='tousuzt'){
$zt=iconv("UTF-8","GB2312",$_POST['zt']);
$type="zt='$zt'   where id='$postid'";
upalldt(ts,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='flname'){
$type="name='$name1'   where id='$postid'";
upalldt(fenlei,$type);
$json_data = array ('zt'=>"1");   
echo json_encode($json_data);
}elseif($lx=='flsz'){
$type="yc='$zt'   where id='$postid'";
upalldt(fenlei,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='wxlist'){
$str="../../config/wxlist.php";  
$strhtml = '<?php'."\r\n";
$strhtml .='error_reporting(0); '."\r\n";
$strhtml .='$appid= "'.$appid.'";'."\r\n";
$strhtml .='$appsecret= "'.$appsecret.'";'."\r\n";
$strhtml .='$squrl= "'.$squrl.'";'."\r\n";
$strhtml .='$kg= "'.$kg.'";'."\r\n";
$strhtml .='?>';
writefile($str,$strhtml);  
$json_data = array ('status'=>"true");   
echo json_encode($json_data);
}elseif($lx=='wxlistsc'){
$type="id='$postid'";
dbdel(wxlist,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='yjscwxlist'){
$sql="delete from wxlist";
$result=mysql_query($sql);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='gzhzt'){
$type="WHERE id='$postid'";
$hzpay=queryall(hzpayto,$type);
$mulu='../../hzpay/wxgzh/gzh/';
if (strpos($mulu, '../../') !== false) {
$paymulu= str_replace('../../','',$mulu);
}
$wxurl=$hzpay[squrl].$paymulu."wxpay.php";
$zslj1=$hzpay[squrl].$paymulu."cacert/apiclient_cert.pem";
$zslj2=$hzpay[squrl].$paymulu."cacert/apiclient_key.pem";
$tzurl=$hzpay[squrl].$paymulu."tzurl.php";
$str=$mulu.'/WxPay.pub.config.php';  
$strhtml = '<?php'."\r\n";
$strhtml .='error_reporting(0); '."\r\n";
$strhtml .='$squrl="'.$hzpay[squrl].'";'."\r\n";
$strhtml .='class WxPayConf_pub{'."\r\n";
$strhtml .='const APPID='."'".$hzpay[payid]."';"."\r\n";
$strhtml .='const MCHID='."'".$hzpay[mchid]."';"."\r\n";
$strhtml .='const KEY='."'".$hzpay[paykey]."';"."\r\n";
$strhtml .='const APPSECRET='."'".$hzpay[appsecret]."';"."\r\n";
$strhtml .='const JS_API_CALL_URL='."'".$wxurl."';"."\r\n";
$strhtml .='const SSLCERT_PATH='."'".$zslj1."';"."\r\n";
$strhtml .='const SSLKEY_PATH='."'".$zslj2."';"."\r\n";
$strhtml .='const NOTIFY_URL='."'".$tzurl."';"."\r\n";
$strhtml .='const CURL_TIMEOUT = 30;'."\r\n";
$strhtml .='}'."\r\n";
$strhtml .='?>';
writefile($str,$strhtml);  
$type="zt='0'";
upalldt(hzpayto,$type);
$type="zt='1',sz='1' WHERE id='$postid'";
upalldt(hzpayto,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='hzpaytozt'){
$type="zt='0'";
upalldt(hzpayto,$type);
$type="zt='1',sz='1' WHERE id='$postid'";
upalldt(hzpayto,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='hzpayzt'){
$type="zt='$zt' WHERE id='$postid'";
upalldt(hzpay,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='hzpaylistsz'){
$type="sz='$zt'";
upalldt(hzpaylist,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='hzpaylistsc'){
$type="id='$postid'";
dbdel(hzpaylist,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='hzpaytosz'){
$type="WHERE id='$postid'";
$hzpay=queryall(hzpayto,$type);
$type="sz='$zt'   where id='$postid'";
upalldt(hzpayto,$type);
$type="sz='$zt' WHERE biaoshi='$hzpay[biaoshi]'";
upalldt(hzpaylist,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='hzpaytosc'){
$type="WHERE id='$postid'";
$hzpay=queryall(hzpayto,$type);
$type="biaoshi='$hzpay[biaoshi]'";
dbdel(hzpaylist,$type);
$type="id='$postid'";
dbdel(hzpayto,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='hzpaytoadd'){
$name=ubo(iconv("UTF-8","GB2312",$_POST["name"]));
$biaoshi=ubo(iconv("UTF-8","GB2312",$_POST["biaoshi"]));
$payid=ubo(iconv("UTF-8","GB2312",$_POST["payid"]));
$paykey=ubo(iconv("UTF-8","GB2312",$_POST["paykey"]));
$payurl=ubo(iconv("UTF-8","GB2312",$_POST["payurl"]));
$squrl=ubo(iconv("UTF-8","GB2312",$_POST["squrl"]));
$mchid=ubo(iconv("UTF-8","GB2312",$_POST["mchid"]));
$appsecret=ubo(iconv("UTF-8","GB2312",$_POST["appsecret"]));
$type="WHERE name='$name' and biaoshi='$biaoshi'";
$tdpd=queryall(hzpayto,$type);
if($tdpd){
$tip=iconv("GB2312","UTF-8","已存在该通道配置");
$json_data = array ('zt'=>"0",'msg'=>$tip);   
echo json_encode($json_data);
exit;
}
$type = "order by id DESC limit 0,1";
$tdid=queryall(hzpayto,$type);
$id=$tdid[id];
if ($id==null){
$id="1";
}else{
$id=$tdid[id]+1;
}
$type="(`id`, `name`, `biaoshi`, `payid`, `paykey`, `payurl`, `squrl`, `mchid`, `appsecret`, `sz`, `zt`) VALUES ('$id', '$name', '$biaoshi', '$payid', '$paykey', '$payurl', '$squrl', '$mchid', '$appsecret', '0', '0')";
dbinsert(hzpayto,$type);
$json_data = array ('zt'=>"1");   
echo json_encode($json_data);

}elseif($lx=='hzlistadd'){
$id=ubo(iconv("UTF-8","GB2312",$_POST["id"]));
$name=ubo(iconv("UTF-8","GB2312",$_POST["name"]));
$biaoshi=ubo(iconv("UTF-8","GB2312",$_POST["biaoshi"]));
$payid=ubo(iconv("UTF-8","GB2312",$_POST["payid"]));
$paykey=ubo(iconv("UTF-8","GB2312",$_POST["paykey"]));
$payurl=ubo(iconv("UTF-8","GB2312",$_POST["payurl"]));
$squrl=ubo(iconv("UTF-8","GB2312",$_POST["squrl"]));
$mchid=ubo(iconv("UTF-8","GB2312",$_POST["mchid"]));
$appsecret=ubo(iconv("UTF-8","GB2312",$_POST["appsecret"]));
$userid=ubo(iconv("UTF-8","GB2312",$_POST["userid"]));
if (strpos($userid, "-") !== false) {
$p= explode("-",$userid); 
$qs=$p[0];
$js=$p[1];
}else{
$tip=iconv("GB2312","UTF-8","代理ID格式错误");
$json_data = array ('zt'=>"0",'msg'=>$tip);   
echo json_encode($json_data);
exit;
}
for($j=$qs; $j<=$js; $j= $j + 1) {
$type = "order by id DESC limit 0,1";
$tdid=queryall(hzpaylist,$type);
$id=$tdid[id];
if ($id==null){
$id="1";
}else{
$id=$tdid[id]+1;
}
$type="(`id`, `name`, `biaoshi`, `payid`, `paykey`, `payurl`, `squrl`, `mchid`, `appsecret`, `sz`, `userid`, `toid`, `shijian`) VALUES ('$id', '$name', '$biaoshi', '$payid', '$paykey', '$payurl', '$squrl', '$mchid', '$appsecret', '1', '$j', '$postid', '$shijian')";
dbinsert(hzpaylist,$type);
if($biaoshi=='wxgzh'){
//创建目录
$mulu='../../hzpay/wxgzh/'.$j;
if(!is_dir($mulu)){
mkdir ($mulu);
}
$mulu2='../../hzpay/wxgzh/'.$j.'/cacert/';
if(!is_dir($mulu2)){
mkdir ($mulu2);
}
$mulu3='../../hzpay/wxgzh/'.$j.'/css/';
if(!is_dir($mulu3)){
mkdir ($mulu2);
}
//复制文件
copy("../../hzpay/wxgzh/log_.php",$mulu.'/'.'log_.php');
copy("../../hzpay/wxgzh/SDKRuntimeException.php",$mulu.'/'.'SDKRuntimeException.php');
copy("../../hzpay/wxgzh/WxPayPubHelper.php",$mulu.'/'.'WxPayPubHelper.php');
copy("../../hzpay/wxgzh/pay.php",$mulu.'/'.'pay.php');
copy("../../hzpay/wxgzh/tzurl.php",$mulu.'/'.'tzurl.php');
copy("../../hzpay/wxgzh/weixinpay.php",$mulu.'/'.'weixinpay.php');
copy("../../hzpay/wxgzh/wxpay.php",$mulu.'/'.'wxpay.php');
copy("../../hzpay/wxgzh/cacert/apiclient_cert.p12",$mulu2.'/'.'apiclient_cert.p12');
copy("../../hzpay/wxgzh/cacert/apiclient_cert.pem",$mulu2.'/'.'apiclient_cert.pem');
copy("../../hzpay/wxgzh/cacert/apiclient_key.pem",$mulu2.'/'.'apiclient_key.pem');
copy("../../hzpay/wxgzh/cacert/rootca.pem",$mulu2.'/'.'rootca.pem');
copy("../../hzpay/wxgzh/cacert/证书使用说明.txt",$mulu2.'/'.'证书使用说明.txt');
if (strpos($mulu, '../../') !== false) {
$paymulu= str_replace('../../','',$mulu);
}
$wxurl=$squrl.$paymulu."/wxpay.php";
$zslj1=$squrl.$paymulu."/cacert/apiclient_cert.pem";
$zslj2=$squrl.$paymulu."/cacert/apiclient_key.pem";
$tzurl=$squrl.$paymulu."/tzurl.php";
$str=$mulu.'/WxPay.pub.config.php';  
$strhtml = '<?php'."\r\n";
$strhtml .='error_reporting(0); '."\r\n";
$strhtml .='$squrl="'.$squrl.'";'."\r\n";
$strhtml .='class WxPayConf_pub{'."\r\n";
$strhtml .='const APPID='."'".$payid."';"."\r\n";
$strhtml .='const MCHID='."'".$mchid."';"."\r\n";
$strhtml .='const KEY='."'".$paykey."';"."\r\n";
$strhtml .='const APPSECRET='."'".$appsecret."';"."\r\n";
$strhtml .='const JS_API_CALL_URL='."'".$wxurl."';"."\r\n";
$strhtml .='const SSLCERT_PATH='."'".$zslj1."';"."\r\n";
$strhtml .='const SSLKEY_PATH='."'".$zslj2."';"."\r\n";
$strhtml .='const NOTIFY_URL='."'".$tzurl."';"."\r\n";
$strhtml .='const CURL_TIMEOUT = 30;'."\r\n";
$strhtml .='}'."\r\n";
$strhtml .='?>';
writefile($str,$strhtml);  
}
}
$json_data = array ('zt'=>"1");   
echo json_encode($json_data);
}elseif($lx=='hzpaytoxg'){
$type="WHERE id='$postid'";
$hzpayto=queryall(hzpayto,$type);
$name=ubo(iconv("UTF-8","GB2312",$_POST["name"]));
$payid=ubo(iconv("UTF-8","GB2312",$_POST["payid"]));
$paykey=ubo(iconv("UTF-8","GB2312",$_POST["paykey"]));
$payurl=ubo(iconv("UTF-8","GB2312",$_POST["payurl"]));
$squrl=ubo(iconv("UTF-8","GB2312",$_POST["squrl"]));
$mchid=ubo(iconv("UTF-8","GB2312",$_POST["mchid"]));
$appsecret=ubo(iconv("UTF-8","GB2312",$_POST["appsecret"]));
$type="name='$name',payid='$payid',paykey='$paykey',payurl='$payurl',squrl='$squrl',mchid='$mchid',appsecret='$appsecret'      where id='$postid'";
upalldt(hzpayto,$type);
$type="name='$name',payid='$payid',paykey='$paykey',payurl='$payurl',squrl='$squrl',mchid='$mchid',appsecret='$appsecret'      where toid='$hzpayto[id]'";
upalldt(hzpaylist,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='hzpaysz'){
$type="WHERE id='$postid'";
$hzpay=queryall(hzpay,$type);
if($zt==1){
$type="sz='0'";
upalldt(hzpay,$type);
$type="sz='1' WHERE biaoshi='$hzpay[biaoshi]'";
upalldt(hzpayto,$type);
$type="sz='1' WHERE biaoshi='$hzpay[biaoshi]'";
upalldt(hzpaylist,$type);
$type="sz='1'   where id='$postid'";
upalldt(hzpay,$type);
echo json_encode(array('zt'=>"1"));
}else{
$type="sz='0'   where id='$postid'";
upalldt(hzpay,$type);
$type="sz='0' WHERE biaoshi='$hzpay[biaoshi]'";
upalldt(hzpayto,$type);
$type="sz='0' WHERE biaoshi='$hzpay[biaoshi]'";
upalldt(hzpaylist,$type);
echo json_encode(array('zt'=>"1"));
}
}elseif($lx=='hzpaysc'){
$type="WHERE id='$postid'";
$hzpay=queryall(hzpay,$type);
$type="biaoshi='$hzpay[biaoshi]'";
dbdel(hzpayto,$type);
$type="biaoshi='$hzpay[biaoshi]'";
dbdel(hzpaylist,$type);
$type="id='$postid'";
dbdel(hzpay,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='hzpayadd'){
$name=ubo(iconv("UTF-8","GB2312",$_POST["name"]));
$biaoshi=ubo(iconv("UTF-8","GB2312",$_POST["biaoshi"]));
if($biaoshi=='wxgzh' or $biaoshi=='wxh5' or $biaoshi=='zfbwap'){
$tip=iconv("GB2312","UTF-8","默认通道，禁止创建");
$json_data = array ('zt'=>"0",'msg'=>$tip);   
echo json_encode($json_data);
exit;
}
$type="WHERE name='$name'";
$tdpd=queryall(hzpay,$type);
if($tdpd){
$tip=iconv("GB2312","UTF-8","已存在该通道");
$json_data = array ('zt'=>"0",'msg'=>$tip);   
echo json_encode($json_data);
exit;
}
$type = "order by id DESC limit 0,1";
$tdid=queryall(hzpay,$type);
$id=$tdid[id];
if ($id==null){
$id="1";
}else{
$id=$tdid[id]+1;
}
$type="(`id`, `name`, `biaoshi`, `sz`, `lx`, `zt`) VALUES ('$id', '$name', '$biaoshi', '0', '0', '0')";
dbinsert(hzpay,$type);
///这里插入配置
$json_data = array ('zt'=>"1");   
echo json_encode($json_data);
}elseif($lx=='hzpayxg'){
$name=ubo(iconv("UTF-8","GB2312",$_POST["name"]));
$type="name='$name'      where id='$postid'";
upalldt(hzpay,$type);
echo json_encode(array('zt'=>"1"));
}elseif($lx=='bhtx'){
$type="where id='$postid'";
$pay=queryall(pay,$type);
$type="where userid='$pay[userid]'";
$user=queryall(user,$type);
$postmoneyoney=$user['money']+$pay[money];
$type="money='$postmoneyoney' where userid='$pay[userid]'";
upalldt(user,$type);
$postmoneyoney2=$user['txmoney']-$pay[money];
$type="txmoney='$postmoneyoney2' where userid='$pay[userid]'";
upalldt(user,$type);
$tjr=$user['tjr'];
$type="where userid='$tjr'";
$user2=queryall(user,$type);
if($user2[fy]){
$dlfy=$user2[fy];
}else{
$dlfy=$fy;
}
$fymoney=($pay[money]*$dlfy)/100;
$postmoneyoney3=$user2['money']-$fymoney;
$type="money='$postmoneyoney3' where userid='$tjr'";
upalldt(user,$type);
$type="zt='$zt'   where id='$postid'";
upalldt(pay,$type);
$errstr = array ('zt'=>"1");   
echo json_encode($errstr);
}elseif($lx=='yjtx'){
if($postaqm==$aqm){
$query = mysql_query("select * from  user");
while ($a=mysql_fetch_array($query)) { 
if($a[money]>=$js){
if($a[tixian]=='---'){
}elseif($a[txname]=='---'){
}elseif($a[skm]==null){
}else{
$sql="select sum(money) from dingdan  where   userid='$a[userid]'  and    shijian like '%".$day."%'";
if ($res=mysql_query($sql)){
list($daymoney)=mysql_fetch_row($res);
mysql_free_result($res);
} 
$ktx=$daymoney-(($daymoney*$a[txfl])/100);
$kmoney=$a[money]-$ktx;
$type="where shijian='$day' and userid='$a[userid]'";
$pd=queryall(pay,$type);
if(!$pd){
$type="(`id`,`userid`,`shijian`,`money`,`zt`) VALUES (null, '$a[userid]', '$day', '$kmoney', '等待支付')";
dbinsert(pay,$type);
}
$postmoneyoney=$a['money']-$kmoney;
$type="money='$postmoneyoney' where userid='$a[userid]'";
upalldt(user,$type);
$postmoneyoney2=$user['txmoney']+$kmoney;
$type="txmoney='$postmoneyoney2' where userid='$a[userid]'";
upalldt(user,$type);
$tjr=$a['tjr'];
$type="where userid='$tjr'";
$user2=queryall(user,$type);
if($user2[fy]){
$dlfy=$user2[fy];
}else{
$dlfy=$fy;
}
if($a['money']>=$yye){
$fymoney=($kmoney*$dlfy)/100;
$name=$a['name'];
$type="(`id`,`shijian`,`fymoney`,`name`,`money2`,`tjr`) VALUES (null, '$shijian', '$fymoney', '$name', '$kmoney', '$tjr')";
dbinsert(fanyong,$type);
$postmoneyoney3=$user2['money']+$fymoney;
$type="money='$postmoneyoney3' where userid='$tjr'";
upalldt(user,$type);
}
}
}
}
echo json_encode(array('zt'=>"1"));
}else{
$err=iconv("GB2312","UTF-8","安全码错误");
echo json_encode(array('zt'=>"0",'msg'=>$err));
}
}

}else{
$code=$_SERVER["REQUEST_URI"];
$html ='<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">';
$html.='<html><head>';
$html.='<meta charset="gb2312">';
$html.='<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />';
$html.='<title>404 Not Found</title>';
$html.='</head><body>';
$html.='<h1>Not Found</h1>';
$html.='<p>The requested URL '.$code.' was not found on this server.</p>';
$html.='</body>';
$html.='</html>';
echo $html;
exit;
}
?>
