<?php
/**
 *	Generated by miceCMS
 *	http://www.miceCMS.com/
 */
class database_restoresAction extends security_login {
	function action(){
		ModuleLimit(__CLASS__);

		set_time_limit(0);
		include_once MICE_DIR.'/includes/restore.php';

		if(isset($_POST['Files'])){

			$num1=strrpos($_POST['Files'],'_-');
			$num2=strrpos($_POST['Files'],'-_');
			$num2=$num2-$num1-2;
			$filenum= substr($_POST['Files'],$num1+2,$num2);

			$files='';
			for($i=0;$i<=$filenum;$i++){
				$filename=str_replace('_-'.$filenum,'_-'.$i,$_POST['Files']);
				$filename=MICE_DIR.MICE_PRIVATE.'backup/'.$filename;
				if (is_file($filename)){
					$restoreDB = new restoreDB($filename);
					$files.=$filename.'<BR>';
				}
			}

			$jsstring='Dialog.alert("还原成功的文件有:<br>'.$files.'",function(){history.back(-1);});';
			MessageBox($jsstring);
		}

		$smarty = new Smarty();
		$smarty->load_filter('pre','micePreCompileAdmin');		
		$smarty->assign('table_data',$table_data);
		$smarty->assign('url',MICE_URL.'admin.php/database/index');
		$smarty->assign("results",$restoreDB->results);
		$smarty->assign("ExeResults",$restoreDB->ExeResults);

		$filename = new getTPLFileName(__CLASS__);
		$smarty->display($filename->TPLFileName);
	}
}
?>