-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrack_details.php
112 lines (94 loc) · 2.9 KB
/
track_details.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
111
112
<?php
require_once('frame_header.php');
// should check session first. if not go back to index.php
$trackid=$_GET['trackid'];
?>
<br>
<div class="container-fluid">
<div class="row">
<div class="col-md text-primary">
<span class="details">Username:</span> <?php echo $user->getusername() ?><br>
</div>
<div class="col-md text-primary">
<?php
if($isOwner){// only disply owner detail if owner is viewing own page?>
<span class="details">Name:</span> <?php echo $user->getusertitle() ?><br>
<span class="details">Email:</span> <?php echo $user->getuseremail() ?><br>
<span class="details">City:</span> <?php echo $user->getusercity()?><br>
<?php }?></div>
<div class="col-md text-primary">
</div>
</div>
</div>
<br>
<div class="container-fluid">
<div class="row">
<div class="col-md">
<h3 class="text-danger">Playlists owned</h3>
<div>
<?php
if($isOwner){
$userplaylist=$user->getUserAllPlaylist();
}else{
$userplaylist=$user->getUserPublicPlaylist();
}
// check if there are results
if ($userplaylist->num_rows >0){
while ($row=mysqli_fetch_assoc($userplaylist)) {
//ptitle, pdate, powner, public
$pid = $row["pid"];
echo "<div class='listitem'>
<a href='playlist.php?pid=".$pid."'><b>".$pid."</b><br></a>
<a href='playlist.php?pid=".$pid."'>".$row["ptitle"]."<hr class='bg-danger'></a>
</div>";
}
}else{
echo "<hr class='bg-danger'>";
}
?>
</div>
</div>
<div class="col-md">
<h3 class="text-primary">Artist Liked</h3>
<div>
<?php
$userLikes=$user->getUserLikes();
// check if there are results
if ($userLikes->num_rows >0){
while ($row=mysqli_fetch_assoc($userLikes)) {
//ptitle, pdate, powner, public
$artistid = $row["artistid"];
$artist = new Artist($conn,$artistid);
echo "<div class='listitem'>
<a href='artist.php?artistid=".$artistid."'><b>".$artist->getTitle()."</b><br></a><hr class='bg-danger'></a>
</div>";
}
}else{
echo "<hr class='bg-danger'>";
}
?>
</div>
</div>
<div class="col-md">
<h3 class="text-secondary">User Followed</h3>
<div>
<?php
$userFollows=$user->getUserFollows();
// check if there are results
if ($userFollows->num_rows >0){
while ($row=mysqli_fetch_assoc($userFollows)) {
//ptitle, pdate, powner, public
$username=$row["username"];
echo "<div class='listitem'>
<a href='user.php?username=".$username."'><b>".$username."</b><br></a><hr class='bg-danger'></a>
</div>";
}
}else{
echo "<hr class='bg-danger'>";
}
?>
</div>
</div>
</div>
</div>
<?php require_once('frame_footer.php'); ?>