-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreateInvoiceForm.php
65 lines (60 loc) · 2.73 KB
/
createInvoiceForm.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<?php
include 'header.php';
echo '<div id="conteudo">
<div class="texto">';
if ($_SESSION['permission'] == "reader")
{
echo ' Precisa de ter permissões de writer para criar faturas!';
exit();
}
?>
<script language="Javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script>
$(document).ready(function()
{
var scntDiv = $('#line');
var i = $('#line label').size() + 1;
var j = 10;
$('#addLine').live('click', function()
{
$('#addLine').remove();
j++;
$('<p>').appendTo(scntDiv);
$('<br><label for="ProductCode">ID do Produto</label><br><input type="text" name="ProductCode[]" value=""><br><br>').appendTo(scntDiv);
j++;
$('<label for="Quantity">Quantidade Vendida</label><br><input type="text" name="Quantity[]" value=""><br><br>').appendTo(scntDiv);
j++;
$('<label for="UnitPrice">Preço Unitário</label><br><input type="text" name="UnitPrice[]" value=""><br><br>').appendTo(scntDiv);
j++;
$('<label for="TaxType">Tipo de Taxa</label><br><input type="text" name="TaxType[]" value=""><br><br>').appendTo(scntDiv);
j++;
$('<label for="TaxPercentage">Percentagem da Taxa</label><br><input type="text" name="TaxPercentage[]" value=""><br><br>').appendTo(scntDiv);
$('</p>').appendTo(scntDiv);
$('<h4><a href="#" id="addLine"> Add Line</a></h4>').appendTo(scntDiv);
i++;
return false;
});
});
</script>
<form id="form" action="createInvoice.php" method="GET">
<h2>Adicionar Fatura:</h2><br>
<label for="InvoiceDate">Data da Fatura</label><br><input type="date" name="InvoiceDate" value=""><br><br>
<label for="CustomerID">ID do Cliente</label><br><input type="text" name="CustomerID" value=""><br><br>
<br>
<div id="line">
<label for="ProductCode">ID do Produto</label><br><input type="number" name="ProductCode[]" value=""><br><br>
<label for="Quantity">Quantidade Vendida</label><br><input type="number" name="Quantity[]" value=""><br><br>
<label for="UnitPrice">Preço Unitário</label><br><input type="number" name="UnitPrice[]" value=""><br><br>
<label for="TaxType">Tipo de Taxa</label><br><input type="text" name="TaxType[]" value=""><br><br>
<label for="TaxPercentage">Percentagem da Taxa</label><br><input type="text" name="TaxPercentage[]" value=""><br><br>
<h4><a href="#" id="addLine">Add Line</a></h4>
</div>
<br>
<label for="TaxPayable">Total de Imposto</label><br><input type="number" name="TaxPayable" value=""><br><br>
<label for="NetTotal">Total sem Imposto</label><br><input type="number" name="NetTotal" value=""><br><br>
<br>
<input type="submit" value="Criar novo">
</form>
</div>
</div>