-
Notifications
You must be signed in to change notification settings - Fork 0
/
userprofil.php
236 lines (176 loc) · 7.02 KB
/
userprofil.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!doctype html>
<html>
<head>
<title>QPT</title>
<meta charset="utf-8">
<link rel="stylesheet" href="kube/css/kube.css">
<link rel="stylesheet" href="css/default.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="raphael.js"></script>
<!-- Musik -->
<script type="text/javascript" src="js/musikplayer.js"></script>
<script type="text/javascript" src="js/soundmanager/soundmanager2.js"></script>
<!-- soundmanager wird aufgerufen -->
<script type="text/javascript">
soundManager.setup({
//Pfad zu swf ordner
url: 'js/soundmanager/swf/'
});
</script>
<!-- Noten -->
<script type="text/javascript" src="./js/jquery/jquery.min.js"></script>
<script type="text/javascript" src="./js/jquery/jquery-ui-1.8.20.custom.min.js"></script>
<script type="text/javascript" src="./js/zip.js/arraybuffer.js"></script>
<script type="text/javascript" src="./js/zip.js/dataview.js"></script>
<script type="text/javascript" src="./js/zip.js/deflate.js"></script>
<script type="text/javascript" src="./js/zip.js/inflate.js"></script>
<script type="text/javascript" src="./js/zip.js/zip.js"></script>
<script type="text/javascript" src="./scorediv-pv0.0.3.js"></script>
<script>
$(document).ready(function(){
$(".noten").hide();
$(".shownoten").click(function(){
$(this).next(".noten").slideToggle('slow');
});
});
</script>
<!-- show current song -->
<script>
$(document).ready(function(){
$(".current").hide();
$(".btnsplay").click(function(){
//$(this).next(".current").css('background-color', 'red');
$(this).next(".current").toggle('slow');
});
});
</script>
<!-- update rockon -->
<script type="text/javascript">
$(document).ready(function() {
$(".rockon").click(function() {
var id = $(this).attr("id");
var name = $(this).attr("name");
var data = 'id='+ id ;
var parent = $(this);
$.ajax({
type: "POST",
url: "rockonrating.php",
data: data,
cache: false,
success: function() {
parent.html('dir und '+ name + ' andere gefällt das');
alert ("Der Song rockt!");
}
});
return false;
});
});
</script>
</head>
<body>
<?php
// include "functions.php";
include "rockonrating.php";
if(isset($_SESSION['id'])){
$userid = $_GET['id'];
$userquery = $dbh->prepare( "SELECT * FROM users WHERE id = $userid ");
$userquery->execute();
$user = $userquery->fetch(PDO::FETCH_OBJ);
$musikquery = $dbh->prepare( "SELECT * FROM user_musik um JOIN musik m ON um.musik_id = m.id WHERE user_id = $userid");
$musikquery->execute();
$musik = $musikquery->fetchAll(PDO::FETCH_OBJ);
$rowquery = $dbh->prepare("SELECT musik_id FROM user_musik WHERE user_id = $userid");
$rowquery->execute();
$num_rows = $rowquery->rowCount();
if ( $num_rows < 1) {
echo ('<h4 style="color: #fff; padding: 3%; background-color: #881100;"> keine Songs hochgeladen </h4> ');
}
// if ($num_rows > 0) {
/*
$vollstaendig = false;
$mid = "";
$rockon = "";
if(array_key_exists("rockon", $_POST)){
if(trim($_POST['rockon']) == "") $vollstaendig = false;
else $rockon = htmlspecialchars(trim($_POST['rockon']));
$rockupdate = $rockon + 1;
if(trim($_POST['mid']) == "") $vollstaendig = false;
else $mid = htmlspecialchars(trim($_POST['mid']));
$deletemusik = $dbh->prepare("UPDATE musik SET rating = ? WHERE id = ?");
$deletemusik->execute(array($rockupdate, $mid));
header('location: userprofil.php?id=');
} */
?>
<img src="images/logo.png" alt="logo" class="logo-profil">
<div class="content">
<div class="bg">
<h2 style="padding: 3%; color: #fff;"> <?php echo $user->username; ?></h2>
<div class="div">
<img src=" <?php echo $user->profilbild; ?> ">
</div>
<div class="beschr">
<p> <?php echo $user->beschreibung; ?> </p>
</div>
</div>
<div id="player">
<img src="images/player2.png" class="playerLP">
<div id="holder">
<img id="platte" src="images/lp.png" width="200" alt="pattern">
</div>
</div>
<div class="bgmusikuser">
<?php
$index = 0;
foreach($musik as $index => $value){?>
<div class="allesmusikuser">
<div class="listemusikuser">
<li>
<h4> <a href="#" class="play" onclick="soundManager.play('mySound<?php echo $musik[$index]->musik_id; ?>','<?php echo $musik[$index]->musiklink; ?>');" > <?php echo $musik[$index]->titel; ?> </a> </h4>
<div class="btnsplay" style="margin-top: 5%;">
<!-- Buttons to Play Pause and Stop -->
<input type="image" value="" src="images/btnplay.png" class="btnplay play" onclick="soundManager.play('mySound<?php echo $musik[$index]->musik_id; ?>','<?php echo $musik[$index]->musiklink; ?>'); ">
<input type="image" value="" src="images/btnpause.png" class="btnpause pause" onclick="soundManager.pause('mySound<?php echo $musik[$index]->musik_id; ?>');">
<input type="image" value="" src="images/btnstop.png" class="btnpause pause" onclick="soundManager.unload('mySound<?php echo $musik[$index]->musik_id; ?>');">
<!-- /end of Buttons -->
</div>
<div class="current"><p style="color: #fff;"> zur zeit läuft: <strong><?php echo $musik[$index]->titel; ?></strong></p></div>
<?php
$ratingquery = $dbh->prepare( "SELECT rating FROM musik WHERE id = $value->musik_id");
$ratingquery->execute();
$rating = $ratingquery->fetch(PDO::FETCH_OBJ);
$ratingup = $rating-> rating +1;
?>
<!-- rock on rating -->
<div class="rockon" id="<?php echo $musik[$index]->musik_id; ?>" name="<?php echo $ratingup; ?>" style="color: #fff;">
<input type="image" value="" src="images/btnrock.png" style="width: 30px; margin-top: -50%;" class="btnrock" name="<?php echo $ratingup; ?>">
<p class="like_show" > rock on: <span class="showrockon"><?php echo $rating->rating; ?></span> </p>
<!--<input type="text" name="mid" value="<?php //echo $musik[$index]->musik_id; ?>" hidden>-->
</div>
<button class="btn btn-round shownoten"> zu den Noten </button>
<div class="noten">
<form method="post" action="musik.php" enctype="multipart/form-data">
<input type="text" name="musikid" value="<?php echo $musik[$index]->musik_id; ?>" hidden>
<input type="file" name="xmlupload" value="upload xml" class="btn btn-small" >
<input type="submit" value="upload" class="btn btn-append">
</form>
<script type="text/javascript">zip.workerScriptsPath='../js/zip.js/';</script>
<div class="score-div" style="position: relative; width: 700px; height: 500px; margin-bottom: 10px;" musicxml_ref="<?php echo $value->notenlink; ?>"></div>
</div>
</li>
</div>
</div>
<?php
}
?>
</div>
</div>
<?php
}
else{
header('location:index.html');
}
include "navigation.php";
?>
</body>
</html>