-
Notifications
You must be signed in to change notification settings - Fork 0
/
titulos.php
87 lines (59 loc) · 1.59 KB
/
titulos.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
<?php
/**
* @author iberlot
* @version 20151223
* @package Mytthos
* @category General
*
* Mostramos los titulos que hay para una saga
*
*/
require_once ("Config/includes.php");
if (isset ($_GET ["idAutor"]))
{
$idAutor = trim ($_GET ['idAutor']);
}
else
{
header ("Location:autores.php");
exit ();
}
if (isset ($_GET ["idSaga"]))
{
$idSaga = trim ($_GET ['idSaga']);
}
else
{
header ("Location:sagas.php?autorId=$idAutor");
exit ();
}
$equery = "SELECT * FROM Saga WHERE idSaga = $idSaga";
$result = mysqli_query ($link, $equery) or die ('Query error: ' . mysqli_error ($link));
$row = mysqli_fetch_array ($result, MYSQLI_ASSOC);
echo "<div id='autor'>";
echo '<img class="fotoAutor" src="fotosSagas/'.$row['imagen'].'">';
echo '<Br />';
echo '<h4>'.$row['titulo'].'</h4>';
echo 'Cantidad de libros: '.$row['cantLibros'];
echo '<Br />';
echo '<Br />';
echo $row['descripcion'];
echo '<Br />';
echo "</div>";
echo "<h3>Titulos</h3>\n";
$equery = "SELECT * FROM Libro WHERE idAutor = $idAutor and idSaga = $idSaga ORDER BY ordenSaga";
$result = mysqli_query ($link, $equery) or die ('Query error: ' . mysqli_error ($link));
while ($row = mysqli_fetch_array ($result, MYSQLI_ASSOC))
{
$idSaga = trim ($row ['idSaga']);
$idLibro = $row ['idLibro'];
$titulo = trim ($row ['titulo']);
$ordenLibro = $row ['ordenSaga'];
$tituloLink = str_pad ($ordenLibro, 2, "0", STR_PAD_LEFT) . "-" . str_replace (' ', '_', $titulo);
echo "<li><a href='capitulos.php?idLibro=$idLibro'>";
echo "<b> $titulo</b></a></li><Br/>";
}
mysqli_close ($link);
?>
<Br/><Br/><Br/>
<Br/><Br/><Br/>