Ver Mensaje Individual
  #9 (permalink)  
Antiguo 05/10/2009, 15:47
infinitum88
 
Fecha de Ingreso: octubre-2009
Mensajes: 40
Antigüedad: 14 años, 6 meses
Puntos: 0
Respuesta: Abrir PDF desde MySQL

OK SI ESO YA LO CONTEMPLE ESTE ES MI CODIGO: DOND UTILIZO ESOS OBJETOS:
TENGO UNA CLASE QUE SE LLAMA ARCHIVO Y ES LA SIEGUIENTE:

Cita:
class Archivo
{
private $arc;
private $regnom;

public function Regiduria($a,$rn)
{
$this->arc = $a;
$this->regnom = $rn;
}
Y OTRA QUE SE LLAMA Arch que es la que contiene la consulta a la BD es la siguiente:
Cita:
class Arch
{
private $ID;
private $archivo;
private $reg_nom;

public function Regiduria_Arch($id,$a,$arc)
{
$this->ID = $id;
$this->archivo = $a;
$this->nombre = $n;
}

public function getBuscar()
{
try
{
$conBD = new ConexionBD();
$conBD->setConectar();
$cSQL = $conBD->getSQL("SELECT * FROM archivos WHERE ID=".$this->ID);
if($datos=$conBD->getDatos($cSQL))
{
$this->nombre = $datos["nombre"];
$this->reg_nom = $datos["reg_nom"];
$this->archivo = $datos["archivo"];
$this->fecha = $datos["fecha"];
return true;
}
else
{
$this->ID=0;
return false;
}
}
catch(Exception $ex)
{
throw new Exception($ex->getMessage());
}
}

public function getArchivo()
{return $this->archivo;}

public function getNombre()
{return $this->reg_nom;}
}
y en la siguiente clase es dond paso las variables:
Cita:
if(isset($_GET["arch"]))
{
$r = new Regiduria_Arch($_GET["arch"],"","");
if($r->getBuscar())
{
$Reg = new Regiduria($r->getArchivo(),$r->getNombre());
echo $Reg->principal();
}
else
{
$Reg = new Regiduria($_GET["arch"],"","");
echo $Reg->principal();
}
}
else
{
$Reg = new Regiduria(0,"","");
echo $Reg->principal();
}