-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
78 lines (65 loc) · 3.03 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
72
73
74
75
76
77
78
<?php
require_once'./vendor/autoload.php';
use App\classes\calculator;
$result = '';
if(isset($_POST['first_number']))
{
$calculator = new calculator($_POST);
$result = $calculator->Mycalculator();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Calculator</title>
<link rel="stylesheet" href="./asset/css/bootstrap.css">
</head>
<body>
<section class="bg-secondary py-5">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header rounded-0">
My Calculator
</div>
<div class="card-body rounded-0">
<form action="" method="POST">
<div class="form-group row">
<label class="col from-label col-md-3">First number</label>
<div class="col-md-9">
<input type="number" placeholder="First number" name="first_number" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col from-label col-md-3">Second number</label>
<div class="col-md-9">
<input type="number" placeholder="Second number" name="second_number" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col from-label col-md-3">Result</label>
<div class="col-md-9">
<input type="text" placeholder=" Result" value="<?php echo $result ; ?>" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col from-label col-md-3"></label>
<div class="col-md-9">
<input type="Submit" name="btn" class="btn btn-success" value="+">
<input type="Submit" name="btn" class="btn btn-success" value="-">
<input type="Submit" name="btn" class="btn btn-success" value="*">
<input type="Submit" name="btn" class="btn btn-success" value="/">
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</body>
</html>