Ver Mensaje Individual
  #12 (permalink)  
Antiguo 12/04/2009, 13:11
dasa
 
Fecha de Ingreso: marzo-2009
Mensajes: 132
Antigüedad: 15 años, 1 mes
Puntos: 8
Respuesta: Eliminacion checkbox Dreamweaver

Esta es la pagina en PHP completa

Código listar:
Ver original
  1. <?php require_once('Connections/farmacia.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6.   $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  7.  
  8.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  9.  
  10.   switch ($theType) {
  11.     case "text":
  12.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  13.       break;    
  14.     case "long":
  15.     case "int":
  16.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  17.       break;
  18.     case "double":
  19.       $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  20.       break;
  21.     case "date":
  22.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  23.       break;
  24.     case "defined":
  25.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  26.       break;
  27.   }
  28.   return $theValue;
  29. }
  30. }
  31.  
  32. $maxRows_listaringreso = 10;
  33. $pageNum_listaringreso = 0;
  34. if (isset($_GET['pageNum_listaringreso'])) {
  35.   $pageNum_listaringreso = $_GET['pageNum_listaringreso'];
  36. }
  37. $startRow_listaringreso = $pageNum_listaringreso * $maxRows_listaringreso;
  38.  
  39. mysql_select_db($database_farmacia, $farmacia);
  40. $query_listaringreso = "SELECT * FROM factura_ingreso";
  41. $query_limit_listaringreso = sprintf("%s LIMIT %d, %d", $query_listaringreso, $startRow_listaringreso, $maxRows_listaringreso);
  42. $listaringreso = mysql_query($query_limit_listaringreso, $farmacia) or die(mysql_error());
  43. $row_listaringreso = mysql_fetch_assoc($listaringreso);
  44.  
  45. if (isset($_GET['totalRows_listaringreso'])) {
  46.   $totalRows_listaringreso = $_GET['totalRows_listaringreso'];
  47. } else {
  48.   $all_listaringreso = mysql_query($query_listaringreso);
  49.   $totalRows_listaringreso = mysql_num_rows($all_listaringreso);
  50. }
  51. $totalPages_listaringreso = ceil($totalRows_listaringreso/$maxRows_listaringreso)-1;
  52. ?>
  53. <html>
  54. <head>
  55. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  56. <title>Documento sin t&iacute;tulo</title>
  57. </head>
  58.  
  59. <body>
  60. <form id="form1" name="form1" method="post" action="">
  61. <table border="1">
  62.   <tr>
  63.     <td>Id</td>
  64.     <td>numfactura</td>
  65.     <td>nombre</td>
  66.     <td>cantidad</td>
  67.     <td>fecha</td>
  68.     <td>precio</td>
  69.     <td>iva</td>
  70.     <td>proveedor</td>
  71.     <td>&nbsp;</td>
  72.   </tr>
  73.   <?php do { ?>
  74.     <tr>
  75.       <td><?php echo $row_listaringreso['Id']; ?></td>
  76.       <td><?php echo $row_listaringreso['numfactura']; ?></td>
  77.       <td><?php echo $row_listaringreso['nombre']; ?></td>
  78.       <td><?php echo $row_listaringreso['cantidad']; ?></td>
  79.       <td><?php echo $row_listaringreso['fecha']; ?></td>
  80.       <td><?php echo $row_listaringreso['precio']; ?></td>
  81.       <td><?php echo $row_listaringreso['iva']; ?></td>
  82.       <td><?php echo $row_listaringreso['proveedor']; ?></td>
  83.       <td><a href="pruebaeliminar.php?Id=<?php echo $row_listaringreso['Id']; ?>">Eliminar</a></td>
  84.     </tr>
  85.     <?php } while ($row_listaringreso = mysql_fetch_assoc($listaringreso)); ?>
  86. </table>
  87. <p>&nbsp;</p>
  88. </form>
  89. </body>
  90. </html>
  91. <?php
  92. mysql_free_result($listaringreso);
  93. ?>