diff --git a/htdocs/adherents/edit.php b/htdocs/adherents/edit.php
new file mode 100644
index 00000000000..3814ab7f672
--- /dev/null
+++ b/htdocs/adherents/edit.php
@@ -0,0 +1,170 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+require("./pre.inc.php");
+require("../../don.class.php");
+require("../../paiement.class.php");
+
+$db = new Db();
+
+
+if ($action == 'update')
+{
+
+ if ($amount > 0)
+ {
+
+ $don = new Don($db);
+
+ $don->id = $HTTP_POST_VARS["rowid"];
+ $don->prenom = $prenom;
+ $don->nom = $nom;
+ $don->statut = $HTTP_POST_VARS["statutid"];
+ $don->societe = $societe;
+ $don->adresse = $adresse;
+ $don->amount = $amount;
+ $don->cp = $cp;
+ $don->ville = $ville;
+ $don->email = $email;
+ $don->date = mktime(12, 0 , 0, $remonth, $reday, $reyear);
+ $don->note = $note;
+ $don->pays = $pays;
+ $don->public = $public;
+ $don->projetid = $projetid;
+ $don->commentaire = $HTTP_POST_VARS["comment"];
+ $don->modepaiementid = $modepaiement;
+
+ if ($don->update($user->id) )
+ {
+ Header("Location: fiche.php?rowid=$don->id&action=edit");
+ }
+ }
+ else
+ {
+ print "Erreur";
+ $action = "create";
+ }
+}
+
+
+llxHeader();
+
+
+if ($rowid)
+{
+
+ $don = new Don($db);
+ $don->id = $rowid;
+ $don->fetch($rowid);
+
+ $sql = "SELECT s.nom,s.idp, f.amount, f.total, f.facnumber";
+ $sql .= " FROM societe as s, llx_facture as f WHERE f.fk_soc = s.idp";
+ $sql .= " AND f.rowid = $facid";
+
+ $result = $db->query($sql);
+ if ($result) {
+ $num = $db->num_rows();
+ if ($num) {
+ $obj = $db->fetch_object( 0);
+
+ $total = $obj->total;
+ }
+ }
+ print_titre("Saisir un don");
+ print "
';
+
+}
+
+$db->close();
+
+llxFooter("Dernière modification $Date$ révision $Revision$");
+?>
diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php
new file mode 100644
index 00000000000..0602fd5b712
--- /dev/null
+++ b/htdocs/adherents/index.php
@@ -0,0 +1,74 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+require("./pre.inc.php");
+
+llxHeader();
+
+$db = new Db();
+
+
+$sql = "SELECT sum(d.amount) as somme , d.fk_statut FROM llx_don as d GROUP BY d.fk_statut";
+
+$result = $db->query($sql);
+
+if ($result)
+{
+ $num = $db->num_rows();
+ $i = 0;
+ while ($i < $num)
+ {
+ $objp = $db->fetch_object( $i);
+
+ $somme[$objp->fk_statut] = $objp->somme;
+ $i++;
+ }
+ $db->free();
+}
+
+print_barre_liste("Dons", $page, $PHP_SELF);
+
+print '
";
+
+
+
+$db->close();
+
+llxFooter("Dernière modification $Date$ révision $Revision$");
+?>
diff --git a/htdocs/adherents/index.php3 b/htdocs/adherents/index.php3
deleted file mode 100644
index 6b4e29813a3..00000000000
--- a/htdocs/adherents/index.php3
+++ /dev/null
@@ -1,70 +0,0 @@
-
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Id$
- * $Source$
- *
- */
-require("./pre.inc.php3");
-require("../contact.class.php3");
-
-
-llxHeader();
-$db = new Db();
-if ($sortorder == "")
-{
- $sortorder="ASC";
-}
-if ($sortfield == "")
-{
- $sortfield="nom";
-}
-
-print_titre("Liste des adherents");
-
-
-$ds=ldap_connect("localhost");
-
-if ($ds)
-{
- print "Connected";
- // bind with appropriate dn to give update access
- $r=ldap_bind($ds,"cn=admin,dc=rodo,dc=lan", "gnu8lx");
-
-
- // prepare data
- $info["cn"]="John Jones";
- $info["sn"]="Jones";
- $info["mail"]="jonj@here.and.now";
- $info["objectclass"]="person";
-
- // add data to directory
- // $r=ldap_add($ds, "cn=John Jones, o=Adherents, c=FR", $info);
-
-
- ldap_close($ds);
-}
-else
-{
- echo "Unable to connect to LDAP server";
-}
-
-
-$db->close();
-
-llxFooter("Dernière modification $Date$ révision $Revision$");
-?>
diff --git a/htdocs/adherents/pre.inc.php3 b/htdocs/adherents/pre.inc.php
similarity index 69%
rename from htdocs/adherents/pre.inc.php3
rename to htdocs/adherents/pre.inc.php
index cb0f2baf6bd..3aea22e3c4e 100644
--- a/htdocs/adherents/pre.inc.php3
+++ b/htdocs/adherents/pre.inc.php
@@ -1,8 +1,5 @@
- *
- * $Id$
- * $Source$
+/* Copyright (C) 2001-2002 Rodolphe Quiedeville
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,10 +15,19 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
+ * $Id$
+ * $Source$
+ *
*/
-require("../main.inc.php3");
+require("../../main.inc.php3");
+require("../../projetdon.class.php");
-function llxHeader($head = "", $urlp = "") {
+$libelle[0] = "Promesses non validées";
+$libelle[1] = "Promesses validées";
+$libelle[2] = "Dons payés";
+$libelle[3] = "Dons encaissés";
+
+function llxHeader($head = "") {
global $user, $conf;
@@ -33,10 +39,13 @@ function llxHeader($head = "", $urlp = "") {
$menu = new Menu();
- $menu->add("/adherents/", "Adherents");
+ $menu->add("/compta/dons/","Dons");
+ $menu->add_submenu("fiche.php?action=create","Saisir un don");
+
+ $menu->add("/compta/bank/index.php3","Bank");
left_menu($menu->liste);
+
}
-
?>