mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 02:11:27 +01:00
deplacement de l'interface public vers /public/adherents/
This commit is contained in:
@@ -1,181 +0,0 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* 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("../../adherent.class.php");
|
||||
require("../../adherent_type.class.php");
|
||||
require("../../cotisation.class.php");
|
||||
require("../../paiement.class.php");
|
||||
|
||||
|
||||
$db = new Db();
|
||||
$errmsg='';
|
||||
$num=0;
|
||||
$error=0;
|
||||
|
||||
if ($HTTP_POST_VARS["action"] == 'add')
|
||||
{
|
||||
// test si le login existe deja
|
||||
$sql = "SELECT login FROM llx_adherent WHERE login='$login';";
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows();
|
||||
}
|
||||
if (!isset($nom) || !isset($prenom) || $prenom=='' || $nom==''){
|
||||
$error+=1;
|
||||
$errmsg .="Nom et Prenom obligatoires<BR>\n";
|
||||
}
|
||||
if (!isset($email) || $email == '' || !ereg('@',$email)){
|
||||
$error+=1;
|
||||
$errmsg .="Adresse Email invalide<BR>\n";
|
||||
}
|
||||
if ($num !=0){
|
||||
$error+=1;
|
||||
$errmsg .="Login deja utilise. Veuillez en changer<BR>\n";
|
||||
}
|
||||
if (!isset($pass1) || !isset($pass2) || $pass1 == '' || $pass2 == '' || $pass1!=$pass2){
|
||||
$error+=1;
|
||||
$errmsg .="Password invalide<BR>\n";
|
||||
}
|
||||
if (isset($naiss) && $nais !=''){
|
||||
if (!ereg("^\d\d\d\d\-\d\d\-\d\d",$naiss)){
|
||||
$error+=1;
|
||||
$errmsg .="Date de naissance invalide (Format AAAA-MM-JJ)<BR>\n";
|
||||
}
|
||||
}
|
||||
if (isset($public)){
|
||||
$public=1;
|
||||
}else{
|
||||
$public=0;
|
||||
}
|
||||
if (!$error){
|
||||
// email a peu pres correct et le login n'existe pas
|
||||
$adh = new Adherent($db);
|
||||
$adh->statut = -1;
|
||||
$adh->public = $public;
|
||||
$adh->prenom = $prenom;
|
||||
$adh->nom = $nom;
|
||||
$adh->societe = $societe;
|
||||
$adh->adresse = $adresse;
|
||||
$adh->cp = $cp;
|
||||
$adh->ville = $ville;
|
||||
$adh->email = $email;
|
||||
$adh->login = $login;
|
||||
$adh->pass = $pass1;
|
||||
$adh->naiss = $naiss;
|
||||
$adh->photo = $photo;
|
||||
$adh->note = $note;
|
||||
$adh->pays = $pays;
|
||||
$adh->typeid = $type;
|
||||
$adh->commentaire = $HTTP_POST_VARS["comment"];
|
||||
$adh->morphy = $HTTP_POST_VARS["morphy"];
|
||||
|
||||
if ($adh->create($user->id) )
|
||||
{
|
||||
if ($cotisation > 0)
|
||||
{
|
||||
$adh->cotisation(mktime(12, 0 , 0, $remonth, $reday, $reyear), $cotisation);
|
||||
}
|
||||
// Envoi d'un Email de confirmation au nouvel adherent
|
||||
$mesg="Merci de votre inscription. Votre adhesion devrait etre rapidement validee.\nVoici le rappel des coordonnees que vous avez rentrees (toute information erronee entrainera la non validation de votre inscription) :\n\nPrenom : $prenom\nNom : $nom\nSociete = $societe\nAdresse = $adresse\nCode Postal : $cp\nVille : $ville\nPays : $pays\nEmail : $email\nLogin : $login\nPassword : $pass\nNote : $note\n\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l'adresse suivante :\nhttp://$SERVER_NAME/adherents/private/edit.php\n\n";
|
||||
mail($email,"Votre adhesion sur http://$SERVER_NAME/",$mesg);
|
||||
Header("Location: new.php?action=added");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
llxHeader();
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Cr<43>ation d'une fiche */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
if (isset($action) && $action== 'added'){
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
print "<tr><td><FONT COLOR=\"blue\">Nouvel Adh<64>rent ajout<75>. En attente de validation</FONT></td></tr>\n";
|
||||
print '</table>';
|
||||
}
|
||||
if ($errmsg != ''){
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
|
||||
print '<th>Erreur dans le formulaire</th>';
|
||||
print "<tr><td class=\"delete\"><b>$errmsg</b></td></tr>\n";
|
||||
// print "<FONT COLOR=\"red\">$errmsg</FONT>\n";
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
print_titre("Nouvel adh<64>rent");
|
||||
print '<ul>';
|
||||
print '<li> Les champs Commencant par un <FONT COLOR="red">*</FONT> sont obligatoire';
|
||||
print '<li> Les champs Commencant par un <FONT COLOR="blue">*</FONT> seront affiche sur la liste publique des membres. Si vous ne souhaite pas cela <b>DECOCHEZ</b> la case public ci dessous';
|
||||
print "<li> Les login et password vous serviront a editer vos coordonnees ulterieurement<BR>\n";
|
||||
print "</ul><BR>\n";
|
||||
print "<form action=\"$PHP_SELF\" method=\"post\">\n";
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
$htmls = new Form($db);
|
||||
$adht = new AdherentType($db);
|
||||
|
||||
print '<tr><td width="15%">Type</td><td width="35%">';
|
||||
$htmls->select_array("type", $adht->liste_array());
|
||||
print "</td>\n";
|
||||
|
||||
print '<td width="50%" valign="top">Commentaires :</td></tr>';
|
||||
|
||||
$morphys["phy"] = "Physique";
|
||||
$morphys["mor"] = "Morale";
|
||||
|
||||
print "<tr><td>Personne</td><td>\n";
|
||||
$htmls->select_array("morphy", $morphys);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td valign="top" rowspan="14"><textarea name="comment" wrap="soft" cols="40" rows="25">'.$comment.'</textarea></td></tr>';
|
||||
|
||||
print '<tr><td><FONT COLOR="red">*</FONT> <FONT COLOR="blue">*</FONT> Pr<50>nom</td><td><input type="text" name="prenom" size="40" value="'.$prenom.'"></td></tr>';
|
||||
|
||||
print '<tr><td><FONT COLOR="red">*</FONT> <FONT COLOR="blue">*</FONT> Nom</td><td><input type="text" name="nom" size="40" value="'.$nom.'"></td></tr>';
|
||||
print '<tr><td>Societe</td><td><input type="text" name="societe" size="40" value="'.$societe.'"></td></tr>';
|
||||
print '<tr><td>Adresse</td><td>';
|
||||
print '<textarea name="adresse" wrap="soft" cols="40" rows="3">'.$adresse.'</textarea></td></tr>';
|
||||
print '<tr><td>CP Ville</td><td><input type="text" name="cp" size="8" value="'.$cp.'"> <input type="text" name="ville" size="40" value="'.$ville.'"></td></tr>';
|
||||
print '<tr><td>Pays</td><td><input type="text" name="pays" size="40" value="'.$pays.'"></td></tr>';
|
||||
print '<tr><td><FONT COLOR="red">*</FONT> <FONT COLOR="blue">*</FONT> Email</td><td><input type="text" name="email" size="40" value="'.$email.'"></td></tr>';
|
||||
print '<tr><td><FONT COLOR="red">*</FONT> Login</td><td><input type="text" name="login" size="40" value="'.$login.'"></td></tr>';
|
||||
print '<tr><td><FONT COLOR="red">*</FONT> Password (a entrer 2 fois)</td><td><input type="password" name="pass1" size="40"><BR><input type="password" name="pass2" size="40"></td></tr>';
|
||||
print '<tr><td>Date de naissance<BR>Format AAAA-MM-JJ</td><td><input type="text" name="naiss" size="40" value="'.$naiss.'"></td></tr>';
|
||||
print '<tr><td><FONT COLOR="blue">*</FONT> URL Photo</td><td><input type="text" name="photo" size="40" value="'.$photo.'"></td></tr>';
|
||||
print '<tr><td>Profil public ?</td><td><input type="checkbox" name="public" checked></td></tr>';
|
||||
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" value="Enregistrer"></td></tr>';
|
||||
print "</form>\n";
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
@@ -1,63 +0,0 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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("../../main.inc.php3");
|
||||
|
||||
function llxHeader($head = "") {
|
||||
global $user, $conf;
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
top_menu($head);
|
||||
|
||||
$menu = new Menu();
|
||||
|
||||
$menu->add("new.php","Nouvel adherent");
|
||||
/*
|
||||
$menu->add_submenu("liste.php?statut=1","Adh<64>rents <20> ce jour");
|
||||
$menu->add_submenu("liste.php?statut=-1","Adh<64>sions <20> valider");
|
||||
|
||||
$menu->add_submenu("liste.php?statut=0","Adh<64>sions r<>sili<6C>es");
|
||||
|
||||
if ($user->admin)
|
||||
{
|
||||
$menu->add("fiche.php?action=create","Nouvel adh<64>rent");
|
||||
}
|
||||
|
||||
|
||||
|
||||
$menu->add("cotisations.php","Cotisations");
|
||||
|
||||
if ($user->admin)
|
||||
{
|
||||
$menu->add("type.php","Configuration");
|
||||
}
|
||||
left_menu($menu->liste);
|
||||
*/
|
||||
// remplacement de la barre de gauche
|
||||
print '</td><td valign="top" width="85%" colspan="6">';
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user