Location: PHPKode > projects > CMSmelborp > CMSmelborp/admin/includes/log.php
<?php
/*******************************************************************************
License:
	Copyright 2005 Ryan Morehart
	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at
	
	http://www.apache.org/licenses/LICENSE-2.0
	
	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
	
Filename: /admin/includes/log.php

Purpose: Logging functions for administrator actions.

Processed parameters: (TYPE - NAME - DESCRIPTION - DEFAULT)
	None
*******************************************************************************/

function addLogEntry(&$connection, $date, $actionCat, $actionType, $user)
{
	// Add to database
	if(mysql_query("INSERT INTO log VALUES(NULL, " . addslashes($date) . ",  '"
		. addslashes($actionCat) . "', '" . addslashes($actionType) . "', '"
		. addslashes($user) . "', '');", $connection) !== false)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function getLog(&$connection)
{
	// Get everything from table
	$log = mysql_query('SELECT * FROM log ORDER BY entry_date, entry_id;', $connection);
	if($log !== false)
	{
		$temp = fetchResults($log);
	}
	else
	{
		return false;
	}
	
	return $temp;
}

function getUserLog(&$connection, $user)
{
	// Get everything from table
	$log = mysql_query("SELECT * FROM log WHERE user_name='"
		. addslashes($user) . "' ORDER BY entry_date, entry_id;", $connection);
	if($log !== false)
	{
		$temp = fetchResults($log);
	}
	else
	{
		return false;
	}
	
	return $temp;
}

function deleteLog(&$connection)
{
	// Erase entire table
	if(mysql_query("DELETE FROM log;", $connection) !== false)
	{
		return true;
	}
	else
	{
		return false;
	}
}
?>
Return current item: CMSmelborp