aqui esta el codigo de fuente:
Código HTML:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <link href="CSS2.css" rel="stylesheet" type="text/css" /> <meta http-equiv="Content-type" content="text/html; charset=UTF-8" /> <script language="javascript" type="text/javascript"> function funcion (id, val, control, net, fin) {
var precio = document.getElementById(id+'_hidden').value;
var total = (parseFloat(precio * val)).toFixed(2);
control.innerHTML=total;
var neto= total;
net.innerHTML=neto;
var final=(neto * 1.21).toFixed(2);
fin.innerHTML=final;
}
function seleccionarCheck(elem, sel) {
var sel = "";
var elem = document.getElementById(ok);
for (i=0; i<elem.length; i++) {
if (document.getElementById("ok").checked==true) {
elem[i].checked=true;
sel += ","+elem[i].value;
} else {
elem[i].checked=false;
sel = "";
}
}
alert('sel')
}
function seleccionar_todo(){
for (i=0;i<document.form.elements.length;i++)
if(document.form.elements[i].type == "checkbox")
document.form.elements[i].checked=1
}
function ControlNum(){
var tecla=window.event.keyCode;
if (tecla < 48 || tecla > 57){
window.event.returnValue=false;
}
else
{
window.event.returnValue=true;
}
}
function paso(id,bol){
var precio = document.getElementById(id+'_hidden').value;
var nombre=document.getElementById(id + '_td');
if (bol) {
window.location.href="Presupuesto.php?precio=" + precio + "&nombre=" + nombre
}
}
</script>
</head>
<body>
<div align="center">
<form action="Presupuesto.php" method="post" name="form" id="form">
<table align='right' border='1'><tr><td>Neto: <label id='neto' name='etiqet'/></td></tr><tr><td>IVA: 21%</td></tr><tr><td>FINAL:
<label id='final' name='etiqeta'/></td></tr></table><table class='table' aling='center' border=1><tr> <td><div class='letra1'><b>PRODUCTO
</b></td><td><div class='letra2'><b>PRECIO
</b></td><td><div class='letra1'><b>CANTIDAD
</b></td><td><div class='letra2'><b>PRECIO_TOTAL
</b></td><td><div class='letra1'><b><input type='checkbox' name='todo' onClick='seleccionar_todo()' id='todo'></b></td></tr> <tr class='th'><td id='nombre_<?php echo i++?>_td' class='td'>Unipolar 10 - 16 - 20 Amp
</td><td>$12.67
<input type='hidden' value='12.67' id='precio_0_hidden' name='precio_0_hidden' /></td><td><input type='text' value='' id='precio_0' name='precio_0' onKeyUp='funcion(this.id, this.value,total466,neto,final)' onkeypress='ControlNum()' class='input'/></td><td><label id='total466' name='etiq'/></td><td><input type='checkbox' name='checkbox[]' id='precio_<?php echo i++?>_td' onClick='paso(this.id, this.checked)'/>
</td></tr><tr class='th'><td id='nombre_<?php echo i++?>_td' class='td'>Unipolar 10-16-20-25-32 Amp
</td><td>$8.32
<input type='hidden' value='8.32' id='precio_1_hidden' name='precio_1_hidden' /></td><td><input type='text' value='' id='precio_1' name='precio_1' onKeyUp='funcion(this.id, this.value,total455,neto,final)' onkeypress='ControlNum()' class='input'/></td><td><label id='total455' name='etiq'/></td><td><input type='checkbox' name='checkbox[]' id='precio_<?php echo i++?>_td' onClick='paso(this.id, this.checked)'/>
</td></tr><tr class='th'><td id='nombre_<?php echo i++?>_td' class='td'>Unipolar 10-16-20-25-32 Amp
</td><td>$5.99
<input type='hidden' value='5.99' id='precio_2_hidden' name='precio_2_hidden' /></td><td><input type='text' value='' id='precio_2' name='precio_2' onKeyUp='funcion(this.id, this.value,total462,neto,final)' onkeypress='ControlNum()' class='input'/></td><td><label id='total462' name='etiq'/></td><td><input type='checkbox' name='checkbox[]' id='precio_<?php echo i++?>_td' onClick='paso(this.id, this.checked)'/>
</td></tr><tr class='th'><td id='nombre_<?php echo i++?>_td' class='td'>Unipolar 25 - 32 Amp
</td><td>$13.45
<input type='hidden' value='13.45' id='precio_3_hidden' name='precio_3_hidden' /></td><td><input type='text' value='' id='precio_3' name='precio_3' onKeyUp='funcion(this.id, this.value,total467,neto,final)' onkeypress='ControlNum()' class='input'/></td><td><label id='total467' name='etiq'/></td><td><input type='checkbox' name='checkbox[]' id='precio_<?php echo i++?>_td' onClick='paso(this.id, this.checked)'/>
</td></tr><tr class='th'><td id='nombre_<?php echo i++?>_td' class='td'>Unipolar 40 Amp
</td><td>$11.99
<input type='hidden' value='11.99' id='precio_4_hidden' name='precio_4_hidden' /></td><td><input type='text' value='' id='precio_4' name='precio_4' onKeyUp='funcion(this.id, this.value,total456,neto,final)' onkeypress='ControlNum()' class='input'/></td><td><label id='total456' name='etiq'/></td><td><input type='checkbox' name='checkbox[]' id='precio_<?php echo i++?>_td' onClick='paso(this.id, this.checked)'/>
</td></tr><tr class='th'><td id='nombre_<?php echo i++?>_td' class='td'>Unipolar 40 Amp
</td><td>$16.73
<input type='hidden' value='16.73' id='precio_5_hidden' name='precio_5_hidden' /></td><td><input type='text' value='' id='precio_5' name='precio_5' onKeyUp='funcion(this.id, this.value,total468,neto,final)' onkeypress='ControlNum()' class='input'/></td><td><label id='total468' name='etiq'/></td><td><input type='checkbox' name='checkbox[]' id='precio_<?php echo i++?>_td' onClick='paso(this.id, this.checked)'/>
</td></tr><tr class='th'><td id='nombre_<?php echo i++?>_td' class='td'>Unipolar 50 - 63 Amp
</td><td>$22.05
<input type='hidden' value='22.05' id='precio_6_hidden' name='precio_6_hidden' /></td><td><input type='text' value='' id='precio_6' name='precio_6' onKeyUp='funcion(this.id, this.value,total469,neto,final)' onkeypress='ControlNum()' class='input'/></td><td><label id='total469' name='etiq'/></td><td><input type='checkbox' name='checkbox[]' id='precio_<?php echo i++?>_td' onClick='paso(this.id, this.checked)'/>
</td></tr><tr class='th'><td id='nombre_<?php echo i++?>_td' class='td'>Unipolar 50 Amp.
</td><td>$17.36
<input type='hidden' value='17.36' id='precio_7_hidden' name='precio_7_hidden' /></td><td><input type='text' value='' id='precio_7' name='precio_7' onKeyUp='funcion(this.id, this.value,total457,neto,final)' onkeypress='ControlNum()' class='input'/></td><td><label id='total457' name='etiq'/></td><td><input type='checkbox' name='checkbox[]' id='precio_<?php echo i++?>_td' onClick='paso(this.id, this.checked)'/>
</td></tr><tr class='th'><td id='nombre_<?php echo i++?>_td' class='td'>Unipolar 6 Amp
</td><td>$14.96
<input type='hidden' value='14.96' id='precio_8_hidden' name='precio_8_hidden' /></td><td><input type='text' value='' id='precio_8' name='precio_8' onKeyUp='funcion(this.id, this.value,total465,neto,final)' onkeypress='ControlNum()' class='input'/></td><td><label id='total465' name='etiq'/></td><td><input type='checkbox' name='checkbox[]' id='precio_<?php echo i++?>_td' onClick='paso(this.id, this.checked)'/>
</td></tr><tr class='th'><td id='nombre_<?php echo i++?>_td' class='td'>Unipolar 63 Amp
</td><td>$17.36
<input type='hidden' value='17.36' id='precio_9_hidden' name='precio_9_hidden' /></td><td><input type='text' value='' id='precio_9' name='precio_9' onKeyUp='funcion(this.id, this.value,total458,neto,final)' onkeypress='ControlNum()' class='input'/></td><td><label id='total458' name='etiq'/></td><td><input type='checkbox' name='checkbox[]' id='precio_<?php echo i++?>_td' onClick='paso(this.id, this.checked)'/>
</td></tr></table><br> <input type="button" name="consulta" id="consulta" value="Nueva Consulta" onclick = "this.form.action = 'pre.php'; this.form.submit()" /> <input type="submit" name="presupuesto" id="presupuesto" value="Agregar a Presupuesto" /> <input type="reset" name="cancel" id="cancel" value="Cancelar"/>