-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
65 lines (52 loc) · 2.73 KB
/
index.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
<html>
<head>
<meta charset="utf-8" />
<title>Datepicker example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://unpkg.com/[email protected]/css/gijgo.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
</head>
<body>
<div class="fluid-container bg-dark">
<h3 class="text-center text-white">Juice Price Calculator</h3>
<form id="form" method ="post" class="mt-5 form-group">
<div class="d-flex justify-content-center">
<div class="p-2 bd-highlight"><input id="rate" width="276" placeholder="Rate" class="form-control" required/></div>
<div class="p-2 bd-highlight"><input id="datepicker" width="276" placeholder="order date" class="form-control" required/></div>
<div class="p-2 bd-highlight"><input id="amount" width="276" placeholder="Total amount" class="form-control" required/></div>
<div class="p-2 bd-highlight"><button type="submit" class="btn btn-success">submit</button></div>
</div>
<div class = "text-center text-white">
<span id="response" class="text-center"></span>
</div>
</form>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+" crossorigin="anonymous"></script>
<script src="https://unpkg.com/[email protected]/js/gijgo.min.js" type="text/javascript"></script>
<script>
$('#datepicker').datepicker({
format: 'dd-mm-yyyy'
});
$(document).ready(function() {
$('#form').submit(function(e) {
e.preventDefault();
var rate = $("#rate").val();
var date = $("#datepicker").val();
var amt = $("#amount").val();
// alert(date);
$.ajax({
type: "POST",
url: 'function.php',
data: {'rate': rate, 'date': date,'amt': amt, 'call':1},
success: function(response)
{
//var jsonData = JSON.parse(response);
$('#response').html('output: ' + response);
}
});
});
});
</script>
</body>
</html>