-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
62 lines (55 loc) · 2.27 KB
/
home.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
<?php
require_once './vendor/autoload.php';
use App\classes\Calculator;
$result;
if (isset($_POST['btn'])) {
$calculator = new Calculator();
$result = $calculator->myCalculator();
}
?>
<?php include './includes/my-header.php'?>
<section class="bg-light py-5">
<div class="container">
<div class="row">
<div class="col-md-6 offset-3">
<div class="card">
<div class="card-header">
<h1 style="text-align: center">My Calculator</h1>
</div>
<div class="card-body">
<form action="" method="POST">
<div class="row form-group ">
<label for="" class="col-md-3 col-from-label">First Number:</label>
<div class="col-md-9">
<input type="number" name="first_number" class="form-control">
</div>
</div>
<div class="row form-group ">
<label for="" class="col-md-3 col-from-label">Second Number:</label>
<div class="col-md-9">
<input type="number" name="second_number" class="form-control">
</div>
</div>
<div class="row form-group ">
<label for="" class="col-md-3 col-from-label">Result:</label>
<div class="col-md-9">
<input type="number" class="form-control" value="<?php echo $result; ?>">
</div>
</div>
<div class="row form-group ">
<label for="" class="col-md-3 col-from-label"></label>
<div class="col-md-9">
<input class="btn btn-success" type="submit" name="btn" class="form-control" value="+">
<input class="btn btn-success" type="submit" name="btn" class="form-control" value="-">
<input class="btn btn-success" type="submit" name="btn" class="form-control" value="*">
<input class="btn btn-success" type="submit" name="btn" class="form-control" value="/">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
<?php include './includes/my-footer.php'?>