-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibros.php
executable file
·78 lines (69 loc) · 2.12 KB
/
libros.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
<!DOCTYPE html>
<html lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" type="image/x-icon" href="Imagen/favicon.ico" />
<style type="text/css">
th
{
color: white;
background-color: green;
height: 50px;
}
td
{
height: 30px;
}
</style>
</head>
<body>
<?php
include ("conexion.php");
echo "<h2 align='center' style='font-family: sans-serif'>Ultimos libros <img type='image/x-icon' src='Imagen/favicon.ico'></h2><br>";
echo "<center>";
$consultar = @mysql_query("SELECT * FROM libros WHERE aprobado='1' ORDER BY fecha DESC");
echo "<table border='5' bordercolor='green' style='font-family: sans-serif; border-radius: 7.5px'>
<tr>
<th> Código </th>
<th> Título </th>
<th> Autor </th>
<th> Genero </th>
<th>Año de<br /> publicación </th>
<th> Subido por </th>
<th> Fecha de subida </th>
<th><img type='image/x-icon' src='Imagen/favicon.ico'></th>
<tr>";
while ($libros = @mysql_fetch_array($consultar))
{
$codigo=$libros['codigo'];
$titulo=$libros['titulo'];
$autor=$libros['autor'];
$genero=$libros['genero'];
$year=$libros['year'];
$archivo=$libros['archivo'];
$subido=$libros['subido'];
$fecha=$libros['fecha'];
echo "<tr>
<td align='center'> <strong>".$codigo."</strong> </td>
<td align='center'> ".$titulo." </td>
<td align='center'> ".$autor." </td>
<td align='center'> ".$genero." </td>
<td align='center'> ".$year." </td>";
if ($subido == "Administrador")
{
echo "<td align='center'> <i>".$subido."</i> </td>";
}
else
{
echo "<td align='center'> ".$subido." </td>";
}
echo "<td align='justify'> ".$fecha." </td>
<td> <a href='$archivo' style='color: green' target='_blank'>Leer</a> </td>
</tr>";
}
echo "</table>";
echo "<br><br>";
echo "</center>";
?>
</body>
</html>