| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/projects/isvtgr/ |
Upload File : |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="60" />
<title>Untitled Document</title>
</head>
<style>
.table-data{
margin-left: auto;
margin-right: auto;
width: 1000px;
height: 450px;
overflow: scroll;
}
.center{
font-family: Verdana;
font-size: 14px;
}
</style>
<body style = "text-align: cneter; background-color: beige;"></body>
<body>
<?php
include "isvtg_header-sr.php";
$servername = "localhost";
$username = "rasintest";
$password = "testl0zink@";
$dbname = "isvtg";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn -> connect_error) {
die("Connection failed: " . $conn -> connect_error);
}
?>
<div class = "table-data">
<table class = "center">
<tr bgcolor="#008000" style="color:white" align="center">
<th>Serial number</th>
<th>Time</th>
<th>Weather station [ID]</th>
<th>Atmospheric pressure [mbar]</th>
<th>Temperature [ºC]</th>
<th>Relative humidity [%]</th>
<th>Wind speed [m/s]</th>
<th>Light level [lux]</th>
<th>Green Wind Potential [%]</th>
<th> Green Sun Potential [%]</th>
</tr>
<?php
$ams = array("Čačak", "VTG", "Beograd");
$id_ams = 0;
//$windmax = 25;
//$lightmax = 15000;
$sql = "SELECT * FROM meteovtg ORDER BY wind DESC";
/*$result = $conn -> query($sql);*/
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_array($result);
$windmax = $row['wind'];
$sql = "SELECT * FROM meteovtg ORDER BY sunl DESC";
/*$result = $conn -> query($sql);*/
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_array($result);
$lightmax = $row['sunl'];
// Output data of each row
$sql = "SELECT * FROM meteovtg ORDER BY id DESC";
/*$result = $conn -> query($sql);*/
$result = mysqli_query($conn, $sql);
while($node_name_row = $result -> fetch_assoc()) {
$id_number = $node_name_row['id'];
$time = $node_name_row['time'];
$idvtg = $node_name_row['ws'];
$pressure = $node_name_row['pres'];
$temperature = $node_name_row['temp'];
$rel_humidity = $node_name_row['humi'];
$windspeed = $node_name_row['wind'];
$light = $node_name_row['sunl'];
if ($row_color){
echo "<tr bgcolor=\"#9ad1f8\" align=\"center\">";
}
else {
echo "<tr bgcolor=\"#cee7f9\" align=\"center\">";
}
echo "<td>".$id_number."</td>";
echo "<td>".$time."</td>";
echo "<td>".$ams[$id_ams]."</td>";
echo "<td>".round($pressure,1)."</td>";
echo "<td>".round($temperature,1)."</td>";
echo "<td>".round($rel_humidity,0)."</td>";
echo "<td>".round($windspeed,1)."</td>";
echo "<td>".round($light,0)."</td>";
echo "<td>".round((100*$windspeed/$windmax),0)."</td>";
echo "<td>".round((100*$light/$lightmax),0)."</td>";
echo "</tr>";
$row_color = !$row_color;
}
echo "</table>";
echo "</div>";
$status=0;
// include 'closedbconn.php';
// include 'isvtg_foother-sr.php';
?>
<table>
<tr>
<td style = "width: 100px; text-align: center"><a href = "isvtg.php"><img src = "img/r_ret.png" width = "" height = "48"></a></td>
<td style = "width: 200px; font-size: 12px; text-align: justify; color: blue"><i>Povratak na početnu stranicu</i></td>
<td style = "width: 400px"></td>
<td style = "width: 100px; text-align: center"><a href = "isvtg_is.php"><img src = "img/r_hlp.png" width = "" height = "48"></a></td>
<td style = "width: 200px; font-size: 12px; text-align: justify; color: blue"><i>Ukratko o informacionom sistemu za praćenje rada pr>
</tr>
</table>
<?php include "foother.php"; ?>
</body>
</html>