-
Notifications
You must be signed in to change notification settings - Fork 7
/
rainfall_prediction.php
135 lines (98 loc) · 3.73 KB
/
rainfall_prediction.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html>
<?php include ('header.php'); ?>
<body class="bg-white" id="top">
<?php include ('nav.php'); ?>
<section class="section section-shaped section-lg">
<div class="shape shape-style-1 shape-primary">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<!-- ======================================================================================================================================== -->
<div class="container ">
<div class="row">
<div class="col-md-8 mx-auto text-center">
<span class="badge badge-danger badge-pill mb-3">Prediction</span>
</div>
</div>
<div class="row row-content">
<div class="col-md-12 mb-3">
<div class="card text-white bg-gradient-success mb-3">
<form role="form" action="#" method="post" >
<div class="card-header">
<span class=" text-info display-4" > Rainfall Prediction </span>
</div>
<div class="card-body text-dark">
<table class="table table-striped table-hover table-bordered bg-gradient-white text-center display" id="myTable">
<thead>
<tr class="font-weight-bold text-default">
<th><center>Region</center></th>
<th><center>Month</center></th>
<th><center>Prediction</center></th>
</tr>
</thead>
<tbody>
<tr class="text-center">
<td>
<div class="form-group ">
<select id="region-select" name="region" class="form-control" required>
<option value="">Select Region</option>
</select>
<script language="javascript"> print_region("region-select"); </script>
</div>
</td>
<td>
<div class="form-group ">
<select id="month-select" name="month" class="form-control" required>
<option value="">Select Month</option>
</select>
<script language="javascript"> print_months("month-select"); </script>
</div>
</td>
<td>
<center>
<div class="form-group ">
<button type="submit" value="Yield" name="Rainfall_Predict" class="btn btn-success btn-submit">Predict</button>
</div>
</center>
</td>
</tr>
</tbody>
</table>
</div>
</form>
</div>
<div class="card text-white bg-gradient-success mb-3">
<div class="card-header">
<span class=" text-success display-4" > Result </span>
</div>
<h4>
<?php
if(isset($_POST['Rainfall_Predict'])){
$region=trim($_POST['region']);
$month=trim($_POST['month']);
echo "Predicted Rainfall for the Region $region in the month $month is (in mm) : ";
$Jregion=json_encode($region);
$Jmonth=json_encode($month);
$command = escapeshellcmd("python ML/rainfall_prediction/rainfall_prediction.py $Jregion $Jmonth ");
$output = passthru($command);
echo $output;
}
?>
</h4>
</div>
</div>
</div>
</div>
</section>
<?php require("footer.php");?>
</body>
</html>