Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. <div class="scroll">
  2. <table class="table table-hover" id="myTable">
  3. <thead>
  4. <tr>
  5. <th><b>Nome</b></th>
  6. <th><b>Email</b></th>
  7. <td><b>Telefone</b></td>
  8. <td><b>Cidade</b></td>
  9. <td><b>PR</b></td>
  10. </tr>
  11. </thead>
  12.  
  13. <tbody>
  14. <?php foreach ($results as $data) : ?>
  15. <td><?= $data->nomeCliente ?></td>
  16. <td><?= $data->emailCliente ?></td>
  17. <td><?= $data->telefoneCliente ?></td>
  18. <td><?= $data->cidadeCliente ?></td>
  19. <td><?= $data->estadoCliente ?></td>
  20. <td>
  21. <a ><i class="glyphicon glyphicon-trash" title="Apagar" onclick="modalDelete()"></i></a>
  22. </td>
  23.  
  24. <td>
  25. <a href="index.php"><i class="glyphicon glyphicon-edit" title="Editar".></i></a>
  26. </td>
  27.  
  28. <td>
  29. <a href="index.php"><i class="glyphicon glyphicon-eye-open" title="Visualizar"></i></a>
  30. </td>
  31. </tr>
  32. <?php endforeach ?>
  33. </tbody>
  34. </table>
  35. <center>
  36. <ul class="pagination">
  37. <li><a><?php echo $links; ?></a></li>
  38. <ul>
  39. </center>
  40. </div>
  41.  
  42. public function consultaClientes() {
  43. $this->output->enable_profiler(TRUE);
  44. $this->load->model("Cliente/Clientes_Model");
  45. $config["base_url"] = base_url('index.php/Cliente/');
  46. $config["total_rows"] = $this->Clientes_Model->record_count();
  47. $config["per_page"] = 5;
  48. $config['use_page_numbers'] = TRUE;
  49. $config["uri_segment"] = 3;
  50. $choice = $config["total_rows"] / $config["per_page"];
  51. $config["num_links"] = round($choice);
  52.  
  53. $this->pagination->initialize($config);
  54.  
  55. $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
  56. $data["results"] = $this->Clientes_Model
  57. ->fetch_countries($config["per_page"], $page);
  58. $data["links"] = $this->pagination->create_links();
  59.  
  60. $this->load->view("menu");
  61. $this->load->view("Cliente/Clientes", $data);
  62. }
  63.  
  64. public function record_count() {
  65. return $this->db->count_all("cliente");
  66. }
  67.  
  68.  
  69. public function fetch_countries($limit, $start) {
  70. $this->db->limit($limit, $start);
  71. $query = $this->db->get("cliente");
  72.  
  73. if ($query->num_rows() > 0) {
  74. foreach ($query->result() as $row) {
  75. $data[] = $row;
  76. }
  77. return $data;
  78. }
  79. return false;
  80. }
  81.  
  82. $route['Cliente'] = 'Cliente/Clientes/consultaClientes';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement