%PDF- %PDF-
Direktori : /proc/self/root/var/www/spotreba/ |
Current File : //proc/self/root/var/www/spotreba/receive.php |
<?php if(isset($_GET['sent'])) { include "db.php"; if(isset($_POST['water']) && $_POST['water'] > 0.1) { $vals = array('amount' => $_POST['water'], 'timestamp' => new DateTime()); dibi::query("insert into [water]", $vals); } if(isset($_POST['gas']) && $_POST['gas'] > 0.1) { $vals = array('amount' => $_POST['gas'], 'timestamp' => new DateTime()); dibi::query("insert into [gas]", $vals); } if(isset($_POST['furnace']) && $_POST['furnace'] > 0.1) { $vals = array('amount' => $_POST['furnace'], 'timestamp' => new DateTime()); dibi::query("insert into [furnace]", $vals); } if(isset($_POST['pc']) && $_POST['pc'] > 0.1) { $vals = array('amount' => $_POST['pc'], 'timestamp' => new DateTime()); dibi::query("insert into [pc]", $vals); } if(isset($_POST['electricity_low']) && $_POST['electricity_low'] > 0.1) { $vals = array('amountlow' => $_POST['electricity_low'], 'amounthigh' => $_POST['electricity_high'], 'timestamp' => new DateTime()); dibi::query("insert into [electricity]", $vals); } header("Location: index.php"); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="../../favicon.ico"> <title>Spotřeba</title> <!-- Bootstrap core CSS --> <link href="./css/bootstrap.min.css" rel="stylesheet"> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <script type="application/javascript"> /*! * IE10 viewport hack for Surface/desktop Windows 8 bug * Copyright 2014 Twitter, Inc. * Licensed under the Creative Commons Attribution 3.0 Unported License. For * details, see http://creativecommons.org/licenses/by/3.0/. */ // See the Getting Started docs for more information: // http://getbootstrap.com/getting-started/#support-ie10-width (function () { 'use strict'; if (navigator.userAgent.match(/IEMobile\/10\.0/)) { var msViewportStyle = document.createElement('style') msViewportStyle.appendChild( document.createTextNode( '@-ms-viewport{width:auto!important}' ) ) document.querySelector('head').appendChild(msViewportStyle) } })(); </script> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body style="padding-top: 70px;"> <!-- Fixed navbar --> <div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <span class="navbar-brand" href="#">Spotřeba</span> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li><a href="index.php?action=water">Voda</a></li> <li><a href="index.php?action=gas">Plyn</a></li> <li><a href="index.php?action=electricity">Elektřina</a></li> <li><a href="index.php?action=furnace">Elektřina kotel</a></li> <li><a href="index.php?action=pc">Elektřina PC</a></li> <li><a href="receive.php">Přidat nový záznam</a></li> </ul> </div><!--/.nav-collapse --> </div> </div> <div class="container"> <!-- Main component for a primary marketing message or call to action --> <div class="jumbotron"> <form action="receive.php?sent=true" method="post"> <table style="max-width: 600px; margin-left: auto; margin-right: auto; border: 0 0 0 0"> <tr> <td style="padding-right: 10px;"><label for="water">Voda</label></td> <td><input type="number" step="0.001" min="0" max="100000000" id="water" name="water"></td> </tr> <tr> <td style="padding-right: 10px;"><label for="gas">Plyn</label></td> <td><input type="number" step="0.001" min="0" max="100000000" id="gas" name="gas"></td> </tr> <tr> <td style="padding-right: 10px;"><label for="electricity_low">Elektrina N</label></td> <td><input type="number" step="0.001" min="0" max="100000000" id="electricity_low" name="electricity_low"></td> </tr> <tr> <td style="padding-right: 10px;"><label for="electricity_high">Elektrina D</label></td> <td><input type="number" step="0.001" min="0" max="100000000" id="electricity_high" name="electricity_high"></td> </tr> <tr> <td style="padding-right: 10px;"><label for="furnace">Kotel</label></td> <td><input type="number" step="0.001" min="0" max="100000000" id="furnace" name="furnace"></td> </tr> <tr> <td style="padding-right: 10px;"><label for="pc">PC</label></td> <td><input type="number" step="0.001" min="0" max="100000000" id="pc" name="pc"></td> </tr> <tr> <td></td> <td><input type="submit" value="Odeslat" name="submit" class="btn btn-info" style="margin-top: 5px;"></td> </tr> </table> </form> </div> </div> <!-- /container --> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../dist/js/bootstrap.min.js"></script> </body> </html>