-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
70 lines (63 loc) · 1.68 KB
/
Copy pathindex.php
File metadata and controls
70 lines (63 loc) · 1.68 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
<?php
$BDD = mysql_connect('localhost', 'root','');
mysql_set_charset('utf8',$BDD);
mysql_select_db('test');
$sql = "SELECT * FROM interview";
$sql = mysql_query($sql);
$interview = array();
while($data=mysql_fetch_array($sql)) {
$interview[] = array(
"nom" => $data['nom']),
"prenom" => $data['prenom']), // lors des caractère spéciaux
"bio" => $data['bio']),
"img" => $data['image']
);
}
?>
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>test</title>
<link rel="stylesheet" href="css/normalize.css"/>
<link rel="stylesheet" href="css/sc-player-minimal.css" type="text/css">
<link rel="stylesheet" href="css/style.css"/>
<?php
$interview = json_encode($interview);
echo "<script>
var interview = ".$interview.";
</script>";
?>
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/soundcloud.player.api.js"></script>
<script type="text/javascript" src="js/sc-player.js"></script>
</head>
<body>
<div id="haut">
<div id="logo">
</div>
<div id="lecteur">
<a href="https://soundcloud.com/macklemore/macklemore-x-ryan-lewis-cant" class="sc-player"></a>
</div>
<div id="info">
</div>
</div>
<ul id="liste">
</ul>
<div id="footer">
</div>
<script>
$(function() {
$(document).ready(function(){
for (var i = 0; i < interview.length; i++) {
$('#liste').append("<li data-index='"+ i +"'></li>");
};
$('#liste li').click(function(){
var index = $(this).attr('data-index');
$('#info').html("<p id='ligne_nom'>hi there " + interview[index].prenom + "</p>");
});
});
});
</script>
</body>
</html>