Foros del Web » Estrategias Digitales y Negocios Online » Negocios »

Como pasar varibales a Pasat4b

Estas en el tema de Como pasar varibales a Pasat4b en el foro de Negocios en Foros del Web. Buenas a todos, tengo hecho un carrito de la compra segun un libro que se llama desarrollo web con php, apache y mysql de Anaya ...
  #1 (permalink)  
Antiguo 28/12/2010, 04:29
 
Fecha de Ingreso: mayo-2008
Mensajes: 228
Antigüedad: 16 años
Puntos: 2
Como pasar varibales a Pasat4b

Buenas a todos, tengo hecho un carrito de la compra segun un libro que se llama desarrollo web con php, apache y mysql de Anaya pag 504 o 540 era por la 500 y lo tratan en unc apitulo entero, lo digo porque las tablas y todo lo tengo = a excepcion de la tabla productos que la modifique. El problema es que se muy poco de programacion, solo he ido cambiando variables hasta que ha funcionado, a ver si me podeis indicar como pasar las variables al pasat, os pongo mis 3 scripts php de comercio electronico y a ver desde cual tengo que pasarle y como de que manera, alguien que lo haya hecho ya que me heche un cable please.

ecomm_checkout.php

Código PHP:
<?php
session_start
();
?>
<html>
<head>
<title> Checkout Step 1 of 3 </title>
<style type="text/css">
th {background-color: #999;}
td {vertical-align: top; }
.odd_row {background-color: #EEE;}
.even_row {background-color: #FFF;}
</style>
<script type="text/javascript">
window.onload = function() {
// assign toggle_shipping_visibility to same_info checkbox
var c = document.getElementById('same_info');
c.onchange = toggle_shipping_visibility;
}
function toggle_shipping_visibility() {
var c = document.getElementById('same_info');
var t = document.getElementById('shipping_table');
// update shipping table's visibility
t.style.display = (c.checked) ? 'none' : '';
}
</script>

</head>
<body>


<h1> Un placer  </h1>
<h2> Orden de Pedido </h2>
<ol>
  <li> <strong>Ingrese la informacion de facturacion y envio</strong></li>
  <li> Verificacion de los datos de facuración y producto a enviar </li>
  <li>Confirmacion de pedido y recibo</li>
  
</ol>
<form method="post" action="ecomm_checkout2.php">
<table>
<tr>
<td>
<table>
<tr>
<th colspan="2"> Informacion de Facturacion </th>
</tr> <tr>
<td> <label for="first_name" > Nombre: </label> </td>
<td> <input type="text" id="first_name" name="first_name" size="20"
maxlength="20"/> </td>
</tr> <tr>
<td> <label for="last_name"> Apellidos: </label> </td>
<td> <input type="text" id="last_name" name="last_name" size="20"
maxlength="20"/> </td>
</tr> <tr>
<td> <label for="address_1"> Dirección de Facturación: </label> </td>
<td> <input type="text" id="address_1" name="address_1" size="30"
maxlength="50"/> </td>
</tr> <tr>
<td> </td>
<td> <input type="text" id="address_2" name="address_2" size="30"
maxlength="50"/> </td>
</tr> <tr>
<td> <label for="city"> Ciudad: </label></td>
<td> <input type="text" id="city" name="city" size="20"
maxlength="20"/></td>
</tr> <tr>
<td> <label for="state"> Localidad: </label> </td>
<td> <input type="text" id="state" name="state" size="2"
maxlength="20"/> </td>
</tr> <tr>
<td> <label for="zip_code" > Codigo Postal: </label> </td>
<td> <input type="text" id="zip_code" name="zip_code" size="5"
maxlength="5"/> </td>
</tr> <tr>
<td> <label for="phone" > Telefono: </label> </td>
<td> <input type="text" id="phone" name="phone" size="10"
maxlength="10"/> </td>
</tr> <tr>
<td> <label for="email"> Email: </label> </td>
<td> <input type="text" id="email" name="email" size="30"
maxlength="100"/>
</td>
</tr> <tr>
<td colspan="2" style="text-align: center;" >
<input type="checkbox" id="same_info" name="same_info"
checked="checked"/>
<label for="same_info"> Marcar si los datos de envio son los mismos que los de facturacion.
</label></td>
</tr>
</table>
</td>
<td>
<table id="shipping_table" style="display:none;">
<tr>
<th colspan="2"> Informacion de Envio </th>
</tr> <tr>
<td> <label for="shipping_first_name"> Nombre: </label> </td>
<td> <input type="text" id="shipping_first_name"
name="shipping_first_name" size="20" maxlength="20"/> </td>
</tr> <tr>
<td> <label for="shipping_last_name" > Apellidos: </label> </td>
<td> <input type="text" id="shipping_last_name"
name="shipping_last_name" size="20" maxlength="20"/> </td>
</tr> <tr>
<td> <label for="shipping_address_1" > Direccion de envio: </label> </td>
<td> <input type="text" id="shipping_address_1" name="shipping_address_1" size="30" maxlength="50"/> </td>
</tr> <tr>
<td> </td>
<td> <input type="text" id="shipping_address_2" name="shipping_address_2" size="30" maxlength="50"/> </td>
</tr> <tr>
<td> <label for="shipping_city" > Ciudad: </label> </td>
<td> <input type="text" id="shipping_city" name="shipping_city"size="20" maxlength="20"/> </td>
</tr> <tr>
<td> <label for="shipping_state" > Localidad: </label> </td>
<td> <input type="text" id="shipping_state" name="shipping_state" size="2" maxlength="20"/> </td>
</tr> <tr>
<td> <label for="shipping_zip_code" > Codigo Postal: </label> </td>
<td> <input type="text" id="shipping_zip_code" name="shipping_zip_code" size="5" maxlength="5"/> </td>
</tr> <tr>
<td> <label for="shipping_phone" > Telefono: </label> </td>
<td> <input type="text" id="shipping_phone" name="shipping_phone" size="10" maxlength="10"/> </td>
</tr> <tr>
<td> <label for="shipping_email" > Email: </label> </td>
<td> <input type="text" id="shipping_email" name="shipping_email" size="30" maxlength="100"/>
</td>
</tr>
</table>
</td>
</tr> <tr>
<td colspan="2">
<input type="submit" value="Validar"/>
</td>
</tr>
</table>
</form>
</body>
</html>
  #2 (permalink)  
Antiguo 28/12/2010, 04:30
 
Fecha de Ingreso: mayo-2008
Mensajes: 228
Antigüedad: 16 años
Puntos: 2
Respuesta: Como pasar varibales a Pasat4b

Expongo los otros 2 archivos que tengo que no me permitia ponerlos por exceso de caracteres.

ecomm_cheout2.php

ecomm_checkout2.php

Código PHP:
<?php
session_start
();
require 
'db.inc.php';
$db mysql_connect(MYSQL_HOSTMYSQL_USERMYSQL_PASSWORD) or
die (
'Unable to connect. Check your connection parameters.');
mysql_select_db(MYSQL_DB$db) or die(mysql_error($db));
$session session_id();
if (isset(
$_POST['same_info'])) {
$_POST['shipping_first_name'] = $_POST['first_name'];
$_POST['shipping_last_name'] = $_POST['last_name'];
$_POST['shipping_address_1'] = $_POST['address_1'];
$_POST['shipping_address_2'] = $_POST['address_2'];
$_POST['shipping_city'] = $_POST['city'];
$_POST['shipping_state'] = $_POST['state'];
$_POST['shipping_zip_code'] = $_POST['zip_code'];
$_POST['shipping_phone'] = $_POST['phone'];
$_POST['shipping_email'] = $_POST['email'];
}
?>
<html>
<head>
<title>Compra Paso 2 de 3</title>
<style type="text/css" >
th {background-color: #999;}
td {vertical-align: top;}
.odd_row {background-color: #EEE;}
.even_row {background-color: #FFF;}
</style>
</head>
<body>
<h1>Un Placer</h1>
<h2>Orden de Pedido</h2>
<ol>
<li> Ingrese la informacion de facturacion y envio</li>
<li> <strong> Verificacion de los datos de facuracion y producto a enviar</strong>
</li>
<li>Confirmación de pedido y recibo</li>
</ol>
<table style="width: 75%;" >
<tr>
<th style="width: 100px;" > </th> <th> Nombre Articulo </th> <th> Cantidad </th>
<th> Precio por Articulo </th> <th> Precio total </th>
</tr>
<?php
$query 
'SELECT
t.product_code, qty,
nombre, descripcion_castellano, precio
FROM ecomm_temp_cart t JOIN novedades p ON
t.product_code = p.codigo
WHERE
session = "' 
$session '"
ORDER BY
t.product_code ASC'
;
$results mysql_query($query$db) or die (mysql_error($db));
$rows mysql_num_rows($results);
$total 0;
$odd true;
while (
$row mysql_fetch_array($results)) {
echo (
$odd == true) ? ' <tr class="odd_row"> ' ' <tr class="even_row"> ';
$odd = !$odd;
extract($row);
?>
<td style="text-align:center;">
<img src="http://www.grutinet.com/articulos/or/or_<?php echo $product_code?>.jpg"
alt=" <?php echo $nombre?> "/>
</td>
<td> <?php echo $nombre?> </td>
<td> <?php echo $qty?> </td>
<td style="text-align: right;" > € <?php echo $precio?> </td>
<td style="text-align: right;" > € <?php echo number_format
($precio $qty2);?>
</td>
</tr>
<?php
$total 
$total $precio $qty;
}
?>
</table>
<p> Su Total sin manipulacion ni envio es:
<strong> € <?php echo number_format($total2); ?> </strong> </p>
<table>
<tr>
<td>
<table>
<tr>
<th colspan="2"> Informacion de facturacion
</th>
</tr> <tr>
<td> Nombre: </td>
<td> <?php echo htmlspecialchars($_POST['first_name']);?> </td>
</tr> <tr>
<td> Apellidos: </td>
<td> <?php echo htmlspecialchars($_POST['last_name']);?> </td>
</tr> <tr>
<td> Direccion de Facturacion: </td>
<td> <?php echo htmlspecialchars($_POST['address_1']);?> </td>
</tr> <tr>
<td> </td>
<td> <?php echo htmlspecialchars($_POST['address_2']);?> </td>
</tr> <tr><td> Cioudad: </td>
<td> <?php echo htmlspecialchars($_POST['city']);?> </td>
</tr> <tr>
<td> Localidad: </td>
<td> <?php echo htmlspecialchars($_POST['state']);?> </td>
</tr> <tr>
<!--<td> Codigo Postal: </td>-->
<?php /*?><td> <?php echo htmlspecialchars($_POST['zip_code']);?> </td>
<?php */
?></tr> <tr>
<td> Telefono: </td>
<td> <?php echo htmlspecialchars($_POST['phone']);?> </td>
</tr><tr>
<td> Email: </td>
<td> <?php echo htmlspecialchars($_POST['email']);?> </td>
</td>
</tr><tr>
<td colspan="2" style="text-align: center;" >
<?php
if (isset($_POST['same_info'])) {
echo 
'Shipping information is same as billing.';
}
?>
</td>
</tr>
</table>
</td>
<td>
<?php
if (!isset($_POST['same_info'])) {
?>
<table>
<tr>
<th colspan="2"> Informacion de Envio </th>
</tr> <tr>
<td> Nombre: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_first_name']);?> </td>
</tr> <tr>
<td> Apellidos: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_last_name']);?> </td>
</tr> <tr>
<td> Direccion de Envio: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_address_1']);?> </td>
</tr> <tr>
<td> </td>
<td> <?php echo htmlspecialchars($_POST['shipping_address_2']);?> </td>
</tr> <tr>
<td> Ciudad: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_city']);?> </td>
</tr> <tr>
<td> Localidad: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_state']);?> </td>
</tr> <tr>
<td> Codigo Postal: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_zip_code']);?> </td>
</tr> <tr>
<td> Telefono: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_phone']);?> </td>
</tr><tr>
<td> Email: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_email']);?> </td>
</td>
</tr>
</table>
<?php
}
?>
</td>
</tr>
</table>
<form method="post" action="pasarelaphp.php">
<div>
<input type="submit" name="submit" value="pasarelaphp.php"/>
<input type="hidden" name="last_name"
value=" <?php echo htmlspecialchars($_POST['last_name']);?> "/>
<input type="hidden" name="address_1"
value=" <?php echo htmlspecialchars($_POST['address_1']);?> "/>
<input type="hidden" name="address_2"
value=" <?php echo htmlspecialchars($_POST['address_2']);?> "/>
<input type="hidden" name="city"
value=" <?php echo htmlspecialchars($_POST['city']);?> "/>
<input type="hidden" name="state"
value=" <?php echo htmlspecialchars($_POST['state']);?> "/>
<input type="hidden" name="zip_code"
value=" <?php echo htmlspecialchars($_POST['zip_code']);?> "/>
<input type="hidden" name="phone"
value=" <?php echo htmlspecialchars($_POST['phone']);?> "/>
<input type="hidden" name="email"
value=" <?php echo htmlspecialchars($_POST['email']);?> "/>
<input type="hidden" name="shipping_first_name"
value=" <?php echo htmlspecialchars($_POST['shipping_first_name']);?> "/>
<input type="hidden" name="shipping_last_name"
value=" <?php echo htmlspecialchars($_POST['shipping_last_name']);?> "/>
<input type="hidden" name="shipping_address_1"
value=" <?php echo htmlspecialchars($_POST['shipping_address_1']);?> "/>
<input type="hidden" name="shipping_address_2"
value=" <?php echo htmlspecialchars($_POST['shipping_address_2']);?> "/>
<input type="hidden" name="shipping_city"
value=" <?php echo htmlspecialchars($_POST['shipping_city']);?> "/>
<input type="hidden" name="shipping_state"
value=" <?php echo htmlspecialchars($_POST['shipping_state']);?> "/>
<input type="hidden" name="shipping_zip_code"
value=" <?php echo htmlspecialchars($_POST['shipping_zip_code']);?> "/>
<input type="hidden" name="shipping_phone"
value=" <?php echo htmlspecialchars($_POST['shipping_phone']);?> "/>
<input type="hidden" name="shipping_email"
value=" <?php echo htmlspecialchars($_POST['shipping_email']);?> "/>
<input type="hidden" name="order_id"
value=" <?php echo htmlspecialchars($_POST['order_id']);?> "/>
</div>
</form>
</body>
</html>
  #3 (permalink)  
Antiguo 28/12/2010, 04:31
 
Fecha de Ingreso: mayo-2008
Mensajes: 228
Antigüedad: 16 años
Puntos: 2
Respuesta: Como pasar varibales a Pasat4b

ecomm_checkout3.php

Código PHP:
Ver original
  1. <?php
  2. require 'db.inc.php';
  3. $db = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) or
  4. die ('Unable to connect. Check your connection parameters.');
  5. mysql_select_db(MYSQL_DB, $db) or die(mysql_error($db));
  6. $now = date('Y-m-d H:i:s');
  7. $session = session_id();
  8. $first_name=$_POST['first_name'];
  9. $last_name = $_POST['last_name'];
  10. $address_1 = $_POST['address_1'];
  11. $address_2 = $_POST['address_2'];
  12. $city = $_POST['city'];
  13. $state = $_POST['state'];
  14. $zip_code = $_POST['zip_code'];
  15. $phone = $_POST['phone'];
  16. $email = $_POST['email'];
  17. $shipping_first_name = $_POST['shipping_first_name'];
  18. $shipping_last_name = $_POST['shipping_last_name'];
  19. $shipping_address_1 = $_POST['shipping_address_1'];
  20. $shipping_address_2 = $_POST['shipping_address_2'];
  21. $shipping_city = $_POST['shipping_city'];
  22. $shipping_state = $_POST['shipping_state'];
  23. $shipping_zip_code = $_POST['shipping_zip_code'];
  24. $shipping_phone = $_POST['shipping_phone'];
  25. $shipping_email = $_POST['shipping_email'];
  26. // assign customer id to new customer, or find existing customer id
  27. $query = 'SELECT customer_id FROM ecomm_customers
  28. WHERE
  29. first_name = "' . mysql_real_escape_string($first_name, $db) . '" AND
  30. last_name = "' . mysql_real_escape_string($last_name, $db) . '" AND
  31. address_1 = "' . mysql_real_escape_string($address_1, $db) . '" AND
  32. address_2 = "' . mysql_real_escape_string($address_2, $db) . '" AND
  33. city = "' . mysql_real_escape_string($city, $db) . '" AND
  34. state = "' . mysql_real_escape_string($state, $db) . '" AND
  35. zip_code = "' . mysql_real_escape_string($zip_code, $db) . '" AND
  36. phone = "' . mysql_real_escape_string($phone, $db) . '" AND
  37. email = "' . mysql_real_escape_string($email, $db) . '"';
  38. $result = mysql_query($query, $db) or (mysql_error($db));
  39. if (mysql_num_rows($result) > 0) {
  40. $row = mysql_fetch_assoc($result);
  41. extract($row);
  42. } else {
  43. $query = 'INSERT INTO ecomm_customers
  44. (customer_id, first_name, last_name, address_1, address_2, city,
  45. state, zip_code, phone, email)
  46. VALUES
  47. (NULL,
  48. "' . mysql_real_escape_string($first_name, $db) . '",
  49. "' . mysql_real_escape_string($last_name, $db) . '",
  50. "' . mysql_real_escape_string($address_1, $db) . '",
  51. "' . mysql_real_escape_string($address_2, $db) . '",
  52. "' . mysql_real_escape_string($city, $db) . '",
  53. "' . mysql_real_escape_string($state, $db) . '",
  54. "' . mysql_real_escape_string($zip_code, $db) . '",
  55. "' . mysql_real_escape_string($phone, $db) . '",
  56. "' . mysql_real_escape_string($email, $db) . '")';
  57. mysql_query($query, $db) or (mysql_error($db));
  58. $customer_id = mysql_insert_id();
  59. }
  60. // start order entry
  61. $query = 'INSERT into ecomm_orders
  62. (order_id, order_date, customer_id, cost_subtotal, cost_total,
  63. shipping_first_name, shipping_last_name, shipping_address_1,
  64. shipping_address_2, shipping_city, shipping_state, shipping_zip_code,
  65. shipping_phone, shipping_email)
  66. VALUES
  67. (NULL,
  68. "' . $now . '",
  69. ' . $customer_id . ',
  70. 0.00,
  71. 0.00,
  72. "' . mysql_real_escape_string($shipping_first_name, $db) . '",
  73. "' . mysql_real_escape_string($shipping_last_name, $db) . '",
  74. "' . mysql_real_escape_string($shipping_address_1, $db) . '",
  75. "' . mysql_real_escape_string($shipping_address_2, $db) . '",
  76. "' . mysql_real_escape_string($shipping_city, $db) . '",
  77. "' . mysql_real_escape_string($shipping_state, $db) . '",
  78. "' . mysql_real_escape_string($shipping_zip_code, $db) . '",
  79. "' . mysql_real_escape_string($shipping_phone, $db) . '",
  80. "' . mysql_real_escape_string($shipping_email, $db) . '")';
  81. mysql_query($query, $db) or (mysql_error($db));
  82. $order_id = mysql_insert_id();
  83. // Move order information from ecomm_temp_cart into ecomm_order_details
  84. $query = 'INSERT INTO ecomm_order_details
  85. (order_id, order_qty, product_code)
  86. SELECT
  87. ' . $order_id . ', qty, product_code
  88. FROM
  89. ecomm_temp_cart
  90. WHERE
  91. session = "' . $session . '"';
  92. mysql_query($query, $db) or (mysql_error($db));
  93. $query = 'DELETE FROM ecomm_temp_cart WHERE session = "' . $session . '"';
  94. mysql_query($query, $db) or (mysql_error($db));
  95. // retrieve subtotal
  96. $query = 'SELECT
  97. SUM(precio * order_qty) AS cost_subtotal
  98. FROM
  99. ecomm_order_details d JOIN novedades p ON
  100. d.product_code = p.codigo
  101. WHERE
  102. order_id = ' . $order_id;
  103. $result = mysql_query($query, $db) or (mysql_error($db));
  104. $row = mysql_fetch_assoc($result);
  105. extract($row);
  106. // calculate shipping, tax and total costs
  107. $cost_shipping = round($cost_subtotal * 0.25, 2);
  108. $cost_tax = round($cost_subtotal * 0.1, 2);
  109. $cost_total = $cost_subtotal + $cost_shipping + $cost_tax;
  110. // upate costs in ecomm_orders
  111. $query = 'UPDATE ecomm_orders
  112. SET
  113. cost_subtotal = ' . $cost_subtotal . ',
  114. cost_shipping = ' . $cost_shipping . ',
  115. cost_tax = ' . $cost_tax . ',
  116. cost_total = ' . $cost_total . '
  117. WHERE
  118. order_id = ' . $order_id;
  119. mysql_query($query, $db) or (mysql_error($db));
  120. ?>
  121.  
  122.  
  123.  
  124.  
  125. <html>
  126. <head>
  127. <title> Order Confirmation </title>
  128. <style type="text/css">
  129. th { background-color: #999;}
  130. td { vertical-align: top; }
  131. .odd_row { background-color: #EEE; }
  132. .even_row { background-color: #FFF; }
  133. </style>
  134. </head>
  135. <body>
  136. <?php
  137. $html_head = ob_get_contents();
  138. ?>
  139. <p>Datos de orden de pedido: </p>
  140. <p> Fecha del Pedido: <?php echo $now; ?> </p>
  141. <p> Nº de pedido: <?php echo $order_id; ?> </p>
  142. <table>
  143. <tr>
  144. <td>
  145. <table>
  146. <tr>
  147. <th colspan="2"> Informacion de Facturacion  </th>
  148. </tr> <tr>
  149. <td> Nombre: </td>
  150. <td> <?php echo htmlspecialchars($first_name);?> </td>
  151. </tr> <tr>
  152. <td> Apellidos: </td>
  153. <td> <?php echo htmlspecialchars($last_name);?> </td>
  154. </tr> <tr>
  155. <td> Direccion de Facturacion: </td>
  156. <td> <?php echo htmlspecialchars($address_1);?> </td>
  157. </tr> <tr>
  158. <td> </td>
  159. <td> <?php echo htmlspecialchars($address_2);?> </td>
  160. </tr> <tr>
  161. <td> Ciudad: </td>
  162. <td> <?php echo htmlspecialchars($city);?> </td>
  163. </tr> <tr>
  164. <td> Localidad: </td>
  165. <td> <?php echo htmlspecialchars($state);?> </td>
  166. </tr> <tr>
  167. <td> Codigo: </td>
  168. <td> <?php echo htmlspecialchars($zip_code);?> </td>
  169. </tr> <tr>
  170. <td> Telefono: </td>
  171. <td> <?php echo htmlspecialchars($phone);?> </td>
  172. </tr> <tr>
  173. <td> Email: </td>
  174. <td> <?php echo htmlspecialchars($email);?> </td>
  175. </td>
  176. </tr>
  177. </table>
  178. </td>
  179. <td>
  180. <table>
  181. <tr>
  182. <th colspan="2">Informacion del Pedido</th>
  183. </tr> <tr>
  184. <td> Nombre: </td>
  185. <td> <?php echo htmlspecialchars($shipping_first_name);?> </td>
  186. </tr> <tr>
  187. <td> Apellidos: </td>
  188. <td> <?php echo htmlspecialchars($shipping_last_name);?> </td>
  189. </tr> <tr>
  190. <td> Direccion de envío: </td>
  191. <td> <?php echo htmlspecialchars($shipping_address_1);?> </td>
  192. </tr> <tr>
  193. <td> </td>
  194. <td> <?php echo htmlspecialchars($shipping_address_2);?> </td>
  195. </tr> <tr>
  196. <td> Ciudad: </td>
  197. <td> <?php echo htmlspecialchars($shipping_city);?> </td>
  198. </tr> <tr>
  199. <td> Localidad: </td>
  200. <td> <?php echo htmlspecialchars($shipping_state);?> </td>
  201. </tr> <tr>
  202. <td> Codigo Postal: </td>
  203. <td> <?php echo htmlspecialchars($shipping_zip_code);?> </td>
  204. </tr> <tr>
  205. <td> Nº de telefono: </td>
  206. <td> <?php echo htmlspecialchars($shipping_phone);?> </td>
  207. </tr> <tr>
  208. <td> Email: </td>
  209. <td> <?php echo htmlspecialchars($shipping_email);?> </td>
  210. </tr>
  211. </table>
  212. </td>
  213. </tr>
  214. </table>
  215. <table style="width: 75%;">
  216. <tr>
  217. <th> Codigo de producto </th> <th> Nombre </th> <th> Cantidad </th> <th> Precio </th>
  218. <th> Precio total </th>
  219. </tr>
  220. <?php
  221. $query = 'SELECT
  222. p.codigo, d.order_qty, p.nombre, p.descripcion_castellano, p.precio FROM
  223. ecomm_order_details d JOIN novedades p ON
  224. d.product_code = p.codigo
  225. WHERE
  226. order_id = "' . $order_id . '"
  227. ORDER BY
  228. p.codigo ASC';
  229. $result = mysql_query($query, $db) or die (mysql_error($db));
  230. $rows = mysql_num_rows($result);
  231. $total = 0;
  232. $odd = true;
  233. while ($row = mysql_fetch_array($result)) {
  234. echo ($odd == true) ? ' <tr class="odd_row"> ' : ' <tr class="even_row"> ';
  235. $odd = !$odd;
  236. extract($row);
  237. ?>
  238. <td> <?php echo $codigo; ?> </td>
  239. <td> <?php echo $nombre; ?> </td>
  240. <td> <?php echo $order_qty; ?> </td>
  241. <td style="text-align: right;"><strong>€</strong><?php echo $precio; ?> </td>
  242. <td style="text-align: right;"><strong>€</strong><?php
  243. echo number_format($precio * $order_qty, 2);?>
  244. </td>
  245. </tr>
  246. <?php
  247. }
  248. ?>
  249. </table>
  250. <p> Coste Subtotal: <strong>€</strong> <?php echo number_format($cost_subtotal, 2); ?> </p>
  251. <p> Tasas y manipulacion: <strong>€</strong> <?php echo number_format($cost_tax, 2); ?> </p>
  252. <p> <strong> Coste Total : <strong>€</strong> <?php echo number_format($cost_total, 2); ?>
  253. </strong> </p>
  254.  
  255. </body>
  256. </html>
  #4 (permalink)  
Antiguo 11/01/2011, 09:02
 
Fecha de Ingreso: mayo-2008
Mensajes: 228
Antigüedad: 16 años
Puntos: 2
Respuesta: Como pasar varibales a Pasat4b

Al final lo he conseguido, lo que pedia ahora entiendo que era demasiado codigo aun teniendo los archivos y sin poder mirar errores no era posible ayudarme.

Etiquetas: pasar
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:06.