⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 systemlog.php

📁 a short sketch about linux syntex lines.
💻 PHP
字号:
<?php
/*
秀影EasyFramework框架
qq:24498936
msn:jdzcn_net@hotmail.com
website:http://www.vodcms.com
系统日志记录
*/
class systemlog{
	public static $name = VODCMS_SYSTEMLOG;
	public static $error;
	public static $printpage;
	/*
	写入系统日志
	*/
	public static function  set($message, $admin=null, $DB=null){
		if (is_null($DB)){
			$DB = $GLOBALS['DB'];
		}
		$array = array();
		$Response = new Easy_Controller_Request();
		$array['admin'] = $admin ? $admin : $Response->getCookie('admin');
		$array['addtime'] = time();
		$array['userip'] = $_SERVER['REMOTE_ADDR'];
		$array['message'] = $_SERVER['REQUEST_METHOD'].$message;
		$array['uri'] = $_SERVER['REQUEST_URI'];
		return $DB->insert(self::$name, $array);
	}
	public static function getAll(){
		$DB = $GLOBALS['DB'];
		$select = $DB->select();
		$sql = $select->from(self::$name)->order('id DESC')->toString();
		$total = $DB->getCount($sql);
		$page = new Page();
		$page->set($total);
		$result = $DB->FetAll($sql.$page->limit());
		self::$printpage = $page->PrintPage();
		return $result;
	}
	public static function search($where){
		$DB = $GLOBALS['DB'];
		$select = $DB->select();
		$sql = $select->from(self::$name)->where($where)->order('id DESC')->toString();
		$total = $DB->getCount($sql);
		$page = new Page();
		//echo $sql;
		$page->set($total);
		$result = $DB->FetAll($sql.$page->limit());
		self::$printpage = $page->PrintPage();
		return $result;
	}
	public static function delete($id){
		$DB = $GLOBALS['DB'];
		$lifetime = time() - (30 * 86400);
		return $DB->delete(self::$name, 'id='.(int)$id.' AND addtime<='.$lifetime);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -