<?php require_once('Connections/conexion_prueba.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$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":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_practicando_tarifas = 10;
$pageNum_practicando_tarifas = 0;
if (isset($_GET['pageNum_practicando_tarifas'])) {
$pageNum_practicando_tarifas = $_GET['pageNum_practicando_tarifas'];
}
$startRow_practicando_tarifas = $pageNum_practicando_tarifas * $maxRows_practicando_tarifas;
mysql_select_db($database_conexion_prueba, $conexion_prueba);
$query_practicando_tarifas = "SELECT ORIGEN, DESTINO, PRECIO FROM tarifa WHERE ORIGEN LIKE '%CENTRAL%' ORDER BY ORIGEN ASC";
$query_limit_practicando_tarifas = sprintf("%s LIMIT %d, %d", $query_practicando_tarifas, $startRow_practicando_tarifas, $maxRows_practicando_tarifas);
$practicando_tarifas = mysql_query($query_limit_practicando_tarifas, $conexion_prueba) or die(mysql_error());
$row_practicando_tarifas = mysql_fetch_assoc($practicando_tarifas);
if (isset($_GET['totalRows_practicando_tarifas'])) {
$totalRows_practicando_tarifas = $_GET['totalRows_practicando_tarifas'];
} else {
$all_practicando_tarifas = mysql_query($query_practicando_tarifas);
$totalRows_practicando_tarifas = mysql_num_rows($all_practicando_tarifas);
}
$totalPages_practicando_tarifas = ceil($totalRows_practicando_tarifas/$maxRows_practicando_tarifas)-1;
$queryString_practicando_tarifas = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_practicando_tarifas") == false &&
stristr($param, "totalRows_practicando_tarifas") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_practicando_tarifas = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_practicando_tarifas = sprintf("&totalRows_practicando_tarifas=%d%s", $totalRows_practicando_tarifas, $queryString_practicando_tarifas);
?>
<!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=utf-8" />
<title>Documento sin título</title>
</head>
<body>
<p> </p>
<p> </p>
<table border="1">
<tr>
<td>ORIGEN</td>
<td>DESTINO</td>
<td>PRECIO</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_practicando_tarifas['ORIGEN']; ?></td>
<td><?php echo $row_practicando_tarifas['DESTINO']; ?></td>
<td><?php echo $row_practicando_tarifas['PRECIO']; ?></td>
</tr>
<?php } while ($row_practicando_tarifas = mysql_fetch_assoc($practicando_tarifas)); ?>
</table>
<p> </p>
</body>
</html>
<?php
mysql_free_result($practicando_tarifas);
?>