0byt3m1n1
Path:
C:
/
Users
/
Administrator
/
Desktop
/
shafna
/
rainfall- 2phase
/
[
Home
]
File: result.php
<?php include("config.php"); $p1l = $_POST['p1l']; $p1w = $_POST['p1w']; $p2l = $_POST['p2l']; $p2w = $_POST['p2w']; $length = $_POST['fname']; $width = $_POST['lname']; $district = $_POST['state']; $block = $_POST['district']; $last_id=$con->insert_id; $sql = "SELECT DistCode FROM district WHERE DistrictName = '$block'"; $result = mysqli_query($con, $sql ); if( $result ) { while( $row = mysqli_fetch_assoc( $result ) ) { $id=$row['DistCode']; } //echo $id; } else{ echo "Somethimg went wrong please check"; // failure! check for errors and do something else } $rainsql = "SELECT AvgRain FROM rainfalldata WHERE DistCode = '$id'"; $rainresult = mysqli_query($con, $rainsql ); if( $rainresult ) { while( $row = mysqli_fetch_assoc( $rainresult ) ) { $rainAvg=$row['AvgRain']; } } else{ echo "Somethimg went wrong please check"; // failure! check for errors and do something else } $rooftype = $_POST['rooftype']; if ($rooftype == 's') { $rt = 'Sloped / Pitched Roof'; $ph1area = $p1l*$p1w*2; $ph2area = $p2l*$p2w; $area = $ph1area + $ph2area ; } else { $rt = 'Flat Roof'; $area = $length * $width ; } $roof=$_POST['type']; //echo $roof; if ($roof == 'Fibre sheet') { $rc= 0.9; } elseif($roof == 'Tile') { $rc= 0.8; } elseif($roof == 'Asbestos') { $rc= 0.8; } elseif($roof == 'Concrete') { $rc= 0.7; } else { $rc= 0.2; } //echo $rc; $rain= $rainAvg/1000; $result = $rc*$area*$rain*1000; $sw=$result*0.8; $ne=$result*0.1; ?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> <title>Rainfall Calculator</title> <meta name="generator" content="Bootply" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous"> <link rel="stylesheet" href="resultstyle.css"> <script> </script> </head> <body style="background-color: #c2d1f0;"> <div class="col-sm-8"> <div class="row"> <div class="col-xs-12"> <!--<form name="insert" action="" method="post">--> <form action="result.php" method="POST"> <div class="banner"> <h1>ROOF TOP RUN-OFF VOLUME CALCULATOR </h1> </div> <div class="colums"> <!--<div class="item"> <label for="fname"> Length of roof top </label> <input id="fname" type="text" name="fname" value='<?php echo $length;?> meter'> </div> <div class="item"> <label for="fname"> Width of roof top </label> <input id="fname" type="text" name="fname" value='<?php echo $width;?> meter'> </div> --> <div class="item" > <label for="fname"> Area of the Roof <!--<span>*</span>--></label> <input id="fname" type="text" name="fname" value='<?php echo $area ;?> meter square'> </div> <div class="item" > <label for="fname"> Roof type <!--<span>*</span>--></label> <input id="fname" type="text" name="fname" value='<?php echo $rt ;?> '> </div> <div class="item"> <!--style="margin-left:25%"--> <label for="fname"> Roof Material <!--<span>*</span>--></label> <input id="fname" type="text" name="fname" value='<?php echo $roof;?> '> </div> <div class="item" > <label for="fname"> Location <!--<span>*</span>--></label> <input id="fname" type="text" name="fname" value='<?php echo $block ;?> '> </div> <table> <th>Available Rainwater for Harvesting during :-</th> <tbody> <tr> <td style="padding-left: 10%; padding: right 0;">South West Monsoon (June - Sept)</td> <td >: <?php echo $sw?> Litre </td> </tr> <tr> <td style="padding-left: 10%;"> North East Monsoon (Oct - Nov)</td> <td>: <?php echo $ne?> Litre </td> </tr> <tr> <td style="padding-left: 10%;"> Winter and Summer (Dec - May)</td> <td>: <?php echo $ne?> Litre </td> </tr> <tr> <td style="padding-left: 35%;">Total(Annual) </td> <td>: <?php echo $result?> Litre</td> </tr> </tbody> </table> </div> <div class="btn-block"> <button type="button" name="logout" id="logout" onclick="window.location.href ='index.php'">close</button> </div> </form> </div> </div> </div> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>