-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtracks_view.php
More file actions
122 lines (102 loc) · 4.15 KB
/
Copy pathtracks_view.php
File metadata and controls
122 lines (102 loc) · 4.15 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
<?php
include 'includes/callAPI.php';
// Check if we have a filter parm
if (!empty($_GET["filt"])) {
$filt = $_GET["filt"];
$plfilt = $filt;
} else {
$filt = '';
$plfilt = 'Filter...';
}
// Check if we have an offset value passed for pagination
if (!empty($_GET["ofst"])) {
$offset = $_GET["ofst"];
} else {
$offset = 0;
}
//Set up some offset values for our next and prev buttons
if ($offset == 0) {
$poffset = 0;
} else {
$poffset = $offset - 20;
}
$noffset = $offset + 20;
$get_data = handshakeAPI();
$hshake = json_decode($get_data, true);
$auth=$hshake['auth'];
$get_data = songsAPI($auth, $filt, $offset);
$song_results = json_decode($get_data, true);
$cnt = count($song_results['song']); //Set counter to number of songs returned
$main_results['album'][0]['songcount'] = $cnt;
// Get playlist info so we can have them listed in our per track menu
$get_data = playlistsAPI($auth, '', 0);
$playlists_results = json_decode($get_data, true);
include 'includes/header_iframe.php';
?>
<script>
parent.activeMenu(5); // Call js function in parent to highlight the correct active menu item -->
parent.list = []; // Clean out the old list before we build a new one
</script>
<body>
<div class="ui inverted space segment">
<?php
echo '<div class="ui one column grid">' . "\r\n"; //Two columns - first column just for spacing.
// Left column for album art and stats
echo '<div class="ui four wide column">' . "\r\n";
echo '<i class="massive bordered feature music icon"></i>';
echo '<br><br>';
echo '<strong>Tracks</strong></a>';
echo '<br>A - Z';
echo '<br> songs';
echo '</div>'; // End of 1st column
// Right column for list of songs in table
echo '<div class="ui twelve wide column">';
echo '<div class="ui middle aligned grid">';
echo '<div class="left floated four wide column">';
echo '<h1 class="ui smoke header">Tracks <i class="small music icon"></i></h1>';
echo '</div>' . "\r\n";
// Tag column
echo '<div class="three wide column">' . "\r\n";
if ($filt !== '') {echo '<div class="ui filter large label">' . $filt . ' <a class="icn" href="tracks_view.php"><i class="icon close"></i></a></div>';}
echo '</div>' . "\r\n";
// Filter bar column
echo '<div class="three wide column">' . "\r\n";
echo '<form class="ui form" method="GET" action="tracks_view.php">' . "\r\n";
echo '<div class="field">' . "\r\n";
echo '<div class="ui small icon input">' . "\r\n";
echo '<input name="filt" type="text" placeholder="' . $plfilt . '" value="' . $filt . '"><i class="filter icon"></i>';
echo '</div>' . "\r\n";
echo '</div>' . "\r\n";
echo '</form>' . "\r\n";
echo '</div>' . "\r\n";
// Pagination column
echo '<div class="right floated right aligned four wide column">' . "\r\n";
if ($offset > 0) echo '<a class="icn" href="tracks_view.php?filt=' . $filt . '&ofst=' . $poffset . '"><i class="arrow circle left icon"></i></a> ';
if ($cnt == 20) echo '<a class="icn" href="tracks_view.php?filt=' . $filt . '&ofst=' . $noffset . '"><i class="arrow circle right icon"></i></a>';
echo '</div>' . "\r\n";
echo '</div>' . "\r\n";
// Build the table that will list our tracks
include 'includes/build_tracks.php';
echo '</div>' . "\r\n"; // End of 2nd column
echo '</div>' . "\r\n"; //End of content grid.
?>
</div>
<!-- Set up new playlist modal -->
<div class="ui modal">
<div class="ui inverted space segment">
<div class="ui huge smoke header">New Playlist</div>
<div class="item"><input id="newname" type="text" placeholder="Title"></div><br>
<div class="actions">
<button class="ui tiny cancel button" id="cancel">CANCEL</button>
<button class="ui tiny approve button" id="save">SAVE</button>
</div>
</div>
</div>
<!-- JS to initialise dropdowns-->
<script>
$('.ui.dropdown')
.dropdown()
;
</script>
</body>
</html>