Guest User

Untitled

a guest
Feb 7th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['data']))
  3. {
  4. $servername = "xxx.xxx.x.xx";
  5. $username = "xxxxx";
  6. $password = "xxxxxxxx";
  7. $dbname = "xxxxxxx";
  8.  
  9. $conn = new mysqli($servername, $username, $password, $dbname);
  10. $conn->set_charset('utf8');
  11.  
  12. $inicio = mysqli_real_escape_string($conn, $_POST['data']);
  13.  
  14. $sql = "SELECT `regOratorio`.`DataEntrada`,
  15. `regOratorio`.`Utente`,
  16. `regOratorio`.`Estado`,
  17. `regOratorio`.`Observacao`,
  18. `regOratorio`.`Colaborador`
  19. FROM `centrodb`.`regOratorio` WHERE DataEntrada = '$inicio'";
  20.  
  21. $estado = $_POST['Estado'];
  22. $observacao = $_POST['Observacao'];
  23.  
  24. $result=mysqli_query($conn, $sql);
  25.  
  26. if (!$result) {
  27. echo 'There are no results for your search';
  28. } else {
  29. echo '<form name="customer_details" action="" method="POST" onsubmit="return alguma_funcao()">';
  30. }
  31. while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
  32. {
  33.  
  34. echo "<fieldset>";
  35. echo "<table cellspacing='10'>";
  36. echo "<tr>";
  37. echo "<td>";
  38.  
  39. echo "<label>Utente</label>";
  40. echo "<input id='' type='text' value='".$row['Utente']."'";
  41.  
  42. echo "<label>Estado</label>";
  43. echo "<input type='radio' id='Estado' name='Estado' value='Presente' " . ( ($row['Estado']=='Presente') ? 'checked' : '' ) ."> Presente";
  44. echo "<input type='radio' id='Estado' name='Estado' value='Ausente' " . ( ($row['Estado']=='Ausente') ? 'checked' : '' ) ."> Ausente";
  45.  
  46. echo "<label>Observacao</label>";
  47. echo "<input type='text' id='Observacao' name='Observacao' value='".$row['Observacao']."'";
  48. echo "</td>";
  49. echo "</tr>";
  50. echo "</table>";
  51. echo "</fieldset>";
  52.  
  53. echo "<fieldset>";
  54. echo "<table cellspacing='10'>";
  55. echo "<tr>";
  56. echo "<td>";
  57. echo "<input type='text' value='".$row['Colaborador']."'";
  58. echo "</td>";
  59. echo "</tr>";
  60. echo "</table>";
  61. echo "</fieldset>";
  62.  
  63. }
  64. echo "</form>";
  65.  
  66. mysqli_close($conn);
  67. }
  68. else
  69. {
  70. ?>
  71.  
  72. <?php
  73. }
  74. ?>
Add Comment
Please, Sign In to add comment