<?php

/*
'**************************************************************************************************
' 程序名称: CCTVAI开源音乐管理系统
' 官方网站: http://www.cctvai.com
' 联系 Q Q: 1542367792
' QQ交流群：136687984
' 版本：(终结版)
' 备注：未经书面授权，不得向任何第三方提供本软件系统！
' 功能，模板，插件，扩展，定制请联系QQ：1542367792
'**************************************************************************************************
*/
error_reporting(0);
include "../../include/cctvai.conn.php";
include "../function_common.php";
admincheck(7);
/*if(Smallfivesolution() == $_SERVER['SERVER_NAME']) {
} else {
    echo Smallfivesq();
    exit();
}*/
$Path=basename(SafeRequest("path", "get"));
$Admin=basename(SafeRequest("admin", "get"));
$Gurl="http://www.cctvai.com/".SafeRequest("path", "get")."";
$Aurl="http://www.cctvai.com/".SafeRequest("admin", "get")."";

//G
ob_start();
readfile($Gurl);
$content=ob_get_contents();
ob_end_clean();
$size=strlen($content);
$fp2=@fopen($Path, 'a');
fwrite($fp2, $content);
fclose($fp2);
unset($content, $Gurl);
include('pclzip.lib.php'); 
$archive = new PclZip($Path);
if ($archive->extract(PCLZIP_OPT_PATH, _cctvai_root_) == 0) {@unlink($Path);}
@unlink($Path);

//A
ob_start();
readfile($Aurl);
$content=ob_get_contents();
ob_end_clean();
$size=strlen($content);
$fp2=@fopen($Admin, 'a');
fwrite($fp2, $content);
fclose($fp2);
unset($content, $Aurl);
$archive = new PclZip($Admin);
if ($archive->extract(PCLZIP_OPT_PATH, '../') == 0) {
	@unlink($Admin);
	showmessage("抱歉，下载失败！请联系QQ：1542367792", '../plug/index.php', 0);
	}
@unlink($Admin);
showmessage("应用已下载，正在转跳中.....", '../plug/index.php', 0);
?>