Esempio n. 1
0
                <?php 
require '../class/books.php';
$objBook = new Books();
$Nbooks = $objBook->counting_books();
//tamaño de la pagina
$page_size = 4;
if (isset($_GET['pages'])) {
    $page = $_GET['pages'];
    $init = ($page - 1) * $page_size;
} else {
    $init = 0;
    $page = 1;
}
//calcular el total de las paginas
$total_pages = ceil($Nbooks / $page_size);
$result = $objBook->show_books($init, $page_size);
?>
                
                <h2>Listado de Libros</h2>
                <div class="space"></div>
                <a class="opcion" href="<?php 
echo URL;
?>
admin/newB.php">Insertar Nuevo Libro</a>
                <div class="space"></div>
                <form name="upload" action="<?php 
echo URL;
?>
admin/uploadB.php" method="POST" enctype="multipart/form-data">
                    <label>Cargar Libros:</label>
                    <div class="fileinputs">