| Line 14... |
Line 14... |
| 14 |
// | annuaire_COTISATION |
|
14 |
// | annuaire_COTISATION |
|
| 15 |
// +--------------------------------------------------------------------------------+
|
15 |
// +--------------------------------------------------------------------------------+
|
| 16 |
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> |
|
16 |
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> |
|
| 17 |
// +--------------------------------------------------------------------------------+
|
17 |
// +--------------------------------------------------------------------------------+
|
| 18 |
//
|
18 |
//
|
| 19 |
// $Id: edition_fiche.php,v 1.5 2007-04-11 08:30:12 neiluj Exp $
|
19 |
// $Id: edition_fiche.php,v 1.6 2007-11-08 09:28:18 alexandre_tb Exp $
|
| Line 20... |
Line 20... |
| 20 |
|
20 |
|
| Line 21... |
Line 21... |
| 21 |
|
21 |
|
| Line 22... |
Line 22... |
| 22 |
define ("URL_RECU", $GLOBALS['ins_url']->protocol. '://'.$GLOBALS['ins_url']->host."/client/annuaire/voir_recu_pdf.php") ;
|
22 |
define ("URL_RECU", $GLOBALS['ins_url']->protocol. '://'.$GLOBALS['ins_url']->host."/client/annuaire/voir_recu_pdf.php") ;
|
| 23 |
|
23 |
|
| Line 24... |
Line 24... |
| 24 |
include_once ("HTML/Table.php") ;
|
24 |
include_once ("HTML/Table.php") ;
|
| 25 |
|
- |
|
| 26 |
// admin_annu est une application cliente de gsite elle commence donc
|
- |
|
| 27 |
// dans une fonction putFrame()
|
- |
|
| 28 |
|
- |
|
| 29 |
|
- |
|
| 30 |
function putFrame()
|
- |
|
| 31 |
{
|
25 |
|
| 32 |
|
26 |
// admin_annu est une application cliente de gsite elle commence donc
|
| 33 |
$url = $GLOBALS['ins_url']->getURL() ;
|
27 |
// dans une fonction putFrame()
|
| Line 34... |
Line 28... |
| 34 |
|
28 |
|
| 35 |
// mise à jour si il y lieu
|
29 |
|
| 36 |
|
- |
|
| 37 |
if (isset ($_REQUEST['action']) && $_REQUEST['action'] == 'up') {
|
- |
|
| 38 |
upSQL() ;
|
- |
|
| 39 |
}
|
- |
|
| 40 |
|
- |
|
| 41 |
// Requete de pour récupérer toutes les infos d'un usager
|
- |
|
| 42 |
|
- |
|
| 43 |
$query = 'select '.INS_ANNUAIRE.'.* ,'.INS_TABLE_PAYS.'.'.INS_CHAMPS_LABEL_PAYS ;
|
- |
|
| 44 |
$query .= ' from '.INS_ANNUAIRE.','.INS_TABLE_PAYS.','.INS_TABLE_DPT ;
|
- |
|
| 45 |
$query .= ' where '.INS_CHAMPS_ID.'='.$_REQUEST[INS_CHAMPS_ID] ;
|
- |
|
| 46 |
$query .= ' and '.INS_ANNUAIRE.'.'.INS_CHAMPS_PAYS.'='.INS_TABLE_PAYS.'.'.INS_CHAMPS_ID_PAYS ;
|
- |
|
| 47 |
|
- |
|
| 48 |
$result = $GLOBALS['ins_db']->query($query) ;
|
- |
|
| 49 |
if (DB::isError($result)) {
|
- |
|
| 50 |
echo $result->getMessage().'<br />'.$query ;
|
- |
|
| 51 |
}
|
- |
|
| 52 |
|
- |
|
| 53 |
$row = $result->fetchRow(DB_FETCHMODE_ASSOC) ;
|
- |
|
| 54 |
|
- |
|
| 55 |
$res = '<h1>Edition d\'un adhérent : '.$row[INS_CHAMPS_NOM].' '.$row[INS_CHAMPS_PRENOM].'</h1>'."\n" ;
|
- |
|
| 56 |
$res .= "<div>".form("Nom : ", INS_CHAMPS_NOM, $row[INS_CHAMPS_NOM])."</div>\n" ;
|
- |
|
| 57 |
$res .= "<div>".form("Prénom : ", INS_CHAMPS_PRENOM, $row[INS_CHAMPS_PRENOM])."</div>\n" ;
|
- |
|
| 58 |
$res .= "<div>".form("Adresse mail : ", INS_CHAMPS_MAIL, $row[INS_CHAMPS_MAIL])."</div>\n" ;
|
- |
|
| 59 |
$res .= "<div>".form("Date d'inscription : ", INS_CHAMPS_DATE, $row[INS_CHAMPS_DATE])."</div>\n" ;
|
- |
|
| 60 |
$res .= "<div>".form("Adresse 1 : ", INS_CHAMPS_ADRESSE_1, $row[INS_CHAMPS_ADRESSE_1])."</div>\n" ;
|
- |
|
| 61 |
$res .= "<div>".form("Adresse 2 : ", INS_CHAMPS_ADRESSE_2, $row[INS_CHAMPS_ADRESSE_2])."</div>\n" ;
|
30 |
function putFrame() {
|
| 62 |
$res .= "<div>".form("Région : ", "a_region", $row['a_region'])."</div>\n" ;
|
31 |
if (isset($_REQUEST[INS_CHAMPS_ID]) && !isset($_REQUEST['action'])) {
|
| 63 |
$res .= "<div>".form("Code postal : ", INS_CHAMPS_CODE_POSTAL, $row[INS_CHAMPS_CODE_POSTAL])."</div>\n" ;
|
- |
|
| - |
|
32 |
$_REQUEST['action'] = 'modifier';
|
| 64 |
$res .= "<div>".form("Ville : ", INS_CHAMPS_VILLE, $row[INS_CHAMPS_VILLE])."</div>\n" ;
|
33 |
}
|
| 65 |
$res .= "<div>".form("Pays : ", INS_CHAMPS_PAYS, $row[INS_CHAMPS_PAYS])."</div>\n" ;
|
34 |
|
| 66 |
$res .= "<div>".form("Site web personnel : ", INS_CHAMPS_SITE_INTERNET, $row[INS_CHAMPS_SITE_INTERNET])."</div>\n" ;
|
35 |
$res = '<h1>Edition d\'un adhérent : </h1>'."\n" ;
|
| 67 |
$res .= suppression($row[INS_CHAMPS_ID]) ;
|
36 |
|
| 68 |
$formulaire = new HTML_formulaireInscription('formulaire_inscription', 'post',
|
37 |
$formulaire = new HTML_formulaireInscription('formulaire_inscription', 'post',
|
| 69 |
preg_replace('/&/', '&', $GLOBALS['ins_url']->getURL()), '_self', '', 0) ;
|
38 |
preg_replace('/&/', '&', $GLOBALS['ins_url']->getURL()), '_self', '', 0) ;
|
| 70 |
|
- |
|
| 71 |
$formulaire->construitFormulaire(preg_replace('/&/', '&', $GLOBALS['ins_url']->getURL()));
|
39 |
$formulaire->addElement('hidden', 'id_inscription', $GLOBALS['ins_config']['ic_id_inscription']) ;
|
| 72 |
if (isset($_REQUEST['form_structure'])) {
|
40 |
$formulaire->construitFormulaire(preg_replace('/&/', '&', $GLOBALS['ins_url']->getURL()), $_REQUEST[INS_CHAMPS_ID]);
|
| 73 |
if ($_REQUEST['form_structure']==1) {
|
41 |
if (isset($_REQUEST['form_structure'])) {
|
| 74 |
$formulaire->formulaireStructure() ;
|
42 |
if ($_REQUEST['form_structure']==1) {
|
| 75 |
}
|
43 |
$formulaire->formulaireStructure() ;
|
| Line 76... |
Line 44... |
| 76 |
}
|
44 |
}
|
| - |
|
45 |
}
|
| 77 |
|
46 |
//pour la modification d'une inscription, on charge les valeurs par défauts
|
| 78 |
//pour la modification d'une inscription, on charge les valeurs par défauts
|
47 |
if (isset ($_REQUEST[INS_CHAMPS_ID]) == 'modifier') {
|
| - |
|
48 |
$formulaire->addElement('hidden', 'action', 'modifier_v') ;
|
| 79 |
if (isset ($_REQUEST[INS_CHAMPS_ID]) == 'modifier') {
|
49 |
$formulaire->setDefaults(formulaire_defaults($_REQUEST[INS_CHAMPS_ID])) ;
|
| 80 |
$formulaire->addElement('hidden', 'modifier_v', '1') ;
|
50 |
}
|
| 81 |
$formulaire->setDefaults(formulaire_defaults($_REQUEST[INS_CHAMPS_ID])) ;
|
51 |
|
| 82 |
}
|
- |
|
| 83 |
|
52 |
if (isset ($_REQUEST['action']) && $_REQUEST['action'] == 'modifier_v') {
|
| 84 |
if (isset ($_REQUEST['modifier_v'])) {
|
53 |
$GLOBALS['id_utilisateur'] = $_REQUEST[INS_CHAMPS_ID];
|
| 85 |
if ($formulaire->validate()) {
|
54 |
if ($formulaire->validate()) {
|
| 86 |
mise_a_jour($formulaire->getSubmitValues(), $_REQUEST[INS_CHAMPS_ID]);
|
55 |
inscription_mise_a_jour($formulaire->getSubmitValues(), $_REQUEST[INS_CHAMPS_ID]);
|
| 87 |
} else {
|
56 |
return $res.$formulaire->toHTML();
|
| Line 103... |
Line 72... |
| 103 |
// soit construit un lien vers un formulaire à partir du champs $field_
|
72 |
// soit construit un lien vers un formulaire à partir du champs $field_
|
| Line 104... |
Line 73... |
| 104 |
|
73 |
|
| 105 |
|
74 |
|
| 106 |
function form($label, $field_, $value)
|
75 |
function form($label, $field_, $value)
|
| Line 107... |
Line 76... |
| 107 |
{
|
76 |
{
|
| Line 108... |
Line 77... |
| 108 |
global $u_id, $GS_GLOBAL, $field ;
|
77 |
global $u_id, $field ;
|
| 109 |
|
78 |
|