<?php
/**
 *	Generated by miceCMS
 *	http://www.miceCMS.com/
 */
class database_sqlAction extends security_login {
	function action(){
		ModuleLimit(__CLASS__);
		global $conn;
		$smarty = new Smarty();
		$smarty->load_filter('pre','micePreCompileAdmin');

		if(isset($_POST['sql'])){
			$query_arr = SplitSQL($_POST['sql']);
			if (count($query_arr)) {
				$exeresult='';
				$i=0;
				foreach ($query_arr as $query) {
					$exeresult .= record_html($query, $i++);
				}
			} else {
				$exeresult = '<b>结果为空</b>';
			}
			$smarty->assign('sql',$_POST['sql']);
			$smarty->assign('exeresult',$exeresult);
		}else{
			$smarty->assign('sql','SELECT loginname,lastloginip FROM #__user ;SELECT loginname,email FROM #__user');
			$smarty->assign('exeresult','<b>结果为空</b>');
		}

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