Advertisement
hugovrcandido

Untitled

Mar 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | None | 0 0
  1. public function getList($area, $offset) {
  2. $array = array();
  3.  
  4. $sql = $this->db->prepare("SELECT item, sla, opening_date, brief_description, requester, status, area FROM manutencao"); //ORDER BY item DESC LIMIT $offset, 10
  5. $sql->execute();
  6.  
  7. if($sql->rowCount() > 0) {
  8. $array = $sql->fetchAll();
  9. }
  10.  
  11. return $array;
  12. }
  13.  
  14. <table class="highlight striped responsive-table" id="tabela" width="100%">
  15. <thead>
  16. <tr>
  17. <th>Item</th>
  18. <th>Setor</th>
  19. <th>SLA</th>
  20. <th>Título</th>
  21. <th>Solicitante</th>
  22. <th>Data de abertura</th>
  23. <th>Status</th>
  24. <th>Ações</th>
  25. </tr>
  26. </thead>
  27.  
  28. <tbody>
  29. <?php foreach ($order_list as $os): ?>
  30. <tr>
  31. <td><strong><?php echo $os['item']; ?></strong></td>
  32. <td><?php echo $os['area']; ?></td>
  33. <td><?php echo $os['sla']; ?></td>
  34. <td style="white-space: normal;"><?php echo $os['brief_description']; ?></td>
  35. <td><?php echo $os['requester']; ?></td>
  36. <td><?php echo date('d/m/Y H:i', strtotime($os['opening_date'])); ?></td>
  37. <td width="100"><span class="new badge <?php echo $colores[$os['status']]; ?>" data-badge-caption=""><?php echo $statuses[$os['status']]; ?></span></td>
  38. <td>
  39. <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>
  40. </td>
  41. </tr>
  42. <?php endforeach; ?>
  43. </tbody>
  44. </table>
  45.  
  46. <script type="text/javascript">
  47. $(document).ready(function() {
  48. $('#tabela').DataTable( {
  49. "processing": true,
  50. // "serverSide": true,
  51. "deferLoading": 5000,
  52.  
  53. // "serverSide": true,
  54.  
  55. // "deferLoading": 57,
  56. responsive: true,
  57. "language": {
  58. //"url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Portuguese-Brasil.json",
  59. "emptyTable": "Nenhum registro disponível.",
  60. "info": "Mostrando de _START_ até _END_ de _TOTAL_ registros",
  61. "infoEmpty": "Nenhum registro disponível.",
  62. "infoFiltered": "(filtrado _MAX_ registros no total)",
  63. "lengthMenu": "Registros por página _MENU_",
  64. "loadingRecords": "Carregando...",
  65. "processing": "Processando...",
  66. "search": "Pesquisar:",
  67. "zeroRecords": "Nenhum registro encontrado.",
  68. "paginate": {
  69. "first": "Primeiro",
  70. "last": "Último",
  71. "next": "<i class='material-icons'>navigate_next</i>",
  72. "previous": "<i class='material-icons'>navigate_before</i>"
  73. }
  74.  
  75. },
  76. } );
  77. } );
  78.  
  79. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement