-
Notifications
You must be signed in to change notification settings - Fork 0
/
mymusic.php
171 lines (154 loc) · 7.01 KB
/
mymusic.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
session_start();
if (!isset($_SESSION["loggedin"])) {
header("Location: login-register.php");
}
include "functions.php";
//aktuális felhasználó adatai
$user=$_SESSION["user"];
$user_name=$user["username"];
$user_email=$user["email"];
$user_picture=$_SESSION["user_pic"];
$user_id=$user["id"];
$user_musics=array();
$user_musics=list_mymusic($user_id);
//megnézzük van-e egyáltalán zenénk az adatbázisban
if(count($user_musics)==0){
//ha nincs zenénk
$have_beats=false;
}else{
//ha van zenénk
$uploads=list_beats_and_covers($user_musics, $user_name);//audio-cover párosok kilistázása
$have_beats=true;
}
?>
<!DOCTYPE html>
<html lang="hu">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="authors" content="Földes Gergely, Czellár Botond">
<meta name="description" content="licenciába adás">
<meta name="keywords" content="HTML,CSS,webterv">
<link rel="icon" href="assets/img/icon.jpg">
<title>BEAT STORE</title>
<!--css-->
<link rel="stylesheet" href="style/mymusic.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css">
</head>
<!--valamiért css-ben nem működik a background-->
<body>
<!--navbar&logo-->
<header class="header">
<input type="checkbox" id="check">
<label for="check">
<img src="assets/img/menu2.png" alt="menu" id="btn" class="menu_icon">
<img src="assets/img/xmenu.png" alt="menu" id="cancel" class="xmenu_icon">
</label>
<a href="beat.php" class="logo">BEAT STORE</a>
<nav class="navbar">
<ul class="header_menu">
<li><a href="tracks.php" class="menus">Tracks</a></li>
<li><a href="licensing.php" class="menus">Licensing</a></li>
<li><a href="sell.php" class="menus">Sell your music</a></li>
<li><a href="contact.php" class="menus">Contact</a></li>
</ul>
<div>
<a href="profile.php"><img class="profile-picture" src="<?php echo "$user_picture" ?>" alt="profile_picture"></a>
</div>
</nav>
</header>
<main class="main_body">
<!--Profile-->
<div class="container">
<!--menü-->
<div class="profile-menu">
<div>
<img class="profile-picture" src="<?php echo "$user_picture" ?>" alt="profile_picture">
</div>
<ul class="datas">
<li><a href="profile.php">My profile</a></li>
<li><a class="active" href="mymusic.php">My musics</a></li>
<li><a href="editdata.php">Edit data</a></li> <!--change password|edit profile picture-->
</ul>
</div>
<!--audiók-->
<?php if($have_beats==false){ ?>
<div class="mymusics">
<h2 class="no-beats">You didn't upload any audio.</h2>
</div>
<?php }else{ ?>
<div class="mymusics">
<div class="slider_head">
<h2>My tracks</h2>
<div class="slider-btn">
<img id="left_scroll" src="assets/img/arrow_left.png" alt="left_arrow">
<img id="right_scroll" src="assets/img/arrow_right.png" alt="right_arrow">
</div>
</div>
<ul class="slider_content">
<?php $i=1; //számláló + music_id + tömb index?>
<?php foreach($uploads as $upload) {//a $key music id is egyben?>
<?php $actual=list_mymusic_by_music_id($upload[2]); //music_id alapján az aktuális zene adatai ($uploads[2]-ben van a music_id)?>
<?php $title=$actual["title"];?>
<?php $artist=$actual["artist"];?>
<?php $bpm=$actual["bpm"];?>
<?php $price=$actual["price"];?>
<li class="music_card">
<div class="img_player"> <!--$uploads[1][$key] -> azért 1-es az 1. index, mert azon az indexen belül van a covers asszoc. mappa, ahonnan a borító képeket lehet elérni--->
<img class="audio-img" src="<?php echo $upload[1] ?>" alt="beat<?php echo $i ?>" onclick="document.getElementById('audio_play<?php echo $i ?>').play(); return false;"/>
<audio id="audio_play<?php echo $i ?>">
<source src="<?php echo $upload[0] ?>">
</audio>
</div>
<h3><?php echo $artist ?></h3>
<p class="title"><?php echo $title ?></p>
<p class="title">$<?php echo $price ?> | <?php echo $bpm ?> BPM</p>
</li>
<?php $i++; ?>
<?php } ?>
</ul>
</div>
<?php } ?>
<img class="waves-picture" src="assets/img/waves.png" alt="waves_picture">
</div>
</main>
<!--footer-->
<footer class="footer">
<div class="footer_container">
<div class="footer_row">
<div class="footer-col">
<h4>Beat Store</h4>
<ul>
<li><a href="licensing.php">About us</a></li>
<li><a href="#">Merch</a></li>
</ul>
</div>
<div class="footer-col">
<h4>Support</h4>
<ul>
<li><a href="#">Pricing</a></li>
<li><a href="login-register.php">Register</a></li>
<li><a href="login-register.php">Login</a></li>
<li><a href="contact.php">Contact us</a></li>
</ul>
</div>
<div class="footer-col">
<h4>Social Media</h4>
<div class="social">
<ul>
<li><a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ" target="_blank"><i class="fa-brands fa-youtube"></i></a></li>
<li><a href="https://www.instagram.com/unico_uniuni/" target="_blank"><i class="fa-brands fa-instagram"></i></a></li>
<li><a href="https://www.facebook.com/profile.php" target="_blank"><i class="fa-brands fa-facebook"></i></a></li>
<li><a href="https://www.mme.hu/" target="_blank"><i class="fa-brands fa-twitter"></i></a></li>
</ul>
</div>
</div>
</div>
<p class="beatStore2023">© 2023 Beat Store</p>
</div>
</footer>
<script src="script/scrolls.js"></script>
</body>
</html>