-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
54 lines (54 loc) · 1.58 KB
/
index.php
File metadata and controls
54 lines (54 loc) · 1.58 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Currency Converter</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/flatly.min.css">
<script src="js/jquery-3.1.1.min.js" charset="utf-8"></script>
<script src="js/bootstrap.min.js" charset="utf-8"></script>
</head>
<body>
<div class="container-fluid">
<div class="col-md-6">
<h1>Currency Converter</h1>
<hr>
<div class="form-group">
<input class="form-control" type="number" id="a" value="1">
</div>
<div class="form-group">
<select class="form-control" id="from">
<?php include('countries.php'); ?>
</select>
</div>
<div class="form-group">
<select class="form-control" id="to">
<?php include('countries.php'); ?>
</select>
</div>
<button id="convert" class="btn btn-primary btn-lg btn-block">Convert</button>
<hr>
<div class="form-group">
<h3 id="result"></h3>
</div>
</div>
</div>
<script type="text/javascript">
$('#convert').click(function(){
$.ajax({
type: 'GET',
url: 'request.php',
data: {
origen : $('#from').val(),
destino : $('#to').val(),
cantidad : $('#a').val()
},
beforeSend: function() { $('#result').html('Loading...'); },
success: function(result){
$('#result').html(result);
}
});
});
</script>
</body>
</html>