Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 1681 → Rev 1682

/trunk/client/bottin/bibliotheque/edition_fiche.php
16,7 → 16,7
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> |
// +--------------------------------------------------------------------------------+
//
// $Id: edition_fiche.php,v 1.5 2007-04-11 08:30:12 neiluj Exp $
// $Id: edition_fiche.php,v 1.6 2007-11-08 09:28:18 alexandre_tb Exp $
 
 
define ("URL_RECU", $GLOBALS['ins_url']->protocol. '://'.$GLOBALS['ins_url']->host."/client/annuaire/voir_recu_pdf.php") ;
27,67 → 27,36
// dans une fonction putFrame()
 
 
function putFrame()
{
 
$url = $GLOBALS['ins_url']->getURL() ;
 
// mise à jour si il y lieu
 
if (isset ($_REQUEST['action']) && $_REQUEST['action'] == 'up') {
upSQL() ;
function putFrame() {
if (isset($_REQUEST[INS_CHAMPS_ID]) && !isset($_REQUEST['action'])) {
$_REQUEST['action'] = 'modifier';
}
 
// Requete de pour récupérer toutes les infos d'un usager
 
$query = 'select '.INS_ANNUAIRE.'.* ,'.INS_TABLE_PAYS.'.'.INS_CHAMPS_LABEL_PAYS ;
$query .= ' from '.INS_ANNUAIRE.','.INS_TABLE_PAYS.','.INS_TABLE_DPT ;
$query .= ' where '.INS_CHAMPS_ID.'='.$_REQUEST[INS_CHAMPS_ID] ;
$query .= ' and '.INS_ANNUAIRE.'.'.INS_CHAMPS_PAYS.'='.INS_TABLE_PAYS.'.'.INS_CHAMPS_ID_PAYS ;
 
$result = $GLOBALS['ins_db']->query($query) ;
if (DB::isError($result)) {
echo $result->getMessage().'<br />'.$query ;
}
 
$row = $result->fetchRow(DB_FETCHMODE_ASSOC) ;
 
$res = '<h1>Edition d\'un adh&eacute;rent : '.$row[INS_CHAMPS_NOM].' '.$row[INS_CHAMPS_PRENOM].'</h1>'."\n" ;
$res .= "<div>".form("Nom : ", INS_CHAMPS_NOM, $row[INS_CHAMPS_NOM])."</div>\n" ;
$res .= "<div>".form("Pr&eacute;nom : ", INS_CHAMPS_PRENOM, $row[INS_CHAMPS_PRENOM])."</div>\n" ;
$res .= "<div>".form("Adresse mail : ", INS_CHAMPS_MAIL, $row[INS_CHAMPS_MAIL])."</div>\n" ;
$res .= "<div>".form("Date d'inscription : ", INS_CHAMPS_DATE, $row[INS_CHAMPS_DATE])."</div>\n" ;
$res .= "<div>".form("Adresse 1 : ", INS_CHAMPS_ADRESSE_1, $row[INS_CHAMPS_ADRESSE_1])."</div>\n" ;
$res .= "<div>".form("Adresse 2 : ", INS_CHAMPS_ADRESSE_2, $row[INS_CHAMPS_ADRESSE_2])."</div>\n" ;
$res .= "<div>".form("Région : ", "a_region", $row['a_region'])."</div>\n" ;
$res .= "<div>".form("Code postal : ", INS_CHAMPS_CODE_POSTAL, $row[INS_CHAMPS_CODE_POSTAL])."</div>\n" ;
$res .= "<div>".form("Ville : ", INS_CHAMPS_VILLE, $row[INS_CHAMPS_VILLE])."</div>\n" ;
$res .= "<div>".form("Pays : ", INS_CHAMPS_PAYS, $row[INS_CHAMPS_PAYS])."</div>\n" ;
$res .= "<div>".form("Site web personnel : ", INS_CHAMPS_SITE_INTERNET, $row[INS_CHAMPS_SITE_INTERNET])."</div>\n" ;
$res .= suppression($row[INS_CHAMPS_ID]) ;
$res = '<h1>Edition d\'un adh&eacute;rent : </h1>'."\n" ;
$formulaire = new HTML_formulaireInscription('formulaire_inscription', 'post',
preg_replace('/&amp;/', '&', $GLOBALS['ins_url']->getURL()), '_self', '', 0) ;
$formulaire->construitFormulaire(preg_replace('/&amp;/', '&', $GLOBALS['ins_url']->getURL()));
$formulaire->addElement('hidden', 'id_inscription', $GLOBALS['ins_config']['ic_id_inscription']) ;
$formulaire->construitFormulaire(preg_replace('/&amp;/', '&', $GLOBALS['ins_url']->getURL()), $_REQUEST[INS_CHAMPS_ID]);
if (isset($_REQUEST['form_structure'])) {
if ($_REQUEST['form_structure']==1) {
$formulaire->formulaireStructure() ;
}
}
//pour la modification d'une inscription, on charge les valeurs par défauts
if (isset ($_REQUEST[INS_CHAMPS_ID]) == 'modifier') {
$formulaire->addElement('hidden', 'modifier_v', '1') ;
$formulaire->addElement('hidden', 'action', 'modifier_v') ;
$formulaire->setDefaults(formulaire_defaults($_REQUEST[INS_CHAMPS_ID])) ;
}
if (isset ($_REQUEST['modifier_v'])) {
if (isset ($_REQUEST['action']) && $_REQUEST['action'] == 'modifier_v') {
$GLOBALS['id_utilisateur'] = $_REQUEST[INS_CHAMPS_ID];
if ($formulaire->validate()) {
mise_a_jour($formulaire->getSubmitValues(), $_REQUEST[INS_CHAMPS_ID]);
inscription_mise_a_jour($formulaire->getSubmitValues(), $_REQUEST[INS_CHAMPS_ID]);
return $res.$formulaire->toHTML();
} else {
return $res.$formulaire->toHTML();
return $res.$formulaire->toHTML();
}
return $res;
}
$res .= $formulaire->toHTML();
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'suppr_adh') {
105,7 → 74,7
 
function form($label, $field_, $value)
{
global $u_id, $GS_GLOBAL, $field ;
global $u_id, $field ;
 
$url = $GLOBALS['ins_url']->getURL() ;