是一个基于PHP+Mysql架构的开源内容管理系统
源代码在线查看: error.class.php
class error
{
var $db;
var $table_error;
var $pay ;
function error()
{
global $db;
$this->db = $db;
$this->table_error = DB_PRE.'error_report';
}
function get_list( $condition = null, $page = 1, $pagesize )
{
$errors = array();
$arg['where'] = $this->_make_condition($condition);
$page = max(intval($page), 1);
$offset = $pagesize*($page-1);
$errors['num'] = $this->db->get_one("SELECT COUNT(*) AS number FROM `$this->table_error` WHERE 1 {$arg['where']} ");
$errors['pages'] = pages($errors['num']['number'], $page, $pagesize);
$sql = "SELECT * FROM `$this->table_error` WHERE 1 {$arg['where']} ORDER BY `error_id` DESC LIMIT $offset,$pagesize";
$result = $this->db->query($sql);
while($r = $this->db->fetch_array($result))
{
$errors['info'][] = $r;
}
return $errors;
}
function drop( $ids, $where='' )
{
if(!empty($ids))
{
$query_in = $this->db_create_in($ids);
$where = 'where `error_id` '.$query_in;
}
return $this->db->query("DELETE FROM `$this->table_error` $where");
}
function check($ids)
{
global $M, $_userid, $_username;
if($M['ispoint'])
{
$this->pay = load('pay_api.class.php', 'pay', 'api');
$module = 'error_report';
$type = 'point';
$number = $M['ispoint'];
$note = "鎻愪氦閿欒