Código PHP:
Ver original
<?php require_once('Connections/conbanca.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": break; case "double": break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $currentPage = $_SERVER["PHP_SELF"]; $maxRows_Recordset1 = 10; $pageNum_Recordset1 = 0; $pageNum_Recordset1 = $_GET['pageNum_Recordset1']; } $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1; $colname_Recordset1 = "-1"; $colname_Recordset1 = $_GET['busca']; } $colname2_Recordset1 = "-1"; $colname2_Recordset1 = $_GET['busca2']; } $colname3_Recordset1 = "-1"; $colname3_Recordset1 = $_GET['busca3']; } $colname4_Recordset1 = "-1"; $colname4_Recordset1 = $_GET['campo']; } $colname5_Recordset1 = "-1"; $colname5_Recordset1 = $_GET['orden']; } $query_Recordset1 = sprintf("SELECT * FROM inmuebles WHERE ciudad LIKE %s AND zona LIKE %s AND tipo LIKE %s ORDER BY %s %s", GetSQLValueString("%" . $colname_Recordset1 . "%", "text"),GetSQLValueString("%" . $colname2_Recordset1 . "%", "text"),GetSQLValueString("%" . $colname3_Recordset1 . "%", "text"),GetSQLValueString($colname4_Recordset1, "text"),GetSQLValueString($colname5_Recordset1, "text")); $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1); $totalRows_Recordset1 = $_GET['totalRows_Recordset1']; } else { } $queryString_Recordset1 = ""; foreach ($params as $param) { } } } } $queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Documento sin título</title> </head> <body> <table width="90%" border="0" cellspacing="0" cellpadding="2"> </table> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td> Registros <?php echo ($startRow_Recordset1 + 1) ?> a <?php echo min($startRow_Recordset1 + $maxRows_Recordset1, $totalRows_Recordset1) ?> de <?php echo $totalRows_Recordset1 ?></td> <td><form id="form1" name="form1" method="get" action="result2b.php"> <select name="campo" id="campo"> <option value="barrio">Seleccione un campo</option> <option value="barrio">Barrio</option> <option value="valor">Valor</option> <option value="area">Area</option> <option value="habitaciones">Habitaciones</option> <option value="codigo_inm">Codigo</option> </select> <select name="orden" id="orden" method="get"> <option value="ASC" selected="selected">Orden</option> <option value="ASC">Ascendente</option> <option value="DESC">Descendente</option> </select> <input name="busca" type="hidden" id="busca" value="<?php echo $row_Recordset1['ciudad']; ?>" /> <input name="busca2" type="hidden" id="busca2" value="<?php echo $row_Recordset1['zona']; ?>" /> <input name="busca3" type="hidden" id="busca3" value="<?php echo $row_Recordset1['tipo']; ?>" /> <label for="button"></label> <input type="submit" name="button" id="button" value="Enviar" /> </form></td> <td><table border="0"> <tr> <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>"><img src="First.gif" border="0" /></a> <?php } // Show if not first page ?></td> <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>"><img src="Previous.gif" border="0" /></a> <?php } // Show if not first page ?></td> <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>"><img src="Next.gif" border="0" /></a> <?php } // Show if not last page ?></td> <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>"><img src="Last.gif" border="0" /></a> <?php } // Show if not last page ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php do { ?> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td rowspan="3"><img src="photos/<?php echo $row_Recordset1['foto_a']; ?>" width="150" height="112" /></td> <td align="center">Barrio</td> <td align="center">Valor Venta</td> <td align="center">Area</td> <td align="center">Habit.</td> <td align="center">Codigo</td> <td rowspan="3"> </td> </tr> <tr> <td align="center"><?php echo $row_Recordset1['barrio']; ?></td> <td align="center"><?php echo $row_Recordset1['valor']; ?></td> <td align="center"><?php echo $row_Recordset1['area']; ?></td> <td align="center"><?php echo $row_Recordset1['habitaciones']; ?></td> <td align="center"><?php echo $row_Recordset1['codigo_inm']; ?></td> </tr> <tr> <td colspan="5"><?php echo $row_Recordset1['masinfo']; ?></td> </tr> </table> <br /> </tr> </table> <p> </p> <p> </p> </body> </html> <?php ?>