/****conexion.php***\
<?php
if (!$cnx) {
}
if (!$bd) {
}
?>
/*************listar.php*****************\
<?php
require_once('conexion.php');
if (isset($_POST['busc'])){ $num=$_POST['num'];
$sql="select * from tblCondominio where codigo='$num' order by fechaAcceso DESC";
}else{
$sql="select * from tblCondominio order by fechaAcceso DESC";
}
$_SESSION["SQL_SHOW"]=$sql;
$TAMANO_PAGINA = 5;
$pagina = $_GET["pagina"];
if (!$pagina) {
$inicio = 0;
$pagina = 1;
}
else {
$inicio = ($pagina - 1) * $TAMANO_PAGINA;
}
$total_paginas = ceil($num_total_registros / $TAMANO_PAGINA); $consulta = $sql." LIMIT ".$inicio."," . $TAMANO_PAGINA;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" language="javascript">
function cambiar(id,color){
document.getElementById(id).style.backgroundColor=color;
}
</script>
</head>
<body>
<form action="default.php?op=1073" method="POST" >
<table width="700" align="center" border="1">
<tr>
<td colspan=6 align="center">Modificación</td></tr>
<tr><td align=right>Codigo
<td align=left><input type="text" name="codigo"/></td></tr>
<tr>
<td colspan=6><center><input type="submit" name="busc" value="Buscar">
</center>
</table>
</form>
<table width="100%" align="center" border="1">
<tr><td width="62" align=center>TIPO</td>
<td width="70" align=center>CODIGO</td>
<td width="340" align=center>NOMBRE</td>
<td width="40" align=right>DOCUMENTOS</td>
<td width="40" align=center>OBSERVACIONES</td>
<td width="30" align=center>OPCIONES</td></tr>
<?php
$i=0;
?>
<tr style="background-color:#f0f0f0" id="<?php echo $i;?>" onMouseMove="cambiar('<?php echo $i;?>','#cccccc')" onMouseOut="cambiar('<?php echo $i;?>','#f0f0f0')">
<td width="62" align=center>
<?php if($res['tipo']==2){?>casa
<?php }
elseif($res['tipo']==1){?>
departamento
<?php }
?></td>
<td width="70" align=center><?php echo $res['codigo'];?></td>
<td width="340" align=justify><?php echo $res['nombre'];?></td>
<td width="40" align=center>
<a href="recaudacion/data2/documents2/<?php echo $res['documentosReg'];?>" target="_blank"><?php echo $res['documentosReg'];?></a></h6></td>
<td width="40"><?php echo $res['observaciones'];?></td>
<td width="30"><a href="editar.php?num=<?php echo $res[2];?>"><strong>Editar</strong></a></td></tr>
<?php
$i=$i+1;
}
?>
</table>
<table width="100%" align="center">
<tr>
<td width="8"></td>
<td width="474" align="left" ><h3>
<?php
if ($total_paginas > 1) {
if ($pagina != 1)
echo '<a href="'.$url.'?pagina='.($pagina-1).'" class="Estilo1" >Anterior < </a>';
for ($i=1;$i<=$total_paginas;$i++) {
if ($pagina == $i)
echo $pagina;
else
echo ' <a href="'.$url.'?pagina='.$i.'" class="Estilo1">'.$i.'</a> ';
}
if ($pagina != $total_paginas)
echo '<a href="'.$url.'?pagina='.($pagina+1).'" class="Estilo1"> >Siguiente </a>';
}
?>
</h3></td>
<td width="105"></td>
<td width="250" align="left"><strong>Total de Registros: <span class="Estilo4">
<?php
$cantidad = "select count(codigo) from tblCondominio";
?>
<?php echo $total_registros;?><br>
</span></strong><strong>Registros Encontrados: <span class="Estilo4">
<?php
$cantidad = "select count(codigo) from tblCondominio where codigo='$num'";
?>
<?php echo $total_registros;?></span></strong></td>
</tr>
</table>
</body>
</html>