From 40aeef678884e64100275e69b3d88631a24915bb Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 30 Dec 2002 16:29:21 +0000 Subject: [PATCH] *** empty log message *** --- htdocs/adherent.class.php | 36 +++++++++++++++- htdocs/adherents/fiche.php | 84 ++++++++++++++++++++++++++++---------- 2 files changed, 97 insertions(+), 23 deletions(-) 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 "
"; print ''; - print ''; - + print ""; print ''; - print ''; - + print ''; + print ''; + print ''; + + print ''; + + print ''; print ''; print ''; @@ -195,11 +214,10 @@ if ($rowid > 0) * Case 2 */ - if ($adh->statut == 1 && $resteapayer > 0) + if ($adh->statut == -1) { - print ""; + print ""; } - else { print ""; @@ -212,18 +230,9 @@ if ($rowid > 0) /* * Case 4 */ - if ($adh->statut == 0) - { - print ""; - } - elseif ($adh->statut == 2) - { - print ""; - } - else - { - print ""; - } + + print ""; + print "
Prénom'.$adh->prenom.' 
Type$adh->typeCommentaires
Nom'.$adh->nom.' 
Personne'.$adh->morphy.' '; print nl2br($adh->commentaire).' 
Prénom'.$adh->prenom.' 
Nom'.$adh->nom.' 
Société'.$adh->societe.' 
Adresse'.nl2br($adh->adresse).' 
CP Ville'.$adh->cp.' '.$adh->ville.' 
[Emettre un paiement][Valider l'adhésion]-[id&action=delete\">Supprimer][id&action=set_encaisse\">Encaisser]-[id&action=delete\">Supprimer]

"; } @@ -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 '

'; + print ''; + print ''; + + print ''; + + print '"; + print ''; + print '
Valider un adhérent
Etes-vous sur de vouloir valider cet adhérent ?'; + $htmls = new Form($db); + + $htmls->selectyesno("confirm","no"); + + print "
'; + print "
"; + } + + } $db->close();