Mister Spy Say ="Hello Kids ... :D"
___ ____ _ _____
| \/ (_) | | / ___|
| . . |_ ___| |_ ___ _ __ \ `--. _ __ _ _
| |\/| | / __| __/ _ \ '__| `--. \ '_ \| | | |
| | | | \__ \ || __/ | /\__/ / |_) | |_| |
\_| |_/_|___/\__\___|_| \____/| .__/ \__, |
| | __/ |
|_| |___/
Bot Mister Spy V3
Mister Spy
Mister Spy
<?php
require_once('class.dbaccess.php');
require_once('class.premiomorfologico.php');
require_once('class.filter.php');
require_once('class.page.php');
class PremiosMorfologicos 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['IdTipo']) && ($filter['IdTipo'] != ''))
$sql.= " AND IdTipo = " . DB::Number($filter['IdTipo']);
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 tblPremiosMorfologicos";
if ($filter)
$sql.= $this->ParseFilter($filter);
$sql.= " ORDER BY IdPremio ASC";
if ($oPage != NULL)
$sql.= " " . Pageable::ParsePage($oPage);
if (!($oRes = $this->GetQuery($sql)))
return false;
$arr = array();
while ($oRow = $oRes->GetRow())
{
$oPremioMofologico = new PremioMorfologico();
$oPremioMofologico->ParseFromArray($oRow);
array_push($arr, $oPremioMofologico);
$oRes->MoveNext();
}
return $arr;
}
public function GetById($IdPremio)
{
$sql = "SELECT *";
$sql.= " FROM tblPremiosMorfologicos";
$sql.= " WHERE IdPremio = " . DB::Number($IdPremio);
if (!($oRes = $this->GetQuery($sql)))
return false;
if (!($oRow = $oRes->GetRow()))
return false;
$oPremioMofologico = new PremioMorfologico();
$oPremioMofologico->ParseFromArray($oRow);
return $oPremioMofologico;
}
public function GetCountRows(array $filter = NULL)
{
$sql = "SELECT *";
$sql.= " FROM tblPremiosMorfologicos";
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