-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathctrAutor.php
72 lines (60 loc) · 1.87 KB
/
ctrAutor.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
<?php
$tokenUnicoBD = "101452";
if (isset ( $_POST ["token"] ))
{
// Con el token que se guarda en session despues del login ya podes saber quien es la persona y tenes los datos en la base
$tokenSession = $_POST ["token"];
}
else
{
$tokenSession = "";
}
if (isset ( $_POST ["funcion"] ))
{
$funcion = $_POST ["funcion"];
}
else
{
$funcion = "";
}
if ($tokenUnicoBD == $tokenSession)
{
include_once ("Config/variables.php"); // incluimos el archivo que contiene las variables
include_once ("Config/config.php"); // incluimos el archivo de configuracion
include_once ("Config/conect.php"); // incluimos el archivo de conexion
include_once ("Config/funciones.php"); // incluimos el archivo que va a contener todas las funciones del sistem
if ($funcion == 'header')
{
include_once ("inc/header2.php");
}
elseif ($funcion == 'autores')
{
$directorio = "Biblioteca";
$archivo = scandir ( $directorio );
$equery = "SELECT * FROM Autor ORDER BY Apellido";
$result = mysqli_query ( $link, $equery ) or die ( 'Query error: ' . mysqli_error ( $link ) );
while ($row = mysqli_fetch_array ( $result, MYSQLI_ASSOC ))
{
if ($row ['segNombre'] != "")
{
$nombre = trim ( $row ['nombre'] ) . "_" . trim ( $row ['segNombre'] );
$nombreTitulo = trim ( $row ['nombre'] ) . " " . trim ( $row ['segNombre'] );
}
else
{
$nombre = trim ( $row ['nombre'] );
$nombreTitulo = trim ( $row ['nombre'] );
}
$nombre = str_replace ( ' ', '_', $nombre );
//$dato .= "<li><a href='sagas.php?autorId=" . $row ['idAutor'] . "'>" . $row ['apellido'] . ", " . $nombreTitulo . "</a></li><Br/>";
$dato .= "<li><a href='?funcion=sagas&autorId=" . $row ['idAutor'] . "'>" . $row ['apellido'] . ", " . $nombreTitulo . "</a></li><Br/>";
}
echo $dato;
}
elseif ($funcion == 'footer')
{
include_once ("inc/footer2.php");
}
mysqli_close ( $link );
}
?>