Files
kopalnia_2014/reports/rep_025_print.php
T
2026-09-03 11:24:19 +02:00

150 lines
4.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php session_start();?>
<?php
require_once'../func.php';
require_once'../dbaccess.php';
$con = mysql_connect($db_host, $db_user, $db_user_pass) or die ('cannot connect to db');
mysql_select_db($db_name);
mysql_query("SET NAMES utf8");
mysql_query("SET CHARACTER_SET utf8_general_ci");
function realTime($inParam_od,$inParam_do)
{
unset($outParam);
if (strlen($inParam_do)<8) $inParam_do=date('Y-m-d H:i:s');
$inParam = (strtotime($inParam_do) - strtotime($inParam_od));
$hour = floor($inParam/3600);
$min = $inParam - ($hour*3600);
$min = floor($min/60);
$sek = $inParam - ($hour*3600) - ($min*60);
if ($hour<10) $hour = "0".$hour;
if ($min<10) $min = "0".$min;
if ($sek<10) $sek = "0".$sek;
$outParam = $hour.":".$min.":".$sek;
return $outParam;
}
?>
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="../images/SoftSPM.ico">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Raport – zestawienie braku łączności/komunikacji</title>
<!-- Bootstrap -->
<link href="./bootstrap.min.css" rel="stylesheet">
<link href="./datepicker/css/datepicker.css" rel="stylesheet">
</head>
<body>
<div id="loader"></div>
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">Raport – zestawienie (wraz z historią) braku łączności/komunikacji z poszczególnymi studniami </i>NOTREALIABLE</i></h3>
</div>
<div class="panel-footer">
<a class="btn btn-default" href="#" role="button" onclick="window.print();">Drukuj &nbsp;&nbsp;<span class="glyphicon glyphicon-print" aria-hidden="true"></span></a>&nbsp;&nbsp;&nbsp;
</div>
</div>
<div>
<table class="table table-bordered" >
<thead>
<tr>
<th>Lp.</th>
<th>Studnia</th>
<th>Data rejestracji zdarzenia</th>
<th>Flaga rejestracji</th>
<th>Data zakończenia zdarzenia</th>
<th>Flaga zakończenia</th>
<th>Czas trwania [gg:mm:ss]</th>
</tr>
</thead>
<?php
if (empty($_GET['sh'])) $limit = ' limit 100';
else unset($limit);
unset($rep021Array);
$rep021Array = sqlGetResAsArray("select * from rep_soap_syndis_notrealiable_onoff,seg_dev_resources where DRS_ID=NOT_DRS_ID and NOT_END_DATE is null and DRS_DEPARTMENT='".$_SESSION['syndis_eq_stock']."' order by NOT_WELL_NAME, NOT_AUDIT_WHEN_DATE");
for ($i=0; $i<count($rep021Array); $i++)
{
echo'
<tr>
<td>'.($i+1).'</td>
<td>'.$rep021Array[$i]['NOT_WELL_NAME'].'</td>
<td>'.$rep021Array[$i]['NOT_AUDIT_WHEN_DATE'].'</td>
<td>'.$rep021Array[$i]['NOT_WHEN_FLAG'].'</td>
<td>'.$rep021Array[$i]['NOT_AUDIT_END_DATE'].'</td>
<td>'.$rep021Array[$i]['NOT_END_FLAG'].'</td>
<td>'.realTime($rep021Array[$i]['NOT_AUDIT_WHEN_DATE'],$rep021Array[$i]['NOT_AUDIT_END_DATE']).'</td>
<tr>
';
}
echo'<tr><td clospan="7"><br/><br/><b>Historia z przywróconą transmisją</b></td></tr>';
unset($rep021Array);
$rep021Array = sqlGetResAsArray("select * from rep_soap_syndis_notrealiable_onoff,seg_dev_resources where DRS_ID=NOT_DRS_ID and NOT_END_DATE is not null and DRS_DEPARTMENT='".$_SESSION['syndis_eq_stock']."' order by NOT_WELL_NAME, NOT_AUDIT_WHEN_DATE desc ".$limit);
for ($i=0; $i<count($rep021Array); $i++)
{
echo'
<tr>
<td>'.($i+1).'</td>
<td>'.$rep021Array[$i]['NOT_WELL_NAME'].'</td>
<td>'.$rep021Array[$i]['NOT_AUDIT_WHEN_DATE'].'</td>
<td>'.$rep021Array[$i]['NOT_WHEN_FLAG'].'</td>
<td>'.$rep021Array[$i]['NOT_AUDIT_END_DATE'].'</td>
<td>'.$rep021Array[$i]['NOT_END_FLAG'].'</td>
<td>'.realTime($rep021Array[$i]['NOT_AUDIT_WHEN_DATE'],$rep021Array[$i]['NOT_AUDIT_END_DATE']).'</td>
<tr>
';
}
?>
</table>
</div>
<div>
<a href="./rep_025_print.php?sh=all" class="btn btn-primary" role="button">Pokaż całą historię</a>
</div>
<br/><br/>
</body>
</html>
<?php
mysql_close($con);
?>