Initial commit
This commit is contained in:
@@ -0,0 +1,439 @@
|
||||
<?php
|
||||
if (!empty($_SESSION['site205']))
|
||||
{
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
if ($_POST['subEng4PupUpdate']== $lab_ButtonName_Update)
|
||||
{
|
||||
$_GET['pup']=$_POST['pup'];
|
||||
mysql_query("DELETE FROM seg_pump_engine_rel where RPE_PUP_ID=".$_POST['pup']);
|
||||
|
||||
$wynik = mysql_query("select ENG_ID from seg_engines");
|
||||
if($wynik)while ($r = mysql_fetch_array($wynik))
|
||||
{
|
||||
$eID = $r["ENG_ID"];
|
||||
if ($_POST['eng4pump'][$eID])
|
||||
mysql_query("INSERT INTO seg_pump_engine_rel SET RPE_PUP_ID=".$_POST['pup'].",RPE_ENG_ID=$eID");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<form action="./?pg=site203&pgn=1" method="post">
|
||||
<div class="tag100">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php getSelectValueAsArray('sr_param', $typSelArray,$_SESSION['site203_sr_param']); ?></td>
|
||||
<td style="width: 10px;"></td>
|
||||
<td><input type="text" name="sr_well" value="<?php echo $_SESSION['site203_input'];?>"></td>
|
||||
<td style="width: 10px;"></td>
|
||||
<td>producent:</td>
|
||||
<td style="width: 5px;"></td>
|
||||
<td>
|
||||
<select name="sr_status">
|
||||
<?php
|
||||
$wynik = mysql_query("select MCF_ID,MCF_NAME from seg_manufacturers order by MCF_NAME");
|
||||
if($wynik)while ($r = mysql_fetch_array($wynik))
|
||||
{
|
||||
$resID=$r["MCF_ID"];
|
||||
$resDESC=$r["MCF_NAME"];
|
||||
|
||||
if ($_POST['sr_status']==$resID)
|
||||
echo"<option value='$resID' selected>$resDESC</option>";
|
||||
else
|
||||
echo"<option value='$resID'>$resDESC</option>";
|
||||
}
|
||||
if ($_POST['sr_status']==100)
|
||||
echo"<option value='100' selected>Wszyscy</option>";
|
||||
else
|
||||
echo"<option value='100'>Wszyscy</option>";
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td style="width: 10px;"></td>
|
||||
<td><input type="submit" name="sub_search" value="Szukaj" class="btn btn-default btn-sm"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<?php
|
||||
if (!empty($_POST['sr_all'])) echo"<input type='checkbox' name='sr_all' value='1' checked> ";
|
||||
else echo"<input type='checkbox' name='sr_all' value='1'> ";
|
||||
|
||||
echo $lab_HistoricalData_007;
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="tag50_left">
|
||||
<div class="head_tag"><?php echo $lab_Tag_site205_001 ;?></div>
|
||||
<div class="tag">
|
||||
<table class="tag" style="width: 100%;">
|
||||
<TR>
|
||||
<TD class="label"><?php echo $lab_Field_site203_001 ;?></TD>
|
||||
<TD class="label"><?php echo $lab_Field_site203_002a ;?></TD>
|
||||
<TD class="label"><?php echo $lab_Field_site203_004 ;?></TD>
|
||||
</TR>
|
||||
|
||||
<?php
|
||||
$wynik = mysql_query("select PUP_ID,MCF_NAME,PUP_NAME,(PUP_Q_N/60) PUP_Q_N from seg_pumps left join seg_manufacturers on PUP_MCF_ID=MCF_ID order by PUP_Q_N,PUP_NAME");
|
||||
if($wynik)while ($r = mysql_fetch_array($wynik))
|
||||
{
|
||||
$sql_203_PUP_ID = $r["PUP_ID"]; if(!$_GET['pup']) $_GET['pup']=$sql_203_PUP_ID;
|
||||
$sql_203_PUP_MCF_ID = $r["MCF_NAME"];
|
||||
$sql_203_PUP_NAME = $r["PUP_NAME"];
|
||||
$sql_203_PUP_Q_N = round($r["PUP_Q_N"],3); $sql_203_PUP_Q_N= str_replace(".", ",", $sql_203_PUP_Q_N);
|
||||
|
||||
if ($_GET['pup']==$sql_203_PUP_ID)
|
||||
$styl = 'background-color: #ffff00;';
|
||||
else $styl='';
|
||||
|
||||
echo"
|
||||
<TR STYLE='cursor: pointer; ".$styl."' onclick=".chr(34)."document.location.href='?pg=site205&pup=$sql_203_PUP_ID'".chr(34).">
|
||||
<TD class='field_left'>$sql_203_PUP_NAME</TD>
|
||||
<TD class='field_right'>$sql_203_PUP_Q_N</TD>
|
||||
<TD class='field_center'>$sql_203_PUP_MCF_ID</TD>
|
||||
</TR>
|
||||
";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="tag50_right">
|
||||
<div class="head_tag"><?php echo $lab_Tag_site203_006.sqlValue("select PUP_NAME from seg_pumps where PUP_ID=".$_GET['pup']) ;?></div>
|
||||
<div class="tag">
|
||||
<table WIDTH="100%" class="tag">
|
||||
<TR>
|
||||
<TD class="label"><?php echo $lab_Field_site204_001 ;?></TD>
|
||||
<TD class="label"><?php echo $lab_Field_site204_002 ;?></TD>
|
||||
<TD class="label"><?php echo $lab_Field_site204_004 ;?></TD>
|
||||
</TR>
|
||||
|
||||
<?php
|
||||
$wynik = mysql_query("select RPE_ENG_ID,ENG_NAME,(select MCF_NAME from seg_manufacturers where MCF_ID=ENG_MCF_ID) ENG_MCF,ENG_VOLTAGE from seg_pump_engine_rel left join seg_engines on RPE_ENG_ID=ENG_ID left join seg_pumps on RPE_PUP_ID=PUP_ID where RPE_PUP_ID=".$_GET['pup']);
|
||||
if($wynik)while ($r = mysql_fetch_array($wynik))
|
||||
{
|
||||
$param_1 = $r["RPE_ENG_ID"]; if (!$_GET['eng']) $_GET['eng']=$param_1;
|
||||
$param_4 = $r["ENG_NAME"];
|
||||
$param_5 = $r["ENG_VOLTAGE"]; $param_6= str_replace(".", ",", $param_6);
|
||||
$param_6 = $r["ENG_MCF"];
|
||||
|
||||
|
||||
echo"
|
||||
<TR STYLE='cursor: pointer;' onclick=".chr(34)."document.location.href='?pg=site205&pup=".$_GET['pup']."&eng=$param_1'".chr(34).">
|
||||
<TD class='field_center'>$param_4</TD>
|
||||
<TD class='field_center'>$param_5</TD>
|
||||
<TD class='field_center'>$param_6</TD>
|
||||
</TR>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
$wynik = mysql_query("select PUP_NAME,(select MCF_NAME from seg_manufacturers where MCF_ID=PUP_MCF_ID) PUP_MCF,(PUP_Q_N/60) PUP_Q_N,PUP_H_P,PUP_ETA_MAX,ENG_NAME,(select MCF_NAME from seg_manufacturers where MCF_ID=ENG_MCF_ID) ENG_MCF,ENG_VOLTAGE,ENG_POWER,ENG_ETA from seg_pump_engine_rel left join seg_engines on RPE_ENG_ID=ENG_ID left join seg_pumps on RPE_PUP_ID=PUP_ID where RPE_PUP_ID=".$_GET['pup']." and RPE_ENG_ID=".$_GET['eng']);
|
||||
if($wynik)while ($r = mysql_fetch_array($wynik))
|
||||
{
|
||||
$mix_1 = $r["PUP_NAME"];
|
||||
$mix_2 = $r["PUP_MCF"];
|
||||
$mix_3 = round($r["PUP_Q_N"],3); $mix_3= str_replace(".", ",", $mix_3);
|
||||
$mix_4 = $r["PUP_H_P"]; $mix_4= str_replace(".", ",", $mix_4);
|
||||
$mix_5 = $r["PUP_ETA_MAX"]; $mix_5= str_replace(".", ",", $mix_5);
|
||||
$mix_6 = $r["ENG_NAME"];
|
||||
$mix_7 = $r["ENG_MCF"];
|
||||
$mix_8 = $r["ENG_VOLTAGE"];
|
||||
$mix_9 = $r["ENG_POWER"]; $mix_9= str_replace(".", ",", $mix_9);
|
||||
$mix_10 = $r["ENG_ETA"]; $mix_10= str_replace(".", ",", $mix_10);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div class="head_tag"><?php echo sqlValue("select concat (PUP_NAME, ' + ',ENG_NAME) from seg_pump_engine_rel left join seg_engines on RPE_ENG_ID=ENG_ID left join seg_pumps on RPE_PUP_ID=PUP_ID where RPE_PUP_ID=".$_GET['pup']." and RPE_ENG_ID=".$_GET['eng']) ;?></div>
|
||||
<div class="tag">
|
||||
<TABLE class="desc_val">
|
||||
<TR >
|
||||
|
||||
<?php echo"<TR STYLE='cursor: pointer;' onclick=".chr(34)."document.location.href='?pg=site203inf&pup=".$_GET['pup']."'".chr(34).">"; ?>
|
||||
<TD class="desc"><?php echo $lab_Field_site203_001; ?></TD>
|
||||
<TD CLASS="desc_value"><?php echo $mix_1; ?></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD class="desc"><?php echo $lab_Field_site203_004; ?></TD>
|
||||
<TD CLASS="desc_value"><?php echo $mix_2; ?></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD class="desc"><?php echo $lab_Field_site203_002a; ?></TD>
|
||||
<TD CLASS="desc_value"><?php echo $mix_3; ?></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD class="desc"><?php echo $lab_Field_site203_003; ?></TD>
|
||||
<TD CLASS="desc_value"><?php echo $mix_4; ?></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD class="desc"><?php echo $lab_Field_site203_009; ?></TD>
|
||||
<TD CLASS="desc_value"><?php echo $mix_5; ?></TD>
|
||||
</TR>
|
||||
|
||||
<TR><TD COLSPAN="2" CLASS="desc_value"><HR ></TD></TR>
|
||||
|
||||
<?php echo"<TR STYLE='cursor: pointer;' onclick=".chr(34)."document.location.href='?pg=site204inf&eng=".$_GET['eng']."'".chr(34).">"; ?>
|
||||
<TD class="desc"><?php echo $lab_Field_site204_001; ?></TD>
|
||||
<TD CLASS="desc_value"><?php echo $mix_6; ?></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD class="desc"><?php echo $lab_Field_site204_004; ?></TD>
|
||||
<TD CLASS="desc_value"><?php echo $mix_7; ?></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD class="desc"><?php echo $lab_Field_site204_002; ?></TD>
|
||||
<TD CLASS="desc_value"><?php echo $mix_8; ?></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD class="desc"><?php echo $lab_Field_site204_003; ?></TD>
|
||||
<TD CLASS="desc_value"><?php echo $mix_9; ?></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD class="desc"><?php echo $lab_Field_site204_006; ?></TD>
|
||||
<TD CLASS="desc_value"><?php echo $mix_10; ?></TD>
|
||||
</TR>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
if ($_GET['pup']>0)
|
||||
{
|
||||
|
||||
$fileName1="./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_chart_203inf_01.png";
|
||||
$fileName2="./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_chart_203inf_02.png";
|
||||
|
||||
if (file_exists( $fileName1)) unlink($fileName1);
|
||||
if (file_exists( $fileName2)) unlink($fileName2);
|
||||
|
||||
// Wysokość podnoszenia
|
||||
// =======================================================================================//
|
||||
require_once('./polynomial/PolynomialRegression.php' );
|
||||
require_once('./polynomial/plot.php' );
|
||||
|
||||
|
||||
unset($scope);
|
||||
unset($data);
|
||||
unset($newParam);
|
||||
|
||||
|
||||
$i=0; $j=0;
|
||||
$wynik = mysql_query("select (PEP_X_PARAM/60) PEP_X_PARAM,PEP_Y_PARAM from seg_pump_eng_param where PEP_TYPE='H' and PEP_PUP_ID=".$_GET['pup']." order by PEP_X_PARAM");
|
||||
if($wynik)while ($r = mysql_fetch_array($wynik))
|
||||
{
|
||||
$newParam[$i][$j] = $r["PEP_X_PARAM"];
|
||||
$scope[] = $r["PEP_X_PARAM"];
|
||||
$j++;
|
||||
$newParam[$i][$j] = $r["PEP_Y_PARAM"];
|
||||
$i++; $j=0;
|
||||
}
|
||||
|
||||
$xMin = 0;
|
||||
$xMinLine = $xMin;
|
||||
|
||||
$xMax = sqlValue("select max(PEP_X_PARAM/60) from seg_pump_eng_param where PEP_TYPE='H' and PEP_PUP_ID=".$_GET['pup']);
|
||||
$xMaxLine = ceil($xMax);
|
||||
|
||||
$yMax = sqlValue("select max(PEP_Y_PARAM) from seg_pump_eng_param where PEP_TYPE='H' and PEP_PUP_ID=".$_GET['pup']);
|
||||
$yMax = ceil($yMax+10);
|
||||
|
||||
$X_MajorScale = $xMax/5;
|
||||
$X_MinorScale = $X_MajorScale / 2;
|
||||
$Y_MajorScale = ceil($yMax/4);
|
||||
$Y_MinorScale = $Y_MajorScale / 2;
|
||||
|
||||
$data = $newParam;
|
||||
|
||||
// Precision digits in BC math.
|
||||
bcscale( 10 );
|
||||
|
||||
// Start a regression class with a maximum of 4rd degree polynomial.
|
||||
$polynomialRegression = new PolynomialRegression( 4 );
|
||||
|
||||
// Add all the data to the regression analysis.
|
||||
foreach ( $data as $dataPoint )
|
||||
$polynomialRegression->addData( $dataPoint[ 0 ], $dataPoint[ 1 ] );
|
||||
|
||||
// Add raw data to plot.
|
||||
plotRenderData( $data, $colorMap[ "Blue" ] );
|
||||
|
||||
$plot->setX_Span( 0, $xMax);
|
||||
$plot->setY_Span( 0, ceil($yMax/4)*4 );
|
||||
|
||||
plotAddScale();
|
||||
|
||||
// Render the points to image
|
||||
$plot->setCircleSize( 3 );
|
||||
$plot->renderPoints();
|
||||
|
||||
// Get coefficients for the polynomial.
|
||||
$coefficients = $polynomialRegression->getCoefficients();
|
||||
|
||||
// Place text
|
||||
imageString($image,5,0,0,'H[m]',$colorMap[ "Black" ]);
|
||||
imageString($image,3,355,313,'Q[m3/min]',$colorMap[ "Black" ]);
|
||||
|
||||
// rysuje punkty
|
||||
// plotRenderRegression( $polynomialRegression, $coefficients, $xMinLine, $xMaxLine, $colorMap[ "Red" ] );
|
||||
plotRenderRegression( $polynomialRegression, $coefficients, $scope[0], $scope[2], $colorMap[ "Red" ] );
|
||||
plotRenderRegression( $polynomialRegression, $coefficients, $scope[2], $scope[3], $colorMap[ "DarkYellow" ] );
|
||||
plotRenderRegression( $polynomialRegression, $coefficients, $scope[3], $scope[5], $colorMap[ "Green" ] );
|
||||
plotRenderRegression( $polynomialRegression, $coefficients, $scope[5], $scope[6], $colorMap[ "DarkYellow" ] );
|
||||
plotRenderRegression( $polynomialRegression, $coefficients, $scope[6], $xMaxLine, $colorMap[ "Red" ] );
|
||||
|
||||
imagePNG( $image,$fileName1);
|
||||
// =======================================================================================//
|
||||
|
||||
|
||||
require_once('./polynomial/plot1.php' );
|
||||
|
||||
unset($scope1);
|
||||
unset($data);
|
||||
unset($newParam);
|
||||
|
||||
|
||||
$i=0; $j=0;
|
||||
$wynik = mysql_query("select (PEP_X_PARAM/60) PEP_X_PARAM,PEP_Y_PARAM from seg_pump_eng_param where PEP_TYPE='ETA' and PEP_PUP_ID=".$_GET['pup']." order by PEP_X_PARAM");
|
||||
if($wynik)while ($r = mysql_fetch_array($wynik))
|
||||
{
|
||||
$newParam1[$i][$j] = $r["PEP_X_PARAM"];
|
||||
$scope1[] = $r["PEP_X_PARAM"];
|
||||
$j++;
|
||||
$newParam1[$i][$j] = $r["PEP_Y_PARAM"];
|
||||
$i++; $j=0;
|
||||
}
|
||||
|
||||
|
||||
$xMin = 0;
|
||||
$xMinLine = $xMin;
|
||||
|
||||
$xMax = sqlValue("select max(PEP_X_PARAM/60) from seg_pump_eng_param where PEP_TYPE='ETA' and PEP_PUP_ID=".$_GET['pup']);
|
||||
$xMaxLine = ceil($xMax);
|
||||
|
||||
$X_MajorScale = $xMax/5;
|
||||
$X_MinorScale = $X_MajorScale / 2;
|
||||
|
||||
$Y_MajorScale = 0.2;
|
||||
$Y_MinorScale = $Y_MajorScale / 2;
|
||||
|
||||
|
||||
$data1 = $newParam1;
|
||||
|
||||
// Precision digits in BC math.
|
||||
bcscale( 10 );
|
||||
|
||||
// Start a regression class with a maximum of 4rd degree polynomial.
|
||||
$polynomialRegression1 = new PolynomialRegression( 4 );
|
||||
|
||||
// Add all the data to the regression analysis.
|
||||
foreach ( $data1 as $dataPoint1 )
|
||||
$polynomialRegression1->addData( $dataPoint1[ 0 ], $dataPoint1[ 1 ] );
|
||||
|
||||
// Add raw data to plot.
|
||||
plotRenderData( $data1, $colorMap[ "Blue" ] );
|
||||
|
||||
$plot->setX_Span( 0, $xMax );
|
||||
$plot->setY_Span( 0, 1 );
|
||||
|
||||
plotAddScale();
|
||||
|
||||
// Render the points to image
|
||||
$plot->setCircleSize( 3 );
|
||||
$plot->renderPoints();
|
||||
|
||||
// Get coefficients for the polynomial.
|
||||
$coefficients = $polynomialRegression1->getCoefficients();
|
||||
|
||||
// Place text
|
||||
imageString($image1,5,0,0,'n',$colorMap[ "Black" ]);
|
||||
imagerectangle($image1,6,12,7,17,$colorMap[ "Black" ]);
|
||||
imageString($image1,3,355,313,'Q[m3/min]',$colorMap[ "Black" ]);
|
||||
|
||||
// rysuje punkty
|
||||
// plotRenderRegression( $polynomialRegression1, $coefficients, $xMinLine, $xMaxLine, $colorMap[ "Red" ] );
|
||||
plotRenderRegression( $polynomialRegression1, $coefficients, $scope1[0], $scope1[2], $colorMap[ "Red" ] );
|
||||
plotRenderRegression( $polynomialRegression1, $coefficients, $scope1[2], $scope1[3], $colorMap[ "DarkYellow" ] );
|
||||
plotRenderRegression( $polynomialRegression1, $coefficients, $scope1[3], $scope1[5], $colorMap[ "Green" ] );
|
||||
plotRenderRegression( $polynomialRegression1, $coefficients, $scope1[5], $scope1[6], $colorMap[ "DarkYellow" ] );
|
||||
plotRenderRegression( $polynomialRegression1, $coefficients, $scope1[6], $xMaxLine, $colorMap[ "Red" ] );
|
||||
|
||||
|
||||
imagePNG( $image1,$fileName2);
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div class="head_tag"><?php echo $lab_Tag_site203_004 ;?></div>
|
||||
<div class="tag_center">
|
||||
<?php
|
||||
if (count($scope)>0)
|
||||
echo"<img SRC=$fileName1>";
|
||||
else
|
||||
echo $lab_Field_site203_017;
|
||||
?>
|
||||
</div>
|
||||
<div class="head_tag"><?php echo $lab_Tag_site203_004 ;?></div>
|
||||
<div class="tag_center">
|
||||
<?php
|
||||
if (count($scope1)>0)
|
||||
echo"<img SRC=$fileName2>";
|
||||
else
|
||||
echo $lab_Field_site203_017;
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if (!empty($_SESSION['site205_edit']))
|
||||
echo"
|
||||
<div class='tag100'>
|
||||
<div class='tag_buttons'>
|
||||
<a href='javascript:history.back()'><INPUT class='btn btn-info btn-sm' TYPE='BUTTON' VALUE='$lab_ButtonName_Back'></A>
|
||||
<a href=?pg=site205E&pup=".$_GET['pup']."><INPUT class='btn btn-success btn-sm' TYPE='BUTTON' VALUE='$lab_ButtonName_Modify'></A>
|
||||
</div>
|
||||
</div>
|
||||
";
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
else showFooterWarningAccessNotification($lab_FooterWarningAccessNotification_001);
|
||||
?>
|
||||
Reference in New Issue
Block a user