Location: PHPKode > projects > PBBoard > PBBoard_v2.1.4/Upload/engine/systems/userrating.class.php
<?php

/**
 * PowerBB Engine - The Engine Helps You To Create Bulletin Board System.
 */

/**
 * @package 	: 	PowerBBUserRating (UserRating)
 * @author 		: 	MSHRAQ abu-rakan (hide@address.com)
 * @start 		: 	7/2/2010 , 03:25 AM
 */
class PowerBBUserRating
{
	var $id;
	var $Engine;

	function PowerBBUserRating($Engine)
	{
		$this->Engine = $Engine;
	}

	function InsertUserRating($param)
	{
 		if (!isset($param)
 			or !is_array($param))
 		{
 			$param = array();
 		}

		$query = $this->Engine->records->Insert($this->Engine->table['userrating'],$param['field']);

		if ($param['get_id'])
		{
			$this->id = $this->Engine->DB->sql_insert_id();
		}

		return ($query) ? true : false;
	}

	function GetUserRatingList($param)
	{
 		if (!isset($param)
 			or !is_array($param))
 		{
 			$param = array();
 		}

 		$param['select'] 	= 	'*';
 		$param['from'] 		= 	$this->Engine->table['userrating'];

 	 	$rows = $this->Engine->records->GetList($param);

 		return $rows;
	}

	function GetUserRatingInfo($param)
	{
 		if (!isset($param)
 			or !is_array($param))
 		{
 			$param = array();
 		}

 	 	$param['select'] 	= 	'*';
 	 	$param['from'] 		= 	$this->Engine->table['userrating'];

 	 	$rows = $this->Engine->records->GetInfo($param);

 	 	return $rows;
	}

	function UpdateUserRating($param)
	{
 		if (!isset($param)
 			or !is_array($param))
 		{
 			$param = array();
 		}

		$query = $this->Engine->records->Update($this->Engine->table['userrating'],$param['field'],$param['where']);

		return ($query) ? true : false;
	}

	function DeleteUserRating($param)
	{
 		if (!isset($param)
 			or !is_array($param))
 		{
 			$param = array();
 		}

 		$param['table'] = $this->Engine->table['userrating'];

		$del = $this->Engine->records->Delete($param);

		return ($del) ? true : false;
	}


}

?>
Return current item: PBBoard