Guest User

Untitled

a guest
Nov 20th, 2017
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. <?php
  2. $cam = $db->prepare('select * from camere');
  3. $cam->execute();
  4.  
  5. while ($cams = $cam->fetch(PDO::FETCH_OBJ)) {?>
  6. <ul class="list" style="list-style: none;">
  7. <div class="panel panel-primary">
  8. <div class="panel-heading">
  9. <li><h3 class="panel-title"><?php $cam_loc = $cams->locatie; ?><?php echo $cam_loc;?></h3> </li>
  10. </div>
  11.  
  12. <div class="panel-body">
  13. <div class="row">
  14. <div class="col-md-2" align="center">
  15. <div class="list-group">
  16. <a class="list-group-item">Model: <strong><?php echo $cams->model; ?></strong></a>
  17. <a class="list-group-item">Ip Intern: <strong><?php echo $cams->ip_int; ?></strong></a>
  18. <a class="list-group-item">Ip Extern: <strong><?php echo $cams->ip_ext; ?></strong></a>
  19. <a class="list-group-item">Port: <strong><?php echo $cams->port; ?></strong></a>
  20. <a class="list-group-item">User: <strong><?php echo $cams->user; ?></strong></a>
  21. <a class="list-group-item">Pass: <strong><?php echo $cams->pass; ?></strong></a>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. </ul>
  28. <?php } ?>
  29.  
  30. <?php
  31. $cam = $db->prepare('select * from camere');
  32. $cam->execute();
  33.  
  34. $heading = "";
  35.  
  36. while ($cams = $cam->fetch(PDO::FETCH_OBJ)) {?>
  37. <ul class="list" style="list-style: none;">
  38. <div class="panel panel-primary">
  39.  
  40. <?php $cam_loc = $cams->locatie;
  41.  
  42. if ($heading != $cam_loc) { ?>
  43.  
  44. <div class="panel-heading">
  45. <li><h3 class="panel-title"><?php echo $cam_loc; ?></h3> </li>
  46. </div>
  47.  
  48. <?php }
  49. //Update $heading ready for the next row.
  50. $heading = $cam_loc;
  51. } ?>
  52.  
  53. <div class="panel-body">
  54. <div class="row">
  55. <div class="col-md-2" align="center">
  56. <div class="list-group">
  57. <a class="list-group-item">Model: <strong><?php echo $cams->model; ?></strong></a>
  58. <a class="list-group-item">Ip Intern: <strong><?php echo $cams->ip_int; ?></strong></a>
  59. <a class="list-group-item">Ip Extern: <strong><?php echo $cams->ip_ext; ?></strong></a>
  60. <a class="list-group-item">Port: <strong><?php echo $cams->port; ?></strong></a>
  61. <a class="list-group-item">User: <strong><?php echo $cams->user; ?></strong></a>
  62. <a class="list-group-item">Pass: <strong><?php echo $cams->pass; ?></strong></a>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </ul>
  69. <?php } ?>
Add Comment
Please, Sign In to add comment