<?
#factuur init..
$ownInf = getOwnInfo();
$rayonNr = $ownInf['rayonnr'];
$factuurnr = $rayonNr;
$factuurnr .= factuurMaand
(date("n")); $factuurnr .= factuurKwartaal
(date("n")); $factuurnr .= factuurKwartaal
(date("n"));
$addins = 5;
?>
<script>
function calculateTotal(price, price2, num, addin) {
prz = price2 * num;
pri = prz / 100;
var a = pri;
var b = price * num;
prij = a+b;
prijs = prij * num;
addin.value = prij;
}
function makeTotal() {
var addins = [<?
for ($a = 0; $a <= $addins; $a++) {
$nms .= 'fct.sbttl_'.$a.'.value, ';
}
?>]
var count = eval(0);
<?
for ($a = 0; $a <= $addins; $a++) {
//$counter .= 'var count = parseInt(count) + parseInt(fct.sbttl_'.$a.'.value);'."\n";
$counter .= "var a = eval(fct.sbttl_".$a.".value);\n";
$counter .= "var b = eval(count);\n";
$counter .= 'var count = eval(a+b);'."\n\n";
}
?>
document.getElementById('koetjeboe').innerHTML = 'addins.length='+addins.length+'<br>alles opgeteld='+count+'<br>'+document.getElementById('koetjeboe').innerHTML;
fct.subtot.value = count;
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="128"><img src="img/topLeftLogo.png" width="128" height="90"><br>
</td>
<td> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="80" style="border: 1px #FF6600 solid;"><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<img src="img/factuur.png" width="69" height="477"></td>
<td width="2" style="border: 1px #FF6600 solid;"> </td>
<td style="padding-left: 32px; padding-right: 32px; vertical-align:top;"> <br>
<br>
<br>
<div style="float: right; width: 256px;"> <b><font color="#FF6600">Facctuuradres:</font></b> ...<br>
<b><font color="#FF6600">Mobiel:</font></b> 06-...<br>
<b><font color="#FF6600">Kantoor:</font></b> ...<br>
</div>
<div style="float: left; width: 256px;"> <b><font color="#FF6600">Adresgegevens eigen bedrijf:</font></b><br>
<?=$ownInf['naam'];?>
<br>
<?=$ownInf['adres'];?>
<br>
<?=$ownInf['plaats'];?>
<br>
<?=$ownInf['pccijfers'];?>
<?=$ownInf['pcnummers'];?>
<br>
<?=$ownInf['telnr'];?>
</div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<div style="float: left; width: 384px;"> <b><font color="#FF6600"><font size="5">Factuurnummer:</font></font></b>:
<?=$factuurnr;?>
<br>
<b><font color="#FF6600"><font size="5">Factuurdatum:</font></font></b>:
<?=date("d-m-Y", $fctDate);?
> </div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<form name="fct" action="" method="post">
<table cellpadding="4" cellspacing="0" border="0" width="100%" align="left">
<tr style="color: #FF6600;">
<td style="border-left: 2px #00000 solid; border-top: 2px #00000 solid; border-bottom: 2px #00000 solid;">Datum</td>
<td style="border-top: 2px #00000 solid; border-bottom: 2px #00000 solid;">Omschrijving</td>
<td style="border-top: 2px #00000 solid; border-bottom: 2px #00000 solid;">Prijs per eenh.</td>
<td style="border-top: 2px #00000 solid; border-bottom: 2px #00000 solid;">Aantal</td>
<td style="border-right: 2px #00000 solid; border-top: 2px #00000 solid; border-bottom: 2px #00000 solid;">Totaal</td>
</tr>
<?
$a = 0;
for ($a = 0; $a <= $addins; $a++) {
?>
<!-- Start Factuur Loop -->
<tr>
<td style="border-left: 1px #00000 solid; border-bottom: 1px #00000 solid;">
<input type="text" size="4" maxlength="2" name="dtm_d_
<?=$a;?
>" value="
<?=date("d");?
>">-
<input type="text" size="4" maxlength="2" name="dtm_m_
<?=$a;?
>" value="
<?=date("n");?
>">-
<input type="text" size="8" maxlength="4" name="dtm_y_
<?=$a;?
>" value="
<?=date("Y");?
>">
</td>
<td style="border-left: 1px #00000 solid; border-bottom: 1px #00000 solid;">
<input type="text" name="omschr_<?=$a;?>" value="" style="width: 100%;">
</td>
<td style="border-left: 1px #00000 solid; border-bottom: 1px #00000 solid;">
€ <input type="text" size="8" maxlength="20" name="ppe1_<?=$a;?>" value="0" onChange="calculateTotal(this.value, fct.ppe2_<?=$a;?>.value, fct.aantal_<?=$a;?>.value, fct.sbttl_<?=$a;?>);">
, <input type="text" size="4" maxlength="2" name="ppe2_<?=$a;?>" value="0" onChange="calculateTotal(fct.ppe1_<?=$a;?>.value, this.value, fct.aantal_<?=$a;?>.value, fct.sbttl_<?=$a;?>);">
</td>
<td style="border-left: 1px #00000 solid; border-bottom: 1px #00000 solid; border-right: 1px #00000 solid;">
€ <input type="text" size="4" maxlength="2" name="aantal_<?=$a;?>" value="1" onChange="calculateTotal(fct.ppe1_<?=$a;?>.value, fct.ppe2_<?=$a;?>.value, this.value, fct.sbttl_<?=$a;?>);">
</td>
<td style="border-left: 1px #00000 solid; border-bottom: 1px #00000 solid; border-right: 1px #00000 solid;">
€ <input type="text" size="23" maxlength="20" name="sbttl_<?=$a;?>" onFocus="calculateTotal(fct.ppe1_<?=$a;?>.value, fct.ppe2_<?=$a;?>.value, fct.aantal_<?=$a;?>.value, this.value); makeTotal();">
</td>
</tr>
<!-- End Factuur Loop -->
<?
}
?>
<tr>
<td> </td>
<td> </td>
<td style="color: #FF6600; border-left: 1px #00000 solid; border-bottom: 1px #00000 solid;">Sub Totaal</td>
<td style="border-left: 1px #00000 solid; border-bottom: 1px #00000 solid; border-right: 1px #00000 solid;">€
<input type="text" readonly name="subtot" value="0.00">
</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td style="color: #FF6600; border-left: 1px #00000 solid; border-bottom: 1px #00000 solid;">BTW 19%</td>
<td style="border-left: 1px #00000 solid; border-bottom: 1px #00000 solid; border-right: 1px #00000 solid;">€
<input type="text" readonly name="btw" value="0.00">
</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td style="color: #FF6600; border-left: 1px #00000 solid; border-bottom: 1px #00000 solid;">Totaal</td>
<td style="border-left: 1px #00000 solid; border-bottom: 1px #00000 solid; border-right: 1px #00000 solid;">€ </td>
<input type="text" readonly name="alltotl" value="0.00">
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div id="koetjeboe" style="border: 1px #000000 solid;">
hier komt de info...
</div>