public function update(Contrat $contrat)
 {
     $query = $this->_db->prepare('UPDATE t_contrat SET numero=:numero, dateCreation=:dateCreation, 
     prixVente=:prixVente, prixVenteArabe=:prixVenteArabe, avance=:avance, avanceArabe=:avanceArabe, 
     modePaiement=:modePaiement, numeroCheque=:numeroCheque,
     nombreMois=:nombreMois, dureePaiement=:dureePaiement, echeance=:echeance,  
     note=:note, updated=:updated, updatedBy=:updatedBy WHERE id=:id') or die(print_r($this->_db->errorInfo()));
     $query->bindValue(':id', $contrat->id());
     $query->bindValue(':numero', $contrat->numero());
     $query->bindValue(':dateCreation', $contrat->dateCreation());
     $query->bindValue(':prixVente', $contrat->prixVente());
     $query->bindValue(':prixVenteArabe', $contrat->prixVenteArabe());
     $query->bindValue(':avance', $contrat->avance());
     $query->bindValue(':avanceArabe', $contrat->avanceArabe());
     $query->bindValue(':modePaiement', $contrat->modePaiement());
     $query->bindValue(':dureePaiement', $contrat->dureePaiement());
     $query->bindValue(':numeroCheque', $contrat->numeroCheque());
     $query->bindValue(':nombreMois', $contrat->nombreMois());
     $query->bindValue(':echeance', $contrat->echeance());
     $query->bindValue(':note', $contrat->note());
     $query->bindValue(':updated', $contrat->updated());
     $query->bindValue(':updatedBy', $contrat->updatedBy());
     $query->execute();
     $query->closeCursor();
 }
Exemplo n.º 2
0
    public function update(Contrat $contrat)
    {
        $query = $this->_db->prepare('UPDATE t_contrat SET nomClient=:nomClient, cin=:cin, adresse=:adresse, telephone=:telephone,
		dateCreation=:dateCreation, dateRetour=:dateRetour, prixVente=:prixVente, avance=:avance, 
		note=:note, taille=:taille, idBien=:idBien, typeBien=:typeBien, modePaiement=:modePaiement, 
		numeroCheque=:numeroCheque WHERE id=:id') or die(print_r($this->_db->errorInfo()));
        $query->bindValue(':nomClient', $contrat->nomClient());
        $query->bindValue(':cin', $contrat->cin());
        $query->bindValue(':adresse', $contrat->adresse());
        $query->bindValue(':telephone', $contrat->telephone());
        $query->bindValue(':dateCreation', $contrat->dateCreation());
        $query->bindValue(':dateRetour', $contrat->dateRetour());
        $query->bindValue(':prixVente', $contrat->prixVente());
        $query->bindValue(':avance', $contrat->avance());
        $query->bindValue(':note', $contrat->note());
        $query->bindValue(':taille', $contrat->taille());
        $query->bindValue(':idBien', $contrat->idBien());
        $query->bindValue(':typeBien', $contrat->typeBien());
        $query->bindValue(':modePaiement', $contrat->modePaiement());
        $query->bindValue(':numeroCheque', $contrat->numeroCheque());
        $query->bindValue(':id', $contrat->id());
        $query->execute();
        $query->closeCursor();
    }