Home Files
Adminer
Execute Command
PHP Eval
Symlink
File Upload
Owner :
www-data
PHP Version
5.6.40-0+deb8u12
Disk Space
40.84 GB
Server Addr
19-www4
Your IP
10.10.10.40
Edit File
File:
<?php require_once("admin/conexao/conecta.php"); require("admin/functions/limita-texto.php"); // DEFINE O FUSO HORARIO COMO O HORARIO DE CUIABA date_default_timezone_set('America/Cuiaba'); //FUNÇÃO PONTO DE ORVALHO function dewPoint($celsius, $humidity) { // (1) Saturation Vapor Pressure = ESGG(T) $RATIO = 373.15 / (273.15 + $celsius); $RHS = -7.90298 * ($RATIO - 1); $RHS += 5.02808 * log10($RATIO); $RHS += -1.3816e-7 * (pow(10, (11.344 * (1 - 1 / $RATIO ))) - 1) ; $RHS += 8.1328e-3 * (pow(10, (-3.49149 * ($RATIO - 1))) - 1) ; $RHS += log10(1013.246); // factor -3 is to adjust units - Vapor Pressure SVP * humidity $VP = pow(10, $RHS - 3) * $humidity; // (2) DEWPOINT = F(Vapor Pressure) $T = log($VP / 0.61078); // temp var return (241.88 * $T) / (17.558 - $T); } //função avaliar aplicação de defensivos agrícolas function pulverizar($temp, $umid, $ventokm){ if(($temp <= 30)&&($umid >=50)&&($ventokm >=3)&&($ventokm <=10)){ return $pulverizar = "SIM"; }else{ return $pulverizar = "NÃO"; } } ?> <!DOCTYPE html> <html lang="pt-br"> <link rel="icon" href="img/icone.ico"" type="image/x-icon" /> <?php $sql = "SELECT * from tb_site "; try { $resultado = $conexao->prepare($sql); $resultado->execute(); $contar = $resultado->rowCount(); if ($contar > 0) { while ($exibe = $resultado->fetch(PDO::FETCH_OBJ)) { ?> <link rel="shortcut icon" href="img/<?php echo $exibe->logo; ?>" type="image/x-icon" /> <?php }//while } else { echo '<li>Não existe post cadastrados no sistema</li>'; } } catch (PDOException $erro) { echo $erro; } ?> <header> <title>Dados Atuais da Estação Meteorológica com Arduino - GeoClimaMT</title> <script type="text/javascript" src="js/bioep.js"></script> <script type="text/javascript"> bioEp.init({ html: '<div id="bio_ep_content">' + '<img src="http://pesquisa.unemat.br/geoclimamt/img/76203158.png" style="width:100px;height:70px" alt="Precisamos conhecer você" />' + '<span>Pesquisa</span>' + '<span>Precisamos saber o perfil do usuário que acessa essa página</span>' + '<span>Preencha os seguintes campos:</span>' + '<form class="form-horizontal" action="" method="post" enctype="multipart/form-data">'+ '<label class="control-label" for="nome">Seu Nome: </label>'+ '<input type="text" name="nome" class="col-lg-6" required>'+ '<br><label class="control-label" for="email">Seu E-mail: </label>'+ '<input type="text" name="email" class="col-lg-6" required>'+ '<br><label class="control-label" for="perfil">Perfil:</label>'+ '<select class="span2" i name="perfil">'+ '<option>Agricultor(a)</option>'+ '<option>Estudante</option>'+ '<option>Professor(a)</option>'+ '<option>Outro</option>'+ '</select>'+ '<div class="form-actions" align="center">'+ '<br>'+ '<input type="submit" name="boletins" class="btn btn-primary" value="Enviar">'+ '</div>'+ '</form>'+ '</div>', css: '#bio_ep {width: 500px; height: 400px; color: #333; background-color: #fafafa; text-align: center;}' + '#bio_ep_content {padding: 24px 0 0 0; font-family: "Titillium Web";}' + '#bio_ep_content span:nth-child(2) {display: block; color: #f21b1b; font-size: 32px; font-weight: 600;}' + '#bio_ep_content span:nth-child(3) {display: block; font-size: 16px;}' + '#bio_ep_content span:nth-child(4) {display: block; margin: -5px 0 0 0; font-size: 16px; font-weight: 600;}' + '.bio_btn {display: inline-block; margin: 18px 0 0 0; padding: 7px; color: #fff; font-size: 14px; font-weight: 600; background-color: #70bb39; border: 1px solid #47ad0b; cursor: pointer; -webkit-appearance: none; -moz-appearance: none; border-radius: 0; text-decoration: none;}', fonts: ['//fonts.googleapis.com/css?family=Titillium+Web:300,400,600'], cookieExp: 0 }); </script> <?php include("includes/head.php");?> </header> <body id="page-top" style="background-color: #d8d6ff;"> <?php include("includes/menus_pages.php");?> <!-- Page Content --> <div class="container"> <div class="row"> <div class="col-lg-3"> <br><br><br><br><br><br><h2 class="my-4">Estação Meteorológica com Arduino</h2> <?php include("includes/menus_estacaobc.php");?> <br> <!-- <a href="http://pesquisa.unemat.br/geoclimamt/baixar.php?arquivo=upload/TempoTga.apk">Baixar App<a>--> </div> <!-- /.col-lg-3 --> <div class="col-lg-9"> <br><br><br><br><br><br><br> <?php //INICIO gravar pesquisa require_once("admin/conexao/conecta.php"); if(isset($_POST['boletins'])){ $nome = trim(strip_tags($_POST['nome'])); $email = trim(strip_tags($_POST['email'])); $perfil = trim(strip_tags($_POST['perfil'])); $pagina = "Estação Meteorológica"; $data = date('Y-m-d'); $hora = date('H:i:s'); $insert = "INSERT into tb_acesso (nome, email, perfil, pagina, data, hora) VALUES (:nome, :email, :perfil, :pagina, :data, :hora)"; try{ $result = $conexao->prepare($insert); $result->bindParam(':nome', $nome, PDO::PARAM_STR); $result->bindParam(':email', $email, PDO::PARAM_STR); $result->bindParam(':perfil', $perfil, PDO::PARAM_STR); $result->bindParam(':pagina', $pagina, PDO::PARAM_STR); $result->bindParam(':data', $data, PDO::PARAM_STR); $result->bindParam(':hora', $hora, PDO::PARAM_STR); $result->execute(); $contar = $result->rowCount(); if($contar>0){ echo '<div class="alert alert-success"> <button type="button" class="close" data-dismiss="alert">×</button> <strong>Sucesso!</strong> Obrigado por participar da pesquisa. </div>'; }else{ echo '<div class="alert alert-danger"> <button type="button" class="close" data-dismiss="alert">×</button> <strong>Erro ao enviar!</strong> tente novamente, por favor. </div>'; } }catch(PDOException $e){ echo $e; } } //FIM gravar pesquisa ?> <!-- Portfolio Item Row --> <div class="row"> <div class="col-lg-12" align="center"> <h1 class="my-4">Dados Atuais</h1> </div> <?php $quantidade = 1; $inicio = 0; $sql = "SELECT * from tb_estacao ORDER BY id DESC LIMIT $inicio, $quantidade"; try { $resultado = $conexao->prepare($sql); $resultado->execute(); $contar = $resultado->rowCount(); if ($contar > 0) { while ($exibe = $resultado->fetch(PDO::FETCH_OBJ)) { ?> <!-- ÚLTIMA LEITURA--> <div class="col-md-12" align="center"> <h4>Última leitura:</h4> <h4 class="service-heading" style="color: red"><?php echo " ".date("d-m-Y", strtotime($exibe->data))." - ".$exibe->hora; ?></h4> </div> <div class="col-md-12" align="center"> <br> </div> <!-- TEMPERATURA --> <div class="col-md-4" align="center"> <h4 class="service-heading">Temperatura</h4> <h4 class="text-muted"><?php echo $exibe->temp." ºC"; ?></h4> </div> <div class="col-md-4" align="center"> <?php if($exibe->temp >= 40) {?> <img src="img/temp_alta.png" style="width:150px;height:150px;"> <?php } else if($exibe->temp <= 20) { ?> <img src="img/temp_baixa.png" style="width:150px;height:150px;"> <?php } else { ?> <img src="img/temp_normal.png" style="width:150px;height:150px;"> <?php } ?> <br><br> </div> <!-- UMIDADE --> <div class="col-md-4" align="center"> <h4 class="service-heading">Umidade</h4> <h4 class="text-muted"><?php echo $exibe->umid." %"; ?></h4> <br><br> </div> <!-- VELOCIDADE DO VENTO EM KILOMETROS POR HORA--> <div class="col-md-4" align="center"> <h4 class="service-heading">Vento</h4> <h4 class="text-muted"><?php echo $exibe->ventokm." km/h"; ?></h4> </div> <!--<div class="col-md-4" align="center"> <img src="img/vento.gif" style="width:150px;height:150px;"> </div>--> <!-- DIREÇÃO DO VENTO--> <div class="col-md-4" align="center"> <?php if (($exibe->ventodir >= 0)&&($exibe->ventodir < 45)){ ?> <img src="img/norte.jpg" class="tilt mx-auto rounded-circle" style="width:150px;height:150px;"> <?php }if (($exibe->ventodir >= 45)&&($exibe->ventodir < 90)){ ?> <img src="img/nordeste.jpg" class="tilt mx-auto rounded-circle" style="width:150px;height:150px;"> <?php }if (($exibe->ventodir >= 90)&&($exibe->ventodir < 135)){ ?> <img src="img/leste.jpg" class="tilt mx-auto rounded-circle" style="width:150px;height:150px;"> <?php }if (($exibe->ventodir >= 135)&&($exibe->ventodir < 180)){ ?> <img src="img/sudeste.jpg" class="tilt mx-auto rounded-circle" style="width:150px;height:150px;"> <?php }if (($exibe->ventodir >= 180)&&($exibe->ventodir < 235)){ ?> <img src="img/sul.jpg" class="tilt mx-auto rounded-circle" style="width:150px;height:150px;"> <?php }if (($exibe->ventodir >= 235)&&($exibe->ventodir < 270)){ ?> <img src="img/sudoeste.jpg" class="tilt mx-auto rounded-circle" style="width:150px;height:150px;"> <?php }if (($exibe->ventodir >= 270)&&($exibe->ventodir < 315)){ ?> <img src="img/oeste.jpg" class="tilt mx-auto rounded-circle" style="width:150px;height:150px;"> <?php }if ($exibe->ventodir >= 315){ ?> <img src="img/noroeste.jpg" class="tilt mx-auto rounded-circle" style="width:150px;height:150px;"> <?php } ?> <br><br> </div> <!-- VELOCIDADE DO VENTO EM METROS POR SEGUNDO--> <div class="col-md-4" align="center"> <h4 class="service-heading">Vento</h4> <h4 class="text-muted"><?php echo $exibe->ventoms." m/s"; ?></h4> <br><br> </div> <!-- PONTO DE ORVALHO --> <div class="col-md-4" align="center"> <h4 class="service-heading">Ponto de Orvalho</h4> <h4 class="text-muted"><?php echo number_format(dewPoint($exibe->temp,$exibe->umid), 2, '.', ',')." ºC"; ?></h4> </div> <div class="col-md-4" align="center"> <img src="img/pontodeorvalho.jpg" class="tilt mx-auto rounded-circle" style="width:150px;height:150px;"> <br><br> </div> <!-- PULVERIZAR --> <div class="col-md-4" align="center"> <h4 class="service-heading">Pulverizar</h4> <h4 class="text-muted"><?php echo pulverizar($exibe->temp, $exibe->umid, $exibe->ventokm); ?></h4> </div> <!-- PRESSAO ATMOSFÉRICA --> <div class="col-md-4" align="center"> <h4 class="service-heading">Pressão</h4> <h4 class="text-muted"><?php echo $exibe->pressao." hPa"; ?></h4> </div> <div class="col-md-4" align="center"> <img src="img/pressao.png" class="tilt mx-auto" style="width:150px;height:150px;"> <br><br> </div> <!-- ALTITUDE --> <div class="col-md-4" align="center"> <h4 class="service-heading">Altitude</h4> <h4 class="text-muted"><?php echo $exibe->altitude." m"; ?></h4> </div> <!-- ÍNDICE UV--> <div class="col-md-3" align="center"> <h4 class="service-heading">Índice UV</h4> <h4 class="text-muted"><?php echo $exibe->uvindex; ?></h4> </div> <div class="col-md-9" align="center"> <?php if($exibe->uvindex <= 2) {?> <img src="img/Tabela_UV_1.jpg" style="width:350px;"> <?php } else if(($exibe->uvindex >=3) and ($exibe->uvindex <=5)) { ?> <img src="img/Tabela_UV_2.jpg" style="width:350px;"> <?php } else if(($exibe->uvindex >=6) and ($exibe->uvindex <=7)) { ?> <img src="img/Tabela_UV_3.jpg" style="width:350px;"> <?php } else if(($exibe->uvindex >=8) and ($exibe->uvindex <=10)) { ?> <img src="img/Tabela_UV_4.jpg" style="width:350px;"> <?php } else if($exibe->uvindex >=11) { ?> <img src="img/Tabela_UV_5.jpg" style="width:350px;"> <?php } ?> </div> <div class="col-md-12" align="center"> <br><br> </div> <!-- CHUVA--> <div class="col-md-4" align="center"> <h4 class="service-heading">Choveu no dia</h4> <h4 class="text-muted"><?php echo $exibe->chuva." mm"; ?></h4> </div> <div class="col-md-4" align="center"> <?php if($exibe->chuva == 0) {?> <img src="img/chuva_vazio.png" style="width:150px;height:150px;"> <?php } else { ?> <img src="img/chuva.png" style="width:150px;height:150px;"> <?php } ?> </div> <div class="col-md-4" align="center"></div> <div class="col-md-12" align="center"> <br> </div> <?php }//while } else { echo '<li>Não existe ensino do tipo Graduação cadastrada no sistema ainda!</li>'; } } catch (PDOException $erro) { echo $erro; } ?> </div> <!-- /.row --> </div> <!-- /.col-lg-9 --> </div> <!-- /.row --> </div> <!-- /.container --> <!-- Footer --> <footer> <?php include("includes/footer.php");?> </footer> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Plugin JavaScript --> <script src="vendor/jquery-easing/jquery.easing.min.js"></script> <!-- Contact form JavaScript --> <script src="js/jqBootstrapValidation.js"></script> <script src="js/contact_me.js"></script> <!-- Custom scripts for this template --> <script src="js/agency.min.js"></script> </body> </html>