<?php
// +----------------------------------------------------------------------
// | 天方夜谭 [ 世界上最好用的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', '挂机管理');

//删除挂机
if (GET('action')=='del'){
    $qid = GET('qid');
    $only = GET('only');
    if (empty($qid) || empty($only)){
        exit("<script language='javascript'>alert('系统找不到要删除的挂机!');window.location.href='?Mould=Admin_Qq';</script>");
    }else{
        $arr = json_decode(curl_get(TFYT('terminal_api').'?key='.TFYT('terminal_key').'&cron='.TFYT('terminal_cron').'&action=del&only='.$only.'&qid='.$qid));
        if ($arr->state=='ok'){
            exit("<script language='javascript'>alert('{$arr->msg}');window.location.href='?Mould=Admin_Qq';</script>");
        }else{
            exit("<script language='javascript'>alert('{$arr->msg}');window.location.href='?Mould=Admin_Qq';</script>");
        }
    }
}

//获取数据
$list = json_decode(curl_get(TFYT('terminal_api').'?key='.TFYT('terminal_key').'&cron='.TFYT('terminal_cron').'&action=alllist'));

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

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

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