141 lines
6.2 KiB
PHP
141 lines
6.2 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><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'>";
|
|
?>
|
|
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>
|
|
<TD class="label">Sterowanie</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=3 and SRP_NAME like '%".$_POST['sr_well']."%' and SOD_PLC='".$_POST['wydz']."'";
|
|
$query="select DRS_ID,SRP_ID,SRP_MCF_ID,SRP_NAME,SRP_BARIERA,SRP_SYS_TYPE,SRP_STAT_DESC from seg_dev_resources,seg_reservoirs_piezometers where DRS_DEV_ID=SRP_ID and DRS_DEV_TYPE=SRP_TYPE_DIC_ID and DRS_DEV_TYPE=601 and DRS_DEPARTMENT='".$_SESSION['syndis_eq_stock']."' and SRP_NAME like '%".$_POST['sr_well']."%' ";
|
|
$query .= " order by DRS_STATUS_DIC_ID,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"]); // dic ID=210
|
|
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"],
|
|
'ster' => setDicName($r["SRP_MCF_ID"]),
|
|
'hstm' => $hst,//,round(getLastValueFromDevResourceDetail("WELL_PARAMETERS","HSTM",$r["DRS_ID"]),2),
|
|
'depth' => round(getLastValueFromDevResourceDetail("WELL_TECHNICAL_PARAMETERS","LS",$r["DRS_ID"]),2),
|
|
'desc' => $r["SRP_SYS_TYPE"],
|
|
'bariera' => $r["SRP_BARIERA"]
|
|
);
|
|
|
|
}
|
|
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>
|
|
<TD class='field_center'>".$_SESSION['site404_array'][$i]['ster']."</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>
|
|
<a href="./export/site404_print.php" target="_blank" title="Wydruk"><img src="./images/printer-icon.png" style="max-width: 20px; border: 0;"></a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<?php
|
|
}
|
|
else showFooterWarningAccessNotification($lab_FooterWarningAccessNotification_001);
|
|
?>
|