-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsongs.php
110 lines (85 loc) · 3 KB
/
songs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
$nav_selected = "SONGS";
$left_buttons = "YES";
$left_selected = "SONGS";
include("./nav.php");
global $db;
?>
<div class="right-content">
<div class="container">
<h3 style = "color: #01B0F1;">SONG List</h3>
<table id="info" cellpadding="0" cellspacing="0" border="0"
class="datatable table table-striped table-bordered datatable-style table-hover"
width="100%" style="width: 100px;">
<thead>
<tr id="table-first-row">
<th>Movie Name</th>
<th>Song Title</th>
<th>Lyrics</th>
<th>Play</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT
mv.english_name,
s.title,
sm.s_link,
SUBSTRING(s.lyrics, 1, 30) as lyrics
FROM movie_song ms
INNER JOIN `song_media` sm USING(song_id)
INNER JOIN `movies` mv USING(movie_id)
INNER JOIN `songs` s USING(song_id)";
$result = $db->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo '<tr>
<td>'.$row["english_name"].'</td>
<td>'.$row["title"].'</td>
<td>'.$row["lyrics"].'</td>
<td><a target="_blank" class="btn btn-info btn-sm" href="'.$row["s_link"].'">Play</a></td>
</tr>';
}//end while
}//end if
else {
echo "0 results";
}//end else
$result->close();
?>
</tbody>
</table>
<script type="text/javascript" language="javascript">
$(document).ready( function () {
$('#info').DataTable( {
dom: 'lfrtBip',
buttons: [
'copy', 'excel', 'csv', 'pdf'
] }
);
$('#info thead tr').clone(true).appendTo( '#info thead' );
$('#info thead tr:eq(1) th').each( function (i) {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
$( 'input', this ).on( 'keyup change', function () {
if ( table.column(i).search() !== this.value ) {
table
.column(i)
.search( this.value )
.draw();
}
} );
} );
var table = $('#info').DataTable( {
orderCellsTop: true,
fixedHeader: true,
retrieve: true
} );
} );
</script>
<style>
tfoot {
display: table-header-group;
}
</style>
<?php include("./footer.php"); ?>