<?php
require(dirname(__FILE__) .'/check.php');
$skin->CheckIframe();

/* **** 版权所有 ****

 程序开发：网钛科技
 网钛CMS官网：http://otcms.com
 网钛IDC官网：http://idccms.com
 ＱＱ：877873666
 微信：QQ877873666
 邮箱：877873666@qq.com

 **** 版权所有 **** */


//打开用户表，并检测用户是否登录
$MB->Open('','login');

$skin->WebTop();


$MB->IsAdminRight('alertBack');


$tabColorArr = array(
	'manage'	=> '',
	'winRight'	=> '',
	'linuxRight'=> '',
	'check'		=> '',
	'del'		=> '',
	'db'		=> '',
	'sql'		=> '',
	'del'		=> '',
	'file'		=> '',
	);

switch($mudi){
	case 'manage':	
	case 'winRight':
	case 'linuxRight':
	case 'check':
	case 'del':
	case 'db':
	case 'sql':
	case 'del':
	case 'file':
		$tabColorArr[$mudi]	= 'class="selected"';
		break;
}


echo('
<script language="javascript" type="text/javascript" src="js/inc/list.js?v='. OT_VERSION .'"></script>
<script language="javascript" type="text/javascript" src="js/inc/trim.js?v='. OT_VERSION .'"></script>
<script language="javascript" type="text/javascript" src="js/sysCheckFile.js?v='. OT_VERSION .'"></script>

<div class="tabMenu">
<ul>
   <li '. $tabColorArr['manage'] .' onclick=\'document.location.href="?mudi=manage";\'>程序文件对比</li>
   <li '. $tabColorArr['check'] .' onclick=\'document.location.href="?mudi=check";\'>检查多余/问题文件</li>
   <li '. $tabColorArr['del'] .' onclick=\'document.location.href="?mudi=del";\'>无用旧文件删除</li>
   <li '. $tabColorArr['winRight'] .' onclick=\'document.location.href="?mudi=winRight";\'>Win目录权限</li>
   <li '. $tabColorArr['linuxRight'] .' onclick=\'document.location.href="?mudi=linuxRight";\'>Linux文件权限</li>
   <li '. $tabColorArr['db'] .' onclick=\'document.location.href="?mudi=db";\'>数据库结构</li>
   <li '. $tabColorArr['sql'] .' onclick=\'document.location.href="?mudi=sql";\'>SQL语句调试</li>
   <li '. $tabColorArr['file'] .' onclick=\'document.location.href="?mudi=file";\'>可选文件下载</li>
</ul><!-- <input type="button" value="计算网站占用空间" onclick="CalcSiteSize();" /> -->
</div>
');


switch ($mudi){
	case 'manage':
		manage();
		break;

	case 'winRight':
		winRight();
		break;

	case 'linuxRight':
		linuxRight();
		break;

	case 'check':
		check();
		break;

	case 'del':
		del();
		break;

	case 'db':
		db();
		break;

	case 'sql':
		sql();
		break;

	case 'file':
		fileWeb();
		break;

	case 'del':
		del();
		break;

	default:
		die('err');
}

$skin->WebBottom();

$MB->Close();
$DB->Close();





// 程序文件对比
function manage(){
	global $DB,$skin,$mudi,$sysAdminArr,$dataType,$dataTypeCN;

	$mudi2		= OT::GetStr('mudi2');
	$noReadImg	= OT::GetInt('noReadImg');
	if ($mudi2 == 'startStep2'){
		@ini_set('max_execution_time', 0);
		@set_time_limit(0); 

		$step1BtnStyle = 'disabled="true" style="color:#ccc;"';
		$step2BtnStyle = 'disabled="true" style="color:#ccc;"';
		$step2BtnStr = '第2步：请稍等，待加载完才能点该按钮...';
	}else{
		$step1BtnStyle = '';
		$step2BtnStyle = 'disabled="true" style="color:#ccc;"';
		$step2BtnStr = '第2步：与网站文件做对比';
	}

	$alertStr3 = '';
	if ($sysAdminArr['SA_isLan'] == 1){
		$alertStr3 .= '已开启<span style="color:red;">内网模式</span>；';
	}
	if ($sysAdminArr['SA_sendUrlMode'] == 1){
		$alertStr3 .= '授权页面获取模式：<span style="color:red;">AJAX</span>；';
	}
	if ($sysAdminArr['SA_checkUrlMode'] > 0){
		$alertStr3 .= '授权页面获取路线：<span style="color:red;">'. Adm::UrlWebMode($sysAdminArr['SA_checkUrlMode']) .'</span>；';
	}
	if ($sysAdminArr['SA_updateUrlMode'] > 0){
		$alertStr3 .= '授权信息获取路线：<span style="color:red;">'. Adm::UrlWebMode($sysAdminArr['SA_updateUrlMode']) .'</span>；';
	}
	if ($sysAdminArr['SA_getUrlMode'] > 0){
		$alertStr3 .= '授权调用模式：<span style="color:red;">'. Adm::UrlGetMode($sysAdminArr['SA_getUrlMode']) .'</span>；';
	}
	if ($sysAdminArr['SA_collUrlMode'] > 0){
		$alertStr3 .= '授权信息获取路线：<span style="color:red;">'. Adm::UrlGetMode($sysAdminArr['SA_collUrlMode']) .'</span>；';
	}
	if (strlen($alertStr3) > 0){ $alertStr3 = '<div style="color:#000;margin-bottom:12px;">'. $alertStr3 .'</div>'; }

	echo('
	<div style="padding:5px;">
		'. $alertStr3 .'
		<input type="button" value="第1步：获取原版文件信息" onclick=\'document.location.href="?mudi=manage&mudi2=startStep2&noReadImg="+ IsChecked("noReadImg");\' '. $step1BtnStyle .' />&ensp;&ensp;
		<input type="button" value="'. $step2BtnStr .'" onclick="CheckFile()" id="step2Btn" '. $step2BtnStyle .' />&ensp;&ensp;
		<span id="resultAlertStr" style="color:blue;"></span>
		<div style="padding-top:5px;">
			<input type="hidden" id="runStopState" name="runStopState" value="0" />
			<input type="button" value="暂停" onclick="RunStop()" id="runStopBtn" /><span id="runStopAlert" style="color:red;"></span>&ensp;&ensp;
			<input type="button" value="复制异常文件列表" onclick="CopyErrFile()" />&ensp;&ensp;
			<input type="button" value="新窗口调试" onclick="CheckBug()" id="bugBtn" />&ensp;&ensp;
			<label><input type="checkbox" id="noReadImg" name="noReadImg" value="1" checked="checked" />忽略图片文件</label>&ensp;&ensp;
			<!-- <label title="文件对比功能卡在那边没法进行时，可以开启该模式，然后点【第2步】按钮，会弹出新窗口，看看有什么错误信息出现造成的"><input type="checkbox" id="isBugMode" name="isBugMode" value="1" />调试模式</label>&ensp;&ensp; -->
		</div>
		<div><textarea id="errFileList" style="width:450px;height:100px;display:none;"></textarea></div>
	</div>
	');

	if ($mudi2 == 'startStep2'){
		echo('
		<form id="listForm" name="listForm" method="post" action="sysCheckFile_deal.php?mudi=checkFile">
		<script language="javascript" type="text/javascript">document.write (\'<input type="hidden" name="backURL" value="\'+ document.location.href +\'" />\')</script>
		<input type="hidden" name="dataType" value="'. $dataType .'" />
		<input type="hidden" name="dataTypeCN" value="'. $dataTypeCN .'" />
		');

		$skin->TableTop2('share_list.gif','','异常文件列表');
		$skin->TableItemTitle('8%,50%,8%,15%,19%','序号,文件路径,文件大小,最后修改时间,结果');

		$adminURL	= GetUrl::CurrDir();
		$beforeURL	= GetUrl::CurrDir(1);
		$adminDirName = substr($adminURL,strlen($beforeURL),-1);

		$number = 0;
		$postDataArr = array();

		echo('
		<tbody class="tabBody padd3">
		<tr><td align="left" colspan="5" style="background:#f3f3f3;padding:6px;font-weight:bold;font-size:14px;">
			程序文件 v'. OT_VERSION .' '. OT_UPDATETIME .'
			&ensp;&ensp;<a href="http://d.otcms.com/idccms/idccms_V'. OT_VERSION .'.zip" target="_blank" style="font-size:12px;color:red;">[点击下载该安装包，提取对应的原文件覆盖异常文件修复，千万不要整个安装包都覆盖进去！！]</a>
		</td></tr>
		');
		CheckSoftVerList('idcVer'. OT_UPDATEVER .'/verFileList/OTCMS_0_V'. OT_VERSION .'.txt', $adminDirName, $noReadImg, $number, $postDataArr);

		echo('<tr><td align="left" colspan="5" style="background:#f3f3f3;padding:6px;font-weight:bold;font-size:14px;">插件文件&ensp;&ensp;<span style="font-size:12px;color:red;">[插件平台]-[会员中心]-[域名管理]-[插件列表]可对各插件进行[重新升级]修复</span></td></tr>');
		$payexe = $DB->query('SELECT PS_theme,PS_appType,PS_appID,PS_currVer,PS_currTime FROM '. OT_dbPref .'paySoft where PS_state=1');
		while ($row = $payexe->fetch()){
			echo('<tr><td align="left" colspan="5" style="background:#f3f3f3;color:blue;">插件：'. $row['PS_theme'] .' v'. $row['PS_currVer'] .' '. $row['PS_currTime'] .'</td></tr>');
			CheckSoftVerList($row['PS_appType'] .'/verFileList/OTCMS_'. $row['PS_appID'] .'_V'. $row['PS_currVer'] .'.txt', $adminDirName, $noReadImg, $number, $postDataArr);
		}

		echo('
		</tbody>
		</table>
		<input type="hidden" id="fileStart" name="fileStart" value="0" />
		<input type="hidden" id="fileStep" name="fileStep" value="50" />
		<input type="hidden" id="fileTotal" name="fileTotal" value="'. $number .'" />
		<input type="hidden" id="fileData" name="fileData" value="'. implode('[arr]',$postDataArr) .'" />
		</form>

		<!-- 新窗口调试模式专用 -->
		<form id="bugForm" name="bugForm" method="post" action="sysCheckFile_deal.php?mudi=checkFile" target="_blank">
		<input type="hidden" id="fileStartBug" name="fileStart" value="" />
		<input type="hidden" id="fileStepBug" name="fileStep" value="" />
		<input type="hidden" id="fileTotalBug" name="fileTotal" value="" />
		<input type="hidden" id="fileDataBug" name="fileData" value="" />
		</form>
	

		<div style="color:red;margin:6px;">
			<b>提醒：</b>【程序文件】如果对比出异常文件，可点击<a href="http://d.otcms.com/php/OTCMS_PHP_V'. OT_VERSION .'.zip" target="_blank" style="font-size:12px;color:red;">[下载安装包，提取源文件覆盖异常文件]</a>，下载该版本安装包提取对应文件覆盖。<br />
			【插件文件】如果对比出异常文件，可进入[插件平台]-[会员中心]-[域名管理]-[插件列表]，对相关插件进行[重新升级]操作。
		</div>

		<script language="javascript" type="text/javascript">
		$id("step2Btn").value = "第2步：与网站文件做对比"; $id("step2Btn").disabled=false; $id("step2Btn").style.color="blue";
		</script>
		');
	}else{
		echo('
		<div class="padd5" style="color:red;">（由于程序文件匹配规则很严，故提示异常的不一定是真的有问题文件，结果仅供参考.）</div>
		');
	}

}



// Win文件权限
function winRight(){
	global $DB,$skin,$mudi,$sysAdminArr,$dataType,$dataTypeCN;

	$startUrl = 'sysCheckFile_deal.php?mudi=testPhpRun&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'';
	$dataArr = array(
		'cache','cache_html','cache_js','cache_php','cache_session','cache_smarty','cache_taobao','cache_web',
		'upFiles','upFiles_download','upFiles_images','upFiles_infoImg','upFiles_product','upFiles_users',
		'wap_cache'
		);

	echo('<div style="padding:6px;"><span style="color:red;">（服务器信息：'. PHP_OS .' / '. $_SERVER['SERVER_SOFTWARE'] .'）</span></div>');
	$skin->TableTop2('share_list.gif','','目录权限检查');
	$skin->TableItemTitle('8%,30%,22,40%','序号,文件路径,自动操作,手动操作');
	echo('<tbody class="tabBody padd3">');

	$dataNum = 0;
	foreach ($dataArr as $val){
		$dataNum ++;
		$newVal = str_replace('_', '/', $val);
		echo('
		<tr>
			<td align="center">'. $dataNum .'</td>
			<td align="left">'. $newVal .'/</td>
			<td align="center">
				<input type="button" value="检查执行权限" style="cursor:pointer;" onclick=\'DataDeal.location.href="'. $startUrl .'&mudi2=run&fileType='. $val .'"\' />
			</td>
			<td align="center">
				<input type="button" value="创建测试文件" style="cursor:pointer;'. (file_exists(OT_ROOT . $newVal .'/testOtcmsRun.php') ? 'color:blue;font-weight:bold;' : '') .'" onclick=\'DataDeal.location.href="'. $startUrl .'&mudi2=create&fileType='. $val .'"\' />
				<input type="button" value="访问测试文件" style="cursor:pointer;" onclick=\'var a=window.open("../'. $newVal .'/testOtcmsRun.php");\' />
				<input type="button" value="删除测试文件" style="cursor:pointer;" onclick=\'DataDeal.location.href="'. $startUrl .'&mudi2=del&fileType='. $val .'"\' />
			</td>
		</tr>
		');
	}
	echo('
	</tbody>
	</table>
	<div style="color:blue;margin:6px;">提醒：如果【自动操作】不能用，请用【手动操作】（先创建，然后访问，看是否有显示内容来判断是否能运行PHP文件，再然后删除）</div>
	<br /><br />
	');


	$startUrl = 'sysCheckFile_deal.php?mudi=webConfigDeal&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'';
	$dataArr = array(
		'admin/images'	=> '后台图片目录',
		'admin/js'		=> '后台js文件目录',
		'admin/temp'	=> '后台临时图片目录',
		'admin/tools'	=> '后台工具目录',
		'admin/upFile'	=> '后台上传图片目录<span style="color:red;">【建议有】</span>',
		'cache'			=> '缓存目录<span style="color:red;">【建议有】</span>',
		'Data'			=> '数据库目录<span style="color:red;">【建议有】</span>',
		'Data_backup'	=> '备份目录<span style="color:red;">【建议有】</span>',
		'html'			=> '静态页存放目录<span style="color:red;">【建议有】</span>',
		'inc_img'		=> '图片目录',
		'js'			=> 'js文件目录',
		'pay'			=> '支付核心文件目录<span style="color:red;">【建议有】</span>',
		'pluDef'		=> '插件默认配置目录<span style="color:red;">【建议有】</span>',
		'plugin'		=> '插件目录<span style="color:red;">【建议有】</span>',
		'smarty'		=> '模板引擎目录<span style="color:red;">【建议有】</span>',
		'temp'			=> '临时文件目录',
		'template'		=> '模板目录',
		'tools'			=> '工具目录',
		'upFiles'		=> '上传图片附件目录<span style="color:red;">【建议有】</span>',
		'web_config'	=> '环境配置目录'
		);
	if (AppWap::Jud()){
		$dataArr['wap/cache']		= '手机版缓存目录<span style="color:red;">【建议有】</span>';
		$dataArr['wap/html']		= '手机版静态页目录<span style="color:red;">【建议有】</span>';
		$dataArr['wap/images']		= '手机版图片目录';
		$dataArr['wap/js']			= '手机版js文件目录';
		$dataArr['wap/skin']		= '手机版多皮肤目录';
		$dataArr['wap/template']	= '手机版模板目录';
		$dataArr['wap/tools']		= '手机版工具目录';
	}

	$skin->TableTop2('share_list.gif','','IIS环境 取消执行权限配置文件 列表');
	$skin->TableItemTitle('8%,25%,15%,20%,32','序号,配置文件路径,状态,备注,操作');
	echo('<tbody class="tabBody padd3">');

	$dataNum = 0;
	foreach ($dataArr as $key => $val){
		$dataNum ++;
		if ($key == 'Data'){
			$filePath = OT_ROOT . OT_dbDir .'web.config';
		}elseif ($key == 'Data_backup'){
			$filePath = OT_ROOT . OT_dbBakDir .'web.config';
		}elseif (strpos($key,'admin/') !== false){
			$filePath = str_replace('admin/',OT_adminROOT,$key) .'/web.config';
		}else{
			$filePath = OT_ROOT . $key .'/web.config';
		}
		if (is_file($filePath)){
			if (md5(str_replace(array("\r","\n"),'',File::Read($filePath))) == 'd527f243a4607c2fb74349361adf51e7'){
				$stateCN = '<span style="color:green;">存在</span>';
			}else{
				$stateCN = '<span style="color:;">存在，但md5不一致</span>';
			}
		}else{
			$stateCN = '<span style="color:red;">不存在</span>';
		}
		
		echo('
		<tr>
			<td align="center">'. $dataNum .'</td>
			<td align="left">'. $key .'/<span style="color:blue;">web.config</span></td>
			<td align="center">'. $stateCN .'</td>
			<td align="left">'. $val .'</td>
			<td align="center">
				<input type="button" value="创建配置文件" style="cursor:pointer;" onclick=\'DataDeal.location.href="'. $startUrl .'&mudi2=create&fileType='. urlencode($key) .'"\' />
				<input type="button" value="删除配置文件" style="cursor:pointer;" onclick=\'DataDeal.location.href="'. $startUrl .'&mudi2=del&fileType='. urlencode($key) .'"\' />
			</td>
		</tr>
		');
	}
	echo('
	</tbody>
	</table>
	');
}



// Linux文件权限
function linuxRight(){
	global $DB,$skin,$mudi,$sysAdminArr,$dataType,$dataTypeCN;

	echo('
	<div style="padding:6px;"><span style="color:red;">（服务器信息：'. PHP_OS .' / '. $_SERVER['SERVER_SOFTWARE'] .'）</span></div>
	<div style="padding:5px;">
		文件路径：<input type="text" id="refPath" name="refPath" size="20" style="width:180px;" />&ensp;&ensp;
		权限值：<input type="text" id="refLimitNum" name="refLimitNum" size="20" style="width:50px;" />&ensp;&ensp;
		<input type="button" value=" 查 找 " onclick="RefLimitList()" />&ensp;&ensp;
	</div>
	');

	$skin->TableTop2('share_list.gif','','文件权限列表');
	$skin->TableItemTitle('4%,5%,57%,12%,10%,12%','<input type="checkbox" id="selAll" name="selAll" onclick="CheckBoxAll()" />,序号,文件路径,权限符,权限值,文件大小');

	$number = 0;
	echo('
	<tbody class="tabBody padd3">
	');

	File_Each(OT_ROOT,'',$number);

	echo('
	<input type="hidden" id="fileCount" name="fileCount" value="'. $number .'" />
	</tbody>
	<tr class="tabColorB padd5">
		<td align="left" colspan="20">
			<form id="listForm" name="listForm" method="post" action="sysCheckFile_deal.php?mudi=revLimit" onsubmit="return CheckListForm()">
			<script language="javascript" type="text/javascript">document.write (\'<input type="hidden" name="backURL" value="\'+ document.location.href +\'" />\')</script>
			<input type="hidden" name="dataType" value="'. $dataType .'" />
			<input type="hidden" name="dataTypeCN" value="'. $dataTypeCN .'" />
			<input type="hidden" id="limitFileList" name="limitFileList" value="" />

			<input type="button" value="全选" class="tabBottomBtn allSel" onclick="AllSelBox()" />
			<input type="button" value="反选" class="tabBottomBtn revSel" onclick="RevSelBox()" />
			&ensp;
			修改权限值为：<input type="text" id="newLimitNum" name="newLimitNum" maxlength="3" style="width:50px;" onkeyup="if (this.value!=FiltInt(this.value)){this.value=FiltInt(this.value)}" />
			<input type="submit" value="确定批量修改" />
			&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;<a href="#" onclick=\'ConfirmHref("警告！慎点！如果网站权限没问题，请不要点。\n如果继续点【确定】，否者点【取消】","sysCheckFile_recur.php","");return false;\' target="_blank" style="color:blue;font-weight:bold;">&gt;&gt;警告！慎点！点击运行全站目录755和文件644权限调整脚本（网站权限没问题的不要点）。</a>
			</form>
		</td>
	</tr>
	</table>
	');
}



function File_Each($dirPath, $rootDir, &$number){
	$retArr = array();
	if ($handle = opendir($dirPath)) {
		if (substr($dirPath,-1) != "/"){ $dirPath .= "/"; }
		$dirArr = array();
		$dirListArr = array();
		$fileListArr = array();
		while (($file = readdir($handle)) !== false) {
			if ($file != "." && $file != "..") {
				if (is_dir($dirPath . $file)){
					$dirArr[] = $file;
				}elseif ( strpos(strtolower("|thumbs.db|历史更新记录.txt|使用教程【必看】.txt|风格目录名称说明.txt|favicon.ico|# OTCMS@!db%22.db|# otcms@!db%22.ldb|# otcms@!db%22.mdb|# otcms_coll.mdb|ip库说明.txt|filelist.php|config.php|sitemap.html|narEnd.gif|onload.gif|close.gif|button_true.gif|httpd.ini|robots.txt|lock.txt|123.txt|"),"|". strtolower(Str::ChangeCharset($file,"GBK")) ."|") === false ){
					if (strpos("|.png|.jpg|jpeg|.gif|.swf|.rar|.mdb|.ico|.cab|.exe|", "|". strtolower(substr($file,-4) ."|")) === false){
						$number ++;
						if ($number % 2 == 0){ $bgcolor='class="tabColorTr"'; }else{ $bgcolor=''; }
						$filePath = $dirPath . $file;
						$fileSize	= filesize($filePath);
						$fileLimit	= File::LimitNum($filePath);
						echo('
						<input type="hidden" id="state'. $number .'" name="state'. $number .'" value="1" />
						<input type="hidden" id="pathinfo'. $number .'" name="pathinfo'. $number .'" value="'. $filePath .'" />
						<input type="hidden" id="sizeinfo'. $number .'" name="sizeinfo'. $number .'" value="'. $fileSize .'" />
						<input type="hidden" id="limitinfo'. $number .'" name="limitinfo'. $number .'" value="'. $fileLimit .'" />
						<tr '. $bgcolor .' id="data'. $number .'">
							<td align="center"><input type="checkbox" id="sel'. $number .'" name="selDataID[]" value="'. $number .'" /></td>
							<td align="center">'. $number .'</td>
							<td id="filePath'. $number .'" align="left">'. Str::ChangeCharset($rootDir . $file) .'</td>
							<td align="center" id="limitChar'. $number .'">'. File::LimitChar($filePath) .'</td>
							<td align="center" id="limitNum'. $number .'">'. $fileLimit .'</td>
							<td align="right">'. File::SizeUnit($fileSize) .'</td>
							<!-- <td align="center"><br /></td> -->
						</tr>
						');
					}
				}
			}
		}
		foreach ($dirArr as $dir){
			if (strpos('|install/|upFiles/|temp/|smarty/|'. OT_dbDir .'|'. OT_dbBakDir .'|','|'. $dir .'/|') === false){
				$dirListArr = array_merge($dirListArr,File_Each($dirPath . $dir .'/', $rootDir . $dir .'/', $number));
			}
		}
		$retArr = array_merge($fileListArr, $dirListArr);
	}
	closedir($handle);
	return $retArr;
}



// 检查多余/问题文件
function check(){
	global $DB,$skin,$mudi,$sysAdminArr;

	$skin->TableTop('share_rev.gif','','非程序目录检查');
		echo('
		<div><input type="button" value="检查" onclick="CheckSoftDir();" /></div>
		<div id="dirErrList" style="line-height:1.4;"></div>
		');
	$skin->TableBottom();

	echo('
	<br />
	');

	$skin->TableTop('share_rev.gif','','非程序文件检查');
		echo('
		<input type="button" value="检查" onclick="CheckSoftDirFile();" />&ensp;&ensp;<span style="color:red;">（点击【检查】按钮前，请先点击 <input type="button" value="清理缓存" onclick="UpdateAllCache();return false;" /> 和 <input type="button" id="clearUpdateDbBtn" value="清空升级库" onclick="ClearUpdateDb();" />，避免把一些缓存视为异常文件列出）</span>
		<div style="line-height:2;margin-top:8px;">
		<div><span style="font-weight:bold;">检查选择区域范围，范围越大所花时间越多。</span><span style="color:red;">（列出的文件仅是说明不属于程序文件或者是禁用的插件文件，不一定是异常文件，请自行判断）</span></div>
		<ul>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="before" />前台目录</label><span id="beforeStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="admin" />后台目录</label><span id="adminStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="Data" />数据库目录</label><span id="DataStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="Data_backup" />数据库备份目录</label><span id="Data_backupStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="api" />api/</label><span id="apiStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="onePage" />onePage/</label><span id="onePageStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="cache" />cache/</label><span id="cacheStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="go" />go/</label><span id="goStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="goods" />goods/</label><span id="goodsStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="inc" />inc/</label><span id="incStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="inc_img" />inc_img/</label><span id="inc_imgStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="js" />js/</label><span id="jsStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="news" />news/</label><span id="newsStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="pay" />pay/</label><span id="payStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="pluDef" />pluDef/</label><span id="pluDefStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="plugin" />plugin/</label><span id="pluginStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="smarty" />smarty/</label><span id="smartyStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="smarty4.x" />smarty4.x/</label><span id="smarty4.xStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="temp" />temp/</label><span id="tempStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="template" />template/</label><span id="templateStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="tools" />tools/</label><span id="toolsStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="upFiles" />upFiles/</label><span id="upFilesStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="wap" />wap/</label><span id="wapStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="message" />message/</label><span id="messageStateStr"></span></li>
			<li style="float:left;width:130px;"><label><input type="checkbox" name="area[]" checked="checked" value="web_config" />web_config/</label><span id="web_configStateStr"></span></li>
		</ul>
		</div>
		<div class="clr"></div>
		<div id="beforeErrList" style="line-height:1.4;"></div>
		<div id="adminErrList" style="line-height:1.4;"></div>
		<div id="DataErrList" style="line-height:1.4;"></div>
		<div id="Data_backupErrList" style="line-height:1.4;"></div>
		<div id="apiErrList" style="line-height:1.4;"></div>
		<div id="onePageErrList" style="line-height:1.4;"></div>
		<div id="cacheErrList" style="line-height:1.4;"></div>
		<div id="goErrList" style="line-height:1.4;"></div>
		<div id="goodsErrList" style="line-height:1.4;"></div>
		<div id="incErrList" style="line-height:1.4;"></div>
		<div id="inc_imgErrList" style="line-height:1.4;"></div>
		<div id="inc_tempErrList" style="line-height:1.4;"></div>
		<div id="jsErrList" style="line-height:1.4;"></div>
		<div id="newsErrList" style="line-height:1.4;"></div>
		<div id="payErrList" style="line-height:1.4;"></div>
		<div id="pluDefErrList" style="line-height:1.4;"></div>
		<div id="pluginErrList" style="line-height:1.4;"></div>
		<div id="smartyErrList" style="line-height:1.4;"></div>
		<div id="smarty4.xErrList" style="line-height:1.4;"></div>
		<div id="tempErrList" style="line-height:1.4;"></div>
		<div id="templateErrList" style="line-height:1.4;"></div>
		<div id="toolsErrList" style="line-height:1.4;"></div>
		<div id="upFilesErrList" style="line-height:1.4;"></div>
		<div id="wapErrList" style="line-height:1.4;"></div>
		<div id="messageErrList" style="line-height:1.4;"></div>
		<div id="web_configErrList" style="line-height:1.4;"></div>
		');
	$skin->TableBottom();

	echo('
	<br />
	');

	$skin->TableTop('share_rev.gif','','upFiles/目录图片木马检查');
		echo('
		<div><input type="button" value="检查" onclick="CheckUpFilesDir();" /></div>
		<div id="upFilesErrImgList" style="line-height:1.4;"></div>
		<div style="color:blue;margin:5px 0 5px 0;">（如果检测出疑似木马图片很多，可能部分不是木马，删除时会再次检测，不是木马图片会提示不允许删除）</div>
		');
	$skin->TableBottom();

}



// 获取数据库结构
function db(){
	global $DB,$skin,$mudi,$sysAdminArr,$dbName;

	$dbStr = '';
	$infoStr = '';
	$sqlStr = $sqlDefStr = '';
	$judRevSql = false;	// 显示恢复大小写表名语句
	$tableCount = 0;
	$tableNum = 0;
	$tabPrefLen = strlen(OT_dbPref);

	if (OT_Database == 'mysql'){
		$sizeArr = $typeArr = array();
		$sizeexe = $DB->query("select TABLE_NAME, concat(truncate(data_length/1024/1024,2),'') as data_size,
			concat(truncate(data_free/1024/1024,2),'') AS data_free,
			concat(truncate(index_length/1024/1024,2),'') as index_size
			from information_schema.tables where TABLE_SCHEMA = '". $dbName ."'
			group by TABLE_NAME
			order by data_length desc;");
			while ($row = $sizeexe->fetch()){
				$sizeArr[$row['TABLE_NAME']] = array('data_size'=>$row['data_size'], 'index_size'=>$row['index_size'], 'data_free'=>$row['data_free']);
			}
		unset($sizeexe);
		$typeexe = $DB->query("show table status FROM ". $dbName .";");
			while ($row = $typeexe->fetch()){
				// print_r($row);die();
				$typeArr[$row['Name']] = array('ENGINE'=>$row['Engine'], 'ROW_FORMAT'=>$row['Row_format'], 'TABLE_COLLATION'=>$row['Collation']);
			}
		unset($sizeexe);

		$tabDataSize = $tabIndexSize = $tabFreeSize = 0;

		$tabexe = $DB->query("select TABLE_NAME from information_schema.tables where TABLE_SCHEMA='". $dbName ."' order by TABLE_NAME ASC");
		while ($row = $tabexe->fetch()){
			$tabName = $row['TABLE_NAME'];
			if (strcasecmp(substr($tabName,0,$tabPrefLen), OT_dbPref) == 0){
				if (strlen($dbStr) > 0){ $dbStr .= PHP_EOL .'【'. $tabName .'】'. PHP_EOL; }else{ $dbStr .= '【'. $tabName .'】'. PHP_EOL; }
				$tableNum ++;

				/*
				| 字段名				| 数据类型					| 描述 |
				|----------------------	|--------------------		|--------------------------------------------------------------|
				| TABLE_CATALOG			| varchar(512)				| 数据库的目录名，通常为 `def`。 |
				| TABLE_SCHEMA			| varchar(64)				| 表所属的数据库名称。 |
				| TABLE_NAME			| varchar(64)				| 表的名称。 |
				| COLUMN_NAME			| varchar(64)				| 列的名称。 |
				| ORDINAL_POSITION		| bigint(10) unsigned		| 列在表中的顺序位置，从1开始。 |
				| COLUMN_DEFAULT		| longtext					| 列的默认值。	|
				| IS_NULLABLE			| varchar(3)				| 是否允许NULL值，可以是 `YES` 或 `NO`。 |
				| DATA_TYPE				| varchar(64)				| 列的数据类型，如 `int`, `varchar`, `datetime` 等。 |
				| CHARACTER_MAXIMUM_LENGTH	| bigint(21) unsigned	| 对于字符类型，此列的最大长度。 |
				| CHARACTER_OCTET_LENGTH	| bigint(21) unsigned	| 对于字符类型，此列的最大字节长度。 |
				| NUMERIC_PRECISION		| bigint(21) unsigned		| 对于数值类型，精度（总位数）。 |
				| NUMERIC_SCALE			| bigint(21) unsigned		| 对于数值类型，小数位数。 |
				| DATETIME_PRECISION	| tinyint(3) unsigned		| 对于日期和时间类型，精度（小数点后的位数）。 |
				| CHARACTER_SET_NAME	| varchar(32)				| 字符集名称。 |
				| COLLATION_NAME		| varchar(32)				| 排序规则名称。 |
				| COLUMN_TYPE			| longtext					| 列的完整类型定义，包括类型和约束。 |
				| COLUMN_KEY			| varchar(3)				| 列的键类型，可以是 `PRI`（主键）、`MUL`（多值索引）等。 |
				| EXTRA					| varchar(30)				| 列的附加信息，如 `AUTO_INCREMENT`, `ON UPDATE CURRENT_TIMESTAMP` 等。 |
				| PRIVILEGES			| varchar(80)				| 列的权限，如 `SELECT`, `INSERT`, `UPDATE`, `REFERENCES` 等。 |
				| COLUMN_COMMENT		| varchar(1024)				| 列的注释。 |
				*/
				$fieldRow = $DB->GetAll("select COLUMN_NAME,DATA_TYPE,COLUMN_DEFAULT from information_schema.COLUMNS where TABLE_SCHEMA='". $dbName ."' and TABLE_NAME='". $tabName ."' order by COLUMN_NAME ASC");	// ORDINAL_POSITION
				//print_r($fieldRow);die();
				$fieldNum = count($fieldRow);
				for ($i=0; $i<$fieldNum; $i++){
					$dbStr .= '['. $fieldRow[$i]['COLUMN_NAME'] .']'. PHP_EOL;
					if ($fieldRow[$i]['DATA_TYPE'] == 'varchar' && is_null($fieldRow[$i]['COLUMN_DEFAULT'])){
						// $sqlDefStr .= '$DB->query("ALTER TABLE '. $tabName .' ALTER COLUMN '. $fieldRow[$i]['COLUMN_NAME'] .' SET DEFAULT \'\';");<br />';
						$sqlDefStr .= 'ALTER TABLE '. $tabName .' ALTER COLUMN '. $fieldRow[$i]['COLUMN_NAME'] .' SET DEFAULT \'\';'. PHP_EOL;
					}
				}
				unset($fieldRow,$fieldexe);

				if (! isset($sizeArr[$tabName])){
					$sizeArr[$tabName] = array('data_size'=>'', 'index_size'=>'', 'data_free'=>'');
				}
				if (! isset($typeArr[$tabName])){
					$typeArr[$tabName] = array('ENGINE'=>'', 'ROW_FORMAT'=>'', 'TABLE_COLLATION'=>'');
				}
				if ($judRevSql){
					$sqlStr .= '$DB->query("ALTER  TABLE '. str_replace('ot_', '". $prefl ."', strtolower($tabName)) .' RENAME TO '. str_replace('OT_', '". OT_dbPref ."', $tabName) .'");<br />';
				}
				$infoStr .= '
				<tr>
					<td align="center" class="selCheckbox"><input type="checkbox" name="selDataID[]" value="'. $tabName .'" /></td>
					<td align="center">'. $tableNum .'</td>
					<td align="left" style="padding-left:12px;">'. $tabName .'</td>
					<td align="center">'. $fieldNum .'</td>
					<td align="center">'. $DB->GetOne('select count(1) from '. $tabName .'') .'</td>
					<td align="center">'. $typeArr[$tabName]['ENGINE'] .'</td>
					<td align="center">'. $typeArr[$tabName]['ROW_FORMAT'] .'</td>
					<td align="center">'. $typeArr[$tabName]['TABLE_COLLATION'] .'</td>
					<td align="right" style="padding-right:6px;">'. $sizeArr[$tabName]['data_size'] .' MB</td>
					<td align="right" style="padding-right:6px;">'. $sizeArr[$tabName]['index_size'] .' MB</td>
					<td align="right" style="padding-right:6px;">'. $sizeArr[$tabName]['data_free'] .' MB</td>
				</tr>
				';
				$tabDataSize += OT::ToFloat($sizeArr[$tabName]['data_size']);
				$tabIndexSize += OT::ToFloat($sizeArr[$tabName]['index_size']);
				$tabFreeSize += OT::ToFloat($sizeArr[$tabName]['data_free']);
			}
		}
		$infoStr .= '
		<tr>
			<td align="center"></td>
			<td align="center"></td>
			<td align="left"></td>
			<td align="center"></td>
			<td align="center"></td>
			<td align="center"></td>
			<td align="center"></td>
			<td align="center">总：'. ($tabDataSize + $tabIndexSize + $tabFreeSize) .' MB</td>
			<td align="right" style="padding-right:10px;">'. $tabDataSize .' MB</td>
			<td align="right" style="padding-right:10px;">'. $tabIndexSize .' MB</td>
			<td align="right" style="padding-right:10px;">'. $tabFreeSize .' MB</td>
		</tr>
		';

	}elseif (OT_Database == 'sqlite'){
		$tabexe = $DB->query("select name,sql from sqlite_master where type='table' order by name ASC"); // select name from sqlite_sequence ORDER BY name ASC
		while ($row = $tabexe->fetch()){
			$tabName = $row['name'];
			if (substr($tabName,0,$tabPrefLen) == OT_dbPref){
				$dbStr .= '【'. $tabName .'】';
				$tableNum ++;

				$fieldRow = $DB->GetAll('PRAGMA table_info('. $tabName .')'); // SHOW COLUMNS FROM
				//print_r($fieldRow);die();
				$fieldNum = count($fieldRow);
				for ($i=0; $i<$fieldNum; $i++){
					$dbStr .= '['. $fieldRow[$i]['name'] .']';
				}

				unset($fieldRow,$fieldexe);

				$infoStr .= '
				<tr>
					<td align="center" class="selCheckbox"><input type="checkbox" name="selDataID[]" value="'. $tabName .'" /></td>
					<td align="center">'. $tableNum .'</td>
					<td align="left" style="padding-left:15px;">'. $tabName .'</td>
					<td align="center">'. $fieldNum .'</td>
					<td align="center">'. $DB->GetOne('select count(1) from '. $tabName .'') .'</td>
					<td align="center"></td>
					<td align="center"></td>
					<td align="center"></td>
					<td align="center"></td>
					<td align="center"></td>
					<td align="center"></td>
				</tr>
				';
			}
		}

	}else{
		$infoStr = '数据库类型错误';
	}

	if ($judRevSql){ echo($sqlStr); }
	$skin->TableTop('share_rev.gif','','数据库结构数据');
		echo('
		<div><input type="button" value="复制内容" onclick=\'ValueToCopy("dbInfo");\' />，然后发给网钛客服。</div>
		<textarea id="dbInfo" name="dbInfo" style="width:750px;height:150px;">'. $dbStr .'</textarea>
		');
		if (strlen($sqlDefStr) > 0){
			echo('
			<div style="padding-top:12px;color:red;">建议执行SQL语句：</div>
			<textarea id="dbDefInfo" name="dbInfo" style="width:750px;height:150px;">'. $sqlDefStr .'</textarea>
			');
		}
	$skin->TableBottom();

	echo('
	<br />

	<form id="listForm" name="listForm" method="post" action="sysCheckFile_deal.php?mudi=db" onsubmit="return CheckListForm()">
	<script language="javascript" type="text/javascript">document.write (\'<input type="hidden" name="backURL" value="\'+ document.location.href +\'" />\')</script>
	<input type="hidden" id="mode" name="mode" value="" />
	');

	$skin->TableTop2('share_list.gif','','数据库基本信息');
	$skin->TableItemTitle('4%,5%,22%,6%,6%,8%,8%,11%,9%,9%,9%','<input type="checkbox" id="selAll" name="selAll" onclick="CheckBoxAll()" />,序号,数据表名,字段数,记录数,存储引擎,行格式,编码,数据大小,索引大小,碎片空间');
		echo('
		<tbody class="tabBody padd5td">
		'. $infoStr .'
		</tbody>
		<tr class="tabColorB padd5">
			<td align="left" colspan="20">
				<input type="button" value="全选" class="tabBottomBtn allSel" onclick="AllSelBox()" />
				<input type="button" value="反选" class="tabBottomBtn revSel" onclick="RevSelBox()" />
				&ensp;
				<input type="button" value="检查表" class="tabBottomBtn tool" onclick="CheckDbForm(\'check\')" />
				&ensp;
				<input type="button" value="优化表" class="tabBottomBtn tool" onclick="CheckDbForm(\'optimize\')" />
				&ensp;
				<input type="button" value="修复表" class="tabBottomBtn tool" onclick="CheckDbForm(\'repair\')" />
				&ensp;
				<input type="button" value="分析表" class="tabBottomBtn tool" onclick="CheckDbForm(\'analyze\')" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				<a href="#" onclick=\'ConfirmHref("警告！慎点！如果数据库表名大小写没问题，请不要点。\n如果继续点【确定】，否者点【取消】","readDeal.php?mudi=updateWebCache&mode=revTabName&mudi2=db","");return false;\' target="_blank" style="color:red;font-weight:bold;">&gt;&gt;警告！慎点！点击运行修复数据库表名大小写问题。</a>
				<div style="padding:18px 5px 5px 5px;">
					编码：
					<input type="button" value="utf8" class="tabBottomBtn tool" style="background-color:red;color:#fff;" onclick="CheckDbForm(\'utf8\')" />
					<input type="button" value="utf8mb4" class="tabBottomBtn tool" style="background-color:red;color:#fff;" onclick="CheckDbForm(\'utf8mb4\')" />
					&ensp;&ensp;

					存储引擎：
					<input type="button" value="InnoDB" class="tabBottomBtn tool" style="background-color:red;color:#fff;" onclick="CheckDbForm(\'InnoDB\')" />
					<input type="button" value="MyISAM" class="tabBottomBtn tool" style="background-color:red;color:#fff;" onclick="CheckDbForm(\'MyISAM\')" />
					&ensp;&ensp;
					<!-- <select>
							<option value=""></option>
							<option value="InnoDB">InnoDB</option>
							<option value="MyISAM">MyISAM</option> -->
							<!-- <option value="ARCHIVE">ARCHIVE</option>
							<option value="BLACKHOLE">BLACKHOLE</option>
							<option value="CSV">CSV</option>
							<option value="MEMORY">MEMORY</option>
							<option value="MRG_MYISAM">MRG_MYISAM</option>
							<option value="PERFORMANCE_SCHEMA">PERFORMANCE_SCHEMA</option> -->
						<!-- </select>
					&ensp;&ensp; -->

					行格式：
					<input type="button" value="Compact" class="tabBottomBtn tool" style="background-color:red;color:#fff;" onclick="CheckDbForm(\'Compact\')" />
					<input type="button" value="Dynamic" class="tabBottomBtn tool" style="background-color:red;color:#fff;" onclick="CheckDbForm(\'Dynamic\')" />
					<input type="button" value="Redundant" class="tabBottomBtn tool" style="background-color:red;color:#fff;" onclick="CheckDbForm(\'Redundant\')" />
					<input type="button" value="Compressed" class="tabBottomBtn tool" style="background-color:red;color:#fff;" onclick="CheckDbForm(\'Compressed\')" />
					<!-- <select>
							<option value=""></option>
							<option value="Compact">Compact</option>
							<option value="Dynamic">Dynamic</option>
							<option value="Redundant">Redundant</option>
							<option value="Compressed">Compressed</option>
							<option value="FIXED">FIXED</option>
						</select> -->
							<!-- 
							行格式		引入版本	特性概述				适用场景
							Redundant	5.0之前		原始格式，兼容性好		需要兼容老版本
							Compact		5.0			节省20%存储空间			通用场景
							Dynamic		5.7			处理大文本/BLOB更高效	含大字段的表
							Compressed	5.5			支持压缩存储			存储敏感场景
							FIXED		-			固定长度格式			已废弃
							-->
				</div>
			</td>
		</tr>
	</table>
	</form>
	');

}



// SQL语句调试
function sql(){
	global $DB,$systemArr,$skin,$mudi;

	$skin->TableTop('share_rev.gif','','SQL语句调试');
		echo('
		<form id="dealForm" name="dealForm" method="post" action="sysCheckFile_deal.php?mudi='. $mudi .'" onsubmit="return CheckSqlForm()">
		<script language="javascript" type="text/javascript">document.write(\'<input type="hidden" name="backURL" value="\'+ document.location.href +\'">\')</script>
		<input type="hidden" id="pwdMode" name="pwdMode" value="" />
		<input type="hidden" id="pwdKey" name="pwdKey" value="" />
		<input type="hidden" id="pwdEnc" name="pwdEnc" value="" />
		<textarea id="sqlContent" name="sqlContent" style="width:750px;height:250px;"></textarea>
		<div style="padding:5px;color:red;">
			登录密码：<input type="password" style="width:210px" id="userpwd" name="userpwd" maxlength="50"/>
			&ensp;（为了安全，请输入登录密码以确保是本人操作）
		</div>
		<div style="padding:5px;">
			错误级别：
			<label><input type="radio" name="dbErrMode" value="1" '. Is::Checked($systemArr['SYS_dbErrMode'],1) .' title="SQL执行出错了不处理，仅显示错误代码或空白" />静默模式[默认]</label>&ensp;&ensp;
			<label><input type="radio" name="dbErrMode" value="2" '. Is::Checked($systemArr['SYS_dbErrMode'],2) .' title="SQL执行出错了给出错误提示，并继续运行下去，适合调试错误" />警告模式</label>&ensp;&ensp;
			<label><input type="radio" name="dbErrMode" value="3" '. Is::Checked($systemArr['SYS_dbErrMode'],3) .' title="SQL执行出错了给出更详细错误提示，并停止运行下去" />异常模式</label>&ensp;&ensp;
		</div>
		<div style="padding:5px;">
			<input type="submit" value="立即执行" style="font-size:14px;padding:8px 15px;" />
		</div>
		</form>
		<div style="padding:15px 8px;font-size:14px;">
			<b>快捷指令：<b>
			◆<a href="sysCheckFile_deal.php?mudi=sqlMore&type=infoTypeClear" style="color:blue;">栏目ID重置为1</a>
			◆<a href="sysCheckFile_deal.php?mudi=sqlMore&type=infoClear" style="color:blue;">文章ID重置为1</a>
			◆<a href="sysCheckFile_deal.php?mudi=sqlMore&type=usersClear" style="color:blue;">会员ID重置为1</a>
			◆<a href="sysCheckFile_deal.php?mudi=sqlMore&type=infoWebClear" style="color:blue;">单篇页ID重置为1</a>
		</div>
		');
	$skin->TableBottom();

}



// 可选文件下载
function fileWeb(){
	global $DB,$skin;

	echo('
	<div style="padding:0 6px 6px 6px;color:blue;">
		zip 扩展（解压功能）：'. (extension_loaded('zip') ? '<span style="color:green;">支持</span>' : '<span style="color:red;">不支持，无法使用第二种操作</span>') .'
	</div>
	');

	$skin->TableTop2('share_list.gif','','可选文件列表');
	$skin->TableItemTitle('4%,10%,20%,8%,29%,21%,8%','序号,文件名称,功能描述,大小,ZIP存放位置（upFiles/download/）,解压位置,操作');

	echo('
	<tbody class="tabBody padd3td">
	<tr>
		<td align="center">1</td>
		<td align="center">IP库</td>
		<td align="left">留言、评论、后台登录、多功能表单等，IP地址转为地址信息。<br />纯真社区版IP库，感谢<a href="https://www.cz88.net" target="_blank">纯真CZ88</a>提供</td>
		<td align="right">5.16 MB</td>
		<td align="left">
			<div title="upFiles/download/ip.zip">
				ip.zip
				&ensp;'. File::IsExists(OT_ROOT .'upFiles/download/ip.zip','cn') .'
			</div>
			<div class="clr"></div>
			<div style="float:right;">
				<a href="sysCheckFile_deal.php?mudi=optionFile&mode=down&file=ip" class="font3_2">[下载]</a>'.
				'<a href="sysCheckFile_deal.php?mudi=optionFile&mode=jieya&file=ip" class="font3_2">[解压]</a>'.
				'<a href="sysCheckFile_deal.php?mudi=optionFile&mode=del&file=ip" class="font3_2">[删除]</a>
			</div>
		</td>
		<td align="left">tools/ip.dat&ensp;'. File::IsExists(OT_ROOT .'tools/ip.dat','cn') .'</td>
		<td align="center">
			<a href="http://d.otcms.com/phpExt/ip.zip" target="_blank" class="font1_2">下载到本地</a>
		</td>
	</tr>
	<tr class="tabColorTr">
		<td align="center">2</td>
		<td align="center">分词字库</td>
		<td align="left">使用分词获取关键词需要用到该字库</td>
		<td align="right">5.80 MB</td>
		<td align="left">
			<div title="upFiles/download/pscws4.zip">
				pscws4.zip
				&ensp;'. File::IsExists(OT_ROOT .'upFiles/download/pscws4.zip','cn') .'
			</div>
			<div class="clr"></div>
			<div style="float:right;">
				<a href="sysCheckFile_deal.php?mudi=optionFile&mode=down&file=pscws4" class="font3_2">[下载]</a>'.
				'<a href="sysCheckFile_deal.php?mudi=optionFile&mode=jieya&file=pscws4" class="font3_2">[解压]</a>'.
				'<a href="sysCheckFile_deal.php?mudi=optionFile&mode=del&file=pscws4" class="font3_2">[删除]</a>
			</div>
		</td>
		<td align="left">tools/pscws4/etc/dict.utf8.xdb&ensp;'. File::IsExists(OT_ROOT .'tools/pscws4/etc/dict.utf8.xdb','cn') .'</td>
		<td align="center">
			<a href="http://d.otcms.com/phpExt/pscws4.zip" target="_blank" class="font1_2">下载到本地</a>
		</td>
	</tr>
	<tr>
		<td align="center" rowspan="7">3</td>
		'. FontItem('alibabaPuHuiTi', '阿里妈妈普惠体3.0', '中文文字水印、自动配缩略图、生成推广海报等图片上写文字功能需要加载字库才能用', '5.78 MB', 'otf') .'
	</tr>
	<tr class="tabColorTr">
		'. FontItem('alimamaShuHeiTi', '阿里妈妈数黑体', '同上，多选一，根据自己喜好选择', '0.818 MB', 'otf') .'
	</tr>
	<tr>
		'. FontItem('alimamaDongFangDaKai', '阿里妈妈东方大楷', '同上，多选一，根据自己喜好选择', '3.04 MB', 'otf') .'
	</tr>
	<tr class="tabColorTr">
		'. FontItem('alimamaFangYuanTi', '阿里妈妈方圆体', '同上，多选一，根据自己喜好选择', '5.78 MB', 'ttf') .'
	</tr>
	<tr>
		'. FontItem('dingDingJinBuTi', '钉钉进步体', '同上，多选一，根据自己喜好选择', '1.33 MB', 'ttf') .'
	</tr>
	<tr class="tabColorTr">
		'. FontItem('siyuansongti', '思源宋体字库', '同上，多选一，根据自己喜好选择', '19.786 MB', 'otf') .'
	</tr>
	<tr>
		'. FontItem('siyuanheiti', '思源黑体字库', '同上，多选一，根据自己喜好选择', '7.001 MB', 'otf') .'
	</tr>
	<tr class="tabColorTr">
		<td align="center" rowspan="8">4</td>
		'. EditorItem('tinymce', 'tinyMCE 7.8.0 <br />编辑器', '功能强大的网页编辑器之一', '943 KB') .'
	</tr>
	<tr>
		'. EditorItem('tinymce5', 'tinyMCE 5.10.9 <br />编辑器', '功能强大的网页编辑器之一', '746 KB') .'
	</tr>
	<tr class="tabColorTr">
		'. EditorItem('ckeditor4', 'CKEditor 4.22.1 <br />编辑器', '全球最优秀的网页编辑器之一', '845 KB') .'
	</tr>
	<tr>
		'. EditorItem('ckeditor3', 'CKEditor 3.6.6 <br />编辑器', '全球最优秀的网页编辑器之一', '399 KB') .'
	</tr>
	<tr class="tabColorTr">
		'. EditorItem('fckeditor', 'FCKeditor 2.6.4 <br />编辑器', '国外著名编辑器，新版本名称改为 CKEditor', '437 KB') .'
	</tr>
	<tr>
		'. EditorItem('kindeditor4', 'KindEditor 4.1.11 <br />编辑器', '国产编辑器，可惜已倒闭多年', '99 KB') .'
	</tr>
	<tr class="tabColorTr">
		'. EditorItem('kindeditor3', 'kindeditor 3.5.6 <br />编辑器', '国产编辑器，可惜已倒闭多年', '99 KB') .'
	</tr>
	<tr>
		'. EditorItem('ueditor', 'UEditor 1.4.3.3 <br />百度编辑器', '百度出品的编辑器，可惜已倒闭多年', '1127 KB') .'
	</tr>
	<tr>
		<td align="center">5</td>
		<td align="center">视频转换工具</td>
		<td align="left">视频音乐播放器 插件用，用于转换为支持边播边加载的MP4文件</td>
		<td align="right">28.52 MB</td>
		<td align="left">&ensp;</td>
		<td align="left">&ensp;</td>
		<td align="center">
			<a href="http://d.otcms.com/app/ViedoToMp4.rar" target="_blank" class="font1_2">下载到本地</a>
		</td>
	</tr>
	</tbody>
	</table>
	<div style="padding:6px;font-size:14px;color:red;line-height:1.4;">
		提醒：使用可选文件操作有2种。
		第一种点击【下载到本地】，把文件下载到本地，解压后通过FTP把文件上传到网站的【解压位置】即可。
		第二种点击【ZIP存放位置】里的【下载】，提示下载成功，点击【解压】，提示解压成功即可。
		由于第二种要求空间支持下载大文件，有写入权限和有开启zip扩展，所以不一定您空间能支持，如果第二种操作不成功，请用第一种。
	</div>
	');
}



// 无用旧文件删除
function del(){
	global $DB,$skin,$mudi,$dataType,$dataTypeCN,$sysAdminArr;

	$skin->TableTop2('share_list.gif','','无用旧文件删除');
	$skin->TableItemTitle('20%,65%,15%','路径,备注,操作');

	echo('
	<tbody class="tabBody padd5" style="line-height:1.6;">
	');

	$jud_classBackupMySql	= file_exists(OT_adminROOT .'inc/classBackupMySql.php');
	$jud_classSaveImg		= file_exists(OT_adminROOT .'inc/classSaveImg.php');
	$jud_classWebHtml		= file_exists(OT_adminROOT .'inc/classWebHtml.php');
	$jud_jquery				= file_exists(OT_adminROOT .'js/inc/jquery-1.11.0.min.js');
	$jud_js_ad				= file_exists(OT_adminROOT .'js/ad.js');
	$jud_js_database		= file_exists(OT_adminROOT .'js/database.js');
	$jud_js_databaseMySQL	= file_exists(OT_adminROOT .'js/databaseMySQL.js');
	$jud_ad					= file_exists(OT_adminROOT .'ad.php');
	$jud_ad_deal			= file_exists(OT_adminROOT .'ad_deal.php');
	$jud_database			= file_exists(OT_adminROOT .'database.php');
	$jud_database_deal		= file_exists(OT_adminROOT .'database_deal.php');
	$jud_databaseMySQL		= file_exists(OT_adminROOT .'databaseMySQL.php');
	$jud_databaseMySQL_deal	= file_exists(OT_adminROOT .'databaseMySQL_deal.php');
	if ($jud_classBackupMySql || $jud_classSaveImg || $jud_classWebHtml || $jud_jquery || $jud_js_ad || $jud_js_database || $jud_js_databaseMySQL || $jud_ad || $jud_ad_deal || $jud_database || $jud_database_deal || $jud_databaseMySQL || $jud_databaseMySQL_deal){
		echo('
		<tr>
			<td align="center">后台</td>
			<td align="left">
				早期淘汰功能或现已没用的文件
				<div style="color:red;">
					'. ExistFileCN($jud_classBackupMySql) .'admin/inc/classBackupMySql.php<br />
					'. ExistFileCN($jud_classSaveImg) .'admin/inc/classSaveImg.php<br />
					'. ExistFileCN($jud_classWebHtml) .'admin/inc/classWebHtml.php<br />
					'. ExistFileCN($jud_jquery) .'admin/js/inc/jquery-1.11.0.min.js<br />
					'. ExistFileCN($jud_js_ad) .'admin/js/ad.js<br />
					'. ExistFileCN($jud_js_database) .'admin/js/database.js<br />
					'. ExistFileCN($jud_js_databaseMySQL) .'admin/js/databaseMySQL.js<br />
					'. ExistFileCN($jud_ad) .'admin/ad.php<br />
					'. ExistFileCN($jud_ad_deal) .'admin/ad_deal.php<br />
					'. ExistFileCN($jud_database) .'admin/database.php<br />
					'. ExistFileCN($jud_database_deal) .'admin/database_deal.php<br />
					'. ExistFileCN($jud_databaseMySQL) .'admin/databaseMySQL.php<br />
					'. ExistFileCN($jud_databaseMySQL_deal) .'admin/databaseMySQL_deal.php
				</div>
			</td>
			<td align="center">
				<input type="button" value="删除" style="cursor:pointer;" onclick=\'if(confirm("确定删除？")==true){DataDeal.location.href="sysCheckFile_deal.php?mudi=del&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode('前台没用文件') .'&fileType=admin"}\' />
			</td>
		</tr>
		');
	}

	$jud_configDeal		= file_exists(OT_ROOT .'configDeal.php');
	$jud_configJs		= file_exists(OT_ROOT .'configJs.php');
	$jud_usersApi		= file_exists(OT_ROOT .'usersApi.php');
	$jud_usersNews		= file_exists(OT_ROOT .'usersNews.php');
	$jud_usersWeb		= file_exists(OT_ROOT .'usersWeb.php');
	if ($jud_configDeal || $jud_configJs || $jud_usersApi || $jud_usersNews || $jud_usersWeb){
		echo('
		<tr>
			<td align="center">前台</td>
			<td align="left">
				早期淘汰功能或现已没用的文件
				<div style="color:red;">
					'. ExistFileCN($jud_configDeal) .'configDeal.php<br />
					'. ExistFileCN($jud_configJs) .'configJs.php<br />
					'. ExistFileCN($jud_usersApi) .'usersApi.php<br />
					'. ExistFileCN($jud_usersNews) .'usersNews.php<br />
					'. ExistFileCN($jud_usersWeb) .'usersWeb.php
				</div>
			</td>
			<td align="center">
				<input type="button" value="删除" style="cursor:pointer;" onclick=\'if(confirm("确定删除？")==true){DataDeal.location.href="sysCheckFile_deal.php?mudi=del&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode('前台没用文件') .'&fileType=before"}\' />
			</td>
		</tr>
		');
	}

	$jud_class_ip			= file_exists(OT_ROOT .'inc/class_ip.php');
	if ($jud_class_ip){
		echo('
		<tr>
			<td align="center">inc/</td>
			<td align="left">
				早期淘汰功能或现已没用的文件
				<div style="color:red;">
					'. ExistFileCN($jud_class_ip) .'inc/class_ip.php
				</div>
			</td>
			<td align="center">
				<input type="button" value="删除" style="cursor:pointer;" onclick=\'if(confirm("确定删除？")==true){DataDeal.location.href="sysCheckFile_deal.php?mudi=del&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode('前台没用文件') .'&fileType=inc"}\' />
			</td>
		</tr>
		');
	}

	$jud_classAppApiQQ			= file_exists(OT_ROOT .'pluDef/classAppApiQQ.php');
	$jud_classAppApiWeibo		= file_exists(OT_ROOT .'pluDef/classAppApiWeibo.php');
	$jud_classAppApiWeixin		= file_exists(OT_ROOT .'pluDef/classAppApiWeixin.php');
	$jud_classAppUserMoney		= file_exists(OT_ROOT .'pluDef/classAppUserMoney.php');
	$jud_classAppVpsApi			= file_exists(OT_ROOT .'pluDef/classAppVpsApi.php');
	$jud_classAppVpsBase		= file_exists(OT_ROOT .'pluDef/classAppVpsBase.php');
	$jud_classAppVpsXingwai		= file_exists(OT_ROOT .'pluDef/classAppVpsXingwai.php');
	if ($jud_classAppApiQQ || $jud_classAppApiWeibo || $jud_classAppApiWeixin || $jud_classAppUserMoney || $jud_classAppVpsApi || $jud_classAppVpsBase || $jud_classAppVpsXingwai){
		echo('
		<tr>
			<td align="center">pluDef/</td>
			<td align="left">
				早期淘汰功能或现已没用的文件
				<div style="color:red;">
					'. ExistFileCN($jud_classAppApiQQ) .'pluDef/classAppApiQQ.php<br />
					'. ExistFileCN($jud_classAppApiWeibo) .'pluDef/classAppApiWeibo.php<br />
					'. ExistFileCN($jud_classAppApiWeixin) .'pluDef/classAppApiWeixin.php<br />
					'. ExistFileCN($jud_classAppUserMoney) .'pluDef/classAppUserMoney.php<br />
					'. ExistFileCN($jud_classAppVpsApi) .'pluDef/classAppVpsApi.php<br />
					'. ExistFileCN($jud_classAppVpsBase) .'pluDef/classAppVpsBase.php<br />
					'. ExistFileCN($jud_classAppVpsXingwai) .'pluDef/classAppVpsXingwai.php
				</div>
			</td>
			<td align="center">
				<input type="button" value="删除" style="cursor:pointer;" onclick=\'if(confirm("确定删除？")==true){DataDeal.location.href="sysCheckFile_deal.php?mudi=del&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode('前台没用文件') .'&fileType=pluDef"}\' />
			</td>
		</tr>
		');
	}

	$jud_classAppApiQQ			= file_exists(OT_ROOT .'plugin/classAppApiQQ.php');
	$jud_classAppApiWeibo		= file_exists(OT_ROOT .'plugin/classAppApiWeibo.php');
	$jud_classAppUserMoney		= file_exists(OT_ROOT .'plugin/classAppUserMoney.php');
	$jud_classTplBlue			= file_exists(OT_ROOT .'plugin/classTplBlue.php');
	if ($jud_classAppApiQQ || $jud_classAppApiWeibo || $jud_classAppUserMoney || $jud_classTplBlue){
		echo('
		<tr>
			<td align="center">plugin/</td>
			<td align="left">
				早期淘汰功能或现已没用的文件
				<div style="color:red;">
					'. ExistFileCN($jud_classAppApiQQ) .'plugin/classAppApiQQ.php<br />
					'. ExistFileCN($jud_classAppApiWeibo) .'plugin/classAppApiWeibo.php<br />
					'. ExistFileCN($jud_classAppUserMoney) .'plugin/classAppUserMoney.php<br />
					'. ExistFileCN($jud_classTplBlue) .'plugin/classTplBlue.php
				</div>
			</td>
			<td align="center">
				<input type="button" value="删除" style="cursor:pointer;" onclick=\'if(confirm("确定删除？")==true){DataDeal.location.href="sysCheckFile_deal.php?mudi=del&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode('前台没用文件') .'&fileType=plugin"}\' />
			</td>
		</tr>
		');
	}

	$jud_plugins1			= file_exists(OT_ROOT .'smarty/plugins/shared.mb_wordwrap.php');
	$jud_sysplugins1		= file_exists(OT_ROOT .'smarty/sysplugins/smarty_internal_extension_clear.php');
	$jud_sysplugins2		= file_exists(OT_ROOT .'smarty/sysplugins/smarty_internal_extension_codeframe.php');
	$jud_sysplugins3		= file_exists(OT_ROOT .'smarty/sysplugins/smarty_internal_extension_config.php');
	$jud_sysplugins4		= file_exists(OT_ROOT .'smarty/sysplugins/smarty_internal_extension_defaulttemplatehandler.php');
	$jud_sysplugins5		= file_exists(OT_ROOT .'smarty/sysplugins/smarty_internal_filter_handler.php');
	$jud_sysplugins6		= file_exists(OT_ROOT .'smarty/sysplugins/smarty_internal_function_call_handler.php');
	$jud_sysplugins7		= file_exists(OT_ROOT .'smarty/sysplugins/smarty_internal_get_include_path.php');
	$jud_sysplugins8		= file_exists(OT_ROOT .'smarty/sysplugins/smarty_internal_utility.php');
	$jud_sysplugins9		= file_exists(OT_ROOT .'smarty/sysplugins/smarty_internal_write_file.php');
	if ($jud_plugins1 || $jud_sysplugins1 || $jud_sysplugins2 || $jud_sysplugins3 || $jud_sysplugins4 || $jud_sysplugins5 || $jud_sysplugins6 || $jud_sysplugins7 || $jud_sysplugins8 || $jud_sysplugins9){
		echo('
		<tr>
			<td align="center">smarty/</td>
			<td align="left">
				早期淘汰功能或现已没用的文件
				<div style="color:red;">
					'. ExistFileCN($jud_plugins1) .'smarty/plugins/shared.mb_wordwrap.php<br />
					'. ExistFileCN($jud_sysplugins1) .'smarty/sysplugins/smarty_internal_extension_clear.php<br />
					'. ExistFileCN($jud_sysplugins2) .'smarty/sysplugins/smarty_internal_extension_codeframe.php<br />
					'. ExistFileCN($jud_sysplugins3) .'smarty/sysplugins/smarty_internal_extension_config.php<br />
					'. ExistFileCN($jud_sysplugins4) .'smarty/sysplugins/smarty_internal_extension_defaulttemplatehandler.php<br />
					'. ExistFileCN($jud_sysplugins5) .'smarty/sysplugins/smarty_internal_filter_handler.php<br />
					'. ExistFileCN($jud_sysplugins6) .'smarty/sysplugins/smarty_internal_function_call_handler.php<br />
					'. ExistFileCN($jud_sysplugins7) .'smarty/sysplugins/smarty_internal_get_include_path.php<br />
					'. ExistFileCN($jud_sysplugins8) .'smarty/sysplugins/smarty_internal_utility.php<br />
					'. ExistFileCN($jud_sysplugins9) .'smarty/sysplugins/smarty_internal_write_file.php
				</div>
			</td>
			<td align="center">
				<input type="button" value="删除" style="cursor:pointer;" onclick=\'if(confirm("确定删除？")==true){DataDeal.location.href="sysCheckFile_deal.php?mudi=del&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode('前台没用文件') .'&fileType=smarty"}\' />
			</td>
		</tr>
		');
	}

	$jud_blog_bbs			= file_exists(OT_ROOT .'template/def_blog/bbs.html');
	$jud_blog_sitemap		= file_exists(OT_ROOT .'template/def_blog/sitemap.html');
	$jud_blog_usersCenter	= file_exists(OT_ROOT .'template/def_blog/usersCenter.html');
	$jud_blue_sitemap		= file_exists(OT_ROOT .'template/def_blue/sitemap.html');
	$jud_blue_usersCenter	= file_exists(OT_ROOT .'template/def_blue/usersCenter.html');
	if ($jud_blog_bbs || $jud_blog_sitemap || $jud_blog_usersCenter || $jud_blue_sitemap || $jud_blue_usersCenter){
		echo('
		<tr>
			<td align="center">template/</td>
			<td align="left">
				早期淘汰功能或现已没用的文件
				<div style="color:red;">
					'. ExistFileCN($jud_blog_bbs) .'template/def_blog/bbs.html<br />
					'. ExistFileCN($jud_blog_sitemap) .'template/def_blog/sitemap.html<br />
					'. ExistFileCN($jud_blog_usersCenter) .'template/def_blog/usersCenter.html<br />
					'. ExistFileCN($jud_blue_sitemap) .'template/def_blue/sitemap.html<br />
					'. ExistFileCN($jud_blue_usersCenter) .'template/def_blue/usersCenter.html
				</div>
			</td>
			<td align="center">
				<input type="button" value="删除" style="cursor:pointer;" onclick=\'if(confirm("确定删除？")==true){DataDeal.location.href="sysCheckFile_deal.php?mudi=del&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode('前台没用文件') .'&fileType=template"}\' />
			</td>
		</tr>
		');
	}

	$jud_CuPlayer1			= file_exists(OT_ROOT .'tools/CuPlayer/CuSunV2set.xml');
	$jud_kindeditor1		= file_exists(OT_ROOT .'tools/kindeditor/');
	if ($jud_CuPlayer1 || $jud_kindeditor1){
		echo('
		<tr>
			<td align="center">tools/</td>
			<td align="left">
				早期淘汰功能或现已没用的文件
				<div style="color:red;">
					'. ExistFileCN($jud_CuPlayer1) .'tools/CuPlayer/CuSunV2set.xml<br />
					'. ExistFileCN($jud_kindeditor1) .'tools/kindeditor/
				</div>
			</td>
			<td align="center">
				<input type="button" value="删除" style="cursor:pointer;" onclick=\'if(confirm("确定删除？")==true){DataDeal.location.href="sysCheckFile_deal.php?mudi=del&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode('前台没用文件') .'&fileType=tools"}\' />
			</td>
		</tr>
		');
	}

	$jud_wap_share		= file_exists(OT_ROOT .'wap/css/share.css');
	$jud_wap_url		= file_exists(OT_ROOT .'wap/inc/classWapUrl.php');
	$jud_wap_js1		= file_exists(OT_ROOT .'wap/js/webIndex.js');
	$jud_wap_js2		= file_exists(OT_ROOT .'wap/js/webMessage.js');
	$jud_wap_js3		= file_exists(OT_ROOT .'wap/js/webNewsShow.js');
	$jud_wap_js4		= file_exists(OT_ROOT .'wap/js/webTop.js');
	$jud_wap_js5		= file_exists(OT_ROOT .'wap/js/webUsers.js');
	$jud_wap_js6		= file_exists(OT_ROOT .'wap/js/webUsersCenter.js');
	$jud_wap_form		= file_exists(OT_ROOT .'wap/form_deal.php');
	$jud_wap_usersNews	= file_exists(OT_ROOT .'wap/usersNews.php');
	if ($jud_wap_share || $jud_wap_url || $jud_wap_js1 || $jud_wap_js2 || $jud_wap_js3 || $jud_wap_js4 || $jud_wap_js5 || $jud_wap_js6 || $jud_wap_form || $jud_wap_usersNews){
		echo('
		<tr>
			<td align="center">wap/</td>
			<td align="left">
				早期淘汰功能或现已没用的文件
				<div style="color:red;">
					'. ExistFileCN($jud_wap_share) .'wap/css/share.css<br />
					'. ExistFileCN($jud_wap_url) .'wap/inc/classWapUrl.php<br />
					'. ExistFileCN($jud_wap_js1) .'wap/js/webIndex.js<br />
					'. ExistFileCN($jud_wap_js2) .'wap/js/webMessage.js<br />
					'. ExistFileCN($jud_wap_js3) .'wap/js/webNewsShow.js<br />
					'. ExistFileCN($jud_wap_js4) .'wap/js/webTop.js<br />
					'. ExistFileCN($jud_wap_js5) .'wap/js/webUsers.js<br />
					'. ExistFileCN($jud_wap_js6) .'wap/js/webUsersCenter.js<br />
					'. ExistFileCN($jud_wap_form) .'wap/form_deal.php<br />
					'. ExistFileCN($jud_wap_usersNews) .'wap/usersNews.php
				</div>
			</td>
			<td align="center">
				<input type="button" value="删除" style="cursor:pointer;" onclick=\'if(confirm("确定删除？")==true){DataDeal.location.href="sysCheckFile_deal.php?mudi=del&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode('前台没用文件') .'&fileType=wap"}\' />
			</td>
		</tr>
		');
	}

	echo('
	</tbody>
	</table>
	<div style="padding:6px;color:blue;">提醒：如果出现删除失败或删除出错，可直接手动删除。</div>
	');

}



function ExistFileCN($existJud){
	if ($existJud){ return '<span style="color:blue;">[存在]</span>'; }else{ return '<span style="color:red;">[已删除]</span>'; }
}


function CheckSoftVerList($remReqUrl, $adminDirName, $noReadImg, &$number, &$postDataArr){
	global $sysAdminArr;
//	$softVerFileList = OTauthWeb('sysCheckFile',$remReqUrl, array());
	$softGetUrl = SysDiff::UpdateUrl($sysAdminArr['SA_updateUrlMode']);
	$softVerFileList= ReqUrl::UseAuto($sysAdminArr['SA_getUrlMode'], 'GET', $softGetUrl . $remReqUrl, 'UTF-8', array(), 'note');

	$isData = false;
	if (substr($softVerFileList,0,1) == '1'){
		$isData = true;
		$softVerFileList = str_replace('	admin/', '	'. $adminDirName .'/', $softVerFileList);
		$fileListArr = Str::SplitBr($softVerFileList);
		//if (count($fileListArr) <= 2){ $fileListArr = array('0	'. $softVerFileList .'<input type="button" value="刷新" onclick="document.location.reload();" />		0'); }
	}else{
		$fileListArr = array('0	系统无法访问数据'. $remReqUrl .'<input type="button" value="刷新" onclick="document.location.reload();" />		0');
	}

	foreach ($fileListArr as $fileInfo){
		$fileInfoArr = explode('	', str_replace(array("\r","\n"),'',$fileInfo) .'				');
		if ($noReadImg == 1 && strpos('|.gif|.jpg|.png|.bmp|jpeg|','|'. substr($fileInfoArr[1],-4) .'|') !== false){
		
		}else{
			$number ++;
			if ($number % 2 == 0){ $bgcolor='class="tabColorTr"'; }else{ $bgcolor=''; }
			if ($isData){
				$postDataArr[] = $fileInfoArr[1] .'	'. $fileInfoArr[2] .'	'. $fileInfoArr[3] .'	'. $fileInfoArr[4] .'	'. $fileInfoArr[5];
			}

			echo('
			<input type="hidden" id="state'. $number .'" name="state'. $number .'" value="1" />
			<input type="hidden" id="pathinfo'. $number .'" name="pathinfo'. $number .'" value="'. Str::RegExp($fileInfoArr[1],'html') .'" />
			<input type="hidden" id="sizeinfo'. $number .'" name="sizeinfo'. $number .'" value="'. $fileInfoArr[2] .'" />
			<input type="hidden" id="md5info'. $number .'" name="md5info'. $number .'" value="'. $fileInfoArr[3] .'" />
			<input type="hidden" id="sha1info'. $number .'" name="sha1info'. $number .'" value="'. $fileInfoArr[4] .'" />
			<input type="hidden" id="symd5info'. $number .'" name="symd5info'. $number .'" value="'. $fileInfoArr[5] .'" />
			<input type="hidden" id="errFile'. $number .'" name="errFile'. $number .'" value="0" />
			<tr '. $bgcolor .' id="data'. $number .'">
				<td align="center">'. $number .'</td>
				<td id="filePath'. $number .'" align="left">'. $fileInfoArr[1] .'</td>
				<td align="right">'. File::SizeUnit($fileInfoArr[2]) .'</td>
				<td align="center">'. File::GetRevTime(OT_ROOT . $fileInfoArr[1]) .'</td>
				<td align="center" id="result'. $number .'"><br /></td>
			</tr>
			');
		}
	}
}


function FontItem($type, $name, $desc, $size, $ext){
	$retStr = '
		<td align="center">'. $name .'</td>
		<td align="left">'. $desc .'</td>
		<td align="right">'. $size .'</td>
		<td align="left">
			<div title="upFiles/download/'. $type .'.zip">
				'. $type .'.zip
				&ensp;'. File::IsExists(OT_ROOT .'upFiles/download/'. $type .'.zip','cn') .'
			</div>
			<div class="clr"></div>

			<div style="float:right;">
				<a href="sysCheckFile_deal.php?mudi=optionFile&mode=down&file='. $type .'" class="font3_2">[下载]</a>'.
				'<a href="sysCheckFile_deal.php?mudi=optionFile&mode=jieya&file='. $type .'&ext='. $ext .'" class="font3_2">[解压]</a>'.
				'<a href="sysCheckFile_deal.php?mudi=optionFile&mode=del&file='. $type .'" class="font3_2">[删除]</a>
			</div>
		</td>
		<td align="left">tools/simsun.'. $ext .'&ensp;'. File::IsExists(OT_ROOT .'tools/simsun.'. $ext,'cn') .'</td>
		<td align="center">
			<a href="http://d.otcms.com/phpExt/font_'. $type .'.zip" target="_blank" class="font1_2">下载到本地</a>
		</td>
		';

	return $retStr;
}


function EditorItem($type, $name, $desc, $size){
	$placeList = '';
	if (in_array($type, array('tinymce','tinymce5'))){
		$placeList = '
			<div>admin/tools/'. $type .'/&ensp;'. File::IsExists(OT_adminROOT .'tools/'. $type .'/','cn') .'</div>
			<div>wap/users/tools/'. $type .'/&ensp;'. File::IsExists(OT_ROOT .'wap/users/tools/'. $type .'/','cn') .'</div>
			';
	}else{
		$placeList = '
			<div>tools/'. $type .'/&ensp;'. File::IsExists(OT_ROOT .'tools/'. $type .'/','cn') .'</div>
			<div>admin/tools/'. $type .'/&ensp;'. File::IsExists(OT_adminROOT .'tools/'. $type .'/','cn') .'</div>
			<div>wap/tools/'. $type .'/&ensp;'. File::IsExists(OT_ROOT .'wap/tools/'. $type .'/','cn') .'</div>
			';
		if ($type == 'ueditor'){
			$placeList .= '<div>wap/users/tools/'. $type .'/&ensp;'. File::IsExists(OT_ROOT .'wap/users/tools/'. $type .'/','cn') .'</div>';
		}
	}
	$retStr = '
		<td align="center">'. $name .'</td>
		<td align="left">'. $desc .'</td>
		<td align="right">'. $size .'</td>
		<td align="left">
			<div title="upFiles/download/'. $type .'.zip">
				'. $type .'.zip
				&ensp;'. File::IsExists(OT_ROOT .'upFiles/download/'. $type .'.zip','cn') .'
			</div>
			<div class="clr"></div>
			<div style="float:right;">
				<a href="sysCheckFile_deal.php?mudi=optionFile&mode=down&file='. $type .'" class="font3_2">[下载]</a>'.
				'<a href="sysCheckFile_deal.php?mudi=optionFile&mode=jieya&file='. $type .'" class="font3_2">[解压]</a>'.
				'<a href="sysCheckFile_deal.php?mudi=optionFile&mode=del&file='. $type .'" class="font3_2">[删除]</a>
			</div>
		</td>
		<td align="left">
			'. $placeList .'
		</td>
		<td align="center">
			<a href="http://d.otcms.com/phpExt/editor_'. $type .'.zip" target="_blank" class="font1_2">下载到本地</a>
		</td>
		';

	return $retStr;
}

?>