Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "xxx.xxx.x.xx";
- $username = "xxxxx";
- $password = "xxxxxxxx";
- $dbname = "xxxxxxx";
- $conn = new mysqli($servername, $username, $password, $dbname);
- $conn->set_charset('utf8');
- if(isset($_POST['inicio']) && isset($_POST['fim']))
- {
- $inicio = $_POST['inicio'];
- $fim = $_POST['fim'];
- $result_cursos = "SELECT DataRegisto,
- Dia,
- TipoRefeicao,
- Refeicao,
- Hora,
- Motivo,
- Sugestao,
- Colaborador
- FROM centrodb.RegistoDiario
- WHERE DataRegisto >= '$inicio' AND DataRegisto <= '$fim'";
- $resultado_cursos = mysqli_query($conn, $result_cursos);
- $tabela1 .= '<div style="float: center" table align="center">';
- $tabela1 .= '<table border="5">';
- $tabela1 .= '<tr>';
- $tabela1 .='<thead>';
- $tabela1 .= '<tr>';
- $tabela1 .= '<th>Data</th>';
- $tabela1 .= '<th>Dia</th>';
- $tabela1 .= '<th>Tipo de Refeição</th>';
- $tabela1 .= '<th>Refeicao</th>';
- $tabela1 .= '<th>Hora da Refeição</th>';
- $tabela1 .= '<th>Motivo do incumprimento</th>';
- $tabela1 .= '<th>Sugestões/Observações</th>';
- $tabela1 .= '<th>Colaborador</th>';
- $tabela1 .= '</tr>';
- $tabela1 .='</thead>';
- $tabela1 .='<tbody>';
- while($rows_cursos = mysqli_fetch_array($resultado_cursos)) {
- $tabela1 .= '<tr>';
- $tabela1 .= '<td>'.$rows_cursos['DataRegisto'].'</td>';
- $tabela1 .= '<td>'.$rows_cursos['Dia'].'</td>';
- $tabela1 .= '<td>'.$rows_cursos['TipoRefeicao'].'</td>';
- $tabela1 .= '<td>'.$rows_cursos['Refeicao'].'</td>';
- $tabela1 .= '<td>'.$rows_cursos['Hora'].'</td>';
- $tabela1 .= '<td>'.$rows_cursos['Motivo'].'</td>';
- $tabela1 .= '<td>'.$rows_cursos['Sugestao'].'</td>';
- $tabela1 .= '<td>'.$rows_cursos['Colaborador'].'</td>';
- $tabela1 .= '</tr>';
- }}
- $tabela1 .= '</tr>';
- $tabela1 .='</tbody>';
- $tabela1 .= '</table>';
- $tabela1 .= '</div>';
- echo $tabela1;
- ?>
Add Comment
Please, Sign In to add comment