219 lines
8.4 KiB
PHP
219 lines
8.4 KiB
PHP
<?php
|
|
if (!empty($_SESSION['site404']))
|
|
{
|
|
?>
|
|
<script>
|
|
$(function() {$("#data_01").datepicker({changeMonth: true,changeYear: true});});
|
|
$(function() {$("#data_02").datepicker({changeMonth: true,changeYear: true});});
|
|
</script>
|
|
|
|
<?php
|
|
//paginacja
|
|
if (!$_GET['pgn']) {$_GET['pgn']=1; delSearchSessionData(); }
|
|
?>
|
|
|
|
|
|
|
|
<?php
|
|
if (!$_POST['inDateFrom'] && empty($_SESSION['inDateFrom'])) $_POST['inDateFrom']=date('Y-m')."-01";
|
|
if (!$_POST['inDateTo'] && empty($_SESSION['inDateTo'])) $_POST['inDateTo']=date('Y-m-d');
|
|
|
|
if (!empty($_POST['inDateFrom'])) $_SESSION['inDateFrom']=$_POST['inDateFrom'];
|
|
if (!empty($_POST['inDateTo'])) $_SESSION['inDateTo']=$_POST['inDateTo'];
|
|
|
|
|
|
//ładuje preloader
|
|
if (empty($_SESSION['site404chart_array']) || $_POST['sub_search']=='Pokaż')
|
|
echo"<div id='loader-wrapper'><div id='loader'></div></div>";
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="tag100">
|
|
<div class="head_tag"><?php echo $lab_Field_site404_002; ?></div>
|
|
<div class="tag_center">
|
|
|
|
<form method="post" action="?pg=site404chart&pgn=1&dev=<?php echo $_GET['dev'];?>"><br/>
|
|
<table>
|
|
<tr>
|
|
<td>Wyświetle pomiary za okres od:</td>
|
|
<td style='width: 5px;'></td>
|
|
<td><INPUT STYLE='text-align: right' TYPE='TEXT' id='data_01' NAME='inDateFrom' value='<?php echo $_SESSION['inDateFrom'];?>' SIZE='10'></td>
|
|
<td style='width: 15px;'></td>
|
|
<td>do:</td>
|
|
<td style='width: 5px;'></td>
|
|
<td><INPUT STYLE='text-align: right' TYPE='TEXT' id='data_02' NAME='inDateTo' value='<?php echo $_SESSION['inDateTo'];?>' SIZE='10'></td>
|
|
<td style='width: 20px;'></td>
|
|
<td><input type='submit' name='sub_search' value='Pokaż' class='btn btn-default btn-sm' onclick="makeRequest('?pg=site402chart');"></td>
|
|
</tr>
|
|
</table>
|
|
</form><br/>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
include("./pChart/pData.class.php");
|
|
include("./pChart/pDraw.class.php");
|
|
include("./pChart/pImage.class.php");
|
|
include("./pChart/pScatter.class.php");
|
|
|
|
|
|
$fileName="./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."site402chart_01.png";
|
|
|
|
if (empty($_SESSION['site404chart_array']) || $_POST['sub_search']=='Pokaż')
|
|
{
|
|
$x=null; $y=null; $res=null;
|
|
|
|
if ($_POST['sub_search']=='Pokaż')
|
|
$wynik = mysql_query("select DRD_VALUE,DRD_AUDIT_DATE from (select DRD_VALUE,DRD_AUDIT_DATE from seg_dev_resources_det where DRD_RESOURCES_DETAIL=210 and DRD_DRS_ID=".$_GET['dev']." and DRD_AUDIT_DATE>='".$_SESSION['inDateFrom']." 00:00:00' and DRD_AUDIT_DATE<='".$_SESSION['inDateTo']." 23:59:59' union select DRD_VALUE,DRD_AUDIT_DATE from seg_dev_resources_det_his where DRD_RESOURCES_DETAIL=210 and DRD_DRS_ID=".$_GET['dev']." and DRD_AUDIT_DATE>='".$_SESSION['inDateFrom']." 00:00:00' and DRD_AUDIT_DATE<='".$_SESSION['inDateTo']." 23:59:59') tb order by DRD_AUDIT_DATE");
|
|
else
|
|
$wynik = mysql_query("select DRD_VALUE,DRD_AUDIT_DATE from viw_dev_resources_det where DRD_RESOURCES_DETAIL=210 and DRD_DRS_ID=".$_GET['dev']." and DRD_AUDIT_DATE>='".$_SESSION['inDateFrom']." 00:00:00' and DRD_AUDIT_DATE<='".$_SESSION['inDateTo']." 23:59:59' order by DRD_AUDIT_DATE");
|
|
|
|
|
|
if($wynik)while ($r = mysql_fetch_array($wynik))
|
|
{
|
|
$res[]=array(
|
|
'water_value' => $r["DRD_VALUE"],
|
|
'water_time' => $r["TM"],
|
|
'water_audit' => $r["DRD_AUDIT_DATE"],
|
|
'water_x' =>''
|
|
);
|
|
$x[] = '';
|
|
$y[] = -($r["DRD_VALUE"]);
|
|
}
|
|
unset($_SESSION['site404chart_array']);
|
|
unset($_SESSION['site402chart_x']);
|
|
unset($_SESSION['site402chart_y']);
|
|
|
|
$_SESSION['site404chart_array']=$res;
|
|
$_SESSION['site402chart_x']=$x;
|
|
$_SESSION['site402chart_y']=$y;
|
|
}
|
|
|
|
|
|
|
|
/* Create and populate the pData object */
|
|
$MyData = new pData();
|
|
|
|
$MyData->addPoints($_SESSION['site402chart_x'],"Labels");
|
|
$MyData->addPoints($_SESSION['site402chart_y'],"VALUE");
|
|
|
|
$MyData->setAxisDisplay(0,AXIS_FORMAT_CURRENCY);
|
|
$MyData->setSerieDescription("Labels","Time");
|
|
$MyData->setAbscissa("Labels");
|
|
$MyData->setPalette("VALUE",array("R"=>55,"G"=>91,"B"=>127));
|
|
|
|
/* Create the pChart object */
|
|
//$myPicture = new pImage(700,230,$MyData);
|
|
$myPicture = new pImage(960,500,$MyData);
|
|
|
|
|
|
|
|
$myPicture->drawGradientArea(0,0,960,500,DIRECTION_VERTICAL,array("StartR"=>220,"StartG"=>220,"StartB"=>220,"EndR"=>255,"EndG"=>255,"EndB"=>255,"Alpha"=>100));
|
|
$myPicture->drawRectangle(0,0,959,499,array("R"=>200,"G"=>200,"B"=>200));
|
|
|
|
/* Write the picture title */
|
|
$myPicture->setFontProperties(array("FontName"=>"./fonts/calibri.ttf","FontSize"=>11));
|
|
$myPicture->drawText(390,40,$lab_Field_site404_002,array("FontSize"=>16,"Align"=>TEXT_ALIGN_BOTTOMLEFT));
|
|
|
|
/* Do some cosmetic and draw the chart */
|
|
$myPicture->setGraphArea(60,60,930,460);
|
|
$myPicture->drawFilledRectangle(60,60,930,460,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>10));
|
|
|
|
$myPicture->drawScale(array("GridR"=>180,"GridG"=>180,"GridB"=>180));
|
|
|
|
|
|
|
|
/* Draw a spline chart on top */
|
|
$myPicture->setFontProperties(array("FontName"=>"./fonts/pf_arma_five.ttf","FontSize"=>6));
|
|
//$myPicture->drawFilledSplineChart();
|
|
$myPicture->drawSplineChart();
|
|
$myPicture->setShadow(FALSE);
|
|
|
|
|
|
|
|
/* Write the chart legend */
|
|
//$myPicture->drawLegend(643,210,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL));
|
|
|
|
/* Render the picture (choose the best way) */
|
|
$myPicture->Render($fileName);
|
|
|
|
?>
|
|
<?php echo "<p style='text-align: center;'><img src='$fileName'></p>" ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="tag100">
|
|
<div class="head_tag">Lista pomiarów</div>
|
|
<div class="tag">
|
|
<table WIDTH="100%" class="tag">
|
|
<TR>
|
|
<TD class="label">Lp.</TD>
|
|
<TD class="label">Data pomiaru</TD>
|
|
<TD class="label"><?php echo $lab_Field_site404_002;?></TD>
|
|
</TR>
|
|
|
|
<?php
|
|
|
|
$start=($_GET['pgn']-1)*20;
|
|
$stop = $_GET['pgn']*20;
|
|
if ($stop>count($_SESSION['site404chart_array'])) $stop=count($_SESSION['site404chart_array']);
|
|
|
|
for($i=$start;$i<$stop;$i++)
|
|
{
|
|
echo"
|
|
<TR>
|
|
<TD class='field_right'>".($i+1).".</TD>
|
|
<TD class='field_center'>".$_SESSION['site404chart_array'][$i]['water_audit']."</TD>
|
|
<TD class='field_center'>".$_SESSION['site404chart_array'][$i]['water_value']."</TD>
|
|
</TR>
|
|
";
|
|
}
|
|
?>
|
|
|
|
</table>
|
|
|
|
<table style="width:100%; background-color: #f5f5f5">
|
|
<tr>
|
|
<td style="width: 25%; text-align: left;"><span class="resume">Wyników: <?php echo count($_SESSION['site404chart_array']); ?></span></td>
|
|
<td style="width: 50%; text-align: center;">
|
|
<?php
|
|
if (count($_SESSION['site404chart_array'])>20)
|
|
echo pagination_grid('?pg=site404chart&dev='.$_GET['dev'], $_GET['pgn'], count($_SESSION['site404chart_array']));
|
|
?>
|
|
</td>
|
|
<td style="width: 25%; text-align: right;">
|
|
<a href="./export/site404chart_xls.php" title="Export do EXCEL"><img src="./images/excel_ico.png" style="max-width: 20px; border: 0;"></a>
|
|
<a href="./export/site404chart_print.php" target="_blank" title="Wydruk"><img src="./images/printer-icon.png" style="max-width: 20px; border: 0;"></a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
echo"
|
|
<div class=tag_buttons>
|
|
<a href='?pg=site404inf&dev=".$_GET['dev']."'> <INPUT class='btn btn-info btn-sm' TYPE='BUTTON' VALUE='$lab_ButtonName_Back'></A>
|
|
</div>
|
|
";
|
|
?>
|
|
|
|
</div>
|
|
|
|
|
|
<?php
|
|
}
|
|
else showFooterWarningAccessNotification($lab_FooterWarningAccessNotification_001);
|
|
?>
|