Esta es la pagina en PHP completa
Código listar:
Ver original<?php require_once('Connections/farmacia.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$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;
}
}
$maxRows_listaringreso = 10;
$pageNum_listaringreso = 0;
if (isset($_GET['pageNum_listaringreso'])) {
$pageNum_listaringreso = $_GET['pageNum_listaringreso'];
}
$startRow_listaringreso = $pageNum_listaringreso * $maxRows_listaringreso;
mysql_select_db($database_farmacia, $farmacia);
$query_listaringreso = "SELECT * FROM factura_ingreso";
$query_limit_listaringreso = sprintf("%s LIMIT %d, %d", $query_listaringreso, $startRow_listaringreso, $maxRows_listaringreso);
$listaringreso = mysql_query($query_limit_listaringreso, $farmacia) or die(mysql_error());
$row_listaringreso = mysql_fetch_assoc($listaringreso);
if (isset($_GET['totalRows_listaringreso'])) {
$totalRows_listaringreso = $_GET['totalRows_listaringreso'];
} else {
$all_listaringreso = mysql_query($query_listaringreso);
$totalRows_listaringreso = mysql_num_rows($all_listaringreso);
}
$totalPages_listaringreso = ceil($totalRows_listaringreso/$maxRows_listaringreso)-1;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table border="1">
<tr>
<td>Id</td>
<td>numfactura</td>
<td>nombre</td>
<td>cantidad</td>
<td>fecha</td>
<td>precio</td>
<td>iva</td>
<td>proveedor</td>
<td> </td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_listaringreso['Id']; ?></td>
<td><?php echo $row_listaringreso['numfactura']; ?></td>
<td><?php echo $row_listaringreso['nombre']; ?></td>
<td><?php echo $row_listaringreso['cantidad']; ?></td>
<td><?php echo $row_listaringreso['fecha']; ?></td>
<td><?php echo $row_listaringreso['precio']; ?></td>
<td><?php echo $row_listaringreso['iva']; ?></td>
<td><?php echo $row_listaringreso['proveedor']; ?></td>
<td><a href="pruebaeliminar.php?Id=<?php echo $row_listaringreso['Id']; ?>">Eliminar</a></td>
</tr>
<?php } while ($row_listaringreso = mysql_fetch_assoc($listaringreso)); ?>
</table>
<p> </p>
</form>
</body>
</html>
<?php
mysql_free_result($listaringreso);
?>