| 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/Vetrogenerator.InfoSys/ |
Upload File : |
<!DOCTYPE html>
<!--
******************************
Project: VetroIng, 2023
Version: PHP 5-7
Author : M. Kukic
Note : v3.0
******************************
http://net-nas/www/vtg
-->
<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="20">
<title>Vetroing</title>
</head>
<body>
<div style="width:720px; word-wrap:break-word;">
<?php
//'[]
$loc = $_GET["loc"];
$loc2 = $_GET["loc2"];
if ($loc==""){
$loc=0;
}
if ($loc2==""){
$loc2=0;
}
//
include "config.php";
include "hed.php";
// Grad-Geo-Info
echo "<div align=center>";
echo "<div style=padding-bottom:5px;'>";
echo "<font face = 'Arial'; size = '6', color = 'blue'>";
echo "<b>IS Vetroinženjering VetroGenerator - ".$vtg[$loc]."</font><br>";
echo "Geo-Lok: ";
echo "<font face = 'Arial'; size = '5', color = '#48D1CC'>";
echo str_repeat(" ", 2);
echo $vtgnam[$loc]."</font>";
echo str_repeat(" ", 2);
//
echo "<font face = 'Arial'; size = '5', color = '#48D1CC'>";
echo " # ".$vtggs[$loc]." N - ".$vtggd[$loc]." E, NV ".$vtgnv[$loc]."m</font>";
echo str_repeat(" ", 3);
echo "<a href='http:ekarta.php?loc=".$loc."'><img src='img/geo-tag.png' width='' height='42'></a>";
//
echo "</div>";
echo "</div>";
echo "<hr>";
//
// NTP vreme
$vreme=getCurrentDate();
if ($vreme=="07/02/2036 - 07:28:16"){
$vreme=getCurrentDate();
}
if ($vreme==""){
date_default_timezone_set('Europe/Belgrade');
$vreme=date("d/m/Y - H:i:s");
}
$vreme=substr($vreme,0,18);
$lz=isDST();
if ($lz==0){
$dst=1;
}else{
$dst=2;
}
echo "<b>";
echo "<div style='width:720px; margin:0 auto;' align=center>";
echo "<font face = 'Arial black'; size = '6', color = '#3366ff'>";
//echo str_repeat(" ", 4);
echo $vreme."</font><br/>";
echo "</div>";
echo "</b>";
//
if ($mto==1){
echo "<div align=center>";
echo "<a href=http:help.php><img src='img/energija_m.jpg' width='320' height='160'></a>";
echo "</div>";
}
// LAST Tabela
echo "<div style=padding-bottom:5px;'>";
echo "<b>Poslednja merenja:</b>";
echo "</div>";
//
$sql = "SELECT * FROM engvtg WHERE vtgid='".$vtg[$loc]."' ORDER BY dattim DESC LIMIT 10";
if ($vap==5) {
$result = mysql_query($sql, $dbh) or die (mysql_error($dbh));
$row = mysql_fetch_array($result);
//echo "<font face = 'Arial'; size = '2', color = '#C71585'>";
echo "<table style='background-color:#F0FFFF; width:720px; margin:0 auto;'>";
echo tabhead();
//
aniz($row,0);
tabbodi($row);
$gc=$a;
$ac=$b;
$dc=$c;
//
$row = mysql_fetch_array($result); // pretposlednje
aniz($row,1);
//
$row = mysql_fetch_array($result); // pre predposlednjeg
aniz($row,2);
tabbodi($row);
//
$row = mysql_fetch_array($result); // pretposlednje
aniz($row,3);
//
$row = mysql_fetch_array($result); // pre predposlednjeg
tabbodi($row);
//
echo "</table>";
}else{
$result = mysqli_query($dbh, $sql) or die (mysqli_error($dbh));
$row = mysqli_fetch_array($result);
//echo "<font face = 'Arial'; size = '2', color = '#C71585'>";
echo "<table style='background-color:#F0FFFF; width:720px; margin:0 auto;'>";
echo tabhead();
//
aniz($row,0);
tabbodi($row);
$gc=$a;
$ac=$b;
$dc=$c;
//
$row = mysqli_fetch_array($result); // pretposlednje
aniz($row,1);
//
$row = mysqli_fetch_array($result); // pre predposlednjeg
aniz($row,2);
tabbodi($row);
//
$row = mysqli_fetch_array($result); // pretposlednje
aniz($row,3);
//
$row = mysqli_fetch_array($result); // pre predposlednjeg
tabbodi($row);
//
echo "</table>";
}
// Prosecne vrednosti za 1h PRINT
$ico=76;
echo "<div style=padding-bottom:5px;'>";
echo "<br><b>List-Graf:</b>";
echo "</div>";
echo "<div style='width:720px; margin:0 auto;'>";
echo "<div align=center>";
echo "<a href=elista.php?loc=".$loc."><img src='img/graf-l.png' width='".$ico."' height=''></a></a><img src='img/b_white-2.png'>";
//echo "<a href=karta.php?loc=".$loc."><img src='img/graf-srb.png' width='".$ico."' height=''></a></a><img src='img/b_white-2.png'>";
echo "<a href=egraf-gen.php?loc=".$loc."><img src='img/graf-t.png' width='".$ico."' height=''></a><img src='img/b_white-2.png'>";
echo "<a href=egraf-acv.php?loc=".$loc."><img src='img/graf-b.png' width='".$ico."' height=''></a><img src='img/b_white-2.png'>";
echo "<a href=egraf-dcv.php?loc=".$loc."><img src='img/graf-h.png' width='".$ico."' height=''></a><img src='img/b_white-2.png'>";
echo "<a href=egraf-dca.php?loc=".$loc."><img src='img/graf-s.png' width='".$ico."' height=''></a><img src='img/b_white-2.png'>";
echo "<br></div></div>";
//
// Naglaseno
echo "<hr style='width:70%;'>";
echo "<div style=padding-bottom:5px;'>";
echo "<b>Naglašeni podaci:</b>";
echo "</div>";
echo "<div style=padding-bottom:5px;'>";
echo "<div style='width:720px; margin:0 auto;' align=center>";
echo "<font face = 'Arial'; size = '6', color = '#FF4500'>";
echo "~ <b>".$gc."</b> o/min ~ <b>".$ac."</b> AC-V ~ <b>".$dc."</b> DC-A ~";
echo "</font></div>";
//echo "<hr style='width:70%;'>";
//
// Program END
//
// F U N K C I J E
//
// Elementi niza
function aniz($row,$i)
{
global $apm25,$apm10,$aco;
$apm25[$i]=$row['pm25'];
$apm10[$i]=$row['pm10'];
$aco[$i]=$row['co'];
return;
}
//
// NTP
function query_time_server ($timeserver, $socket)
{
$fp = fsockopen($timeserver,$socket,$err,$errstr,5);
# parameters: server, socket, error code, error text, timeout
if($fp)
{
fputs($fp, "\n");
$timevalue = fread($fp, 49);
fclose($fp); # close the connection
}
else
{
$timevalue = " ";
}
$ret = array();
$ret[] = $timevalue;
$ret[] = $err; # error code
$ret[] = $errstr; # error text
//echo "<br><br>Err: ".$err."/".$errstr."<br><br>";
return($ret);
}
//
function getCurrentDate($format = "d/m/Y - H:i:s"){
$timeserver = "ntp.pads.ufrj.br";
$timercvd = query_time_server($timeserver, 37);
//if no error from query_time_server
if(!$timercvd[1]) {
$timevalue = bin2hex($timercvd[0]);
$timevalue = abs(HexDec('7fffffff') - HexDec($timevalue) - HexDec('7fffffff'));
$tmestamp = $timevalue - 2208988800; # convert to UNIX epoch time stamp
return date($format, $tmestamp);
}
return null;
}
// Determine if DST is currently in effect
function isDST(){
$server_timezone = date_default_timezone_get();
date_default_timezone_set("Europe/Belgrade");
$is_dst = date('I');
date_default_timezone_set($server_timezone);
return $is_dst;
}
// Tabela heder
function tabhead()
{
echo "<tr>";
echo "<th>Vreme</th>";
echo "<th>Gen</th>";
echo "<th>ACV</th>";
echo "<th>DCV</th>";
echo "<th>DCA</th>";
echo "<th>GTmp</th>";
echo "</tr>";
return;
}
// Tabela bodi
function tabbodi($row)
{
echo "<tr>";
$dt=$row['dattim'];
$go=substr($dt,0,4);
$me=substr($dt,5,2);
$da=substr($dt,8,2);
$vr=substr($dt,11,5);
//echo "<td>".$da."/".$me."/".$go." - ".$vr."</td>";
echo "<td>".$da."/".$me." - ".$vr."</td>";
$pg=round($row['gen'],1);
$pa=round($row['acv'],1);
$pd=round($row['dcv'],1);
$pc=round($row['dca'],1);
$pm=round($row['gtmp'],1);
//
echo "<td>".$pg."</td>";
echo "<td>".$pa."</td>";
echo "<td>".$pd."</td>";
echo "<td>".$pc."</td>";
echo "<td>".$pm."</td>";
//
global $a, $b, $c;
$a=$pg;
$b=$pa;
$c=$pc;
//
echo "</tr>";
return;
}
if ($vap==5) {
mysql_close($dbh);
}else{
mysqli_close($dbh);
}
?>
<hr>
</div>
<img src="img/b_white-2.png">
<a href="javascript:history.go(-1)"><img src="img/r_ret.png" width="" height="48"></a>
<?php
if ($mto==1){
echo "<img src='img/b_white-2.png'>";
echo "<a href='http:misvtg.php?loc=".$loc2."&loc2=".$loc."'><img src='img/kap2.png' width='' height='48'></a>";
}
?>
<img src="img/b_white-2.png">
<a href="help.php"><img src="img/r_hlp.png" width="" height="48"></a>
</div>
<?php include "fut.php";?>
</body>
</html>