diff --git a/htdocs/adherent.class.php b/htdocs/adherent.class.php
index c460841e445..9889a681745 100644
--- a/htdocs/adherent.class.php
+++ b/htdocs/adherent.class.php
@@ -43,10 +43,11 @@ class Adherent
*
*
*/
- Function Adherent($DB, $soc_idp="")
+ Function Adherent($DB, $id='')
{
$this->db = $DB ;
- $this->statut = 0;
+ $this->id = $id;
+ $this->statut = -1;
}
/*
*
@@ -337,5 +338,36 @@ class Adherent
}
}
+
+
+ /*
+ * Validation
+ *
+ *
+ */
+ Function validate($userid)
+ {
+
+ $sql = "UPDATE llx_adherent SET ";
+ $sql .= "statut=1";
+ $sql .= ",fk_user_valid=".$userid;
+
+ $sql .= " WHERE rowid = $this->id";
+
+ $result = $this->db->query($sql);
+
+ if ($result)
+ {
+ return 1;
+ }
+ else
+ {
+ print $this->db->error();
+ print "
$sql
";
+ return 0;
+ }
+ }
+
+
}
?>
diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php
index 8d16eff54c0..36cde90d0e0 100644
--- a/htdocs/adherents/fiche.php
+++ b/htdocs/adherents/fiche.php
@@ -44,7 +44,7 @@ if ($HTTP_POST_VARS["action"] == 'add')
{
$adh = new Adherent($db);
-
+ $adh->statut = -1;
$adh->prenom = $prenom;
$adh->nom = $nom;
$adh->societe = $societe;
@@ -56,6 +56,7 @@ if ($HTTP_POST_VARS["action"] == 'add')
$adh->pays = $pays;
$adh->typeid = $type;
$adh->commentaire = $HTTP_POST_VARS["comment"];
+ $adh->morphy = $HTTP_POST_VARS["morphy"];
if ($adh->create($user->id) )
{
@@ -74,6 +75,12 @@ if ($HTTP_POST_VARS["action"] == 'confirm_delete' && $HTTP_POST_VARS["confirm"]
Header("Location: liste.php");
}
+if ($HTTP_POST_VARS["action"] == 'confirm_valid' && $HTTP_POST_VARS["confirm"] == yes)
+{
+ $adh = new Adherent($db, $rowid);
+ $adh->validate($user->id);
+}
+
llxHeader();
@@ -112,6 +119,14 @@ if ($action == 'create') {
$htmls->select_array("type", $adht->liste_array());
print "";
+ $morphys["phy"] = "Physique";
+ $morphys["mor"] = "Morale";
+
+ print "| Personne | ";
+ $htmls->select_array("morphy", $morphys);
+ print " |
";
+
+
print '| Prénom | | ';
print 'Commentaires : ';
@@ -162,15 +177,19 @@ if ($rowid > 0)
print "";
}
@@ -286,7 +295,14 @@ if ($rowid > 0)
print ' |
| Nouvelle adhésion |
';
print "| Date de cotisation | ";
- print_date_select($adh->datefin + (3600*24));
+ if ($adh->datefin > 0)
+ {
+ print_date_select($adh->datefin + (3600*24));
+ }
+ else
+ {
+ print_date_select();
+ }
print " | |
";
print "| Mode de paiement | \n";
@@ -327,6 +343,32 @@ if ($rowid > 0)
}
+ /*
+ * Confirmation de la validation
+ *
+ */
+
+ if ($action == 'valid')
+ {
+
+ print '";
+ }
+
+
}
$db->close();
|