0)
{
unset($eng_array);
//$eng_array = sqlGetResAsArray("select * from seg_dev_resources,seg_engines where DRS_DEV_TYPE=11 and DRS_DEV_ID=ENG_ID and DRS_ID in (select DRS_ID from seg_dev_resources,seg_engines where DRS_DEV_TYPE=11 and DRS_DEV_ID=ENG_ID and DRS_DEPARTMENT='".$_SESSION['syndis_eq_stock']."' and ENG_ID=".$_GET['eng']." and (DRS_RESOURCES_DIC_ID in (1,2,3,707) or (DRS_RESOURCES_DIC_ID=40 and DRS_DEV_ATTENTION='1524')) union select RWS_ENG_DRS_ID DRS_ID from seg_wellsink_pump_eng_rel,seg_dev_resources left join seg_engines on DRS_DEV_TYPE=11 and DRS_DEV_ID=ENG_ID where RWS_ENG_DRS_ID=DRS_ID and DRS_DEPARTMENT='".$_SESSION['syndis_eq_stock']."' and ENG_ID=".$_GET['eng'].") order by DRS_SN_NUMBER,ENG_POWER");
$eng_array = sqlGetResAsArray("select * from seg_engines,seg_dev_resources where DRS_DEV_TYPE=11 and DRS_DEV_ID=ENG_ID and ENG_ID=".$_GET['eng']." and (DRS_RESOURCES_DIC_ID in (1,2,3,707) or (DRS_RESOURCES_DIC_ID=40 and DRS_DEV_ATTENTION in ('1401','1524'))) and DRS_DEPARTMENT='".$_SESSION['syndis_eq_stock']."' order by DRS_SN_NUMBER");
}
// $eng_array = sqlGetResAsArray("select DRS_ID,DRS_SN_NUMBER,DRS_STATUS_DIC_ID,DRS_RESOURCES_DIC_ID,ENG_ID,ENG_NAME,ENG_VOLTAGE,ENG_POWER,(select WLL_NAME from seg_wells where WLL_ID=(select RWL_WLL_ID from seg_well_pump_eng_rel where RWL_ENG_DRS_ID=DRS_ID limit 1)) WLL_NAME from seg_dev_resources left join seg_engines on DRS_DEV_ID=ENG_ID and DRS_DEV_TYPE=11 where DRS_DEPARTMENT = '".$_SESSION['syndis_eq_stock']."' and DRS_STATUS_DIC_ID in (6,7,8,30) and ENG_ID=".$_GET['eng']);
// $eng_array = sqlGetResAsArray("select DRS_ID,DRS_SN_NUMBER,DRS_STATUS_DIC_ID,DRS_RESOURCES_DIC_ID,ENG_ID,ENG_NAME,ENG_VOLTAGE,ENG_POWER,(select WLL_NAME from seg_wells where WLL_ID=(select RWL_WLL_ID from seg_well_pump_eng_rel where RWL_ENG_DRS_ID=DRS_ID limit 1)) WLL_NAME from seg_dev_resources left join seg_engines on DRS_DEV_ID=ENG_ID and DRS_DEV_TYPE=11 where DRS_DEPARTMENT = '".$_SESSION['syndis_eq_stock']."' and ENG_ID=".$_GET['eng']);
//$eng_array = sqlGetResAsArray("select DRS_ID,DRS_SN_NUMBER,DRS_STATUS_DIC_ID,DRS_RESOURCES_DIC_ID,ENG_ID,ENG_NAME,ENG_VOLTAGE,ENG_POWER,(select WLL_NAME from seg_wells where WLL_ID=(select RWL_WLL_ID from seg_well_pump_eng_rel where RWL_ENG_DRS_ID=DRS_ID limit 1)) WLL_NAME from seg_dev_resources left join seg_engines on DRS_DEV_ID=ENG_ID and DRS_DEV_TYPE=11 where DRS_RESOURCES_DIC_ID in (1,2,3,40,707) and DRS_DEPARTMENT = '".$_SESSION['syndis_eq_stock']."' and ENG_ID=".$_GET['eng']);
for($i=0;$i