Guest User

Untitled

a guest
Feb 9th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. <?php
  2.  
  3. $servername = "xxx.xxx.x.xx";
  4. $username = "xxxxx";
  5. $password = "xxxxxxxx";
  6. $dbname = "xxxxxxx";
  7.  
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9. $conn->set_charset('utf8');
  10.  
  11. if(isset($_POST['inicio']) && isset($_POST['fim']))
  12. {
  13.  
  14. $inicio = $_POST['inicio'];
  15. $fim = $_POST['fim'];
  16. $result_cursos = "SELECT DataRegisto,
  17. Dia,
  18. TipoRefeicao,
  19. Refeicao,
  20. Hora,
  21. Motivo,
  22. Sugestao,
  23. Colaborador
  24.  
  25. FROM centrodb.RegistoDiario
  26.  
  27. WHERE DataRegisto >= '$inicio' AND DataRegisto <= '$fim'";
  28. $resultado_cursos = mysqli_query($conn, $result_cursos);
  29.  
  30. $tabela1 .= '<div style="float: center" table align="center">';
  31.  
  32. $tabela1 .= '<table border="5">';
  33.  
  34. $tabela1 .= '<tr>';
  35.  
  36. $tabela1 .='<thead>';
  37.  
  38. $tabela1 .= '<tr>';
  39.  
  40. $tabela1 .= '<th>Data</th>';
  41.  
  42. $tabela1 .= '<th>Dia</th>';
  43.  
  44. $tabela1 .= '<th>Tipo de Refeição</th>';
  45.  
  46. $tabela1 .= '<th>Refeicao</th>';
  47.  
  48. $tabela1 .= '<th>Hora da Refeição</th>';
  49.  
  50. $tabela1 .= '<th>Motivo do incumprimento</th>';
  51.  
  52. $tabela1 .= '<th>Sugestões/Observações</th>';
  53.  
  54. $tabela1 .= '<th>Colaborador</th>';
  55.  
  56. $tabela1 .= '</tr>';
  57.  
  58. $tabela1 .='</thead>';
  59.  
  60. $tabela1 .='<tbody>';
  61.  
  62. while($rows_cursos = mysqli_fetch_array($resultado_cursos)) {
  63.  
  64. $tabela1 .= '<tr>';
  65.  
  66. $tabela1 .= '<td>'.$rows_cursos['DataRegisto'].'</td>';
  67.  
  68. $tabela1 .= '<td>'.$rows_cursos['Dia'].'</td>';
  69.  
  70. $tabela1 .= '<td>'.$rows_cursos['TipoRefeicao'].'</td>';
  71.  
  72. $tabela1 .= '<td>'.$rows_cursos['Refeicao'].'</td>';
  73.  
  74. $tabela1 .= '<td>'.$rows_cursos['Hora'].'</td>';
  75.  
  76. $tabela1 .= '<td>'.$rows_cursos['Motivo'].'</td>';
  77.  
  78. $tabela1 .= '<td>'.$rows_cursos['Sugestao'].'</td>';
  79.  
  80. $tabela1 .= '<td>'.$rows_cursos['Colaborador'].'</td>';
  81.  
  82. $tabela1 .= '</tr>';
  83. }}
  84. $tabela1 .= '</tr>';
  85.  
  86. $tabela1 .='</tbody>';
  87.  
  88. $tabela1 .= '</table>';
  89.  
  90. $tabela1 .= '</div>';
  91.  
  92. echo $tabela1;
  93.  
  94. ?>
Add Comment
Please, Sign In to add comment