PageRenderTime 51ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 1ms

/pages/voir.php

https://bitbucket.org/mw4rf/ajpsc-annuaire
PHP | 162 lines | 114 code | 31 blank | 17 comment | 19 complexity | c69842b2b01a97d99aad236dfcb5ebfe 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='$voir_id'";
  18. $req = mysql_query($sql) or die("Erreur: $sql<br />".mysql_error());
  19. $data = mysql_fetch_assoc($req);
  20. $afficher['nom'] = (formater_nom(stripslashes($data['nom'])));
  21. $afficher['prenom'] = (formater_nom(stripslashes($data['prenom'])));
  22. $afficher['promotion'] = (stripslashes($data['promotion']));
  23. $afficher['nationalite'] = (stripslashes($data['nationalite']));
  24. $afficher['naissance'] = (stripslashes($data['naissance']));
  25. $afficher['adresse'] = (stripslashes($data['adresse']));
  26. $afficher['email'] = (stripslashes($data['email']));
  27. $afficher['q1'] = (stripslashes($data['q1']));
  28. $afficher['q2'] = (stripslashes($data['q2']));
  29. $afficher['q3'] = (stripslashes($data['q3']));
  30. $afficher['q4'] = (stripslashes($data['q4']));
  31. $afficher['q5'] = (stripslashes($data['q5']));
  32. $afficher['q6'] = (stripslashes($data['q6']));
  33. $afficher['q7'] = (stripslashes($data['q7']));
  34. $afficher['modif'] = formater_date($data['modif'],false);
  35. /* Photo */
  36. $sql2 = "SELECT * FROM photo WHERE user_id='$voir_id'";
  37. $req2 = mysql_query($sql2) or die("Erreur: $sql2<br />".mysql_error());
  38. $data2 = mysql_fetch_assoc($req2);
  39. $photo = "&nbsp;";
  40. if(!empty($data2)) {
  41. $imgW = $data2['width'];
  42. $imgH = $data2['height'];
  43. if($imgW == 0) $imgW = 1;
  44. // Resizing image to make a thumbnail
  45. $thumb_width = $_config['images_largeur_fiches'];
  46. $thumb_height = round($imgH / $imgW * $thumb_width);
  47. // Storage: DB / FS ?
  48. if($_config['photos_storage'] == "DB")
  49. $src = "includes/photo.php?id=$voir_id";
  50. else
  51. $src = $_config['data_folder']."/photos/".$data2['user_id'].'.'.$data2['extension'];
  52. $photo = "<img height=\"$thumb_height\" width=\"$thumb_width\" src=\"$src\">";
  53. }
  54. ?>
  55. <div class="container">
  56. <div class="row-fluid">
  57. <div class="span8 well">
  58. <h2>
  59. <?php echo $afficher['prenom']; ?>
  60. <span style="font-variant: small-caps;"><?php echo $afficher['nom']; ?></span>
  61. </h2>
  62. <p><b>
  63. <?php dire('c3'); ?>&nbsp;<?php echo abbr3($afficher['promotion'], promotion($afficher['promotion'])); ?>
  64. </b></p>
  65. <p>
  66. <i class="icon-user"></i>
  67. <?php dire("ne-vp") ?>
  68. &nbsp;<?php echo $afficher['nationalite']; ?>&nbsp;
  69. <?php dire("ne-le") ?>
  70. &nbsp;<?php echo convertir_date($afficher['naissance']); ?>
  71. </p>
  72. <p>
  73. <i class="icon-envelope"></i>
  74. <?php echo $afficher['adresse']; ?>
  75. </p>
  76. <p>
  77. <i class="icon-pencil"></i>
  78. <?php
  79. echo abbr3('<a href="mailto:'.$afficher['email'].'">'.$afficher['email'].'</a>',
  80. donner('env-mail')." ".$afficher['prenom']." ".$afficher['nom']);
  81. ?>
  82. </p>
  83. </div>
  84. <div class="span4 text-center">
  85. <?php echo $photo; ?>
  86. </div>
  87. </div>
  88. <?php if($afficher['q1'] != "") { ?>
  89. <div class="well well-small">
  90. <p class="lead"><?php dire("r1"); ?></p>
  91. <blockquote><?php echo $afficher['q1']; ?></blockquote>
  92. </div>
  93. <?php } ?>
  94. <?php if($afficher['q2'] != "") { ?>
  95. <div class="well well-small">
  96. <p class="lead"><?php dire("r2"); ?></p>
  97. <blockquote><?php echo $afficher['q2']; ?></blockquote>
  98. </div>
  99. <?php } ?>
  100. <?php if($afficher['q3'] != "") { ?>
  101. <div class="well well-small">
  102. <p class="lead"><?php dire("r3"); ?></p>
  103. <blockquote><?php echo $afficher['q3']; ?></blockquote>
  104. </div>
  105. <?php } ?>
  106. <?php if($afficher['q4'] != "") { ?>
  107. <div class="well well-small">
  108. <p class="lead"><?php dire("r4"); ?></p>
  109. <blockquote><?php echo $afficher['q4']; ?></blockquote>
  110. </div>
  111. <?php } ?>
  112. <?php if($afficher['q5'] != "") { ?>
  113. <div class="well well-small">
  114. <p class="lead"><?php dire("r5"); ?></p>
  115. <blockquote><?php echo $afficher['q5']; ?></blockquote>
  116. </div>
  117. <?php } ?>
  118. <?php if($afficher['q6'] != "") { ?>
  119. <div class="well well-small">
  120. <p class="lead"><?php dire("r6"); ?></p>
  121. <blockquote><?php echo $afficher['q6']; ?></blockquote>
  122. </div>
  123. <?php } ?>
  124. <?php if($afficher['q7'] != "") { ?>
  125. <div class="well well-small">
  126. <p class="lead"><?php dire("r7"); ?></p>
  127. <blockquote><?php echo $afficher['q7']; ?></blockquote>
  128. </div>
  129. <?php } ?>
  130. <p class="pull-right"><span class="label"><?php dire("modif"); echo " ".$afficher['modif']; ?></span><p>
  131. </div>