Guest User

Untitled

a guest
Apr 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. if(isset($_GET['term'])){
  2. $string = $_GET['term'];
  3. }else{
  4.  
  5. $string = "";
  6. }
  7.  
  8. $result = mysqli_query ($conexion, "SELECT * FROM paciente where run like '%$string%'");
  9.  
  10.  
  11. if ($result){
  12. $array = [];
  13. $array_respuesta=[];
  14. while ($row = mysqli_fetch_assoc($result)){
  15. //print_r($row);
  16. $array['label'] =$row ['run'];
  17. $array['nombre_persona'] =$row ['nombre'];
  18. $array['apellido_persona'] =$row ['apellido'];
  19. array_push($array_respuesta, $array);
  20. }
  21. echo json_encode($array_respuesta);
  22.  
  23. }
  24.  
  25. if(isset($_GET['term']))
  26. {
  27. $string2 = $_GET['term'];
  28. }else{
  29.  
  30. $string2 = "";
  31. }
  32.  
  33.  
  34. $result2 = mysqli_query ($conexion, "SELECT * FROM funcionario where run_funcionario like '%$string2%'");
  35.  
  36. if ($result2){
  37. $array2 = [];
  38. $array_respuesta2=[];
  39. while ($row2 = mysqli_fetch_assoc($result2)){
  40. //print_r($row);
  41. $array2['run_f'] =$row2 ['run_funcionario'];
  42. $array2['nombre_funcionario'] =$row2 ['nombre'];
  43. $array2['apellido_funcionario'] =$row2 ['apellido'];
  44. array_push($array_respuesta2, $array2);
  45. }
  46. echo json_encode($array_respuesta2);
  47.  
  48. }
  49.  
  50. if(isset($_GET['term'])){
  51. $string = $_GET['term'];
  52. }else{
  53.  
  54. $string = "";
  55. }
  56.  
  57. $result = mysqli_query ($conexion, "SELECT * FROM paciente where run like '%$string%'");
  58.  
  59.  
  60. if ($result){
  61. $array = [];
  62. $array_respuesta=[];
  63. while ($row = mysqli_fetch_assoc($result)){
  64. //print_r($row);
  65. $array['label'] =$row ['run'];
  66. $array['nombre_persona'] =$row ['nombre'];
  67. $array['apellido_persona'] =$row ['apellido'];
  68. array_push($array_respuesta, $array);
  69. }
  70. echo json_encode($array_respuesta);
  71.  
  72. }
  73.  
  74. if(isset($_GET['term']))
  75. {
  76. $string2 = $_GET['term'];
  77. }else{
  78.  
  79. $string2 = "";
  80. }
  81.  
  82.  
  83. $result2 = mysqli_query ($conexion, "SELECT * FROM funcionario where run_funcionario like '%$string2%'");
  84.  
  85. if ($result2){
  86. $array2 = [];
  87. $array_respuesta2=[];
  88. while ($row2 = mysqli_fetch_assoc($result2)){
  89. //print_r($row);
  90. $array2['run_f'] =$row2 ['run_funcionario'];
  91. $array2['nombre_funcionario'] =$row2 ['nombre'];
  92. $array2['apellido_funcionario'] =$row2 ['apellido'];
  93. array_push($array_respuesta2, $array2);
  94. }
  95. echo json_encode($array_respuesta2);
  96.  
  97. }
  98.  
  99. <label for="run_f">Podologa: </label>
  100. <input type="text" name="run_f" id="run_f">
  101. <br>
  102. <label for="nombre_f">Nombre: </label>
  103. <input type="text" name="nombre_f" id="nombre_f">
  104. <br>
  105. <label for="apellido_f">Apellido: </label>
  106. <input type="text" name="apellido_f" id="apellido_f">
Add Comment
Please, Sign In to add comment