rajout de champs optionnels dans les fiches adherents + interface de gestion de ces champs optionnels
This commit is contained in:
parent
ba43c55823
commit
48339b1007
@ -33,6 +33,11 @@ class AdherentOptions
|
||||
* ces champs
|
||||
*/
|
||||
var $attribute_name;
|
||||
/*
|
||||
* Tableau contenant le nom des champs en clef et le label de ces
|
||||
* champs en value
|
||||
*/
|
||||
var $attribute_label;
|
||||
|
||||
var $errorstr;
|
||||
/*
|
||||
@ -45,6 +50,7 @@ class AdherentOptions
|
||||
$this->id = $id;
|
||||
$this->errorstr = array();
|
||||
$this->attribute_name = array();
|
||||
$this->attribute_label = array();
|
||||
}
|
||||
/*
|
||||
* Print error_list
|
||||
@ -110,19 +116,45 @@ class AdherentOptions
|
||||
/*
|
||||
* Insertion dans la base
|
||||
*/
|
||||
$sql = "ALTER TABLE llx_adherent_options ";
|
||||
$sql .= " ADD $attrname $type($length)";
|
||||
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
||||
$sql = "ALTER TABLE llx_adherent_options ";
|
||||
$sql .= " ADD $attrname $type($length)";
|
||||
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
print "<h2><br>$sql<br></h2>";
|
||||
return 0;
|
||||
}
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
print "<h2><br>$sql<br></h2>";
|
||||
return 0;
|
||||
}
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Function create_label($attrname,$label='') {
|
||||
/*
|
||||
* Insertion dans la base
|
||||
*/
|
||||
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
||||
$sql = "INSERT INTO llx_adherent_options_label SET ";
|
||||
$escaped_label=mysql_escape_string($label);
|
||||
$sql .= " name='$attrname',label='$escaped_label' ";
|
||||
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
print "<h2><br>$sql<br></h2>";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -130,20 +162,48 @@ class AdherentOptions
|
||||
*
|
||||
*/
|
||||
Function delete($attrname)
|
||||
|
||||
{
|
||||
$sql = "ALTER TABLE llx_adherent_options DROP COLUMN $attrname";
|
||||
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
||||
$sql = "ALTER TABLE llx_adherent_options DROP COLUMN $attrname";
|
||||
|
||||
if ( $this->db->query( $sql) )
|
||||
{
|
||||
return $this->delete_label($attrname);
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Err : ".$this->db->error();
|
||||
print "<h2><br>$sql<br></h2>";
|
||||
return 0;
|
||||
}
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( $this->db->query( $sql) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Err : ".$this->db->error();
|
||||
print "<h2><br>$sql<br></h2>";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Suppression d'un label
|
||||
*
|
||||
*/
|
||||
Function delete_label($attrname)
|
||||
{
|
||||
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
||||
$sql = "DELETE FROM llx_adherent_options_label WHERE name='$attrname'";
|
||||
|
||||
if ( $this->db->query( $sql) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Err : ".$this->db->error();
|
||||
print "<h2><br>$sql<br></h2>";
|
||||
return 0;
|
||||
}
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -152,23 +212,61 @@ class AdherentOptions
|
||||
*
|
||||
*/
|
||||
Function update($attrname,$type='varchar',$length=255)
|
||||
|
||||
{
|
||||
$sql = "ALTER TABLE llx_adherent_options MODIFY COLUMN $attrname $type($length)";
|
||||
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
||||
$sql = "ALTER TABLE llx_adherent_options MODIFY COLUMN $attrname $type($length)";
|
||||
|
||||
if ( $this->db->query( $sql) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Err : ".$this->db->error();
|
||||
print "<h2><br>$sql<br></h2>";
|
||||
return 0;
|
||||
}
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( $this->db->query( $sql) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Err : ".$this->db->error();
|
||||
print "<h2><br>$sql<br></h2>";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Modification d'un label
|
||||
*
|
||||
*/
|
||||
Function update_label($attrname,$label='')
|
||||
{
|
||||
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
||||
$escaped_label=mysql_escape_string($label);
|
||||
$sql = "REPLACE INTO llx_adherent_options_label SET name='$attrname',label='$escaped_label'";
|
||||
|
||||
if ( $this->db->query( $sql) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Err : ".$this->db->error();
|
||||
print "<h2><br>$sql<br></h2>";
|
||||
return 0;
|
||||
}
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* fetch optional attribute name and optional attribute label
|
||||
*/
|
||||
Function fetch_optionals()
|
||||
{
|
||||
$this->fetch_name_optionals();
|
||||
$this->fetch_name_optionals_label();
|
||||
}
|
||||
|
||||
/*
|
||||
* fetch optional attribute name
|
||||
*/
|
||||
@ -200,5 +298,34 @@ class AdherentOptions
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* fetch optional attribute name and its label
|
||||
*/
|
||||
Function fetch_name_optionals_label()
|
||||
{
|
||||
$array_name_label=array();
|
||||
$sql = "SELECT name,label FROM llx_adherent_options_label";
|
||||
|
||||
if ( $this->db->query( $sql) )
|
||||
{
|
||||
if ($this->db->num_rows())
|
||||
{
|
||||
while ($tab = $this->db->fetch_object())
|
||||
{
|
||||
// we can add this attribute to adherent object
|
||||
$array_name_label[$tab->name]=stripslashes($tab->label);
|
||||
$this->attribute_label[$tab->name]=stripslashes($tab->label);
|
||||
}
|
||||
return $array_name_label;
|
||||
}else{
|
||||
return array();
|
||||
}
|
||||
}else{
|
||||
print $this->db->error();
|
||||
return array() ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -19,12 +19,13 @@
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
require("./pre.inc.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherents/pre.inc.php");
|
||||
require("../adherent.class.php");
|
||||
require("../adherent_type.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherents/adherent_options.class.php");
|
||||
|
||||
$db = new Db();
|
||||
$adho = new AdherentOptions($db);
|
||||
|
||||
/*
|
||||
* Enregistrer les modifs
|
||||
@ -92,7 +93,10 @@ if ($rowid)
|
||||
$adh = new Adherent($db);
|
||||
$adh->id = $rowid;
|
||||
$adh->fetch($rowid);
|
||||
// fetch optionals value
|
||||
$adh->fetch_optionals($rowid);
|
||||
// fetch optionals attributes and labels
|
||||
$adho->fetch_optionals();
|
||||
|
||||
$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";
|
||||
@ -135,9 +139,9 @@ if ($rowid)
|
||||
print '<tr><td>Password</td><td class="valeur">'.$adh->pass.' </td></tr>';
|
||||
print '<tr><td>Date de naissance<BR>Format AAAA-MM-JJ</td><td class="valeur">'.$adh->naiss.' </td></tr>';
|
||||
print '<tr><td>URL Photo</td><td class="valeur">'.$adh->photo.' </td></tr>';
|
||||
$myattr=$adh->fetch_name_optionals();
|
||||
foreach($myattr as $key){
|
||||
print "<tr><td>$key</td><td>".$adh->array_options["options_$key"]." </td></tr>\n";
|
||||
// $adho->fetch_optionals();
|
||||
foreach($adho->attribute_label as $key=>$value){
|
||||
print "<tr><td>$value</td><td>".$adh->array_options["options_$key"]." </td></tr>\n";
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
@ -186,8 +190,10 @@ if ($rowid)
|
||||
print '<tr><td>Password</td><td><input type="text" name="pass" size="40" value="'.$adh->pass.'"></td></tr>';
|
||||
print '<tr><td>Date de naissance<BR>Format AAAA-MM-JJ</td><td><input type="text" name="naiss" size="40" value="'.$adh->naiss.'"></td></tr>';
|
||||
print '<tr><td>URL photo</td><td><input type="text" name="photo" size="40" value="'.$adh->photo.'"></td></tr>';
|
||||
foreach($myattr as $key){
|
||||
print "<tr><td>$key</td><td><input type=\"text\" name=\"options_$key\" size=\"40\" value=\"".$adh->array_options["options_$key"]."\"></td></tr>\n";
|
||||
// $myattr=$adho->fetch_name_optionals();
|
||||
foreach($adho->attribute_label as $key=>$value){
|
||||
// foreach($myattr as $key){
|
||||
print "<tr><td>$value</td><td><input type=\"text\" name=\"options_$key\" size=\"40\" value=\"".$adh->array_options["options_$key"]."\"></td></tr>\n";
|
||||
}
|
||||
print '<tr><td colspan="2" align="center">';
|
||||
print '<input type="submit" name="bouton" value="Enregistrer"> ';
|
||||
|
||||
@ -20,15 +20,16 @@
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
require("./pre.inc.php");
|
||||
require("../adherent.class.php");
|
||||
require("../adherent_type.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherents/pre.inc.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherent.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherent_type.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherents/adherent_options.class.php");
|
||||
require("../cotisation.class.php");
|
||||
require("../paiement.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/cotisation.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/paiement.class.php");
|
||||
|
||||
|
||||
$db = new Db();
|
||||
$adho = new AdherentOptions($db);
|
||||
|
||||
if ($HTTP_POST_VARS["action"] == 'cotisation')
|
||||
{
|
||||
@ -91,7 +92,7 @@ if ($HTTP_POST_VARS["action"] == 'confirm_valid' && $HTTP_POST_VARS["confirm"] =
|
||||
$adh = new Adherent($db, $rowid);
|
||||
$adh->validate($user->id);
|
||||
$adh->fetch($rowid);
|
||||
$mesg=preg_replace("/%INFO%/","Prenom : $adh->prenom\nNom : $adh->nom\nSociete = $adh->societe\nAdresse = $adh->adresse\nCode Postal : $adh->cp\nVille : $adh->ville\nPays : $adh->pays\nEmail : $adh->email\nLogin : $adh->login\nPassword : $adh->pass\nNote : $adh->note",$conf->adherent->email_valid);
|
||||
$mesg=preg_replace("/%INFO%/","Prenom : $adh->prenom\nNom : $adh->nom\nSociete = $adh->societe\nAdresse = $adh->adresse\nCode Postal : $adh->cp\nVille : $adh->ville\nPays : $adh->pays\nEmail : $adh->email\nLogin : $adh->login\nPassword : $adh->pass\nNote : $adh->note\n\nServeur : http://$SERVER_NAME/public/adherents/",$conf->adherent->email_valid);
|
||||
mail($adh->email,"Vos coordonnees sur http://$SERVER_NAME/",$mesg);
|
||||
}
|
||||
|
||||
@ -100,7 +101,7 @@ if ($HTTP_POST_VARS["action"] == 'confirm_resign' && $HTTP_POST_VARS["confirm"]
|
||||
$adh = new Adherent($db, $rowid);
|
||||
$adh->resiliate($user->id);
|
||||
$adh->fetch($rowid);
|
||||
$mesg=preg_replace("/%INFO%/","Prenom : $adh->prenom\nNom : $adh->nom\nSociete = $adh->societe\nAdresse = $adh->adresse\nCode Postal : $adh->cp\nVille : $adh->ville\nPays : $adh->pays\nEmail : $adh->email\nLogin : $adh->login\nPassword : $adh->pass\nNote : $adh->note",$conf->adherent->email_resil);
|
||||
$mesg=preg_replace("/%INFO%/","Prenom : $adh->prenom\nNom : $adh->nom\nSociete = $adh->societe\nAdresse = $adh->adresse\nCode Postal : $adh->cp\nVille : $adh->ville\nPays : $adh->pays\nEmail : $adh->email\nLogin : $adh->login\nPassword : $adh->pass\nNote : $adh->note\n\nServeur : http://$SERVER_NAME/public/adherents/",$conf->adherent->email_resil);
|
||||
mail($adh->email,"Vos coordonnees sur http://$SERVER_NAME/",$mesg);
|
||||
}
|
||||
|
||||
@ -113,7 +114,8 @@ llxHeader();
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$adho->fetch_optionals();
|
||||
if ($action == 'create') {
|
||||
|
||||
$sql = "SELECT s.nom,s.idp, f.amount, f.total, f.facnumber";
|
||||
@ -129,8 +131,9 @@ if ($action == 'create') {
|
||||
$total = $obj->total;
|
||||
}
|
||||
}
|
||||
$adho = new AdherentOptions($db);
|
||||
$myattr=$adho->fetch_name_optionals();
|
||||
// $adho = new AdherentOptions($db);
|
||||
|
||||
//$myattr=$adho->fetch_name_optionals();
|
||||
|
||||
print_titre("Nouvel adhérent");
|
||||
print "<form action=\"$PHP_SELF\" method=\"post\">\n";
|
||||
@ -173,8 +176,8 @@ if ($action == 'create') {
|
||||
print '<tr><td>Password</td><td><input type="text" name="pass" size="40"></td></tr>';
|
||||
print '<tr><td>Date de Naissance<BR>Format AAAA-MM-JJ</td><td><input type="text" name="naiss" size="10"></td></tr>';
|
||||
print '<tr><td>Url photo</td><td><input type="text" name="photo" size="40"></td></tr>';
|
||||
foreach($myattr as $key){
|
||||
print "<tr><td>$key</td><td><input type=\"text\" name=\"options_$key\" size=\"40\"></td></tr>\n";
|
||||
foreach($adho->attribute_label as $key=>$value){
|
||||
print "<tr><td>$value</td><td><input type=\"text\" name=\"options_$key\" size=\"40\"></td></tr>\n";
|
||||
}
|
||||
|
||||
print "<tr><td>Date de cotisation</td><td>\n";
|
||||
@ -208,7 +211,7 @@ if ($rowid > 0)
|
||||
$adh->id = $rowid;
|
||||
$adh->fetch($rowid);
|
||||
$adh->fetch_optionals($rowid);
|
||||
$myattr=$adh->fetch_name_optionals();
|
||||
//$myattr=$adh->fetch_name_optionals();
|
||||
|
||||
print_titre("Edition de la fiche adhérent");
|
||||
|
||||
@ -327,8 +330,8 @@ if ($rowid > 0)
|
||||
|
||||
// print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
// print '<tr><td colspan="2">Champs optionnels</td></tr>';
|
||||
foreach($myattr as $key){
|
||||
print "<tr><td>$key</td><td>".$adh->array_options["options_$key"]." </td></tr>\n";
|
||||
foreach($adho->attribute_label as $key=>$value){
|
||||
print "<tr><td>$value</td><td>".$adh->array_options["options_$key"]." </td></tr>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
require("./pre.inc.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherents/pre.inc.php");
|
||||
//require("../adherent.class.php");
|
||||
//require("../adherent_type.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherents/adherent_options.class.php");
|
||||
@ -33,49 +33,39 @@ $adho = new AdherentOptions($db);
|
||||
|
||||
if ($HTTP_POST_VARS["action"] == 'add' && $user->admin)
|
||||
{
|
||||
|
||||
//$adho->libelle = $HTTP_POST_VARS["attrname"];
|
||||
//$adho->cotisation = $HTTP_POST_VARS["cotisation"];
|
||||
//$adho->commentaire = $HTTP_POST_VARS["comment"];
|
||||
if (preg_match("/^\w[a-zA-Z0-9-]*$/",$_POST['attrname'])){
|
||||
// type et taille non encore pris en compte => varchar(255)
|
||||
if (isset($_POST["attrname"]) && preg_match("/^\w[a-zA-Z0-9-]*$/",$_POST['attrname'])){
|
||||
$adho->create($_POST['attrname']);
|
||||
}
|
||||
if (isset($_POST['label'])){
|
||||
$adho->create_label($_POST['attrname'],$_POST['label']);
|
||||
}
|
||||
Header("Location: $PHP_SELF");
|
||||
}
|
||||
|
||||
if ($HTTP_POST_VARS["action"] == 'update' && $user->admin)
|
||||
{
|
||||
|
||||
// $adho->libelle = $HTTP_POST_VARS["libelle"];
|
||||
// $adho->cotisation = $HTTP_POST_VARS["cotisation"];
|
||||
// $adho->commentaire = $HTTP_POST_VARS["comment"];
|
||||
|
||||
// if ($adho->update($user->id) )
|
||||
//if ($adho->update($user->id) )
|
||||
// {
|
||||
// }
|
||||
if (isset($_POST['label'])){
|
||||
$adho->update_label($_POST['attrname'],$_POST['label']);
|
||||
}
|
||||
Header("Location: $PHP_SELF");
|
||||
|
||||
}
|
||||
|
||||
if ($_POST["action"] == 'delete' && $user->admin)
|
||||
if ($action == 'delete' && $user->admin)
|
||||
{
|
||||
if(isset($_POST["attrname"])){
|
||||
$adho->delete($_POST["attrname"]);
|
||||
if(isset($attrname) && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
||||
$adho->delete($attrname);
|
||||
}
|
||||
Header("Location: $PHP_SELF");
|
||||
}
|
||||
if ($action == 'commentaire')
|
||||
{
|
||||
$don = new Don($db);
|
||||
$don->set_commentaire($rowid,$HTTP_POST_VARS["commentaire"]);
|
||||
$action = "edit";
|
||||
}
|
||||
|
||||
|
||||
|
||||
llxHeader();
|
||||
|
||||
print_titre("Champs optionnels");
|
||||
print_titre("Configuration des champs optionnels");
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
@ -84,7 +74,7 @@ print_titre("Champs optionnels");
|
||||
/* ************************************************************************** */
|
||||
|
||||
$array_options=$adho->fetch_name_optionals();
|
||||
|
||||
$array_label=$adho->fetch_name_optionals_label();
|
||||
if (sizeof($array_options)>0)
|
||||
{
|
||||
print "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
@ -92,7 +82,7 @@ if (sizeof($array_options)>0)
|
||||
print '<TR class="liste_titre">';
|
||||
print "<td>Libelle</td>";
|
||||
print "<td>Nom de l'attribut</td>";
|
||||
print "<td>type</td><td> </td>";
|
||||
print "<td>type</td><td> </td><td> </td>";
|
||||
print "</TR>\n";
|
||||
|
||||
$var=True;
|
||||
@ -100,10 +90,11 @@ if (sizeof($array_options)>0)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print "<TD> </td>\n";
|
||||
print "<TD>".$adho->attribute_label[$key]." </td>\n";
|
||||
print "<TD>$key</td>\n";
|
||||
print "<TD>$value</TD>\n";
|
||||
print "<TD><a href=\"$PHP_SELF?action=edit&attrname=$key\">Editer</TD>\n";
|
||||
print "<TD><a href=\"$PHP_SELF?action=delete&attrname=$key\">Supprimer</TD>\n";
|
||||
print "</tr>";
|
||||
// $i++;
|
||||
}
|
||||
@ -140,7 +131,7 @@ print "</tr></table></form><p>";
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Création d'une fiche don */
|
||||
/* Création d'un champ optionnel */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -153,10 +144,10 @@ if ($action == 'create') {
|
||||
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
print '<tr><td>Libellé</td><td><input type="text" name="libelle" size="40"></td></tr>';
|
||||
print '<tr><td>Libellé</td><td><input type="text" name="label" size="40"></td></tr>';
|
||||
print '<tr><td>Nom de l\'attribut (pas d\'espace et uniquement des carateres alphanumeriques)</td><td><input type="text" name="attrname" size="40"></td></tr>';
|
||||
|
||||
print '<tr><td>Type</td><td>';
|
||||
print '<tr><td>Type (non pris en compte)</td><td>';
|
||||
|
||||
print '<select name="type">';
|
||||
print '<option value="varchar">chaine</option>';
|
||||
@ -176,7 +167,7 @@ if ($action == 'create') {
|
||||
}
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition de la fiche */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if (isset($attrname) && $attrname != '' && $action == 'edit')
|
||||
@ -186,7 +177,7 @@ if (isset($attrname) && $attrname != '' && $action == 'edit')
|
||||
print "<form action=\"$PHP_SELF\" method=\"post\">";
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
|
||||
print '<tr><td>Libellé</td><td class="valeur"> </td></tr>';
|
||||
print '<tr><td>Libellé</td><td class="valeur">'.$adho->attribute_label[$attrname].' </td></tr>';
|
||||
print '<tr><td>Nom de l\'attribut</td><td class="valeur">'.$attrname.' </td></tr>';
|
||||
print '<tr><td>Type</td><td class="valeur">'.$adho->attribute_name[$attrname].' </td></tr>';
|
||||
|
||||
@ -194,18 +185,16 @@ if (isset($attrname) && $attrname != '' && $action == 'edit')
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
* formulaire d'edition
|
||||
*/
|
||||
print '<form method="post" action="'.$PHP_SELF.'?attrname='.$attrname.'">';
|
||||
print '<input type="hidden" name="attrname" value="'.$attrname.'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
|
||||
print '<tr><td>Libellé</td><td class="valeur"><input type="text" name="libelle" size="40" value=" "></td></tr>';
|
||||
print '<tr><td>Libellé</td><td class="valeur"><input type="text" name="label" size="40" value="'.$adho->attribute_label[$attrname].'"></td></tr>';
|
||||
print '<tr><td>Nom de l\'attribut</td><td class="valeur">'.$attrname.' </td></tr>';
|
||||
print '<tr><td>Type</td><td class="valeur"><input type="text" name="type" size="40" value="'.$adho->attribute_name[$attrname].'"></td></tr>';
|
||||
print '<tr><td>Type (non pris en compte)</td><td class="valeur"><input type="text" name="type" size="40" value="'.$adho->attribute_name[$attrname].'"></td></tr>';
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" value="Enregistrer"</td></tr>';
|
||||
print '</table>';
|
||||
print "</form>";
|
||||
|
||||
@ -20,13 +20,15 @@
|
||||
*
|
||||
*/
|
||||
require("./pre.inc.php");
|
||||
require("../../adherent.class.php");
|
||||
require("../../adherent_type.class.php");
|
||||
require("../../cotisation.class.php");
|
||||
require("../../paiement.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherent.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherent_type.class.php");
|
||||
//require($GLOBALS["DOCUMENT_ROOT"]."/cotisation.class.php");
|
||||
//require($GLOBALS["DOCUMENT_ROOT"]."/paiement.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherents/adherent_options.class.php");
|
||||
|
||||
|
||||
$db = new Db();
|
||||
$adho = new AdherentOptions($db);
|
||||
$errmsg='';
|
||||
$num=0;
|
||||
$error=0;
|
||||
@ -88,6 +90,11 @@ if ($HTTP_POST_VARS["action"] == 'add')
|
||||
$adh->commentaire = $HTTP_POST_VARS["comment"];
|
||||
$adh->morphy = $HTTP_POST_VARS["morphy"];
|
||||
|
||||
foreach($_POST as $key => $value){
|
||||
if (ereg("^options_",$key)){
|
||||
$adh->array_options[$key]=$_POST[$key];
|
||||
}
|
||||
}
|
||||
if ($adh->create($user->id) )
|
||||
{
|
||||
if ($cotisation > 0)
|
||||
@ -95,7 +102,7 @@ if ($HTTP_POST_VARS["action"] == 'add')
|
||||
$adh->cotisation(mktime(12, 0 , 0, $remonth, $reday, $reyear), $cotisation);
|
||||
}
|
||||
// Envoi d'un Email de confirmation au nouvel adherent
|
||||
$mesg=preg_replace("/%INFO%/","Prenom : $prenom\nNom : $nom\nSociete = $societe\nAdresse = $adresse\nCode Postal : $cp\nVille : $ville\nPays : $pays\nEmail : $email\nLogin : $login\nPassword : $pass\nNote : $note",$conf->adherent->email_new);
|
||||
$mesg=preg_replace("/%INFO%/","Prenom : $prenom\nNom : $nom\nSociete = $societe\nAdresse = $adresse\nCode Postal : $cp\nVille : $ville\nPays : $pays\nEmail : $email\nLogin : $login\nPassword : $pass1\nNote : $note\n\nServeur : http://$SERVER_NAME/public/adherents/",$conf->adherent->email_new);
|
||||
//$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");
|
||||
@ -112,6 +119,8 @@ llxHeader();
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$adho->fetch_optionals();
|
||||
|
||||
if (isset($action) && $action== 'added'){
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
@ -170,7 +179,9 @@ print '<tr><td><FONT COLOR="red">*</FONT> Password (a entrer 2 fois)</td><td><in
|
||||
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>';
|
||||
|
||||
foreach($adho->attribute_label as $key=>$value){
|
||||
print "<tr><td>$value</td><td><input type=\"text\" name=\"options_$key\" size=\"40\"></td></tr>\n";
|
||||
}
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" value="Enregistrer"></td></tr>';
|
||||
print "</form>\n";
|
||||
print "</table>\n";
|
||||
|
||||
@ -20,10 +20,13 @@
|
||||
*
|
||||
*/
|
||||
require("./pre.inc.php");
|
||||
require("../../adherent.class.php");
|
||||
require("../../adherent_type.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherent.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherent_type.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherents/adherent_options.class.php");
|
||||
|
||||
$db = new Db();
|
||||
$adho = new AdherentOptions($db);
|
||||
|
||||
$errmsg='';
|
||||
$num=0;
|
||||
$error=0;
|
||||
@ -99,10 +102,14 @@ if ($action == 'update')
|
||||
$public=0;
|
||||
}
|
||||
$adh->public = $public;
|
||||
|
||||
foreach($_POST as $key => $value){
|
||||
if (ereg("^options_",$key)){
|
||||
$adh->array_options[$key]=$_POST[$key];
|
||||
}
|
||||
}
|
||||
if ($adh->update($user->id) )
|
||||
{
|
||||
$mesg=preg_replace("/%INFO%/","Prenom : $prenom\nNom : $nom\nSociete = $societe\nAdresse = $adresse\nCode Postal : $cp\nVille : $ville\nPays : $pays\nEmail : $email\nLogin : $login\nPassword : $pass\nNote : $note",$conf->adherent->email_edit);
|
||||
$mesg=preg_replace("/%INFO%/","Prenom : $prenom\nNom : $nom\nSociete = $societe\nAdresse = $adresse\nCode Postal : $cp\nVille : $ville\nPays : $pays\nEmail : $email\nLogin : $login\nPassword : $pass\nNote : $note\n\nServeur : http://$SERVER_NAME/public/adherents/",$conf->adherent->email_edit);
|
||||
mail($email,"Vos coordonnees sur http://$SERVER_NAME/",$mesg);
|
||||
|
||||
//Header("Location: fiche.php?rowid=$adh->id&action=edit");
|
||||
@ -129,6 +136,9 @@ if (isset($_SERVER["REMOTE_USER"])){
|
||||
$adh = new Adherent($db);
|
||||
$adh->login = $_SERVER["REMOTE_USER"];
|
||||
$adh->fetch_login($_SERVER["REMOTE_USER"]);
|
||||
$adh->fetch_optionals($adh->id);
|
||||
// fetch optionals attibutes
|
||||
$adho->fetch_optionals();
|
||||
|
||||
$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";
|
||||
@ -184,6 +194,10 @@ if (isset($_SERVER["REMOTE_USER"])){
|
||||
}else{
|
||||
print '<tr><td>Profil public ?</td><td> Non </td></tr>';
|
||||
}
|
||||
foreach($adho->attribute_label as $key=>$value){
|
||||
print "<tr><td>$value</td><td>".$adh->array_options["options_$key"]." </td></tr>\n";
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
print "<hr>";
|
||||
@ -235,6 +249,9 @@ if (isset($_SERVER["REMOTE_USER"])){
|
||||
}else{
|
||||
print '<tr><td>Profil public ?</td><td><input type="checkbox" name="public"></td></tr>';
|
||||
}
|
||||
foreach($adho->attribute_label as $key=>$value){
|
||||
print "<tr><td>$value</td><td><input type=\"text\" name=\"options_$key\" size=\"40\" value=\"".$adh->array_options["options_$key"]."\"></td></tr>\n";
|
||||
}
|
||||
print '<tr><td colspan="2" align="center">';
|
||||
print '<input type="submit" name="bouton" value="Enregistrer"> ';
|
||||
print '<input type="submit" value="Annuler">';
|
||||
|
||||
@ -21,14 +21,15 @@
|
||||
*
|
||||
*/
|
||||
require("./pre.inc.php");
|
||||
require("../../adherent.class.php");
|
||||
require("../../adherent_type.class.php");
|
||||
require("../../cotisation.class.php");
|
||||
require("../../paiement.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherent.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherent_type.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/cotisation.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/paiement.class.php");
|
||||
require($GLOBALS["DOCUMENT_ROOT"]."/adherents/adherent_options.class.php");
|
||||
|
||||
|
||||
$db = new Db();
|
||||
|
||||
$adho = new AdherentOptions($db);
|
||||
|
||||
llxHeader();
|
||||
|
||||
@ -36,13 +37,16 @@ llxHeader();
|
||||
/* */
|
||||
/* Edition de la fiche */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
/*************************************************************************** */
|
||||
// fetch optionals attributes and labels
|
||||
$adho->fetch_optionals();
|
||||
if ($rowid > 0)
|
||||
{
|
||||
|
||||
$adh = new Adherent($db);
|
||||
$adh->id = $rowid;
|
||||
$adh->fetch($rowid);
|
||||
$adh->fetch_optionals($rowid);
|
||||
|
||||
print_titre("Fiche adhérent de $adh->prenom $adh->nom");
|
||||
|
||||
@ -70,6 +74,9 @@ if ($rowid > 0)
|
||||
if (isset($adh->photo) && $adh->photo !=''){
|
||||
print '<tr><td>URL Photo</td><td class="valeur">'."<A HREF=\"$adh->photo\"><IMG SRC=\"$adh->photo\"></A>".' </td></tr>';
|
||||
}
|
||||
// foreach($adho->attribute_label as $key=>$value){
|
||||
// print "<tr><td>$value</td><td>".$adh->array_options["options_$key"]." </td></tr>\n";
|
||||
// }
|
||||
print '</table>';
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user