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

164 lines
7.1 KiB
PHP

<?php
if (!empty($_SESSION['site404']))
{
//if (empty($_POST['wydz'])) $_POST['wydz']=sqlStringValue("select URG_DESC from sys_users_regions where URG_USR_ID=".$_SESSION['user_id']." limit 1","URG_DESC");
if (empty($_POST['wydz'])) $_POST['wydz']=$_SESSION['eq_stock_param3_1']
?>
<?php
//paginacja
if (!$_GET['pgn']) {$_GET['pgn']=1; delSearchSessionData(); }
if ($_POST['sub_search']=='Szukaj') $_SESSION['site404_input'] = $_POST['sr_well'];
?>
<form action="./?pg=site404&pgn=1" method="post">
<div class="tag100">
<table>
<tr>
<td>Piezometr:</td>
<td style="width: 10px;"></td>
<td><input type="text" name="sr_well" value="<?php echo $_SESSION['site404_input'];?>"></td>
<td style="width: 10px;"></td>
<td>wydział:</td>
<td style="width: 5px;"></td>
<td>
<select name="wydz">
<?php
if (!empty($_SESSION['eq_stock_param3_1']))
{
echo"<option value='".$_SESSION['eq_stock_param3_1']."'>".$_SESSION['eq_stock_param3_1']."</option>";
}
else
{
$wynik = mysql_query("select URG_DESC from sys_users_regions where URG_USR_ID=".$_SESSION['user_id']);
if($wynik)while ($r = mysql_fetch_array($wynik))
{
$resW=$r["URG_DESC"];
if ($_POST['wydz']==$resW)
echo"<option value='$resW' selected>$resW</option>";
else
echo"<option value='$resW'>$resW</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>&nbsp;</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'>";
?>
Pokaż wszystkie</td>
</tr>
</table>
</div>
</form>
<div class="tag100">
<div class="head_tag"><?php echo $lab_Tag_site309_001 ;?></div>
<div class="tag">
<table WIDTH="100%" class="tag">
<TR>
<TD class="label">Lp.</TD>
<TD class="label"><?php echo $lab_Field_site302_001 ;?></TD>
<TD class="label"><?php echo $lab_Field_site301_014 ;?></TD>
<TD class="label"><?php echo $lab_Field_site302_006 ;?></TD>
<TD class="label"><?php echo $lab_Field_site302_007 ;?></TD>
<TD class="label"><?php echo $lab_Field_site301_007 ;?></TD>
</TR>
<?php
if (empty($_SESSION['site404_array']) || $_POST['sub_search']=='Szukaj')
{
$query="select DRS_ID,SRP_ID,SRP_NAME,SOD_UJ,SOD_DESC from seg_dev_resources left join seg_reservoirs_piezometers on DRS_DEV_ID=SRP_ID left join seg_object_def on SOD_NAME=SRP_NAME where DRS_DEV_TYPE=601 and DRS_STATUS_DIC_ID=7 and SRP_NAME like '%".$_POST['sr_well']."%' and SOD_PLC='".$_POST['wydz']."'";
$query .= " order by SRP_NAME";
if (empty($_POST['sr_all'])) $query .= " limit 100";
$res=null;
$wynik = mysql_query($query);
if($wynik)while ($r = mysql_fetch_array($wynik))
{
$hst = getLastValueFromDevResourceDetail("WELL_PARAMETERS","HSTM",$r["DRS_ID"]);
if (empty($hst)) $hst = $lab_Field_site404_001;
else $hst=str_replace('.',',',round($hst,2));
$res[]=array(
'id' => $r["SRP_ID"],
'name' => $r["SRP_NAME"],
'dev_id' => $r["DRS_ID"],
'hstm' => $hst,//,round(getLastValueFromDevResourceDetail("WELL_PARAMETERS","HSTM",$r["DRS_ID"]),2),
'depth' => round(getLastValueFromDevResourceDetail("DEV_RESOURCES_DETAIL","DEPTH",$r["DRS_ID"]),2),
'desc' => $r["SOD_DESC"],
'bariera' => $r["SOD_UJ"]
);
}
unset($_SESSION['site404_array']);
$_SESSION['site404_array']=$res;
}
$start=($_GET['pgn']-1)*20;
$stop = $_GET['pgn']*20;
if ($stop>count($_SESSION['site404_array'])) $stop=count($_SESSION['site404_array']);
for($i=$start;$i<$stop;$i++)
{
echo"
<TR STYLE='cursor: pointer;' onclick=".chr(34)."document.location.href='?pg=site404inf&dev=".$_SESSION['site404_array'][$i]['dev_id']."'".chr(34).">
<TD class='field_left'>".($i+1).".</TD>
<TD class='field_left'>".$_SESSION['site404_array'][$i]['name']."</TD>
<TD class='field_left'>".$_SESSION['site404_array'][$i]['bariera']."</TD>
<TD class='field_center'>".$_SESSION['site404_array'][$i]['hstm']."</TD>
<TD class='field_center'>".$_SESSION['site404_array'][$i]['depth']."</TD>
<TD class='field_center'>".$_SESSION['site404_array'][$i]['desc']."</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['site404_array']); ?></span></td>
<td style="width: 50%; text-align: center;">
<?php
if (count($_SESSION['site404_array'])>20)
echo pagination_grid('?pg=site404', $_GET['pgn'], count($_SESSION['site404_array']));
?>
</td>
<td style="width: 25%; text-align: right;">
<a href="/export/site404_xls.php" title="Export do EXCEL"><img src="/images/excel_ico.png" style="max-width: 20px; border: 0;"></a>&nbsp;
<a href="/export/site404_pdf.php" title="Export do PDF"><img src="/images/pdf_ico.png" style="max-width: 20px; border: 0;"></a>&nbsp;
<a href="/export/site404_print.php" target="_blank" title="Wydruk"><img src="/images/printer-icon.png" style="max-width: 20px; border: 0;"></a>&nbsp;
</td>
</tr>
</table>
</div>
</div>
<?php
}
else showFooterWarningAccessNotification($lab_FooterWarningAccessNotification_001);
?>