include_once('admin/fnc/conexion.php');
include_once('admin/fnc/paginar.php');
if (!isset($_GET['pag'])){ $pag = 1; }else{ $pag=$_GET['pag'];}
$tampag = 20;
$reg1 = ($pag-1) * $tampag;
if(isset($_GET['tipo']) && $_GET['tipo']=="B"){
$result = mysql_query("SELECT * FROM libros WHERE tipo='b' ORDER BY titulo", $con);
}else{
if(isset($_GET['letra'])){ $letra=strtoupper($_GET['letra']); }else{ $letra="A"; }
$result = mysql_query("SELECT * FROM libros WHERE (titulo LIKE '".$letra."%') ORDER BY titulo", $con);
}
$total = mysql_num_rows($result);
if (mysql_num_rows($result)){
for ($i=$reg1; $i