-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearchInvoicesByField.php
94 lines (86 loc) · 2.9 KB
/
searchInvoicesByField.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<script type='text/javascript'>
$(document).ready(function()
{
$("input[name='op']:radio").click(function()
{
$value1 = $("input[name='value1']");
$var = $(this).val();
if ($var == 'range')
{
if($("input[name='value2']").size() <= 0)
{
$value1.after('<input type="text" name="value2" value="">');
$("input[name='value2']").attr("type",$value1.attr("type"));
}
}
else
{
$("input[name='value2']").remove();
}
if ($var == 'contains')
{
$("input[name='value1']").attr("type","text");
}
});
$("input[name='field']:radio").click(function()
{
$value1 = $("input[name='value1']");
$var = $(this).val();
if ($var == 'GrossTotal')
{
$("input[name='value1']").attr("type","number");
$("input[name='value2']").attr("type","number");
$("input[name='value1']").attr("step","any");
$("input[name='value2']").attr("step","any");
}
else if($var == 'InvoiceDate')
{
$("input[name='value1']").attr("type","date");
$("input[name='value2']").attr("type","date");
}
else
{
$("input[name='value1']").attr("type","text");
$("input[name='value2']").attr("type","text");
}
if ($var == 'CompanyName')
{
$("input[name='op']:radio[value=min]").remove();
$("input[name='op']:radio[value=max]").remove();
$("label[for='min']").remove();
$("label[for='max']").remove();
}
else
{
$value1 = $("label[for='contains']");
if ($("input[name='op']:radio[value=min]").size() <= 0 )
{
$value1.after('<input type="radio" name="op" value="max"> <label for="max">Max</label>');
$value1.after('<input type="radio" name="op" value="min"> <label for="min">Min</label>');
}
}
});
});
</script>
<div style="min-width: 1000px;">
<form action="showInvoiceSearch.php" method="GET">
Atributos da pesquisa: <br>
<input type="radio" name="op" value="range"><label for="range">Range</label>
<input type="radio" name="op" value="equal"><label for="equal">Equal</label>
<input type="radio" name="op" value="contains"><label for="contains">Contains</label>
<input type="radio" name="op" value="min"> <label for="min">Min</label>
<input type="radio" name="op" value="max"> <label for="max">Max</label>
<br><br>
Campo: <br>
<input type="radio" name="field" value="InvoiceNo"><label for="InvoiceNo">Nr da fatura</label>
<input type="radio" name="field" value="InvoiceDate"><label for="InvoiceDate">Data da fatura</label>
<input type="radio" name="field" value="GrossTotal"><label for="GrossTotal">Total Bruto</label>
<input type="radio" name="field" value="CompanyName"><label for="CompanyName">Nome da Empresa</label>
<br><br>
Valor: <br>
<input type="text" name="value1" value="">
<input type="text" name="value2" value="">
<input type="submit">
<br><br>
</form>
</div>