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>