From 205846f7cfe7125b3f405301ceb5ed5bf6269015 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 27 Dec 2002 21:54:03 +0000 Subject: [PATCH] *** empty log message *** --- htdocs/compta/dons/fiche.php | 7 +----- htdocs/don.class.php | 47 ++++++++++++++++++++++++++++++++++-- htdocs/html.form.class.php | 2 +- 3 files changed, 47 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index 8a4ff98c1c0..675881e95c6 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -59,8 +59,7 @@ if ($action == 'add') print "Erreur"; $action = "create"; } - -} +} if ($action == 'delete') { @@ -130,10 +129,6 @@ if ($action == 'create') { print ''; print ""; - print ""; - print "facnumber\">"; - print "idp\">"; - print "nom\">"; print "
Date du don :"; print_date_select(); diff --git a/htdocs/don.class.php b/htdocs/don.class.php index 24c04835a3c..10823187d28 100644 --- a/htdocs/don.class.php +++ b/htdocs/don.class.php @@ -159,7 +159,7 @@ class Don } /* - * + * Création * * */ @@ -188,6 +188,48 @@ class Don } } + /* + * Mise à jour + * + * + */ + Function update($userid) + { + + $this->date = $this->db->idate($this->date); + + $sql = "UPDATE llx_don SET "; + $sql .= "amount = " . $this->amount; + $sql .= ",fk_paiement = ".$this->modepaiementid; + $sql .= ",prenom = '".$this->prenom ."'"; + $sql .= ",nom='".$this->nom."'"; + $sql .= ",societe='".$this->societe."'"; + $sql .= ",adresse='".$this->adresse."'"; + $sql .= ",cp='".$this->cp."'"; + $sql .= ",ville='".$this->ville."'"; + $sql .= ",pays='".$this->pays."'"; + $sql .= ",public=".$this->public; + $sql .= ",fk_don_projet=".$this->projetid; + $sql .= ",note='".$this->commentaire."'"; + $sql .= ",datedon='".$this->date."'"; + $sql .= ",email='".$this->email."'"; + + $sql .= " WHERE rowid = $this->id"; + + $result = $this->db->query($sql); + + if ($result) + { + return 1; + } + else + { + print $this->db->error(); + print "


$sql

"; + return 0; + } + } + /* * Suppression du don * @@ -222,7 +264,7 @@ class Don */ Function fetch($rowid) { - $sql = "SELECT d.rowid, ".$this->db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe, d.amount, p.libelle as projet, d.fk_statut, d.adresse, d.cp, d.ville, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email"; + $sql = "SELECT d.rowid, ".$this->db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe, d.amount, p.libelle as projet, d.fk_statut, d.adresse, d.cp, d.ville, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.fk_don_projet"; $sql .= " FROM llx_don as d, llx_don_projet as p, c_paiement as cp"; $sql .= " WHERE p.rowid = d.fk_don_projet AND cp.id = d.fk_paiement AND d.rowid = $rowid"; @@ -245,6 +287,7 @@ class Don $this->email = stripslashes($obj->email); $this->pays = stripslashes($obj->pays); $this->projet = $obj->projet; + $this->projetid = $obj->fk_don_projet; $this->public = $obj->public; $this->modepaiementid = $obj->fk_paiement; $this->modepaiement = $obj->libelle; diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index ccc8be0d97b..b564457423c 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -49,7 +49,7 @@ class Form { $num = $this->db->num_rows(); $i = 0; - if (strlen($id)) + if (strlen("$id")) { while ($i < $num) {