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

259 lines
12 KiB
PHP

<?php
if (!empty($_SESSION['site401']))
{
?>
<?php
if ($_POST['subWellParamSave']==$lab_ButtonName_Save)
{
$_GET['dev'] = $_POST['dev'];
mysql_query("INSERT INTO seg_dev_resources_det SET DRD_DRS_ID=".$_POST['dev'].",DRD_RESOURCES_DETAIL=".$_POST['dic'].",DRD_VALUE='".str_replace(',','.',$_POST['inWellParamValue'])."',DRD_AUDIT_USR='".$_SESSION['user']."',DRD_AUDIT_DATE='".$_POST['inWellParamDate']." ".date('H:i:s')."';");
echo"<div class='actionOK'>$lab_Field_site803_013</div>";
}
?>
<?php
$wynik = mysql_query("select DRS_ID,RWL_WLL_ID,RWL_PUP_DRS_ID,RWL_ENG_DRS_ID from seg_dev_resources left join seg_well_pump_eng_rel on RWL_WLL_ID=DRS_DEV_ID where DRS_ID=".$_GET['dev']);
if($wynik)while ($r = mysql_fetch_array($wynik))
{
$var_DRSid = $r["DRS_ID"];
$var_WLLid = $r["RWL_WLL_ID"];
$var_DRS_PUPid = $r["RWL_PUP_DRS_ID"]; $var_PUPid=sqlValue("select DRS_DEV_ID from seg_dev_resources where DRS_ID=$var_DRS_PUPid");
$var_DRS_ENGid = $r["RWL_ENG_DRS_ID"]; $var_ENGid=sqlValue("select DRS_DEV_ID from seg_dev_resources where DRS_ID=$var_DRS_ENGid");
}
if ($_SESSION['lang'] == 'polish') $decFieldLang = 'DIC_POL_LANG';
else if ($_SESSION['lang'] == 'english') $decFieldLang = 'DIC_ENG_LANG';
else if ($_SESSION['lang'] == 'german') $decFieldLang = 'DIC_GER_LANG';
?>
<div class="tag50_left">
<div class="head_tag"><?php echo $lab_Tag_site301_005 ;?></div>
<div class="tag">
<TABLE class="desc_val">
<TR>
<TD class="desc_well_param"><?php echo $lab_Field_site301_016; ?></TD>
<TD CLASS="desc_value" colspan="2"><?php echo sqlStringValue("select WLL_NAME from seg_wells where WLL_ID=$var_WLLid", "WLL_NAME"); ?></TD>
</TR>
<TR>
<TD class="desc_well_param"><?php echo $lab_Field_site301_017; ?></TD>
<TD CLASS="desc_value" colspan="2"><?php echo sqlStringValue("select DIC_ENG_LANG from sys_dictionaries where DIC_ID=(select WLL_CAT_DIC_ID from seg_wells where WLL_ID=$var_WLLid)","DIC_ENG_LANG"); ?></TD>
</TR>
<TR>
<TD class="desc_well_param"><?php echo $lab_Field_site301_006; ?></TD>
<TD CLASS="desc_value" colspan="2"><?php echo sqlStringValue("select DRS_AVAILABLE_DATE from seg_dev_resources where DRS_ID=$var_DRSid", "DRS_AVAILABLE_DATE"); ?></TD>
</TR>
<TR>
<TD class="desc_well_param"><?php echo $lab_Field_site301_002; ?></TD>
<TD CLASS="desc_value"><?php echo sqlStringValue("select PUP_NAME from seg_dev_resources left join seg_pumps on DRS_DEV_ID=PUP_ID where DRS_ID=$var_DRS_PUPid", "PUP_NAME"); ?></TD>
</TR>
<TR>
<TD class="desc_well_param"><?php echo $lab_Field_site301_003; ?></TD>
<TD CLASS="desc_value"><?php echo sqlStringValue("select DRS_SN_NUMBER from seg_dev_resources left join seg_pumps on DRS_DEV_ID=PUP_ID where DRS_ID=$var_DRS_PUPid", "DRS_SN_NUMBER"); ?></TD>
</TR>
<TR>
<TD class="desc_well_param"><?php echo $lab_Field_site301_004; ?></TD>
<TD CLASS="desc_value"><?php echo sqlStringValue("select ENG_NAME from seg_dev_resources left join seg_engines on DRS_DEV_ID=ENG_ID where DRS_ID=$var_DRS_ENGid", "ENG_NAME"); ?></TD>
</TR>
<TR>
<TD class="desc_well_param"><?php echo $lab_Field_site301_005; ?></TD>
<TD CLASS="desc_value"><?php echo sqlStringValue("select DRS_SN_NUMBER from seg_dev_resources left join seg_engines on DRS_DEV_ID=ENG_ID where DRS_ID=$var_DRS_ENGid", "DRS_SN_NUMBER"); ?></TD>
</TR>
</table>
</div>
<div class="head_tag"><?php echo $lab_Tag_site401_004 ;?></div>
<div class="tag">
<TABLE class="desc_val">
<?php
$result = mysql_query("select DIC_ID,DIC_NAME from sys_dictionaries where DIC_TYPE='WELL_CHEMICAL_PARAMETERS_GR1'");
if($result)while ($r = mysql_fetch_array($result))
{
$var_DIC_ID = $r["DIC_ID"];
$var_DIC_NAME = $r["DIC_NAME"];
echo"
<TR>
<TD class='desc_well_param'>".sqlStringValue("select $decFieldLang from sys_dictionaries where DIC_TYPE='WELL_CHEMICAL_PARAMETERS_GR1' and DIC_NAME='$var_DIC_NAME'",$decFieldLang)."</TD>
<TD CLASS='desc_value'>".getLinkToShowHistoricalData('WELL_CHEMICAL_PARAMETERS_GR1',$var_DIC_NAME,$var_DRSid,'site401CH')."</TD>";
if (!empty($_SESSION['site401_edit_chpar']))
echo"<td CLASS='desc_value' width='5%'><img style='cursor: pointer;' src='./images/edit.png' title='$lab_ButtonName_Modify' onclick=".chr(34)."document.location.href='?pg=site401ECH&dev=$var_DRSid&dic=$var_DIC_ID'".chr(34)."></td>";
echo"
</TR>
";
}
?>
</table>
</div>
</div>
<div class="tag50_right">
<div class="head_tag"><?php echo $lab_Tag_site401_006 ;?></div>
<div class="tag">
<TABLE class="desc_val">
<?php
$result = mysql_query("select DIC_ID,DIC_NAME from sys_dictionaries where DIC_TYPE='WELL_CHEMICAL_PARAMETERS_GR2'");
if($result)while ($r = mysql_fetch_array($result))
{
$var_DIC_ID = $r["DIC_ID"];
$var_DIC_NAME = $r["DIC_NAME"];
echo"
<TR>
<TD class='desc_well_param'>".sqlStringValue("select $decFieldLang from sys_dictionaries where DIC_TYPE='WELL_CHEMICAL_PARAMETERS_GR2' and DIC_NAME='$var_DIC_NAME'",$decFieldLang)."</TD>
<TD CLASS='desc_value'>".getLinkToShowHistoricalData('WELL_CHEMICAL_PARAMETERS_GR2',$var_DIC_NAME,$var_DRSid,'site401CH')."</TD>";
if (!empty($_SESSION['site401_edit_chpar']))
echo"<td CLASS='desc_value' width='5%'><img style='cursor: pointer;' src='./images/edit.png' title='$lab_ButtonName_Modify' onclick=".chr(34)."document.location.href='?pg=site401ECH&dev=$var_DRSid&dic=$var_DIC_ID'".chr(34)."></td>";
echo"
</TR>
";
}
?>
</table>
</div>
<div class="head_tag"><?php echo $lab_Tag_site401_007 ;?></div>
<div class="tag">
<TABLE class="desc_val">
<?php
$result = mysql_query("select DIC_ID,DIC_NAME from sys_dictionaries where DIC_TYPE='WELL_CHEMICAL_PARAMETERS_GR3'");
if($result)while ($r = mysql_fetch_array($result))
{
$var_DIC_ID = $r["DIC_ID"];
$var_DIC_NAME = $r["DIC_NAME"];
echo"
<TR>
<TD class='desc_well_param'>".sqlStringValue("select $decFieldLang from sys_dictionaries where DIC_TYPE='WELL_CHEMICAL_PARAMETERS_GR3' and DIC_NAME='$var_DIC_NAME'",$decFieldLang)."</TD>
<TD CLASS='desc_value'>".getLinkToShowHistoricalData('WELL_CHEMICAL_PARAMETERS_GR3',$var_DIC_NAME,$var_DRSid,'site401CH')."</TD>";
if (!empty($_SESSION['site401_edit_chpar']))
echo"<td CLASS='desc_value' width='5%'><img style='cursor: pointer;' src='./images/edit.png' title='$lab_ButtonName_Modify' onclick=".chr(34)."document.location.href='?pg=site401ECH&dev=$var_DRSid&dic=$var_DIC_ID'".chr(34)."></td>";
echo"
</TR>
";
}
?>
</table>
</div>
</div>
<?php
if (!empty($_GET['dev']) && !empty($_GET['dic']))
getHistoryData($_GET['dev'], $_GET['dic']);
?>
<div class="tag100">
<div class="tag_buttons">
<a class="btn btn-info btn-sm" style="text-decoration: none;" href="./?pg=site401inf&dev=<?php echo$_GET['dev'];?>" role="button"><?php echo $lab_ButtonName_Back; ?></a>
<button id="showHist" class="btn btn-primary btn-sm" type="button"><?php echo $lab_HistoricalData_008; ?></button>
</div>
</div>
<br/><br/>
<div class="tag100" id="tagShowHist">
<table>
<tr>
<td>Wyświetl dane dla parametru:</td>
<td style="width: 5px;"></td>
<td>
<select name="inChemParam" id="inChemParam">
<option value="0"><?php echo $lab_FormSelect_001; ?></option>
<option value="0">-------------------------------------------</option>
<?php
unset($chemParamArray_01);unset($chemParamArray_02);unset($chemParamArray_03);
$chemParamArray_01 = sqlGetResAsArray("select DIC_ID,DIC_NAME,".$decFieldLang." from sys_dictionaries where DIC_TYPE='WELL_CHEMICAL_PARAMETERS_GR1' order by ".$decFieldLang);
$chemParamArray_02 = sqlGetResAsArray("select DIC_ID,DIC_NAME,$decFieldLang from sys_dictionaries where DIC_TYPE='WELL_CHEMICAL_PARAMETERS_GR2' order by ".$decFieldLang);
$chemParamArray_03 = sqlGetResAsArray("select DIC_ID,DIC_NAME,$decFieldLang from sys_dictionaries where DIC_TYPE='WELL_CHEMICAL_PARAMETERS_GR3' order by ".$decFieldLang);
for($i=0; $i<count($chemParamArray_01); $i++)
echo'<option value="'.$chemParamArray_01[$i]['DIC_ID'].'">'.$chemParamArray_01[$i][$decFieldLang].'</option>';
?>
<option value="0">-------------------------------------------</option>
<?php
for($i=0; $i<count($chemParamArray_02); $i++)
echo'<option value="'.$chemParamArray_02[$i]['DIC_ID'].'">'.$chemParamArray_02[$i][$decFieldLang].'</option>';
?>
<option value="0">-------------------------------------------</option>
<?php
for($i=0; $i<count($chemParamArray_03); $i++)
echo'<option value="'.$chemParamArray_03[$i]['DIC_ID'].'">'.$chemParamArray_03[$i][$decFieldLang].'</option>';
?>
</select>
</td>
<td style="width: 5px;"></td>
<td>za okres od:</td>
<td style="width: 5px;"></td>
<td><INPUT STYLE='text-align: right' TYPE='TEXT' id='inDateFrom' NAME='inDateFrom' value='<?php echo date('Y-m').'-01'; ?>' 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='inDateTo' NAME='inDateTo' value='<?php echo date('Y-m-d'); ?>' SIZE='10'></td>
<td style="width: 20px;"></td>
<td><button type="button" id="subSite401CHShow" class="btn btn-default btn-sm">Pokaż</button></td>
</tr>
</table>
</div>
<br/>
<div class="tag100" id="tagShowHistData">
</div>
<script>
$(window).load(function() {
$(function() {$("#inDateFrom").datepicker({changeMonth: true,changeYear: true});});
$(function() {$("#inDateTo").datepicker({changeMonth: true,changeYear: true});});
$('#tagShowHist').hide();
$('#showHist').click(function() {
$('#tagShowHist').show();
});
// wyświetlanie danych
// ===============================================================
$('#subSite401CHShow').click(function() {
$.post("./ajax_func.php",
{
page: "site401CH",
post_action: "show_params",
post_dev_id: "<?php echo $var_DRSid; ?>",
post_param_id: $('#inChemParam').val(),
post_date_from: $('#inDateFrom').val(),
post_date_to: $('#inDateTo').val()
}
).done(function(data)
{
$('#tagShowHistData').html(data);
}
);
});
// ===============================================================
});
</script>
<?php
}
else showFooterWarningAccessNotification($lab_FooterWarningAccessNotification_001);
?>