Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getList($area, $offset) {
- $array = array();
- $sql = $this->db->prepare("SELECT item, sla, opening_date, brief_description, requester, status, area FROM manutencao"); //ORDER BY item DESC LIMIT $offset, 10
- $sql->execute();
- if($sql->rowCount() > 0) {
- $array = $sql->fetchAll();
- }
- return $array;
- }
- <table class="highlight striped responsive-table" id="tabela" width="100%">
- <thead>
- <tr>
- <th>Item</th>
- <th>Setor</th>
- <th>SLA</th>
- <th>Título</th>
- <th>Solicitante</th>
- <th>Data de abertura</th>
- <th>Status</th>
- <th>Ações</th>
- </tr>
- </thead>
- <tbody>
- <?php foreach ($order_list as $os): ?>
- <tr>
- <td><strong><?php echo $os['item']; ?></strong></td>
- <td><?php echo $os['area']; ?></td>
- <td><?php echo $os['sla']; ?></td>
- <td style="white-space: normal;"><?php echo $os['brief_description']; ?></td>
- <td><?php echo $os['requester']; ?></td>
- <td><?php echo date('d/m/Y H:i', strtotime($os['opening_date'])); ?></td>
- <td width="100"><span class="new badge <?php echo $colores[$os['status']]; ?>" data-badge-caption=""><?php echo $statuses[$os['status']]; ?></span></td>
- <td>
- <a href="<?php echo BASE_URL; ?>/os/view/<?php echo $os['item']; ?>"><i title="Visualizar" class="small material-icons white-text teal darken-1 display">zoom_in</i></a><a href="<?php echo BASE_URL; ?>/os/edit/<?php echo $os['item']; ?>"><i title="Editar" class="small material-icons white-text blue accent-3 display">edit</i></a>
- </td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- <script type="text/javascript">
- $(document).ready(function() {
- $('#tabela').DataTable( {
- "processing": true,
- // "serverSide": true,
- "deferLoading": 5000,
- // "serverSide": true,
- // "deferLoading": 57,
- responsive: true,
- "language": {
- //"url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Portuguese-Brasil.json",
- "emptyTable": "Nenhum registro disponível.",
- "info": "Mostrando de _START_ até _END_ de _TOTAL_ registros",
- "infoEmpty": "Nenhum registro disponível.",
- "infoFiltered": "(filtrado _MAX_ registros no total)",
- "lengthMenu": "Registros por página _MENU_",
- "loadingRecords": "Carregando...",
- "processing": "Processando...",
- "search": "Pesquisar:",
- "zeroRecords": "Nenhum registro encontrado.",
- "paginate": {
- "first": "Primeiro",
- "last": "Último",
- "next": "<i class='material-icons'>navigate_next</i>",
- "previous": "<i class='material-icons'>navigate_before</i>"
- }
- },
- } );
- } );
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement