0byt3m1n1
Path:
C:
/
Users
/
Administrator
/
Documents
/
[
Home
]
File: result.txt
<?php include("config.php"); /*$p1l = $_POST['p1l']; $p1w = $_POST['p1w']; $p2l = $_POST['p2l']; $p2w = $_POST['p2w']; $rooftype = $_POST['rooftype'];*/ $length = $_POST['fname']; $width = $_POST['lname']; $district = $_POST['state']; $block = $_POST['district']; $persons = $_POST['pno']; $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 "Something 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 "Something went wrong please check"; // failure! check for errors and do something else } /* if ($rooftype == 's') { $rt = 'Sloped / Pitched Roof'; $ph1area = $p1l*$p1w*2; $ph2area = $p2l*$p2w; $area = $ph1area + $ph2area ; } else {*/ $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; $re=$result*0.8; $sw=$re*0.8; $ne=$re*0.1; $dd=29160*$persons; $total=$sw+$ne+$ne; $percent= ($total/$dd)*100; $per=round($percent, 2); ?> <!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"> </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"> Location <!--<span>*</span>--></label> <input id="fname" type="text" name="fname" value='<?php echo $block ;?> '> </div> <div class="item" > <label for="fname"> No of persons in the household <!--<span>*</span>--></label> <input id="fname" type="text" name="fname" value='<?php echo $persons ;?> '> </div> <div class="item" > <label for="fname"> Projected area of the Roof <!--<span>*</span>--></label> <input id="fname" type="text" name="fname" value='<?php echo $area ;?> meter square'> </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> <table> Annual water harvesting potential of the roof top catchment during :- <tbody> <tr> <td style="padding-left: 10%;">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: 20%;">Total(Annual) </td> <td >: <?php echo $total?> Litre</td> </tr> <tr> <td style="white-space: pre-line;">Required storage capacity of the rain water harvesting tank for meeting your domestic demand </td> <td >: <?php echo $dd;?> Litre</td> </tr> </tbody> </table> </br> </div> <?php if($total<$dd) { ?> <style type="text/css">#alert-block{ display:contents; color: yellow; }</style> <?php } else { ?> <style type="text/css">#alert-block{ display:none; } </style> <?php } ?> <div class="msg-block"> <div class="alert-block" id="alert-block" > The existing area of roof top catchment is insufficient to generate the runoff volume for meeting your domestic demand. Hence increase the area of roof top for collecting more rainfall so as to meet your demand. Here about <?php echo $per?>% of your domestic demand could be met by constructing a tank of capacity <?php echo $total?> litre. </div> In-order to reduce the evaporation loss, the tank should built with less suface area and having more depth. This water should be purified if it is used for drinking purpose. </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>