<?php
// +----------------------------------------------------------------------
// | QQ功能配置 [ 世界上最好用的QQ秒赞系统 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014~2019 http://www.eirds.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 天方夜谭 <17404785@qq.com>
// +----------------------------------------------------------------------

//页面标题
define('Title', 'QQ功能配置');

//检测数据
$cookieqid = isset($_COOKIE['tfyt_qid'])?$_COOKIE['tfyt_qid']:null;
$info = json_decode(curl_get(TFYT('terminal_api').'?key='.TFYT('terminal_key').'&cron='.TFYT('terminal_cron').'&action=info&only='.$GLOBALS['users']['only'].'&qid='.$cookieqid));
if($cookieqid && $info->state=='ok'){
    $info = $info->msg[0];
    if (POST('action')=='zan'){
        $zan = POST('zan');
        $net = POST('net');
        $json = json_decode(curl_get(TFYT('terminal_api').'?key='.TFYT('terminal_key').'&cron='.TFYT('terminal_cron').'&action=config&only='.$GLOBALS['users']['only'].'&qid='.$cookieqid.'&config=zan&zan='.$zan.'&net='.$net));
        if ($json->state=='ok'){
            exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
        }else{
            exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
        }
    }elseif (POST('action')=='shuo'){
        $is=is_numeric(POST('is'))?POST('is'):'0';
        $net=is_numeric(POST('net'))?POST('net'):'0';
        $con=POST('content');
        $url=POST('shuopic');
        $phone=POST('shuophone');;
        $rate=POST('rate');
        if (get_isvip($GLOBALS['users']['vip'],$GLOBALS['users']['vipend'])){
            $json = json_decode(curl_get(TFYT('terminal_api').'?key='.TFYT('terminal_key').'&cron='.TFYT('terminal_cron').'&action=config&only='.$GLOBALS['users']['only'].'&qid='.$cookieqid.'&config=shuo&is='.$is.'&net='.$net.'&content='.$con.'&shuopic='.$url.'&shuophone='.$phone.'&rate='.$rate));
            if ($json->state=='ok'){
                exit("<script language='javascript'>alert('{$json->msg}{$rate}');window.location.href='?Mould=QQSet';</script>");
            }else{
                exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
            }
        }else{
            exit("<script language='javascript'>alert('你不是VIP,无法使用此功能！');window.location.href='?Mould=QQSet';</script>");
        }
    }elseif (POST('action')=='delshuo'){
        $delshuo = POST('delshuo');
        $net = POST('net');
        if (get_isvip($GLOBALS['users']['vip'],$GLOBALS['users']['vipend'])){
            $json = json_decode(curl_get(TFYT('terminal_api').'?key='.TFYT('terminal_key').'&cron='.TFYT('terminal_cron').'&action=config&only='.$GLOBALS['users']['only'].'&qid='.$cookieqid.'&config=delshuo&delshuo='.$delshuo.'&net='.$net));
            if ($json->state=='ok'){
                exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
            }else{
                exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
            }
        }else{
            exit("<script language='javascript'>alert('你不是VIP,无法使用此功能！');window.location.href='?Mould=QQSet';</script>");
        }
    }elseif (POST('action')=='delly'){
        $delly = POST('delly');
        $net = POST('net');
        if (get_isvip($GLOBALS['users']['vip'],$GLOBALS['users']['vipend'])){
            $json = json_decode(curl_get(TFYT('terminal_api').'?key='.TFYT('terminal_key').'&cron='.TFYT('terminal_cron').'&action=config&only='.$GLOBALS['users']['only'].'&qid='.$cookieqid.'&config=delly&delly='.$delly.'&net='.$net));
            if ($json->state=='ok'){
                exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
            }else{
                exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
            }
        }else{
            exit("<script language='javascript'>alert('你不是VIP,无法使用此功能！');window.location.href='?Mould=QQSet';</script>");
        }
    }elseif (POST('action')=='ly'){
        $ly = POST('ly');
        $net = POST('net');
        if (get_isvip($GLOBALS['users']['vip'],$GLOBALS['users']['vipend'])){
            $json = json_decode(curl_get(TFYT('terminal_api').'?key='.TFYT('terminal_key').'&cron='.TFYT('terminal_cron').'&action=config&only='.$GLOBALS['users']['only'].'&qid='.$cookieqid.'&config=ly&ly='.$ly.'&net='.$net));
            if ($json->state=='ok'){
                exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
            }else{
                exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
            }
        }else{
            exit("<script language='javascript'>alert('你不是VIP,无法使用此功能！');window.location.href='?Mould=QQSet';</script>");
        }
    }elseif (POST('action')=='zyzan'){
        $zyzan = POST('zyzan');
        $net = POST('net');
        if (get_isvip($GLOBALS['users']['vip'],$GLOBALS['users']['vipend'])){
            $json = json_decode(curl_get(TFYT('terminal_api').'?key='.TFYT('terminal_key').'&cron='.TFYT('terminal_cron').'&action=config&only='.$GLOBALS['users']['only'].'&qid='.$cookieqid.'&config=zyzan&zyzan='.$zyzan.'&net='.$net));
            if ($json->state=='ok'){
                exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
            }else{
                exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
            }
        }else{
            exit("<script language='javascript'>alert('你不是VIP,无法使用此功能！');window.location.href='?Mould=QQSet';</script>");
        }
    }elseif (POST('action')=='visitor'){
        $visitor = POST('visitor');
        $net = POST('net');
        if (get_isvip($GLOBALS['users']['vip'],$GLOBALS['users']['vipend'])){
        $json = json_decode(curl_get(TFYT('terminal_api').'?key='.TFYT('terminal_key').'&cron='.TFYT('terminal_cron').'&action=config&only='.$GLOBALS['users']['only'].'&qid='.$cookieqid.'&config=visitor&visitor='.$visitor.'&net='.$net));
            if ($json->state=='ok'){
                exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
            }else{
                exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
            }
        }else{
            exit("<script language='javascript'>alert('你不是VIP,无法使用此功能！');window.location.href='?Mould=QQSet';</script>");
        }
    }elseif (POST('action')=='qd'){
        $qd = POST('qd');
        $net = POST('net');
        $qdcon = POST('qdcon');
        if (get_isvip($GLOBALS['users']['vip'],$GLOBALS['users']['vipend'])){
            $json = json_decode(curl_get(TFYT('terminal_api').'?key='.TFYT('terminal_key').'&cron='.TFYT('terminal_cron').'&action=config&only='.$GLOBALS['users']['only'].'&qid='.$cookieqid.'&config=qd&qd='.$qd.'&net='.$net.'&qdcon='.$qdcon));
            if ($json->state=='ok'){
                exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
            }else{
                exit("<script language='javascript'>alert('{$json->msg}');window.location.href='?Mould=QQSet';</script>");
            }
        }else{
            exit("<script language='javascript'>alert('你不是VIP,无法使用此功能！');window.location.href='?Mould=QQSet';</script>");
        }
    }
}else{
    exit("<script language='javascript'>alert('QQ不存在！');window.location.href='?Mould=QQList';</script>");
}

//获取终端服务器
$website = json_decode(curl_get(TFYT('terminal_api').'?key='.TFYT('terminal_key').'&cron='.TFYT('terminal_cron').'&action=website'));

//加载头部
Load_Template(Mains.'head.php');

//加载视图
Load_Template(Mains.'qqset.php');

//加载底部
Load_Template(Mains.'foot.php');