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


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

 网钛CMS(OTCMS)
 程序开发：网钛科技
 官方网站：http://otcms.com
 联系ＱＱ：877873666
 联系邮箱：877873666@qq.com

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


//用户检测
$MB->Open('','login');

$MB->IsAdminRight('alertBack');

switch($mudi){
	case 'deal':
		Deal();
		break;

	default:
		die('err');
}

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





// 处理数据
function Deal(){
	global $DB,$mudi,$menuFileID,$menuTreeID;

	$refInfoType	= OT::GetStr("refInfoType");
	$refInfoStartID	= OT::GetInt("refInfoStartID");
	$refInfoEndID	= OT::GetInt("refInfoEndID");
	$refInfoRunNum	= OT::GetInt("refInfoRunNum");
		if ($refInfoRunNum == 0){ $refInfoRunNum = 10; }
	$refInfoPage	= OT::GetInt("refInfoPage");
	$refInfoCalcNum	= OT::GetInt("refInfoCalcNum");

	$whereStr = "";
	if ($refInfoStartID > 0){ $whereStr .= " and IF_ID>=". $refInfoStartID; }
	if ($refInfoEndID > 0){ $whereStr .= " and IF_ID<=". $refInfoEndID; }

	$infoCount = $DB->GetOne('select count(IF_ID) from '. OT_dbPref .'info where 1=1'. $whereStr);

	if ($refInfoRunNum > 500){
		JS::AlertEnd("一次处理数量最大值500");
	}
	$recordPage = intval($infoCount/$refInfoRunNum*(-1))*(-1);
	$recordLastID = 0;


	$pageRale = ToFloat($refInfoCalcNum/$showCount,2);
	echo('
	<style>body{ text-align:left; margin:0 auto; font-size:12px; color:#000000; line-height:1.2; font-family:宋体; }</style>
	<div style="border:#15a4d0 1px solid; padding:0px; width:700px; height:30px; position:relative;">
		<div style="z-index:8; width:'. ($pageRale*698) .'px; position:absolute; height:28px; background:url(images/lineBg.jpg); font-size:1px;">&nbsp;</div>
		<div style="z-index:88; position:absolute; color:#000000; line-height:30px; text-align:left; font-size:14px; padding-left:400px;">'. $refInfoCalcNum .'/'. $showCount .'('. ($pageRale*100) .'%)</div>
		<div style="z-index:88; position:absolute; padding-left:8px; color:#000000; line-height:30px; text-align:left; font-size:12px;">最后ID：'. $recordLastID .'，成功：'. $apprWordSuccNum .'，失败：'. $apprWordFailNum .'，近似词库'. $apprWordTotal .'个</div>
	</div>
	');
	if ($refInfoCalcNum < $showCount){
		JS::HrefEnd('dataDeal_deal.php?mudi='. $mudi .'&refInfoType='. $refInfoType .'&refInfoStartID='. $refInfoStartID .'&refInfoEndID='. $refInfoEndID .'&refInfoRunNum='. $refInfoRunNum .'&refInfoPage='. ($page+1) .'&refInfoCalcNum='. $refInfoCalcNum .'');
	}

}

?>