Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/12/2008, 16:01
Avatar de hoberwilly
hoberwilly
 
Fecha de Ingreso: julio-2008
Ubicación: Lima - Perú
Mensajes: 769
Antigüedad: 16 años, 7 meses
Puntos: 2
Pregunta Primero imprimir antes de confirmacion

Hola amigos, quisiera pedirles si es posible cambiar este mi codigo el cual existe un link para k el usuario imprima la pagina:

Código php:
Ver original
  1. <!-- <a href="javascript:print()">Imprimir<img src="icono_impresora2.gif" width="26" height="23" border="0" alt="Imprimir"></a> -->

este es codigo total:
Código php:
Ver original
  1. <!-- <?php
  2. include('conec.php');
  3. conectarse();
  4. @ini_set('display_errors', '1');
  5. if(isset($_SESSION['carro']))
  6.     $carro=$_SESSION['carro'];
  7.     else $carro=false;
  8. $user=$_SESSION['username'];
  9. $qry=mysql_query("SELECT * FROM usuario WHERE username='$user'") or die("Error en consulta:" .mysql_error() );
  10. ?>
  11. <html>
  12. <head>
  13. <title>CONFIRMACION DE ENVIO</title>
  14. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  15. </head>
  16.  
  17. <body>
  18. <h1 align="center">Confirmaci&oacute;n de Orden de Pedido</h1>
  19. <HR NOSHADE>
  20. <?php
  21. if($carro)
  22. {
  23. ?>
  24. <table width="95%" border="0" align="center" cellpadding="2" cellspacing="0" class="prod">  
  25. <tr>
  26.     <td colspan=3 align="right"><a href="javascript:print()">Imprimir<img src="icono_impresora2.gif" width="26" height="23" border="0" alt="Imprimir"></a></td>
  27. </tr>
  28. </table>
  29. <form action="facturar.php" method="post" id="frm" name="frm">
  30. <table>  
  31. <tr bgcolor="red" align="center" height="40" class="tit">
  32.     <td colspan=3 align="left">Datos de Destinatario</td>
  33. </tr>
  34.   <?php
  35.   if($row=mysql_fetch_assoc($qry))
  36.   {
  37.   ?>
  38. <tr>
  39.     <td width="30%">Categoría:</td><td width="70%" align="left"><?php echo $row['categoria'] ?></td>
  40. </tr>
  41. <tr>
  42.     <td width="30%">Establecimiento Farmacéutico:</td><td width="70%" align="left"><?php echo $row['establecimiento'] ?></td>
  43. </tr>
  44.   <?php
  45.   }
  46.   ?>
  47. </table>
  48. <p>
  49. <table width="95%" border="0" cellspacing="2" cellpadding="2" align="center">
  50. <tr bgcolor="red" align="center"class="tit">
  51.     <td width="8%">Código</td>
  52.     <td width="37%">Producto</td>
  53. </tr>
  54. <?php
  55.   foreach($carro as $k => $v)
  56.   {
  57. ?>
  58. <tr>
  59.     <td align="center"><?php echo $v['id'] ?></td>
  60.     <?php
  61.     $qry2=mysql_query("SELECT medicamento FROM catalogo
  62.                WHERE id='".$v['id']."'");
  63.     if($row2=mysql_fetch_assoc($qry2))
  64.     {
  65.     ?>
  66.     <td><?php echo $row2['medicamento'] ?></td>
  67.     <?php
  68.     }
  69.     ?>
  70.     <td align="right"><?php echo $v['cantidad'] ?></td>
  71. </tr>
  72.   <?php
  73.   }
  74.   ?>
  75. </table>
  76. <p>
  77. <center>
  78. <table border="0" cellspacing="0" cellpadding="5" class="prod">
  79. <tr valign="middle">
  80.      <td width="35%">&nbsp;</td>
  81.      <td><a href="vercarrito.php">Anterior</a></td>
  82.      <td><input type="submit" name="enviar" value="Confirmar Pedido"></td>
  83.      <td width="35%">&nbsp;</td>
  84. </tr>
  85. </table>
  86. </form>
  87. <?php
  88. }
  89. ?>
  90. </body>
  91. </html>
  92. <?php
  93. ?> -->

Por: antes de confirmar el pedido y se dirija a facturar.php, emita un mensaje para darle al usuario la eleccion de imprimir o no la pagina...se podra???

Gracias antemano sus colaboraciones