Ejemplo n.º 1
0
 public function add(Contrat $contrat)
 {
     $query = $this->_db->prepare('
     INSERT INTO t_contrat (reference, numero, dateCreation, prixVente, prixVenteArabe, 
     avance, avanceArabe, modePaiement, dureePaiement, nombreMois, echeance, note, 
     idClient, idProjet, idBien, typeBien, code, status, revendre, numeroCheque, created, createdBy)
     VALUES (:reference, :numero, :dateCreation, :prixVente, :prixVenteArabe, 
     :avance, :avanceArabe, :modePaiement, :dureePaiement, :nombreMois, :echeance, :note, 
     :idClient, :idProjet, :idBien, :typeBien, :code, :status, :revendre, :numeroCheque, :created, :createdBy)') or die(print_r($this->_db->errorInfo()));
     $query->bindValue(':reference', $contrat->reference());
     $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(':nombreMois', $contrat->nombreMois());
     $query->bindValue(':echeance', $contrat->echeance());
     $query->bindValue(':note', $contrat->note());
     $query->bindValue(':idClient', $contrat->idClient());
     $query->bindValue(':idProjet', $contrat->idProjet());
     $query->bindValue(':idBien', $contrat->idBien());
     $query->bindValue(':typeBien', $contrat->typeBien());
     $query->bindValue(':code', $contrat->code());
     $query->bindValue(':status', 'actif');
     $query->bindValue(':revendre', 0);
     $query->bindValue(':numeroCheque', $contrat->numeroCheque());
     $query->bindValue(':created', $contrat->created());
     $query->bindValue(':createdBy', $contrat->createdBy());
     $query->execute();
     $query->closeCursor();
 }