1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
| <?php /* Date de création: 02/04/2008 */ ?>
<?php
require("cnx/login_sql.php");
//Connexion à la base
$db=mysql_connect($cnxhost,$cnxuser,$cnxpass);
//Selection de la base
mysql_select_db($cnxbase,$db);
//Récupérer la liste des fonctions de l'utilisateur
$sql_fct="SELECT * FROM fonctions";
$req_sql_fct=mysql_query($sql_fct) or die ('Erreur SQL !<br>'.$sql_fct.'<br>'.mysql_error());
//Récupérer la liste des groupes d'appartenance
$sql_grp="SELECT * FROM groups";
$req_sql_grp=mysql_query($sql_grp) or die ('Erreur SQL !<br>'.$sql_grp.'<br>'.mysql_error());
//Récupérer la liste des établissements
$sql_etb="SELECT e.IdEtb, e.Etablissement, lo.LOCA_ID, lo.LOCA_ADRESSE1, lo.LOCA_ADRESSE2, lo.LOCA_CP, lo.LOCA_VILLE, lo.LOCA_CP, lo.LOCA_TEL, lo.IDETB
FROM etablissement e LEFT JOIN localisations lo ON lo.IDETB=e.IdEtb";
//"SELECT * FROM etablissement";
$req_sql_etb=mysql_query($sql_etb) or die ('Erreur SQL !<br>'.$sql_etb.'<br>'.mysql_error());
//Récupérer la liste des lieux de localisation
$sql_loca="SELECT * FROM localisations";
$req_sql_loca=mysql_query($sql_loca) or die ('Erreur SQL !<br>'.$sql_etb.'<br>'.mysql_error());
//Affichage de l'information des enregistrements en cours
echo'<br>';
echo'<table style="background-color:#E1E9EA;border-color:#000000;border-width:1;border-style:dotted" width="70%">';
echo'<tr>';
echo'<td align="center">';
echo'<font size="5" color="#336699"><strong>Fiche Membre</strong></font>';
echo'</td>';
echo'</tr>';
echo'</table>';
echo'<table style="background-color:#E1E9EA;border-color:#000000;border-width:1;border-style:dotted" width="70%">';
echo'<tr>';
echo'<form name="aj_user" method="POST" onsubmit="return refresh(this)" Action="index.php?numlien=aj_user">';
echo'<td><IMG src="image/membre_ets.png" id="identite" style="border:"0"></td>';
echo'<td><strong><font size="2">Civilité</font></strong></td>';
echo'<td>';
echo'<SELECT size="1" name="civilite" document.location=this.options[this.selectedIndex].value>';
echo'<option SELECTED>';
echo'<option>Monsieur</OPTION>';
echo'<option>Madame</OPTION>';
echo'<option>Mademoiselle</OPTION>';
echo'</SELECT>';
echo'</td>';
echo'</tr>';
echo'<tr>';
echo'<td></td>';
echo'<td><strong><font size="2">Identité [Nom] - [Prénom]</font></strong></td>';
echo'<td>';
echo'<input type="text" name="nom" value=""><input type="text" name="prenom" value="">';
echo'</font></td>';
echo'</tr>';
echo'<tr>';
echo'<td><IMG src="image/fonction.png" style="border:"0"></td>';
echo'<td><strong><font size="2">Fonction</font></strong></td>';
echo'<td>';
echo'<SELECT size="1" name="fonction" document.location=this.options[this.selectedIndex].value>';
echo'<option SELECTED></OPTION>';
while($Data_fct=mysql_fetch_array($req_sql_fct))
{
echo'<option>'.$Data_fct['FONCTION_NOM'].'</option>';
}
echo'</SELECT>';
echo'</td>';
echo'</tr>';
echo'<tr>';
echo'<td></td>';
echo'<td><font size="2"><strong>Groupe Appartenance</strong></font></td>';
echo'<td>';
echo'<SELECT size="1" name="group" document.location=this.options[this.selectedIndex].value>';
echo'<option SELECTED></OPTION>';
while($Data_grp=mysql_fetch_array($req_sql_grp))
{
echo'<option>'.$Data_grp['GROUP_NOM'].'</option>';
}
echo'</SELECT>';
echo'</td>';
echo'</tr>';
echo'<tr>';
echo'<td><IMG src="image/tel1.png" id="tel1" style="border:"0"></td>';
echo'<td ><strong><font size="2">Téléphone 1</font></strong></td>';
echo'<td>';
echo'<input type="text" name="tel1" value="">';
echo'</td>';
echo'</tr>';
echo'<tr>';
echo'<td><IMG src="image/tel2.png" id="tel2" style="border:"0"></td>';
echo'<td><strong><font size="2">Téléphone 2</font></strong></td>';
echo'<td>';
echo'<input type="text" name="tel2" value="">';
echo'</td>';
echo'</tr>';
echo'<tr>';
echo'<td></td>';
echo'<td><strong><font size="2">Fax</font></strong></td>';
echo'<td>';
echo'<input type="text" name="fax" value="">';
echo'</td>';
echo'</tr>';
echo'<tr>';
echo'<td><IMG src="image/email.png" id="email" style="border:"0"></td>';
echo'<td><strong><font size="2">Email</font></strong></td>';
echo'<td>';
echo'<input type="text" name="email" value="">';
echo'</td>';
echo'</tr>';
echo'</table>';
echo'<br>';
echo'<table style="background-color:#E1E9EA;border-color:#000000;border-width:1;border-style:dotted" width="70%">';
echo'<tr>';
echo'<td style="background-color:#FFF0FC" align="center" colspan="2"><strong><font size="2">Etablissement</font></strong></td>';
echo'<td>';
//
$loca = "SELECT e.IdEtb, e.Etablissement, lo.LOCA_ID, lo.LOCA_ADRESSE1, lo.LOCA_ADRESSE2, lo.LOCA_CP, lo.LOCA_VILLE, lo.LOCA_CP, lo.LOCA_TEL, lo.IDETB
FROM etablissement e LEFT JOIN localisations lo ON e.IdEtb=lo.IDETB";
//
$req_loca = mysql_query($loca) or die ('Erreur SQL !<br>'.$loca.'<br>'.mysql_error());
//
$etb_loca = mysql_fetch_assoc($req_loca);
$Data_loca=mysql_fetch_assoc($req_sql_etb);
echo'<SELECT size="1" name="etb" onchange="javascript:afficheAdresseEtablissement()">';
echo'<option SELECTED="selected" value="0"></OPTION>';
while($Data_etb=mysql_fetch_assoc($req_sql_etb))
{
echo'<script type="text/javascript">
function afficheAdresseEtablissement(){
document.getElementById("service").value='.$Data_loca['LOCA_ADRESSE1'].';
}
</script>';
echo'<option>'.$Data_etb['Etablissement'].'</option>';
}
echo'</SELECT>';
echo'</td>';
echo'</tr>';
echo'<tr>';
echo'<td style="background-color:#FFF0FC" align="center" colspan="2"><strong><font size="2">Localisation <strong>*</font></strong></td>';
echo'<td align="center"><input type="text" name="service" id="service" value=""></td>';
echo'</tr>';
echo'</form>';
echo'</table>';
echo'<br>';
echo'';
//Fermeture de la connexion
mysql_close();
?> |
Partager