Guest User

Untitled

a guest
Feb 5th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 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. $result=mysqli_query($conn, $sql);
  22.  
  23. if (!$result) {
  24. echo 'There are no results for your search';
  25. } else {
  26. echo '<form name="customer_details" action="" method="POST" onsubmit="return alguma_funcao()">';
  27. }
  28. while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
  29. {
  30.  
  31. echo "<fieldset>";
  32. echo "<table cellspacing='10'>";
  33. echo "<tr>";
  34. echo "<td>";
  35.  
  36. echo "<label>Utente</label>";
  37. echo "<input id='' type='text' value='".$row['Utente']."'";
  38.  
  39. echo "<label>Estado</label>";
  40. echo "<input type='radio' value='Presente' " . ( ($row['Estado']=='Presente') ? 'checked' : '' ) ."> Presente";
  41. echo "<input type='radio' value='Ausente' " . ( ($row['Estado']=='Ausente') ? 'checked' : '' ) ."> Ausente";
  42. echo "<label>Observacao</label>";
  43. echo "<input type='text' value='".$row['Observacao']."'";
  44. echo "</td>";
  45. echo "</tr>";
  46. echo "</table>";
  47. echo "</fieldset>";
  48.  
  49. echo "<fieldset>";
  50. echo "<table cellspacing='10'>";
  51. echo "<tr>";
  52. echo "<td>";
  53. echo "<input type='text' value='".$row['Colaborador']."'";
  54. echo "</td>";
  55. echo "</tr>";
  56. echo "</table>";
  57. echo "</fieldset>";
  58.  
  59. }
  60. echo "</form>";
  61. mysqli_close($conn);
  62. }
  63. else
  64. {
  65. ?>
  66.  
  67. <?php
  68. }
  69. ?>
Add Comment
Please, Sign In to add comment