Ver Mensaje Individual
  #8 (permalink)  
Antiguo 01/10/2008, 07:34
Avatar de Synkronice
Synkronice
 
Fecha de Ingreso: octubre-2007
Ubicación: Madrid
Mensajes: 831
Antigüedad: 16 años, 6 meses
Puntos: 48
Respuesta: Duda con Clases

Yo que tu redefiniria el metodo AgregarCliente() para que pueda recibir las dos fechas, ya que como lo tienes ahora las fechas que estas instanciando en el método AgregarCliente() no están seteadas.

Prueba esto en //ARCHIVO cliente.php

Código PHP:
public function AgregarCliente($fechaCreacion$fechaVencimiento){
    
$bd = new BaseDatos();
                   
    
$query "insertarCliente('".trim($this->GetNomCliente())."',
        '"
.trim($this->GetRif())."',
        '"
.trim($this->GetNit())."',
        '"
.trim($fechaCreacion->GetFecha())."',
        '"
.trim($fechaVencimiento->GetFecha())."');";

    
$bd->Conexion();
    
$resultado =  $bd->EjecutarQuery($query);                                                                  
    
$bd->Desconexion();
    
    return 
$resultado;                                      

y en //ARCHIVO agregarCliente.php

Código PHP:
include_once('cliente.php');
include_once(
'fecha.php');

    
$cliente = new Cliente();
    
$fechaCreacion = new Fechas();
    
$fechaVencimiento = new Fechas();

    
$cliente->SetNomCliente($_POST['nombreCliente']);
    
$cliente->SetRif($_POST['rif']);
    
$cliente->SetNit($_POST['nit']);
    
    
$fechaCreacion->SetFecha($_POST['fechaCreacion']);
    
$fechaVencimiento->SetFecha($_POST['fechaVenc']);

    echo 
$cliente->AgregarCliente($fechaCreacion$fechaVencimiento); 
Saludos!!