PageRenderTime 47ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/pages/modifier.php

https://bitbucket.org/mw4rf/ajpsc-annuaire
PHP | 169 lines | 137 code | 18 blank | 14 comment | 2 complexity | f321645430628164e7d6abee4f6658dc MD5 | raw file
  1. <?php
  2. // Annuaire Alumnii
  3. // Base de données et annuaire d'anciens étudiants.
  4. // Copyright (C) <2006> <Guillaume Florimond>
  5. // This program is free software: you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation, either version 3 of the License, or
  8. // (at your option) any later version.
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  15. connexion();
  16. /* $voir_id est transmise depuis index.php, juste avant l'include de voir.php */
  17. $sql = "SELECT * FROM utilisateur WHERE id='$modifier_id'";
  18. $req = mysql_query($sql) or die('Erreur');
  19. $data = mysql_fetch_assoc($req);
  20. $afficher['nom'] = stripslashes(html_vers_texte(formater_nom($data['nom'])));
  21. $afficher['prenom'] = stripslashes(html_vers_texte(formater_nom($data['prenom'])));
  22. $afficher['promotion'] = stripslashes(html_vers_texte($data['promotion']));
  23. $afficher['nationalite'] = stripslashes(html_vers_texte($data['nationalite']));
  24. $afficher['naissance'] = stripslashes(html_vers_texte(formater_date($data['naissance'],false)));
  25. $afficher['adresse'] = stripslashes(html_vers_texte($data['adresse']));
  26. $afficher['email'] = stripslashes(html_vers_texte($data['email']));
  27. $afficher['q1'] = stripslashes(html_vers_texte($data['q1']));
  28. $afficher['q2'] = stripslashes(html_vers_texte($data['q2']));
  29. $afficher['q3'] = stripslashes(html_vers_texte($data['q3']));
  30. $afficher['q4'] = stripslashes(html_vers_texte($data['q4']));
  31. $afficher['q5'] = stripslashes(html_vers_texte($data['q5']));
  32. $afficher['q6'] = stripslashes(html_vers_texte($data['q6']));
  33. $afficher['q7'] = stripslashes(html_vers_texte($data['q7']));
  34. $afficher['secret_question'] = stripslashes($data['secret_question']);
  35. ?>
  36. <form name="soumettre" method="post" action="index.php?action=action_modifier" onSubmit="return completude(this);" enctype="multipart/form-data">
  37. <input name="id" type="hidden" value="<?php echo $modifier_id; ?>" />
  38. <table width="80%" border="0" align="center" cellpadding="2" cellspacing="10">
  39. <tr>
  40. <td class="question"><?php dire("c1"); ?> <span style="color:#F00">*</span></td>
  41. <td><input name="nom" type="text" size="60" value="<?php echo $afficher['nom']; ?>" onKeyUp="javascript:reinit_couleur(this);" /> <span class="commentaires"><?php dire("a1"); ?></span></td>
  42. </tr>
  43. <tr>
  44. <td class="question"><?php dire("c2"); ?> <span style="color:#F00">*</span></td>
  45. <td><input name="prenom" type="text" size="60" value="<?php echo $afficher['prenom']; ?>" onKeyUp="javascript:reinit_couleur(this);" /> <span class="commentaires"><?php dire("a2"); ?></span></td>
  46. </tr>
  47. <tr>
  48. <td class="question"><?php dire("c3"); ?> <span style="color:#F00">*</span></td>
  49. <td><input name="promotion" type="text" size="4" maxlength="4" value="<?php echo $afficher['promotion']; ?>" onKeyUp="javascript:reinit_couleur(this);" />
  50. <span class="commentaires"><?php dire("a3"); ?></span> </td>
  51. </tr>
  52. <tr>
  53. <td class="question"><?php dire("c4"); ?> <span style="color:#F00">*</span></td>
  54. <td><input type="text" name="nationalite" value="<?php echo $afficher['nationalite']; ?>" onKeyUp="javascript:reinit_couleur(this);" /><span class="commentaires"><?php dire("a4"); ?></span></td>
  55. </tr>
  56. <tr>
  57. <td class="question"><?php dire("c5"); ?> <span style="color:#F00">*</span></td>
  58. <td><input name="naissance" type="text" size="10" maxlength="10" value="<?php echo $afficher['naissance']; ?>" onKeyUp="javascript:reinit_couleur(this);" />
  59. <span class="commentaires"><?php dire("a5"); ?></span></td>
  60. </tr>
  61. <tr>
  62. <td class="question"><?php dire("c6"); ?></td>
  63. <td><textarea name="adresse" cols="60" rows="3"><?php echo $afficher['adresse']; ?></textarea></td>
  64. </tr>
  65. <tr>
  66. <td class="question"><?php dire("c7"); ?> <span style="color:#F00">*</span></td>
  67. <td><input name="email" type="text" size="50" value="<?php echo $afficher['email']; ?>" onKeyUp="javascript:reinit_couleur(this);" /></td>
  68. </tr>
  69. <tr>
  70. <td class="question"><?php dire("c8"); ?></td>
  71. <td>
  72. <input type="hidden" name="MAX_FILE_SIZE" value="1000000" /> <!-- 1 Mb -->
  73. <input type="file" name="image" />
  74. <br /><small><?php dire("photo2"); ?></small>
  75. </td>
  76. </tr>
  77. <tr>
  78. <td colspan="2"><span style="color:#F00">*</span>&nbsp;<span class="commentaires"><?php dire("ax"); ?></span></td>
  79. </tr>
  80. <tr class="orange">
  81. <td height="2" colspan="2">&nbsp;</td>
  82. </tr>
  83. <tr>
  84. <td colspan="2" class="question"><?php dire("q1"); ?></td>
  85. </tr>
  86. <tr>
  87. <td colspan="2"><textarea name="q1" cols="72" rows="6"><?php echo $afficher['q1']; ?></textarea></td>
  88. </tr>
  89. <tr>
  90. <td colspan="2" class="question"><?php dire("q2"); ?></td>
  91. </tr>
  92. <tr>
  93. <td colspan="2"><textarea name="q2" cols="72" rows="6"><?php echo $afficher['q2']; ?></textarea></td>
  94. </tr>
  95. <tr>
  96. <td colspan="2" class="question"><?php dire("q3"); ?></td>
  97. </tr>
  98. <tr>
  99. <td colspan="2"><textarea name="q3" cols="72" rows="6"><?php echo $afficher['q3']; ?></textarea></td>
  100. </tr>
  101. <tr>
  102. <td colspan="2" class="question"><?php dire("q4"); ?></td>
  103. </tr>
  104. <tr>
  105. <td colspan="2"><textarea name="q4" cols="72" rows="3"><?php echo $afficher['q4']; ?></textarea></td>
  106. </tr>
  107. <tr>
  108. <td colspan="2" class="question"><?php dire("q5"); ?></td>
  109. </tr>
  110. <tr>
  111. <td colspan="2"><textarea name="q5" cols="72" rows="3"><?php echo $afficher['q5']; ?></textarea></td>
  112. </tr>
  113. <tr>
  114. <td colspan="2" class="question"><?php dire("q6"); ?></td>
  115. </tr>
  116. <tr>
  117. <td colspan="2"><textarea name="q6" cols="72" rows="6"><?php echo $afficher['q6']; ?></textarea></td>
  118. </tr>
  119. <tr>
  120. <td colspan="2" class="question"><?php dire("q7"); ?></td>
  121. </tr>
  122. <tr>
  123. <td colspan="2"><textarea name="q7" cols="72" rows="12"><?php echo $afficher['q7']; ?></textarea></td>
  124. </tr>
  125. <?php if(!isadmin()) { // Si c'est un admin, il passe outre la question/réponse?>
  126. <tr class="orange">
  127. <td height="2" colspan="2">&nbsp;</td>
  128. </tr>
  129. <tr>
  130. <td class="commentaires" colspan="2"><?php dire("sy"); ?></td>
  131. </tr>
  132. <td class="question"><?php dire("s1"); ?></td>
  133. <td><?php echo $afficher['secret_question']; ?></td>
  134. </tr>
  135. <tr>
  136. <td class="question"><?php dire("s2"); ?> <span style="color:#F00">*</span></td>
  137. <td><input name="secret_reponse" type="text" size="60"></td>
  138. </tr>
  139. <tr class="orange">
  140. <td height="2" colspan="2">&nbsp;</td>
  141. </tr>
  142. <?php } else { ?>
  143. <input name="secret_reponse" type="hidden" value="">
  144. <?php } // fin if/else: isadmin ?>
  145. <tr>
  146. <td colspan="2"><div align="center">
  147. <input type="submit" class="btn btn-large btn-success" name="Submit" value="<?php dire("o2"); ?>" />
  148. </div></td>
  149. </tr>
  150. </table>
  151. </form>