-
Notifications
You must be signed in to change notification settings - Fork 0
/
odd-sum.php
65 lines (58 loc) · 2.1 KB
/
odd-sum.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
<?php
require_once './vendor/autoload.php';
use App\classes\OddSum;
$data = [
'leftSide' => '',
'sum' => ''
];
if (isset($_POST['btn'])) {
$oddSum = new OddSum();
$data = $oddSum->getOddSum();
}
?>
<?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">Sum of Odd numbers</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">Your Result is:</label>
<div class="col-md-9">
<textarea class="form-control" rows="5"><?php echo $data['leftSide'] . $data['sum']; ?></textarea>
</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-warning" type="submit" name="btn" class="form-control" value="Get Sum of Odds">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
<script src="./assets/js/jquery-1.12.4.min.js"></script>
<script src="./assets/js/bootstrap.bundle.min.js"></script>
</body>
</html>