/
escuchar.php
53 lines (49 loc) · 2.07 KB
/
escuchar.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Escuchar</title>
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<section id="contenedor">
<header>
<a href="index.php"><img id="logo" src="css/images/podcast.png"/></a>
<a href="index.php">Index</a>
<a href="buscar.php">Canciones</a>
<?php
require 'clases/AutoCarga.php';
$sesion = new Session();
$sesion->leerArchivo();
$c = Request::get("c");
$user = $sesion->getUser();
if (!$sesion->isLogged()) {
?>
<form id="formu1" action="phplogin.php" method="POST">
<input type="text" name="nombre" value="" placeholder="usuario"/>
<input type="password" name="pass" value="" placeholder="contraseña"/><input type="submit" value="ok" />
</form>
</header>
<?php
} else {
?>
<a href="user.php">Mis canciones</a>
<a href="phplogout.php">Logout</a>
<?php
}
$cancion = $sesion->get($c);
if ($cancion->getPrivado() == "ON" && $user != $cancion->getUser()) {
echo "esta cancion es privada";
exit();
}
$name = $cancion->getNombre();
$imagen = $cancion->getImagen();
$audio = $cancion->getAudio();
$sesion->doVisita($name);
$sesion->guardarArchivo();
echo "</br></br></br>Reproduciendo:" . $cancion->getNombre();
echo "</br><img id=\"imagenReproducir\" src=\"canciones/$name/$imagen\"/>";
echo "<embed id=\"repro\" src =\"canciones/$name/$audio\" autostart=\"true\" play=\"true\">";
?>
</body>
</html>