-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
71 lines (70 loc) · 2.92 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
66
67
68
69
70
71
<?php
require 'core/MathOperations.php';
$math = new MathOperations();
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Calculator</title>
<!-- Bootstrap stylesheet -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Custom main stylesheet -->
<link rel="stylesheet" href="css/main.css">
<!-- Font Awesome stylesheet TODO: Delete if there is no use -->
<link rel="stylesheet" href="css/font-awesome.min.css">
</head>
<body>
<!-- Header text -->
<h1 class="page-header text-center">Calculator</h1>
<!-- Content starts -->
<div class="container">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<form class="form-group" role="form" id="form" action="<?php $_SERVER['PHP_SELF']; ?>" method="POST">
<!-- First operand input -->
<div class="col-sm-5 text-right">
<label for="firstOperand"></label>
<input class="well" type="number" id="firstOperand" name="firstOperand" placeholder="First operand">
</div>
<!-- Operator input -->
<div class="col-sm-2 text-center">
<label for="operator"></label>
<select class="well" id="operator" name="operator">
<option>+</option>
<option>-</option>
<option>*</option>
<option>/</option>
</select>
</div>
<!-- Second operand input -->
<div class="col-sm-5 text-left">
<label for="secondOperand"></label>
<input class="well" type="number" id="secondOperand" name="secondOperand" placeholder="Second operand">
</div>
<!-- Result -->
<div class="col-lg-8 col-lg-offset-2">
<h3 class="text-center">Result</h3>
<div class="well">
<?= MathOperations::$result; ?>
</div>
</div>
<!-- Calculate button -->
<div class="button-area col-sm-8 col-sm-offset-2 text-center">
<button type="submit" class="btn btn-info">Calculate</button>
</div>
</form>
<!-- Form ends -->
</div>
</div>
</div>
<!-- Content ends -->
<!-- JQuery script -->
<script src="js/jquery-3.1.0.min.js"></script>
<!-- Bootstrap script -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>