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

Mister Spy

Current Path : /home/caballoscriollos/www/espanol/library/
Upload File :
Current File : /home/caballoscriollos/www/espanol/library/class.administradoreventos.php

<?php 

require_once('class.dbaccess.php');
require_once('class.administradorevento.php');
require_once('class.filter.php');
require_once('class.page.php');

class AdministradorEventos extends DBAccess implements IFilterable
{
	public function ParseFilter(array $filter)
	{
		$sql = '';
		
		return $sql;
	}


	public function GetPagesCount(Page $oPage, $filter = false)
	{	
		$sql = "SELECT COUNT(1) / " . DB::Number($oPage->Size) . " AS Count";
		$sql.= " FROM tblAdministradorEventos";
		
		if ($filter)
			$sql.= " " . $this->ParseFilter($filter);
		
		if (!($oRes = $this->GetQuery($sql)) )		
			return false;

		if ( !($oRow = $oRes->GetRow()) )
			return false;
		
		$Count = $oRow['Count'];
		
		return ceil($Count);
	}


	public function GetAll(array $filter = NULL, Page $oPage = NULL)
	{
		$sql = "SELECT *";
		$sql.= " FROM tblAdministradorEventos ";

		if ($filter)
			$sql.= $this->ParseFilter($filter);

		$sql.= " ORDER BY IdEvento";

		if ($oPage != NULL)
			$sql.= " " . Pageable::ParsePage($oPage);
						
		if (!($oRes = $this->GetQuery($sql)))
			return false;

		$arr = array();
			
		while ($oRow = $oRes->GetRow())	
		{	
			$oAdministradorEvento = new AdministradorEvento();
			$oAdministradorEvento->ParseFromArray($oRow);
			
			array_push($arr, $oAdministradorEvento);
			
			$oRes->MoveNext();
		}	
		
		return $arr;		
	}


	public function GetAllByAdministrador(Administrador $oAdministrador)
	{
		$sql = "SELECT *";
		$sql.= " FROM tblAdministradorEventos ";
		$sql.= " WHERE IdAdministrador = " . DB::Number($oAdministrador->IdAdministrador);
		$sql.= " ORDER BY IdEvento";

		if ($oPage != NULL)
			$sql.= " " . Pageable::ParsePage($oPage);
						
		if (!($oRes = $this->GetQuery($sql)))
			return false;

		$arr = array();
			
		while ($oRow = $oRes->GetRow())	
		{	
			$oAdministradorEvento = new AdministradorEvento();
			$oAdministradorEvento->ParseFromArray($oRow);
			
			array_push($arr, $oAdministradorEvento);
			
			$oRes->MoveNext();
		}	
		
		return $arr;		
	}
		

	public function GetById($IdAdministrador, $IdEvento)
	{
		$sql = "SELECT *";
		$sql.= " FROM tblAdministradorEventos";
		$sql.= " WHERE IdAdministrador = " . DB::Number($IdAdministrador);
		$sql.= " AND IdEvento = " . DB::Number($IdEvento);
			
		if (!($oRes = $this->GetQuery($sql)))
			return false;
			
		if (!($oRow = $oRes->GetRow()))
			return false;
		
		$oAdministradorEvento = new AdministradorEvento();
		$oAdministradorEvento->ParseFromArray($oRow);
		
		return $oAdministradorEvento;		
	}
	

	public function GetCountRows(array $filter = NULL)
	{
		$sql = "SELECT *";
		$sql.= " FROM tblAdministradorEventos";

		if ($filter)
			$sql.= $this->ParseFilter($filter);

		if (!($oRes = $this->GetQuery($sql)))
			return false;
		
		$CountRows = $oRes->NumRows();
		
		return $CountRows;
	}
	
	
	public function Create(AdministradorEvento $oAdministradorEvento)
	{
		$arr = array
		(
			'IdAdministrador' 	=> DB::Number($oAdministradorEvento->IdAdministrador),
			'IdEvento'  		=> DB::Number($oAdministradorEvento->IdEvento)
		);
		
		if (!$this->Insert('tblAdministradorEventos', $arr))
			return false;
			
		return $oAdministradorEvento;
	}
	
	
	public function Delete($IdAdministrador, $IdEvento)
	{
		if (!DBAccess::$db->Begin())
			return false;
			
		$where = " IdAdministrador = " . DB::Number($IdAdministrador);
		$where.= " AND IdEvento = " . DB::Number($IdEvento);
		
		if (!DBAccess::Delete('tblAdministradorEventos', $where))
		{
			DBAccess::$db->Rollback();	
			return false;
		}

		DBAccess::$db->Commit();
		
		return true;	
	}		
}

?>

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