Пример #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, imageNote, 
        idClient, idProjet, idBien, typeBien, code, status, revendre, numeroCheque, societeArabe, 
        etatBienArabe, facadeArabe, articlesArabes, created, createdBy)
        VALUES (:reference, :numero, :dateCreation, :prixVente, :prixVenteArabe, 
        :avance, :avanceArabe, :modePaiement, :dureePaiement, :nombreMois, :echeance, :note, :imageNote, 
        :idClient, :idProjet, :idBien, :typeBien, :code, :status, :revendre, :numeroCheque, 
        :societeArabe, :etatBienArabe, :facadeArabe, :articlesArabes, :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(':imageNote', $contrat->imageNote());
        $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(':societeArabe', $contrat->societeArabe());
        $query->bindValue(':etatBienArabe', $contrat->etatBienArabe());
        $query->bindValue(':facadeArabe', $contrat->facadeArabe());
        $query->bindValue(':articlesArabes', $contrat->articlesArabes());
        $query->bindValue(':created', $contrat->created());
        $query->bindValue(':createdBy', $contrat->createdBy());
        $query->execute();
        $query->closeCursor();
    }