| 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/infoca/ |
Upload File : |
<!DOCTYPE html>
<!--
******************************
Project: InfoCA, 2021
Version: PHP 5-7
Author : M. Kukic
Note :
******************************
-->
<html>
<head>
<style>
table, th, td {
border: 1px solid gray;
border-collapse: collapse;
}
th, td {
padding: 4px;
text-align: center;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel='shortcut icon' type='image/png' href='favicon.png'/>
<meta http-equiv="refresh" content="60">
<title>InfoCA</title>
</head>
<body>
<div style="width:720px; word-wrap:break-word;">
<?php
//
include "config.php";
//
$plus = $_GET["plus"];
// GET metod prenosa
//$st = $_GET["st"];
$st=0;
$stanica=$ams[$st]; //CA0
//
include "hed.php";
//
echo "<b>Sadržaj PM čestica u funkciji Temp, Humi i Sun</b><br><br>";
include "graf-hdr.php";
echo "<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='682' height='440'>";
echo "<rect width='682' height='420' fill='rgb(253,248,243)' stroke-width='1' stroke='rgb(0,0,0)' />";
echo "<g stroke='gray'>";
$k=0;
for ($x = 12; $x < 682; $x=$x+12) {
$k++;
$x1=$x;
$x2=$x;
if ($k==2){
$y1=424;
$y2=406;
echo "<line x1=".$x1." y1=".$y1." x2=".$x2." y2=".$y2." />";
$k=0;
}else{
$y1=424;
$y2=414;
echo "<line x1=".$x1." y1=".$y1." x2=".$x2." y2=".$y2." />";
}
}
echo "</g>";
//
// PM
$dy=0;
$h=3.5;
$dty=-5;
$dtx=5;
$s=25;
$ds=420-($s-$dy)*$h;
echo"<g stroke='gray'>";
echo "<line x1='0' y1='".$ds."' x2='682' y2='".$ds."' />";
echo "</g>";
$ds=$ds+$dty;
echo "<text x='".$dtx."' y='".$ds."'>".$s."</text>";
// PM 2.5
echo"<g stroke='green'>";
echo "<line x1='415' y1='15' x2='440' y2='15' />";
echo "</g>";
echo "<text x='445' y='20'>PM2.5</text>";
// PM 10
echo"<g stroke='cyan'>";
echo "<line x1='500' y1='15' x2='525' y2='15' />";
echo "</g>";
echo "<text x='530' y='20'>PM10</text>";
//
// TEMP
echo"<g stroke='red'>";
echo "<line x1='415' y1='30' x2='440' y2='30' />";
echo "</g>";
echo "<text x='445' y='35'>Temp</text>";
// HUMI
echo"<g stroke='blue'>";
echo "<line x1='500' y1='30' x2='525' y2='30' />";
echo "</g>";
echo "<text x='530' y='35'>Humi</text>";
//
// SUN
echo"<g stroke='purple'>";
echo "<line x1='585' y1='30' x2='610' y2='30' />";
echo "</g>";
echo "<text x='615' y='35'>Sun</text>";
//
$k=0;
$row = mysqli_fetch_array($result);
$y1=420-($row['pm25']-$dy)*$h;
$z1=420-($row['pm10']-$dz)*$h;
for ($x = 0; $x < 682; $x=$x+$xst) {
$k++;
$row = mysqli_fetch_array($result);
$x1=$x;
$x2=$x+$xst;
$y2=420-($row['pm25']-$dy)*$h;
$z2=420-($row['pm10']-$dz)*$h;
if ($k<$numofrows)
{
if (($plus!=8)and($plus!=9)){
echo "<g stroke='green'>";
echo "<line x1=".$x1." y1=".$y1." x2=".$x2." y2=".$y2." />";
echo "</g>";
}
if (($plus==8)or($plus==9)){
echo "<g stroke='cyan'>";
echo "<line x1=".$x1." y1=".$z1." x2=".$x2." y2=".$z2." />";
echo "</g>";
}
}
$y1=$y2;
$z1=$z2;
}
echo "</g></g>";
//
// TEMP
if (($plus==1)or($plus==3)or($plus==5)or($plus==7)or($plus==9)){
//include "graf-hdr.php";
$sql = "SELECT * FROM datalog WHERE amsid='".$stanica."' ORDER BY dattim ASC";
$result = mysqli_query($dbh, $sql) or die (mysqli_error($dbh));
//
$dy=10;
$h=5;
$dty=-5;
$dtx=5;
$s=0;
$ds=210-($s-$dy)*$h;
echo"<g stroke='gray'>";
echo "<line x1='0' y1='".$ds."' x2='682' y2='".$ds."' />";
echo "</g>";
$ds=$ds+$dty;
echo "<text x='".$dtx."' y='".$ds."'>".$s."</text>";
//
echo "<g stroke='red'>";
$k=0;
$row = mysqli_fetch_array($result);
$y1=210-($row['temp']-$dy)*$h;
for ($x = 0; $x < 682; $x=$x+$xst) {
$k++;
$row = mysqli_fetch_array($result);
$x1=$x;
$x2=$x+$xst;
$y2=210-($row['temp']-$dy)*$h;
if ($k<$numofrows)
{
echo "<line x1=".$x1." y1=".$y1." x2=".$x2." y2=".$y2." />";
}
$y1=$y2;
}
echo "</g></g>";
}
//
// HUMI
if (($plus==2)or($plus==3)or($plus==6)or($plus==7)or($plus==9)){
//include "graf-hdr.php";
$sql = "SELECT * FROM datalog WHERE amsid='".$stanica."' ORDER BY dattim ASC";
$result = mysqli_query($dbh, $sql) or die (mysqli_error($dbh));
//
$dy=0;
$h=3.5;
$dty=-5;
$dtx=5;
$s=100;
$ds=420-($s-$dy)*$h;
echo"<g stroke='gray'>";
echo "<line x1='0' y1='".$ds."' x2='682' y2='".$ds."' />";
echo "</g>";
$ds=$ds+$dty;
echo "<text x='".$dtx."' y='".$ds."'>".$s."</text>";
//
echo "<g stroke='blue'>";
$k=0;
$row = mysqli_fetch_array($result);
$y1=420-($row['humi']-$dy)*$h;
for ($x = 0; $x < 682; $x=$x+$xst) {
$k++;
$row = mysqli_fetch_array($result);
$x1=$x;
$x2=$x+$xst;
$y2=420-($row['humi']-$dy)*$h;
if ($k<$numofrows)
{
echo "<line x1=".$x1." y1=".$y1." x2=".$x2." y2=".$y2." />";
}
$y1=$y2;
}
echo "</g></g>";
}
//
// SUNCE
if (($plus==4)or($plus==6)or($plus==5)or($plus==7)or($plus==9)){
//include "graf-hdr.php";
$sql = "SELECT * FROM datalog WHERE amsid='".$stanica."' ORDER BY dattim ASC";
$result = mysqli_query($dbh, $sql) or die (mysqli_error($dbh));
//
$dy=0;
$h=3.5;
$dty=-5;
$dtx=5;
$s=100;
$ds=420-($s-$dy)*$h;
echo"<g stroke='gray'>";
echo "<line x1='0' y1='".$ds."' x2='682' y2='".$ds."' />";
echo "</g>";
$ds=$ds+$dty;
echo "<text x='".$dtx."' y='".$ds."'>".$s."</text>";
//
echo "<g stroke='purple'>";
$k=0;
$row = mysqli_fetch_array($result);
$y1=420-($row['sun']-$dy)*$h;
for ($x = 0; $x < 682; $x=$x+$xst) {
$k++;
$row = mysqli_fetch_array($result);
$x1=$x;
$x2=$x+$xst;
$y2=420-($row['sun']-$dy)*$h;
if ($k<$numofrows)
{
echo "<line x1=".$x1." y1=".$y1." x2=".$x2." y2=".$y2." />";
}
$y1=$y2;
}
echo "</g></g>";
}
echo "</table>";
mysqli_close($dbh);
?>
<hr>
<img src="img/b_white-2.png">
<a href="javascript:history.go(-1)"><img src="img/r_ret.png" width="" height="48"></a><img src="img/b_white-3.png">
<a href="infoca.php"><img src="img/r_up.png" width="" height="48"></a><img src="img/b_white-2.png">
<a href="graf-f.php?plus=0"><img src="img/r_0.png" width="" height="48"></a><img src="img/b_white-3.png">
<a href="graf-f.php?plus=1"><img src="img/r_1.png" width="" height="48"></a><img src="img/b_white-3.png">
<a href="graf-f.php?plus=2"><img src="img/r_2.png" width="" height="48"></a><img src="img/b_white-3.png">
<a href="graf-f.php?plus=3"><img src="img/r_3.png" width="" height="48"></a><img src="img/b_white-3.png">
<a href="graf-f.php?plus=4"><img src="img/r_4.png" width="" height="48"></a><img src="img/b_white-3.png">
<a href="graf-f.php?plus=5"><img src="img/r_5.png" width="" height="48"></a><img src="img/b_white-3.png">
<a href="graf-f.php?plus=6"><img src="img/r_6.png" width="" height="48"></a><img src="img/b_white-3.png">
<a href="graf-f.php?plus=7"><img src="img/r_7.png" width="" height="48"></a><img src="img/b_white-3.png">
<a href="graf-f.php?plus=8"><img src="img/r_8.png" width="" height="48"></a><img src="img/b_white-3.png">
<a href="graf-f.php?plus=9"><img src="img/r_9.png" width="" height="48"></a>
</div>
<?php include "fut.php";?>
</body>
</html>