-
Notifications
You must be signed in to change notification settings - Fork 0
/
dateconvert.php
74 lines (71 loc) · 2.06 KB
/
dateconvert.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Simple Ajax Demo</title>
<!-- Bootstrap -->
<link href='css/bootstrap.min.css' rel="stylesheet">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script type="text/javascript">
$(document).ready(function(){
$('#convertBS').click(function(){
var input = $('#dateBS').val();
var url = 'proxy.php?url=http://nepalicalender.appspot.com/toenglish/'+input;
$.getJSON(url, function(data) {
$('#resultAD').html('The converted date in AD is: '+data.year+'-'+data.month+'-'+data.day);
});
});
$('#convertAD').click(function(){
var input = $('#dateAD').val();
var url = 'proxy.php?url=http://nepalicalender.appspot.com/tonepali/'+input;
$.getJSON(url, function(data) {
$('#resultBS').html('The converted date in BS is: '+data.year+'-'+data.month+'-'+data.day);
});
});
});
</script>
</head>
<body>
<div class="container">
<section>
<h1>Jquery Ajax Demo</h1>
</section>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<ul class="nav">
<li><a href="ajax.php">Home</a></li>
<li><a href="map.php">Map</a></li>
<li><a href="forex.php">Forex</a></li>
<li class="active"><a href="dateconvert.php">Date Conversion</a></li>
<li><a href="visualization.php">Map Visualization</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row-fluid">
<div class="span4">
<form>
<label>Enter Data in BS: </label>
<input type="text" id="dateBS" ><br/>
<button type="button" id="convertBS" class="btn btn-primary">Convert to AD</button>
</form>
<p id="resultAD"></p>
</div>
<div class="span4">
<form>
<label>Enter Data in AD: </label>
<input type="text" id="dateAD" ><br/>
<button type="button" id="convertAD" class="btn btn-primary">Convert to BS</button>
</form>
<p id="resultBS"></p>
</div>
</div>
</div>
</div>
</body>
</html>