hola este es mi primer tema.
este seria el resultado de la factura creada.
ok. empesemos
necesitamos el archivo index.html y pagina1.php, acontinuacion el codigo de PAGINA1.php
Código PHP:
<DIV ID="seleccion">
<p>
<?php
echo "Datos de tu empresa"; echo "<br/>";
echo "____________________________________________________________________________________"; echo "<br/>";
echo $_REQUEST['nombre'];
echo $_REQUEST['apellido'];
echo " - - - ";
echo $_REQUEST['domicilio'];
echo " - - - ";
echo $_REQUEST['ciudad'];
echo " - - - FECHA:";
echo $_REQUEST['fecha']; echo "<br/>";
echo "____________________________________________________________________________________"; echo "<br/>";
echo "ARTICULO - - - IMPORTE";
echo "<br/>";
echo "<br/>";
echo $_REQUEST['art1']; echo " - $"; echo $_REQUEST['imp1'];
echo "<br/>";
echo "<br/>";
echo $_REQUEST['art2']; echo " - $"; echo $_REQUEST['imp2'];
echo "<br/>";
echo "<br/>";
echo $_REQUEST['art3']; echo " - $"; echo $_REQUEST['imp3'];
echo "<br/>";
echo "____________________________________________________________________________________"; echo "<br/>";
echo "TOTOAL: $";echo $_REQUEST['total'];echo " - - - " ;
?>
</p>
<img src="Dibujo.bmp" width="31" height="13">--------------------------------------------------------------------------------------------------------- </p>
</DIV>
<a href="javascript:imprSelec('seleccion')" >IMPRIMIR</a>
<script language="Javascript">
function imprSelec(nombre)
{
var ficha = document.getElementById(nombre);
var ventimp = window.open(' ', 'popimpr');
ventimp.document.write( ficha.innerHTML );
ventimp.document.close();
ventimp.print( );
ventimp.close();
}
</script> ventimp.close();
}
</script>
y el index:
Código HTML:
<script>
function suma()
{
var uno=0;
var dos=0;
uno=document.frm.imp1.value;
dos=document.frm.imp2.value;
tres=document.frm.imp3.value;
nsuma=parseInt(uno) + parseInt(dos) + parseInt(tres);
document.frm.total.value=nsuma;
}
</script>
<style type="text/css">
<!--
.Estilo6 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
.Estilo7 {font-size: 12px}
.Estilo11 {font-family: Arial, Helvetica, sans-serif; font-size: 18px; }
.Estilo12 {
font-size: 18px;
font-style: italic;
font-weight: bold;
color: #FF0000;
}
.Estilo13 {
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
font-style: italic;
font-weight: bold;
color: #FF0000;
}
.Estilo14 {
font-style: italic;
font-weight: bold;
font-size: 18px;
color: #FFFFFF;
}
-->
</style>
<form name="frm" method="post" action="pagina1.php">
<p align="center"><em><strong>FACTURAS POR PABLO12321 </strong></em></p>
<table width="799" height="144" border="1" bordercolor="#000000">
<tr>
<td height="23" class="Estilo7"><div align="center" class="Estilo13"><span class="Estilo17">Datos del Comprador </span></div></td>
<td class="Estilo7"> <span class="Estilo17 Estilo11 Estilo14">_________</span><span class="Estilo17 Estilo11 Estilo12">Datos de la Venta </span></td>
</tr>
<tr>
<td height="26"><span class="Estilo6">nombre:
<input type="text" name="nombre" />
</span></td>
<td><p class="Estilo6">fecha:
<input type="text" name="fecha" />
</p></td>
</tr>
<tr>
<td height="26"><span class="Estilo6">apellido:
<input type="text" name="apellido" />
</span></td>
<td><span class="Estilo6">nombre de producto 1 :
<input type="text" name="art1" />
precio de producto
<input name="imp1" type="text" value="0" />
</span></td>
</tr>
<tr>
<td height="26"><span class="Estilo6">Domicilio:
<input type="text" name="domicilio" />
</span></td>
<td><span class="Estilo6">nombre de producto 2 :
<input type="text" name="art2" />
precio de producto
<input name="imp2" type="text" value="0" />
</span></td>
</tr>
<tr>
<td height="26"><span class="Estilo6">Ciudad:
<input type="text" name="ciudad" />
</span></td>
<td><span class="Estilo6">nombre de producto 3 :
<input type="text" name="art3" />
precio de producto
<input name="imp3" type="text" value="0" />
</span></td>
</tr>
</table>
<p>
<input name="submit" type="submit" onClick="suma()" value="confirmar">
</p>
<p><span class="Estilo6">
<input style="position:fixed;bottom:-500;right:-500;" name="total" type="text" onfocus="verificarValor(this.value);" />
</span></p>
</form>
Solo nos queda descargar el archivo "dibujo.bmp" y subir nuestros archivos a un servidor con php o instalarlo en Xampp.
link de dibujo.bmp
[URL="http://www.mediafire.com/?kkx82zkle8xwyzf"]http://www.mediafire.com/?kkx82zkle8xwyzf[/URL]
link del trabajo completo
[URL="http://www.mediafire.com/?98dsprl1nsd48fd"]http://www.mediafire.com/?98dsprl1nsd48fd[/URL]
contraseña: pablo12321