<?PHP
(!defined('IN_PowerBB')) ? die() : '';

define('IN_ADMIN',true);

$CALL_SYSTEM				=	array();
$CALL_SYSTEM['WARNLOG'] 		= 	true;
$CALL_SYSTEM['STYLE'] 		= 	true;

include('common.php');
define('CLASS_NAME','PowerBBWarnLogMOD');

class PowerBBWarnLogMOD
{
	function run()
	{
		global $PowerBB;

		if ($PowerBB->_CONF['member_permission'])
			{
			$PowerBB->template->display('header');

			if ($PowerBB->_CONF['rows']['group_info']['admincp_warn'] == '0')
			{
			  $PowerBB->functions->error($PowerBB->_CONF['template']['lang']['error_permission']);
			}

				if ($PowerBB->_GET['main'])
				{
					$this->_ShowLog();
				}
				elseif($PowerBB->_GET['del'])
				{
					$this->_Del();
				}
			}

	}
		function _ShowLog()
		{
		global $PowerBB;
		$LogArr 				= 	array();
		$LogArr['proc'] 			= 	array();
		$LogArr['proc']['*'] 		= 	array('method'=>'clean','param'=>'html');
		$LogArr['order']			=	array();
		$LogArr['order']['field']	=	'id';
		$LogArr['order']['type']	=	'DESC';
		$PowerBB->_CONF['template']['while']['WarningLog'] = $PowerBB->warnlog->Show($LogArr);
		$PowerBB->template->display('warnlog');

		}
		function _Del()
		{
			global $PowerBB;
			$DelArr = array();
			$del = $PowerBB->warnlog->DeleteLog($DelArr);
			if ($del)
				{
				$PowerBB->functions->msg($PowerBB->_CONF['template']['lang']['Been_emptied_record_successfully']);
				$PowerBB->functions->redirect('admin.php?page=warn&amp;main=1');
				}

		}

}
?>
