Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.05 KB | None | 0 0
  1. <?php require_once "PDO_connect.php";
  2. $query="SELECT * FROM smartphone.select_nom_prenom_user";
  3. try{
  4. $prep = $bdd->prepare($query);
  5. $prep->execute();
  6. $resultats = $prep->fetchAll();
  7. }catch(Exception $e){;
  8. echo "Erreur ! ".$e->getMessage() ;
  9. }
  10. $host = "local
  11.  
  12. host";
  13. $user = "root";
  14. $pass = "Mm101010";
  15. $dbn = "smart
  16.  
  17. phone";
  18. $link = mysqli_connect($host, $user, $pass, $dbn);
  19. $type_gestion = 1;
  20. switch ($type_gestion) {
  21. case '1':
  22. if (PHP_VERSION_ID < 50400) error_reporting (E_ALL | E_STRICT);
  23. else error_reporting (E_ALL);
  24. ini_set('display_errors', true);
  25. ini_set('html_errors', false);
  26. ini_set('display_startup_errors',true);
  27. ini_set('log_errors', false);
  28. ini_set('error_prepend_string','<span style="color: red;">');
  29. ini_set('error_append_string','<br /></span>');
  30. ini_set('ignore_repeated_errors', true);
  31. break;
  32. }
  33. ?>
  34. <!DOCTYPE>
  35. <html>
  36. <head>
  37. <title>Abonnement</title>
  38. <script type="text/javascript" src=""quot;https://cdn.datatables.net/3.1.0/js/jquery.dataTables.min.js"></script>
  39. <link rel="stylesheet" type="text/css" href="Select.css">
  40. <style>
  41. #selectable .ui-selected { background: #0000FF; }
  42. #selectable .ui-selecting { background: #0000FF; }
  43. </style>
  44. <script type="text/javascript"></script>
  45. <script src=""quot;https://code.jquery.com/jquery-1.12.4.js"></script>
  46. <script src=""quot;https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  47. <script>
  48. $( function() {
  49. $( "#selectable" ).selectable();
  50. } );
  51. function affiche(tag)
  52. {
  53. msgfield = document.getElementById("id_champ");
  54.  
  55. msgfield.value = tag ;
  56. msgfield.focus();
  57. }
  58. var oTDs = document.querySelectorAll('td');
  59. var oSelect = document.querySelector('select');
  60. function action(val) {
  61. var trouve,
  62. i, nb = oTDs.length;
  63. for (i = 0; i < nb; i += 1) {
  64. trouve = oTDs[i].textContent.indexOf( val) > -1;
  65. oTDs[i].parentNode.className = trouve ? 'selected' : '';
  66. }
  67. }
  68. oSelect.onchange = function () {
  69. action(this.value);
  70. };
  71. @en_tete= "SELECT `select_nom_prenom_user`.`USER_ID`, `select_nom_prenom_user`.`Nom`, `select_nom_prenom_user`.`Num_SIM`,`select_nom_prenom_user`.`Num_ligne` FROM select_nom_prenom_user WHERE (`select_nom_prenom_user`."
  72. @QWhere="`" & @nomchamp & "` " & @contenuchamp & ")"
  73. function clic() { document.getElementById("onclic").innerHTML = ""; }
  74. @nomchamp = "Nom"
  75. @contenuchamp = $Nom
  76. @query= @en_tete & @QWhere
  77. $result = mysqli_query($link, $query)
  78. @nomchamp = "Num_SIM"
  79. @contenuchamp = $Num_SIM
  80. @query= @en_tete & @QWhere
  81. $result = mysqli_query($link, $query)
  82. </script>
  83. </head>
  84. <body>
  85. <center>
  86. <table id="selectable" class="DataTable" >
  87. <thead>
  88. <tr>
  89. <th>Operateur</th>
  90. <th>SIM</th>
  91. <th>PUK</th>
  92. <th>Num ligne</th>
  93. <th>Volume</th>
  94. <th>Statut abo</th>
  95. </tr>
  96. </thead><tbody>
  97. <?php
  98. echo "<br>";
  99. if(!empty($resultats)){
  100. foreach ($resultats as $row) {
  101.  
  102. echo "<tr>";
  103. echo "<td data-name="Operateur">".$row["Operateur"]."</td>";
  104. echo "<td data-name="Num_SIM">".$row["Num_SIM"]."</td>";
  105. echo "<td data-name="PUK">".$row["PUK"]."</td>";
  106. echo "<td data-name="Num_ligne">".$row["Num_ligne"]."</td>";
  107. echo "<td data-name="Volume">".$row["Volume"]."</td>";
  108. echo "<td data-name="Statut_abo">".$row["Statut_abo"]."</td>";
  109. echo "</tr>";
  110. }
  111. }else {
  112. echo "Pas d'enregistrements dans cette table...";
  113. }
  114.  
  115. ?>
  116. </tbody></table><br><br>
  117. <?php
  118. $select = "SELECT `select_nom_prenom_user`.`USER_ID`, `select_nom_prenom_user`.`Num_SIM`, `select_nom_prenom_user`.`Num_ligne`, `select_nom_prenom_user`.`Nom`
  119. FROM `select_nom_prenom_user`
  120. WHERE (`select_nom_prenom_user`.`Nom` " & $ANDRE & ")"
  121. if($result);//error
  122.  
  123. echo'<option value="" selected="selected" disabled="disabled">Selectionnée : Nom</option>';
  124. while ($idresult = mysqli_fetch_row($result))
  125. {
  126. $USER_ID = $idresult[0];
  127. $Nom = $idresult[1];
  128.  
  129. echo'<option value="' . $USER_ID . '">' . $Nom . '</option>';
  130. }
  131. echo'</select></p><p>';
  132. _ }?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement