<?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();


echo('
<script language="javascript" type="text/javascript" src="js/share.js?v='. OT_VERSION .'"></script>
<script language="javascript" type="text/javascript" src="js/autoRunSys.js?v='. OT_VERSION .'"></script>
');


switch($mudi){
	case 'infoSet':
		$MB->IsSecMenuRight('alertBack',274,$dataType);
		InfoSet();
		break;

	default:
		die('err');
}

$skin->WebBottom();

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





// 参数设置
function InfoSet(){
	global $DB,$skin,$mudi,$dataType,$dataTypeCN,$systemArr,$sysAdminArr;

	$infoSysArr = Cache::PhpFile('infoSys');
	$userSysArr = Cache::PhpFile('userSys');

	$revexe = $DB->query('select * from '. OT_dbPref .'autoRunSys');
		if ($row = $revexe->fetch()){
			$ARS_dayDate			= $row['ARS_dayDate'];
			$ARS_runMode			= $row['ARS_runMode'];
			$ARS_runArea			= $row['ARS_runArea'];
			$ARS_isTimeRun			= $row['ARS_isTimeRun'];
			$ARS_timeRunTime		= $row['ARS_timeRunTime'];
			$ARS_timeRunMin			= $row['ARS_timeRunMin'];
			$ARS_timeRunItem		= $row['ARS_timeRunItem'];
			$ARS_isHtmlHome			= $row['ARS_isHtmlHome'];
			$ARS_htmlHomeTime		= $row['ARS_htmlHomeTime'];
			$ARS_htmlHomeWapTime	= $row['ARS_htmlHomeWapTime'];
			$ARS_htmlHomeMin		= $row['ARS_htmlHomeMin'];
			$ARS_isHtmlList			= $row['ARS_isHtmlList'];
			$ARS_htmlListTime		= $row['ARS_htmlListTime'];
			$ARS_htmlListWapTime	= $row['ARS_htmlListWapTime'];
			$ARS_htmlListMin		= $row['ARS_htmlListMin'];
			$ARS_htmlListNum		= $row['ARS_htmlListNum'];
			$ARS_htmlListMaxNum		= $row['ARS_htmlListMaxNum'];
			$ARS_isHtmlShow			= $row['ARS_isHtmlShow'];
			$ARS_htmlShowTime		= $row['ARS_htmlShowTime'];
			$ARS_htmlShowWapTime	= $row['ARS_htmlShowWapTime'];
			$ARS_htmlShowMin		= $row['ARS_htmlShowMin'];
			$ARS_htmlShowNum		= $row['ARS_htmlShowNum'];
			$ARS_htmlShowMaxNum		= $row['ARS_htmlShowMaxNum'];
			$ARS_htmlShowStartTime	= $row['ARS_htmlShowStartTime'];
			$ARS_isColl				= $row['ARS_isColl'];
			$ARS_collTime			= $row['ARS_collTime'];
			$ARS_collMin			= $row['ARS_collMin'];
			$ARS_collNum			= $row['ARS_collNum'];
			$ARS_collFailNum		= $row['ARS_collFailNum'];
			$ARS_isSoftBak			= $row['ARS_isSoftBak'];
			$ARS_softBakTime		= $row['ARS_softBakTime'];
			$ARS_softBakMin			= $row['ARS_softBakMin'];
			$ARS_softBakArea		= $row['ARS_softBakArea'];
			$ARS_isDbBak			= $row['ARS_isDbBak'];
			$ARS_dbBakTime			= $row['ARS_dbBakTime'];
			$ARS_dbBakMin			= $row['ARS_dbBakMin'];
			$ARS_dbBakMode			= $row['ARS_dbBakMode'];
			$ARS_isDayRun			= $row['ARS_isDayRun'];
			$ARS_dayRunTime			= $row['ARS_dayRunTime'];
			$ARS_dayRunItem			= $row['ARS_dayRunItem'];
			$ARS_dayRunList			= $row['ARS_dayRunList'];
			$ARS_isApiItem			= $row['ARS_isApiItem'];
			$ARS_apiItemTime		= $row['ARS_apiItemTime'];
			$ARS_apiItemMin			= $row['ARS_apiItemMin'];
			$ARS_apiItemNum			= $row['ARS_apiItemNum'];
			$ARS_apiItemFailNum		= $row['ARS_apiItemFailNum'];
			$ARS_bigItemDay			= $row['ARS_bigItemDay'];
			$ARS_bigItemTime		= $row['ARS_bigItemTime'];
			$ARS_prevNextDay		= $row['ARS_prevNextDay'];
			$ARS_prevNextTime		= $row['ARS_prevNextTime'];
			$ARS_markNewsDay		= $row['ARS_markNewsDay'];
			$ARS_markNewsTime		= $row['ARS_markNewsTime'];
			$ARS_htmlShowDay		= $row['ARS_htmlShowDay'];
			$ARS_prevNextSize		= $row['ARS_prevNextSize'];
			$ARS_prevNextPage		= $row['ARS_prevNextPage'];
			$ARS_prevNextPageCount	= $row['ARS_prevNextPageCount'];
			$ARS_markNewsSize		= $row['ARS_markNewsSize'];
			$ARS_markNewsPage		= $row['ARS_markNewsPage'];
			$ARS_markNewsPageCount	= $row['ARS_markNewsPageCount'];
		}
	unset($revexe);

	$todayTime = TimeDate::Get();
	$todayDate = TimeDate::Get('date');
	$beforeURL = GetUrl::CurrDir(1);

	if ($systemArr['SYS_isHtmlHome'] != 1){
		$ARS_isHtmlHome = 0;
		$htmlStyle = 'display:none;';
		$alertStyle = 'display:;';
	}else{
		$htmlStyle = 'display:;';
		$alertStyle = 'display:none;';
	}

	$dayRunItemStr = '';
	if ($userSysArr['US_groupExpDay'] == 0){
		$dayRunItemStr .= '<li style="float:left;padding-right:20px;color:#999;" title="会员管理→会员参数设置 - 会员中心 【会员组过期转为默认组】开启"><label><input type="checkbox" disabled="disabled"/>会员组过期转为默认组（未开启）</label></li>';
	}else{
		$dayRunItemStr .= '<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunItem[]" value="|userGroupExp|" '. Is::InstrChecked($ARS_dayRunItem,'|userGroupExp|') .' />会员组过期<span style="color:red;">'. $userSysArr['US_groupExpDay'] .'天</span>转为默认组</label></li>';
	}

	/* 
	if ($infoSysArr['IS_prevNextDay'] == 0){
		$dayRunItemStr .= '<li style="float:left;padding-right:20px;color:#999;" title="文章管理→文章参数设置 - 前台文章内容页设置 【上/下一篇检查间隔】开启"><label><input type="checkbox" disabled="disabled"/>内容页上下篇ID清空（未开启）</label></li>';
	}else{
		$dayRunItemStr .= '<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunItem[]" value="|prevNext|" '. Is::InstrChecked($ARS_dayRunItem,'|prevNext|') .' />内容页上下篇ID清空<span style="color:red;">'. $infoSysArr['IS_prevNextDay'] .'天</span>前</label></li>';
	}

	if ($infoSysArr['IS_markNewsDay'] == 0){
		$dayRunItemStr .= '<li style="float:left;padding-right:20px;color:#999;" title="文章管理→文章参数设置 - 前台文章内容页设置 【相关文章检查间隔】开启"><label><input type="checkbox" disabled="disabled"/>内容页相关文章ID清空（未开启）</label></li>';
	}else{
		$dayRunItemStr .= '<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunItem[]" value="|markNews|" '. Is::InstrChecked($ARS_dayRunItem,'|markNews|') .' />内容页相关文章ID清空<span style="color:red;">'. $infoSysArr['IS_markNewsDay'] .'天</span>前</label></li>';
	}
	*/

	$dayRunList = '';
	if (AppXcx::Jud()){
		$itemList = '';
		$dayRunList .= '
			<li style="float:left;padding-right:20px;">
				小程序基础（
				<label><input type="checkbox" name="dayRunList[]" value="|xcxUsers|" '. Is::InstrChecked($ARS_dayRunList,'|xcxUsers|') .' />会员</label>、
				<label><input type="checkbox" name="dayRunList[]" value="|xcxTixing|" '. Is::InstrChecked($ARS_dayRunList,'|xcxTixing|') .' />页面提醒</label>、
				<label><input type="checkbox" name="dayRunList[]" value="|xcxDingyue|" '. Is::InstrChecked($ARS_dayRunList,'|xcxDingyue|') .' />订阅提醒</label>、
				<label><input type="checkbox" name="dayRunList[]" value="|xcxFamily|" '. Is::InstrChecked($ARS_dayRunList,'|xcxFamily|') .' />家庭</label>、
				<label><input type="checkbox" name="dayRunList[]" value="|xcxYaopin|" '. Is::InstrChecked($ARS_dayRunList,'|xcxYaopin|') .' />药品</label>
				）'. Skin::PluSign('小程序基础包','bottom') .'
			</li>
			';
		if (AppXcxAd::Jud()){
			$dayRunList .= '
				<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|xcxAd|" '. Is::InstrChecked($ARS_dayRunList,'|xcxAd|') .' />'. AreaApp::ItemShow(AppXcxAd::Jud(), '小程序看广告领奖励') . Skin::PluSign('小程序看广告领奖励','bottom') .'</label></li>
				';
		}
		if (AppXcxBaby::Jud()){
			$dayRunList .= '
				<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|xcxBaby|" '. Is::InstrChecked($ARS_dayRunList,'|xcxBaby|') .' />'. AreaApp::ItemShow(AppXcxBaby::Jud(), '小程序宝宝喂养') . Skin::PluSign('小程序宝宝喂养','bottom') .'</label></li>
				';
		}
		if (AppXcxLifeDay::Jud()){
			$dayRunList .= '
				<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|xcxLife|" '. Is::InstrChecked($ARS_dayRunList,'|xcxLife|') .' />'. AreaApp::ItemShow(AppXcxLifeDay::Jud(), '小程序天天测量') . Skin::PluSign('小程序天天测量','bottom') .'</label></li>
				';
		}
	}
	if (OT_SOFTTYPE == 'idccms'){
		$dayRunList .= '
			<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|west|" '. Is::InstrChecked($ARS_dayRunList,'|west|') .' />西部数码余额'. Skin::PluSign('IDC接口_西部数码','bottom') .'</label></li>
			<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|domain|" '. Is::InstrChecked($ARS_dayRunList,'|domain|') .' />注册域名'. Skin::PluSign('IDC域名模块','bottom') .'</label></li>
			<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|host|" '. Is::InstrChecked($ARS_dayRunList,'|host|') .' />虚拟主机'. Skin::PluSign('IDC虚拟主机模块','bottom') .'</label></li>
			<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|vpsApi|" '. Is::InstrChecked($ARS_dayRunList,'|vpsApi|') .' />云服务器</label></li>
			<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|serv|" '. Is::InstrChecked($ARS_dayRunList,'|serv|') .' />服务器租用'. Skin::PluSign('IDC服务器租用模块','bottom') .'</label></li>
			<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|dialing|" '. Is::InstrChecked($ARS_dayRunList,'|dialing|') .' />拨号VPS'. Skin::PluSign('IDC拨号VPS模块','bottom') .'</label></li>
			';
	}

	echo(Adm::StudyShow('autoRunSys','
		<div class="padd5" style="line-height:1.4;">
			'. AreaApp::GetNews('autoNews') .'
		</div>
		<div class="padd8" style="line-height:1.6;">
			<b style="color:red;">关于自动生成静态页和自动采集说明：</b><a href="http://otcms.com/news/8067.html" target="_blank" class="font1_2">http://otcms.com/news/8067.html</a><br />
			<b style="color:red;">挂机宝挂独立页说明：</b><a href="http://otcms.com/news/8325.html" target="_blank" class="font1_2">http://otcms.com/news/8325.html</a>
		</div>
		') .'

	<form id="dealForm" name="dealForm" method="post" action="autoRunSys_deal.php?mudi='. $mudi .'" onsubmit="return CheckForm()">
	<input type="hidden" id="dataType" name="dataType" value="'. $dataType .'" />
	<input type="hidden" id="dataTypeCN" name="dataTypeCN" value="'. $dataTypeCN .'" />
	<script language="javascript" type="text/javascript">document.write(\'<input type="hidden" name="backURL" value="\'+ document.location.href +\'" />\')</script>

	<div class="tabMenu">
	<ul>
		<li rel="tabBase" class="selected">基本设置</li>
		<li rel="tabHome">首页静态页</li>
		<li rel="tabHtml">列表&内容静态页'. Skin::PluSign('自动生成静态页','bottom') .'</li>
		<li rel="tabColl">自动采集'. Skin::PluSign('自动采集','bottom') .'</li>
		<li rel="tabApiItem" style="display:none;">自动数据同步/导入'. Skin::PluSign('自动数据同步','bottom') .'</li>
		<li rel="tabBigItem">大数据量项目设置</li>
	</ul>
	</div>


	<div class="tabMenuArea">
		<table id="tabBase" style="display:;" cellpadding="0" cellspacing="0" summary="" class="padd3">
		<tr><td class="tabLeftWidth"></td><td></td></tr>
		<tr>
			<td align="right">执行模式：</td>
			<td align="left">
				<label><input type="radio" name="runMode" value="1" '. Is::Checked($ARS_runMode,1) .' />AJAX-全项目（默认）</label>&ensp;&ensp;
				<label><input type="radio" name="runMode" value="0" '. Is::Checked($ARS_runMode,0) .' />框架-全项目</label>&ensp;&ensp;
				<label><input type="radio" name="runMode" value="11" '. Is::Checked($ARS_runMode,11) .' />AJAX-单项目</label>&ensp;&ensp;
				<label><input type="radio" name="runMode" value="10" '. Is::Checked($ARS_runMode,10) .' />框架-单项目</label>&ensp;&ensp;
				&ensp;'. $skin->TishiBox('顺序：定时检查 &gt; 首页静态 &gt; 列表内容静态 &gt; 自动采集，单项目是指按顺序运行一个项目后停止，全项目是指按顺序所有项目检查运行过去') .'
			</td>
		</tr>
		<tr>
			<td align="right">执行范围：</td>
			<td align="left">
				<ul>
					<li style="float:left;padding-right:20px;">
						<label><input type="checkbox" name="runArea[]" value="|qiantai|" '. Is::InstrChecked($ARS_runArea,'|qiantai|') .' />前台触发</label>
						（
						<label><input type="checkbox" name="runArea[]" value="|qiantaiTime|" '. Is::InstrChecked($ARS_runArea,'|qiantaiTime|') .' />定时检查</label>
						&ensp;
						<label><input type="checkbox" name="runArea[]" value="|qiantaiDay|" '. Is::InstrChecked($ARS_runArea,'|qiantaiDay|') .' />每日检查</label>
						&ensp;
						<label><input type="checkbox" name="runArea[]" value="|qiantaiColl|" '. Is::InstrChecked($ARS_runArea,'|qiantaiColl|') .' />自动采集</label>
						）
						&ensp;'. $skin->TishiBox('如有生成静态页和采集不建议开启该项，会影响前台访问速度') .'
					</li>
					<li style="float:left;padding-right:20px;">
						<label><input type="checkbox" name="runArea[]" value="|duli|" '. Is::InstrChecked($ARS_runArea,'|duli|') .' />独立页触发<span style="color:red;">（推荐）</span></label>
					</li>
				</ul>
			</td>
		</tr>
		<tr>
			<td align="right" valign="top">独立页网址：</td>
			<td align="left" style="line-height:1.6;">
				<div style="color:blue;">【挂 <b>Win服务器</b> 或 <a href="http://otcms.net/" target="_blank" style="color:red;"><b>挂机宝</b></a> 的浏览器上】（推荐）</div>
				<div>'. AppWap::Show('电脑版：') .'<a href="'. $beforeURL .'apiRun.php?mudi=autoRun&sec=300" target="_blank" style="color:red;">'. $beforeURL .'apiRun.php?mudi=autoRun&sec=300</a>&ensp;（300为定时刷新秒数，可自行设置，不低于60）</div>
				'. AppWap::Show('<div>手机版：<a href="'. $beforeURL .'apiRun.php?mudi=autoRun&mode=wap&sec=300" target="_blank" style="color:red;">'. $beforeURL .'apiRun.php?mudi=autoRun&mode=wap&sec=300</a></div>') .'

				<div style="color:blue;">【宝塔 - 计划任务 - 任务类型：访问URL；执行周期：N分钟，5~30分钟看自己】（该模式静态页生成慢，不支持自动采集）</div>
				<div>'. AppWap::Show('电脑版：') .'<a href="'. $beforeURL .'p.php?m=autoRun&type=duli&isAjaxRun=0" target="_blank" style="color:red;">'. $beforeURL .'p.php?m=autoRun&type=duli&isAjaxRun=0</a></div>
				'. AppWap::Show('<div>手机版：<a href="'. $beforeURL .'wap/p.php?m=autoRun&type=duli&isAjaxRun=0" target="_blank" style="color:red;">'. $beforeURL .'wap/p.php?m=autoRun&type=duli&isAjaxRun=0</a></div>') .'
			</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">每日最后检查日期：</td>
			<td align="left">'. AdmArea::DateRevBox('dayDate', $ARS_dayDate) . CalcDayDiff($ARS_dayDate,$todayDate) .'</td>
		</tr>

		'. Skin::ItemTrTop('定时','检查项目') .'
		<tr>
			<td align="right">定时检查项目：</td>
			<td align="left">
				<label><input type="radio" id="isTimeRun1" name="isTimeRun" value="1" onclick="CheckTimeRunBox()" '. Is::Checked($ARS_isTimeRun,1) .' />开启</label>&ensp;&ensp;
				<label><input type="radio" id="isTimeRun0" name="isTimeRun" value="0" onclick="CheckTimeRunBox()" '. Is::Checked($ARS_isTimeRun,0) .' />关闭</label>&ensp;&ensp;
			</td>
		</tr>
		<tbody id="timeRunBox" style="display:none;">
		<tr>
			<td align="right" class="font1_2d">最后检查时间：</td>
			<td align="left">'. AdmArea::TimeRevBox('timeRunTime', $ARS_timeRunTime) . CalcDiff($ARS_timeRunTime,$todayTime) .'</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">每次检查间隔：</td>
			<td align="left"><input type="text" id="timeRunMin" name="timeRunMin" size="50" style="width:50px;" value="'. $ARS_timeRunMin .'" />分钟</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">检查项目：</td>
			<td align="left">
				<ul>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="timeRunItem[]" value="|infoContent|" '. Is::InstrChecked($ARS_timeRunItem,'|infoContent|') .' />文章内容库分表（超<span style="color:red;">'. $infoSysArr['IS_tabMaxNum'] .'</span>篇分表）</label></li>
					'. AppTaobaoke::AutoRunSysItem($ARS_timeRunItem) .'
					'. AppTaokeOrder::AutoRunSysItem($ARS_timeRunItem) .'
					'. AppGain::AutoRunSysItem($ARS_timeRunItem) .'
				</ul>
			</td>
		</tr>
		</tbody>
		'. Skin::ItemTrBottom() .'

		'. Skin::ItemTrTop('每日0点','检查项目') .'
		<tr>
			<td align="right">每日0点检查项目：</td>
			<td align="left">
				<label><input type="radio" id="isDayRun1" name="isDayRun" value="1" onclick="CheckDayRunBox()" '. Is::Checked($ARS_isDayRun,1) .' />开启</label>&ensp;&ensp;
				<label><input type="radio" id="isDayRun0" name="isDayRun" value="0" onclick="CheckDayRunBox()" '. Is::Checked($ARS_isDayRun,0) .' />关闭</label>&ensp;&ensp;
			</td>
		</tr>
		<tbody id="dayRunBox" style="display:none;">
		<tr>
			<td align="right" class="font1_2d">最后检查时间：</td>
			<td align="left">'. AdmArea::TimeRevBox('dayRunTime', $ARS_dayRunTime) . CalcDiff($ARS_dayRunTime,$todayTime) .'</td>
		</tr>
		<tr>
			<td align="right" valign="top" class="font1_2d" style="padding-top:6px;">检查项目：</td>
			<td align="left">
				<ul>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunItem[]" value="|infoContent|" '. Is::InstrChecked($ARS_dayRunItem,'|infoContent|') .' />文章内容库分表（超<span style="color:red;">'. $infoSysArr['IS_tabMaxNum'] .'</span>篇分表）</label></li>
					'. $dayRunItemStr .'
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunItem[]" value="|ca|" '. Is::InstrChecked($ARS_dayRunItem,'|ca|') .' />'. AreaApp::ItemShow(AppCa::Jud(), '广告数据') . Skin::PluSign('新广告管理','bottom') .'</label></li>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunItem[]" value="|dingding|" '. Is::InstrChecked($ARS_dayRunItem,'|dingding|') .' />'. AreaApp::ItemShow(AppDingding::Jud(), '每日网站汇总-钉钉群') . Skin::PluSign('钉钉群机器人','bottom') .'</label></li>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunItem[]" value="|weixinWork|" '. Is::InstrChecked($ARS_dayRunItem,'|weixinWork|') .' />'. AreaApp::ItemShow(AppWeixinWork::Jud(), '每日网站汇总-企业微信群') . Skin::PluSign('企业微信群机器人','bottom') .'</label></li>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunItem[]" value="|robot|" '. Is::InstrChecked($ARS_dayRunItem,'|robot|') .' />'. AreaApp::ItemShow(AppRobot::Jud(), '访客雷达-记录每日统计') . Skin::PluSign('访客雷达/蜘蛛爬行','bottom') .'</label></li>
				</ul>
			</td>
		</tr>
		<tr>
			<td align="right" valign="top" class="font1_2d" style="padding-top:6px;">每日网站汇总：</td>
			<td align="left">
				<ul>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|noSkip|" '. Is::InstrChecked($ARS_dayRunList,'|noSkip|') .' />【无数量也显示】</label></li>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|info|" '. Is::InstrChecked($ARS_dayRunList,'|info|') .' />新增文章</label></li>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|users|" '. Is::InstrChecked($ARS_dayRunList,'|users|') .' />新增会员</label></li>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|infoMessage|" '. Is::InstrChecked($ARS_dayRunList,'|infoMessage|') .' />新增评论</label></li>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|message|" '. Is::InstrChecked($ARS_dayRunList,'|message|') .' />新增留言</label></li>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|moneyBase|" '. Is::InstrChecked($ARS_dayRunList,'|moneyBase|') .' />'. AreaApp::ItemShow(AppMoneyRecord::Jud(), '财务信息') . Skin::PluSign('财务基础包','bottom') .'</label></li>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|moneyPay|" '. Is::InstrChecked($ARS_dayRunList,'|moneyPay|') .' />在线充值'. Skin::PluSign('充值支付_XXX','bottom') .'</label></li>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|phone|" '. Is::InstrChecked($ARS_dayRunList,'|phone|') .' />'. AreaApp::ItemShow(AppPhone::Jud(), '短信发送量') . Skin::PluSign('短信验证通知','bottom') .'</label></li>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|mail|" '. Is::InstrChecked($ARS_dayRunList,'|mail|') .' />'. AreaApp::ItemShow(AppMail::Jud(), '邮件发送量') . Skin::PluSign('邮件验证通知','bottom') .'</label></li>
					<li style="float:left;padding-right:20px;"><label><input type="checkbox" name="dayRunList[]" value="|robot|" '. Is::InstrChecked($ARS_dayRunList,'|robot|') .' />'. AreaApp::ItemShow(AppRobot::Jud(), '访客每日统计') . Skin::PluSign('访客雷达/蜘蛛爬行','bottom') .'</label></li>
					'. $dayRunList .'
				</ul>
			</td>
		</tr>
		</tbody>
		'. Skin::ItemTrBottom() .'
		</table>

		<table id="tabBigItem" style="display:none;" cellpadding="0" cellspacing="0" summary="" class="padd3">
		<tr><td class="tabLeftWidth"></td><td></td></tr>
		<tr>
			<td align="right" class="font1_2d">项目最后检查时间：</td>
			<td align="left">'. AdmArea::TimeRevBox('bigItemTime', $ARS_bigItemTime) . CalcDiff($ARS_bigItemTime,$todayTime) .'</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">项目检查间隔：</td>
			<td align="left">'. AdmArea::InputDayBox('bigItemDay', $ARS_bigItemDay) .'</td>
		</tr>
		<!-- <tr>
			<td align="right">执行范围：</td>
			<td align="left">
				<label><input type="checkbox" name="runArea[]" value="[prevNext]" '. Is::InstrChecked($ARS_runArea,'[prevNext]') .' />全站上下篇文章ID更新</label>
				&ensp;&ensp;
				<label><input type="checkbox" name="runArea[]" value="[markNews]" '. Is::InstrChecked($ARS_runArea,'[markNews]') .' />全站相关文章ID更新</label>
				&ensp;&ensp;
				<label><input type="checkbox" name="runArea[]" value="[host]" '. Is::InstrChecked($ARS_runArea,'[host]') .' />虚拟主机API更新</label>
				&ensp;&ensp;
				<label><input type="checkbox" name="runArea[]" value="[vpsApi]" '. Is::InstrChecked($ARS_runArea,'[vpsApi]') .' />云服务器API更新</label>
				&ensp;&ensp;
				<label><input type="checkbox" name="runArea[]" value="[idcServVpsClose]" '. Is::InstrChecked($ARS_runArea,'[idcServVpsClose]') .' />主控机器到期关机检测</label>
				&ensp;&ensp;
				<label><input type="checkbox" name="runArea[]" value="[idcServVpsStatus]" '. Is::InstrChecked($ARS_runArea,'[idcServVpsStatus]') .' />主控机器状态更新</label>
			</td>
		</tr> -->
		<tr>
			<td align="right">运行网址：</td>
			<td align="left">
				<a href="'. $beforeURL .'apiRun.php?mudi=autoRunBig&sec=3600" target="_blank" style="color:red;">'. $beforeURL .'apiRun.php?mudi=autoRunBig&sec=3600</a>&ensp;（3600为定时刷新秒数，可自行设置，不低于600）
			</td>
		</tr>

		'. Skin::ItemTrTop('文章上/下','一篇ID更新') .'
		<tr>
			<td align="right" class="font1_2">最后检查时间：</td>
			<td align="left">'. AdmArea::TimeRevBox('prevNextTime', $ARS_prevNextTime) . CalcDiff($ARS_prevNextTime,$todayTime) .'</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">检查间隔：</td>
			<td align="left">'. AdmArea::InputDayBox('prevNextDay', $ARS_prevNextDay) .'</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">每次生成：</td>
			<td align="left">
				<input type="text" id="prevNextSize" name="prevNextSize" size="50" style="width:50px;" value="'. $ARS_prevNextSize .'" />篇
				<span class="font3_2">（建议值30~1000）</span>
				&ensp;&ensp;已运行：'. AdmArea::NumRevBox('prevNextPage', $ARS_prevNextPage, '', '/'. $ARS_prevNextPageCount) .'
			</td>
		</tr>
		'. Skin::ItemTrBottom() .'

		'. Skin::ItemTrTop('相关文章','ID更新') .'
		<tr>
			<td align="right" class="font1_2">最后检查时间：</td>
			<td align="left">'. AdmArea::TimeRevBox('markNewsTime', $ARS_markNewsTime) . CalcDiff($ARS_markNewsTime,$todayTime) .'</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">检查间隔：</td>
			<td align="left">'. AdmArea::InputDayBox('markNewsDay', $ARS_markNewsDay) .'</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">每次生成：</td>
			<td align="left">
				<input type="text" id="markNewsSize" name="markNewsSize" size="50" style="width:50px;" value="'. $ARS_markNewsSize .'" />篇
				<span class="font3_2">（建议值30~1000）</span>
				&ensp;&ensp;已运行：'. AdmArea::NumRevBox('markNewsPage', $ARS_markNewsPage, '', '/'. $ARS_markNewsPageCount) .'
			</td>
		</tr>
		'. Skin::ItemTrBottom() .'

		<tbody style="display:none;">
		'. Skin::ItemTrTop('备份网','站文件') .'
		<tr>
			<td align="right">定时备份网站文件：</td>
			<td align="left">
				<label><input type="radio" id="isSoftBak1" name="isSoftBak" value="1" onclick="CheckSoftBakBox()" '. Is::Checked($ARS_isSoftBak,1) .' />开启</label>&ensp;&ensp;
				<label><input type="radio" id="isSoftBak0" name="isSoftBak" value="0" onclick="CheckSoftBakBox()" '. Is::Checked($ARS_isSoftBak,0) .' />关闭</label>&ensp;&ensp;
			</td>
		</tr>
		<!-- <tbody id="softBakBox" style="display:none;"> -->
		<tr>
			<td align="right" class="font1_2d">备份类型：</td>
			<td align="left">
				<label><input type="radio" name="softBakArea" value="all" '. Is::Checked($ARS_softBakArea,'all') .' />全部备份</label>&ensp;&ensp;
				<label><input type="radio" name="softBakArea" value="soft" '. Is::Checked($ARS_softBakArea,'soft') .' />程序文件备份</label>&ensp;&ensp;
				<label><input type="radio" name="softBakArea" value="upfiles" '. Is::Checked($ARS_softBakArea,'upfiles') .' />只要upFiles目录</label>&ensp;&ensp;
			</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">最后备份时间：</td>
			<td align="left">'. AdmArea::TimeRevBox('softBakTime', $ARS_softBakTime) . CalcDiff($ARS_softBakTime,$todayTime) .'</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">每次备份间隔：</td>
			<td align="left"><input type="text" id="softBakMin" name="softBakMin" size="50" style="width:50px;" value="'. $ARS_softBakMin .'" />分钟</td>
		</tr>
		<!-- </tbody> -->
		'. Skin::ItemTrBottom() .'

		'. Skin::ItemTrTop('备份数','据库') .'
		<tr>
			<td align="right">定时备份数据库：</td>
			<td align="left">
				<label><input type="radio" id="isDbBak1" name="isDbBak" value="1" onclick="CheckDbBakBox()" '. Is::Checked($ARS_isDbBak,1) .' />开启</label>&ensp;&ensp;
				<label><input type="radio" id="isDbBak0" name="isDbBak" value="0" onclick="CheckDbBakBox()" '. Is::Checked($ARS_isDbBak,0) .' />关闭</label>&ensp;&ensp;
			</td>
		</tr>
		<!-- <tbody id="dbBakBox" style="display:none;"> -->
		<tr>
			<td align="right" class="font1_2d">备份类型：</td>
			<td align="left">
				<label><input type="radio" name="dbBakMode" value="all" '. Is::Checked($ARS_dbBakMode,'all') .' />全部备份</label>&ensp;&ensp;
				<label><input type="radio" name="dbBakMode" value="ot" '. Is::Checked($ARS_dbBakMode,'ot') .' />网钛表备份</label>&ensp;&ensp;
			</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">最后备份时间：</td>
			<td align="left">'. AdmArea::TimeRevBox('dbBakTime', $ARS_dbBakTime) . CalcDiff($ARS_dbBakTime,$todayTime) .'</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">每次备份间隔：</td>
			<td align="left"><input type="text" id="dbBakMin" name="dbBakMin" size="50" style="width:50px;" value="'. $ARS_dbBakMin .'" />分钟</td>
		</tr>
		<!-- </tbody> -->
		'. Skin::ItemTrBottom() .'
		</tbody>
		</table>

		<table id="tabHome" style="display:none;" cellpadding="0" cellspacing="0" summary="" class="padd3">
		<tr><td class="tabLeftWidth"></td><td></td></tr>
		<tr>
			<td align="right">自动生成首页静态页：</td>
			<td align="left">
				<span style="color:red;'. $alertStyle .'">首页静态页尚未开启，不能使用该功能</span>
				<span style="'. $htmlStyle .'">
					<label><input type="radio" id="isHtmlHome1" name="isHtmlHome" value="1" onclick="CheckHtmlHomeBox()" '. Is::Checked($ARS_isHtmlHome,1) .' />开启</label>&ensp;&ensp;
					<label><input type="radio" id="isHtmlHome0" name="isHtmlHome" value="0" onclick="CheckHtmlHomeBox()" '. Is::Checked($ARS_isHtmlHome,0) .' />关闭</label>&ensp;&ensp;
				</span>
			</td>
		</tr>
		<tbody id="htmlHomeBox" style="display:none;">
		<tr>
			<td align="right" class="font1_2d">PC最后生成时间：</td>
			<td align="left">'. AdmArea::TimeRevBox('htmlHomeTime', $ARS_htmlHomeTime) . CalcDiff($ARS_htmlHomeTime,$todayTime) .'</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">WAP最后生成时间：</td>
			<td align="left">'. AdmArea::TimeRevBox('htmlHomeWapTime', $ARS_htmlHomeWapTime) . CalcDiff($ARS_htmlHomeWapTime,$todayTime) .'</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">每次生成间隔：</td>
			<td align="left"><input type="text" id="htmlHomeMin" name="htmlHomeMin" size="50" style="width:50px;" value="'. $ARS_htmlHomeMin .'" />分钟</td>
		</tr>
		</tbody>
		</table>
		');

		if ($sysAdminArr['SA_isLan'] == 1 && $sysAdminArr['SA_sendUrlMode'] == 0){
			$skin->PaySoftBox('tabHtml', $skin->TixingLan());
			$skin->PaySoftBox('tabColl', $skin->TixingLan());
			$skin->PaySoftBox('tabApiItem', $skin->TixingLan());
			echo('<input type="hidden" id="authState" name="authState" value="false" />');
		}else{
			$collItemCount = $apiItemItemCount = -1;
			if (OT_Database == 'mysql' && AreaApp::Jud(5)){
				$collItemCount = $DB->GetOne('select count(CI_ID) from '. OT_dbPref .'collItem where CI_isAutoColl=1');
			}
			if (AppApiItem::Jud()){
				$apiItemItemCount = $DB->GetOne('select count(AI_ID) from '. OT_dbPref .'apiItem where AI_isAuto=1');
			}
			$paraArr = array(
				'ARS_isHtmlList'		=> $ARS_isHtmlList ,
				'ARS_htmlListTime'		=> $ARS_htmlListTime . CalcDiff($ARS_htmlListTime,$todayTime) ,
				'ARS_htmlListWapTime'	=> $ARS_htmlListWapTime . CalcDiff($ARS_htmlListWapTime,$todayTime) ,
				'ARS_htmlListMin'		=> $ARS_htmlListMin ,
				'ARS_htmlListNum'		=> $ARS_htmlListNum ,
				'ARS_htmlListMaxNum'	=> $ARS_htmlListMaxNum ,
				'ARS_isHtmlShow'		=> $ARS_isHtmlShow ,
				'ARS_htmlShowTime'		=> $ARS_htmlShowTime . CalcDiff($ARS_htmlShowTime,$todayTime) ,
				'ARS_htmlShowWapTime'	=> $ARS_htmlShowWapTime . CalcDiff($ARS_htmlShowWapTime,$todayTime) ,
				'ARS_htmlShowMin'		=> $ARS_htmlShowMin ,
				'ARS_htmlShowNum'		=> $ARS_htmlShowNum ,
				'ARS_htmlShowMaxNum'	=> $ARS_htmlShowMaxNum ,
				'ARS_htmlShowStartTime'	=> $ARS_htmlShowStartTime ,
				'ARS_isColl'			=> $ARS_isColl ,
				'ARS_collTime'			=> $ARS_collTime . CalcDiff($ARS_collTime,$todayTime) ,
				'ARS_collMin'			=> $ARS_collMin ,
				'ARS_collNum'			=> $ARS_collNum ,
				'ARS_collFailNum'		=> $ARS_collFailNum ,
				'collItemCount'			=> $collItemCount ,
				'ARS_isApiItem'			=> $ARS_isApiItem ,
				'ARS_apiItemTime'		=> $ARS_apiItemTime . CalcDiff($ARS_apiItemTime,$todayTime) ,
				'ARS_apiItemMin'		=> $ARS_apiItemMin ,
				'ARS_apiItemNum'		=> $ARS_apiItemNum ,
				'ARS_apiItemFailNum'	=> $ARS_apiItemFailNum ,
				'ARS_htmlShowDay'		=> $ARS_htmlShowDay ,
				'apiItemItemCount'		=> $apiItemItemCount ,
				'judAppAutoHtml'		=> AppAutoHtml::Jud() ? 1 : 0 ,
				'judAppAutoColl'		=> AppAutoColl::Jud() ? 1 : 0 ,
				'judAppAutoApiItem'		=> AppAutoApiItem::Jud() ? 1 : 0 ,
				);

			$getWebHtml = OTauthWeb('autoRunSys', 'autoRunSys_V6.80.php', $paraArr);
			if (strpos($getWebHtml,'(OTCMS)') === false){
				$authAlertStr = $skin->TixingNoGet($getWebHtml);
				$getWebHtml = ''.
					$skin->PaySoftBox('tabHtml', $authAlertStr, true, true) .
					$skin->PaySoftBox('tabColl', $authAlertStr, true, true) .
					$skin->PaySoftBox('tabApiItem', $authAlertStr, true, true) .
					'<input type="hidden" id="authState" name="authState" value="false" />';
			}
			echo($getWebHtml);
		}

		echo('
		<div class="tabMenuSubmit"><input type="image" src="'. AdmTpl::ImgSrc('button_save') .'" /></div>
	</div>

	</form>

	<div class="font2_1" style="padding:20px;line-height:1.4;color:red;">
		提醒：该功能是页面触发型，分为 前台触发 和 独立页触发，前台触发是前台有人访问时，页面隐藏式运行；独立页触发就是专门一个网址定时刷新运行。<br />
		　　　前台触发慎打钩[定时检查][自动采集]，因为这2项比较耗时容易造成访问卡顿，影响前台用户体验，触发过程中页面会呈现加载运行状态。<br />
		　　　如果用Window服务器可以用服务器浏览器挂着独立页网址运行，或者租台<a href="http://otcms.net/" target="_blank" style="color:blue;"><b>挂机宝</b></a>来挂独立页网址。
	</div>
	');
}

function CalcDiff($time1, $currTime){
	$diffMin = TimeDate::Diff('min',$time1,$currTime);
	if ($diffMin < 4320){
		return '<span style="color:red;">（'. $diffMin .'分钟前）</span>';
	}else{
		return '';
	}
}

function CalcDayDiff($time1, $currTime){
	$diffDay = TimeDate::Diff('d',$time1,$currTime);
	if ($diffDay < 99){
		return '<span style="color:red;">（'. $diffDay .'天前）</span>';
	}else{
		return '';
	}
}

?>