-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.Rmd
72 lines (63 loc) · 1.92 KB
/
test.Rmd
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
<head>
<link rel="stylesheet" href="../lib/css/bootstrap.min.css" type="text/css"/>
<script src="https://use.fontawesome.com/d7a6f6be38.js"></script>
<script type="text/javascript" src="../lib/js/jquery-3.1.1.min.js"></script>
<link href="//cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" rel="stylesheet"/>
<script src="//cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
</head>
<div class="row">
<div id="OrderTable"></div>
</div>
<?php
$output.='<hr />
<table id="SearchResults" class="table table-striped table-bordered" style="width:auto;">
<thead>
<tr>
<th>Order No.</th>
<th>Customer Name</th>
<th>Order Date</th>
<th>Category Name</th>
<th>Category Type</th>
<th>Quantity in Kilos</th>
<th>Delivery Date</th>
<th>Order Status</th>
</tr>
</thead>
';
echo $output;
?>
<script>
function SearchOrders()
{
document.getElementById("OrderTable").innerHTML="";
document.getElementById("NoData").innerHTML="";
document.getElementById("Results").style.display = 'none';
startDate=document.getElementById("Start_Date").value;
endDate=document.getElementById("End_Date").value;
$.ajax({
type:"POST",
url:"searchorders.php",
data:
{
'StartDate': startDate,
'EndDate':endDate
},
success: function(data)
{
if (data == "Failed")
{
$('#NoData').append("No data Found!");
}
else
{
$('#OrderTable').append(data);
document.getElementById("Results").style.display = 'block';
$('#SearchResults').DataTable({"columnDefs": [ {
"targets": [0,4,5,6],
"orderable": false
}]});
}
}
})
}
</script>