Пример #1
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();
    }