<?php
if(!defined('MOD'))  die("access die");
checkAdminReferer();
$id = intval( $_GET[id]) ;
if( !$id){
	qbase::showmsg("error request");
}else{
	$js = qdb::QueryFirst( "select * from ".TABLEPRE."js where id='$id'");
	if ( $js){
		qdb::Query("delete from ".TABLEPRE."js where id='$id' limit 1");
		@unlink( C_P."/js/{$channelid}/{$js[file_name]}");
		@unlink( A_P . "/templates/cache/" . substr($js['file_name'], 0, strpos($js['file_name'], '.')). '.php');
		qbase::get_object('event', 'js', array('action'=>'delete', 'data'=>$js));
		adminLog("删除JS调用");
		qbase::showmsg( "您的操作已经生效，请注意：<br>如果有前台页面引用了这个js/html文件,请修改","default","module.php?mod={$mod}&action=js&action_do=manage&channelid={$channelid}"); 
	}
	qbase::showmsg("没有找到相关信息","default","system.php?sys=js&channelid={$channelid}&channelselect={$channelselect}&action=manage"); 
}
?>