songs.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. $page = 4;
  3. require("inc_header.php");
  4. // ======================================================
  5. // ALL SONGS
  6. // ======================================================
  7. $table = "";
  8. $query = "SELECT `id`, `title`, `author`, (SELECT COUNT(1) FROM `songinstance` WHERE `song`=song.id ) as sis
  9. FROM `song`
  10. ORDER BY `title` ASC";
  11. $result_temp = mysqli_query($connection, $query);
  12. while($result = mysqli_fetch_assoc($result_temp))
  13. {
  14. $table .= "<tr>";
  15. $table .= "<td><a href='" . returnurl('song.php?id=' . $result['id']) . "'>" . $result['title'] . "</a></td>";
  16. $table .= "<td>" . $result['author'] . "</td>";
  17. $table .= "<td>" . $result['sis'] . "</td>";
  18. $table .= "</tr>";
  19. }
  20. ?>
  21. <!-- Content Wrapper. Contains page content -->
  22. <div class="content-wrapper">
  23. <!-- Content Header (Page header) -->
  24. <section class="content-header">
  25. <h1>
  26. Songs
  27. <small>All song activity in one quick overview</small>
  28. </h1>
  29. <ol class="breadcrumb">
  30. <li class="active"><a href="#"><i class="ion ion-music-note"></i> Songs</a></li>
  31. </ol>
  32. </section>
  33. <section class="content">
  34. <div class="row">
  35. <div class="col-lg-12">
  36. <!-- TABLE: LATEST SONGS -->
  37. <div class="box">
  38. <div class="box-header with-border">
  39. <i class="ion ion-music-note"></i>
  40. <h3 class="box-title">Songs</h3>
  41. </div><!-- /.box-header -->
  42. <div class="box-body">
  43. <table id="songs-table" class="table table-bordered">
  44. <thead>
  45. <tr>
  46. <th>Song Name</th>
  47. <th>Author</th>
  48. <th># Songinstances</th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. <?php
  53. echo $table;
  54. ?>
  55. </tbody>
  56. </table>
  57. </div><!-- /.box-body -->
  58. </div><!-- /.box -->
  59. </div><!-- /.col -->
  60. </div><!-- /.row -->
  61. </section><!-- /.content -->
  62. </div><!-- /.content-wrapper -->
  63. <!-- DATA TABES SCRIPT -->
  64. <script src="plugins/datatables/jquery.dataTables.min.js" type="text/javascript"></script>
  65. <script src="plugins/datatables/dataTables.bootstrap.min.js" type="text/javascript"></script>
  66. <!-- Page specific javascript -->
  67. <script src="dist/js/pages/songs.js" type="text/javascript"></script>
  68. <?php
  69. require("inc_footer.php");
  70. ?>