overzicht.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php if($count > 5){
  2. $tomuch = 1;
  3. }else{
  4. $tomuch = 0;
  5. };
  6. ?>
  7. <script>
  8. function checkAlarmAdd(){
  9. if( <?php echo ($tomuch); ?>){
  10. alert("Er zijn teveel alarmen. Verwijder alarmen om nieuwe te kunnen toevoegen.");
  11. }else{
  12. window.location.href = "alarmen.php?i=toevoegen";
  13. }
  14. }
  15. </script>
  16. <div class="col-lg-12">
  17. <div class="ibox float-e-margins">
  18. <div class="ibox-title">
  19. <h5>Alarmen overzicht</h5>
  20. <div class="ibox-tools">
  21. <a class="collapse-link">
  22. <i class="fa fa-chevron-up"></i>
  23. </a>
  24. <a href="javascript:checkAlarmAdd()"> <i class="fa fa-plus"></i></a>
  25. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  26. <i class="fa fa-wrench"></i>
  27. </a>
  28. <ul class="dropdown-menu dropdown-user">
  29. <li><a href="#">Alle alarmen verwijderen</a></li>
  30. </ul>
  31. <a class="close-link">
  32. <i class="fa fa-times"></i>
  33. </a>
  34. </div>
  35. </div>
  36. <div class="ibox-content">
  37. <table class="table table-striped">
  38. <thead>
  39. <tr>
  40. <th>#</th>
  41. <th>Naam</th>
  42. <th>Tijd</th>
  43. <th>StreamUrl</th>
  44. <th>Beschrijving</th>
  45. <th>Acties</th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. <?php
  50. if($stmt = $mysqli -> prepare("SELECT id, message, name, streamurl, streamport, streamip, tijd, streamdomain FROM alarm WHERE uid=?")){
  51. $stmt -> bind_param('i', $userid);
  52. $stmt -> execute();
  53. $stmt -> bind_result($id, $message, $name, $streamurl, $streamport, $streamip, $tijd, $streamdomain);
  54. while($result = $stmt -> fetch()){
  55. print '
  56. <tr>
  57. <td>'.$id.'</td>
  58. <td>'.$name.'</td>
  59. <td>'.$tijd.'</td>
  60. <td>'.$streamdomain.'</td>
  61. <td>'.$message.'</td>
  62. <td style="width: 100px !important" class="text-center valign-middle" >
  63. <a href="alarmen.php?i=wijzigen&id='.$id.'"><button class="btn btn-xs btn-primary"><i class="fa fa-pencil"></i></button></a>
  64. &nbsp;
  65. <a href="alarmen.php?i=verwijderen&id='.$id.'"><button class="btn btn-xs btn-danger"><i class="fa fa-times"></i></button></a>
  66. </td>
  67. </tr>
  68. ';
  69. };
  70. $stmt -> close();
  71. }
  72. ?>
  73. </tbody>
  74. </table>
  75. </div>
  76. </div>
  77. </div>