Viewing file: consulta_cerros.php (1.73 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include ("conex.php");
/*
echo $_GET['tipo'];
echo $_GET['sector'];
echo $_GET['ano'];
echo $_GET['resuelve'];
*/
if($_GET['tipo'] != ""){
$sqltipo= " and norma like '%$_GET[tipo]%'";
}
if($_GET['sector'] != ""){
$sqlsector= " and sector = '$_GET[sector]'";
}
if($_GET['ano'] != ""){
$sqlano= " and ano = '$_GET[ano]'";
}
if($_GET['resuelve'] != ""){
$sqlresuelve= " and resuelve like '%$_GET[resuelve]%'";
}
$order = " order by ano desc ";
$sqlt = "SELECT `id` , `norma` , `ano` , `resuelve` , `sector` , `vinculo` , `publicacion` FROM `normatividad` WHERE `publicacion` = 's' ";
$sqldef=$sqlt.$sqltipo.$sqlno.$sqlsector.$sqlano.$sqlresuelve.$order;
//echo "$sqldef";
$sql=mysql_query($sqldef,$con);
$num_rows = mysql_num_rows($sql);
//muestra los datos consultados
echo "<table>
<caption>
<h5>$menu</h5></caption>
<thead>
<tr class='odd'>
<th scope='col' abbr='Home'><h5><span></span>No.</h5></th>
<th scope='col' abbr='Home'><h5><span></span>Norma</h5></th>
<th scope='col' abbr='Home'><h5><span></span>Título</h5></th>
<th scope='col' abbr='Home'><h5><span></span>Sector</h5></th>
<th scope='col' abbr='Home'><h5><span></span>Enlace</h5></th>
</tr>
</thead>
<tfoot>";
while($row = mysql_fetch_array($sql)){
$menu=ucfirst(strtolower($row['sector']));
$cont=$cont+1;
if ($cont % 2 == 0)
$class= "class='odd'";
if ($cont % 2 == 1)
$class= "";
echo "
<tr $class>
<th scope='row'>$cont</th>
<td>$row[norma]</td>
<td>$row[resuelve]</td>
<td>$menu</td>
<td><A href='$row[vinculo]' target=_blank><img src='images/docs.png' width='32' height='35' border='0' align='absmiddle'/></a></td>
";
}
?>
|