<?php
session_start();
// ============
include("../../asset/theme/css/myfunc.php");
include("../../php_crud/my_class.php");
$obj=new my_class();
// ============
$branchid = $_SESSION['LOGIN_BRANCH'];
extract($_GET);
//echo $sel_stat_id;
$gw_info = $obj->Details_By_Cond("HYDROLOGY.GWM_TBL@HYDRO10","WELL_ID='$well_id'");
$well_id = $well_id;
$new_id = $gw_info['OLD_ID'];
$upazila = $gw_info['UPAZILA_CODE'];
$sub_div = $gw_info['HYDSUBDIVCODE'];
$well_type = $gw_info['WELL_TYPE'];
$long = $gw_info['LONGITUDE'];
$sink_dt = $gw_info['SINK_DT'];
$lat = $gw_info['LATITUDE'];
$para_hgt = $gw_info['PARAPET_HGT'];
$c_dia = $gw_info['CASING_DIA'];
$ri_para = $gw_info['RL_PARAPET'];
$opt = $gw_info['OPT_STATUS'];
$depth = $gw_info['DEPTH'];
$str = $gw_info['STRAINER'];
$well_dia = $gw_info['WELL_DIA'];
$village = $gw_info['VILLAGE'];
$vill_m = $gw_info['VILL_MOUND'];
$site = $gw_info['SITE'];
$note = $gw_info['NOTE'];
$mob_no = $gw_info['MOBILE_NO'];
$cont_per = $gw_info['CONTACT_PERSON'];
$data_type = $gw_info['WELL_DATA_TYPE'];

$upz_info = $obj->Details_By_Cond("HYDROLOGY.UPAZILA_TBL@HYDRO10","UPZL_CODE='$upazila'");
$upz_name = $upz_info['UPZL_NAME'];
$dis_code = $upz_info['DST_CODE'];

$dis_info = $obj->Details_By_Cond("HYDROLOGY.DISTRICT_TBL@HYDRO10","DISTRICT_NO='$dis_code'");
$dis_name = $dis_info['DISTRICT_NAME'];

$sd_info = $obj->Details_By_Cond("HYDROLOGY.GW_SUBDIVCODE_TBL@HYDRO10","HYDSUBDIVCODE='$sub_div'");
$sd_name = $sd_info['SUBDIVISION_NAME'];
?>

<div class="row-fluid">
	<table style="width: 100%; border-collapse: collapse; padding-left: 5px;">
		
		<tr>
			<td colspan="5">&nbsp;&nbsp;&nbsp; </td>
		</tr>
		<tr>
			<th style="text-align: right; width: 20%;">Well ID (New ID): </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$well_id; ?></td>
			<td style="width: 4%;">&nbsp;&nbsp;&nbsp;</td>
			<th style="text-align: right; width: 20%;">Old ID: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$new_id; ?></td>
			<th style="text-align: right; width: 20%;">&nbsp;&nbsp;&nbsp;</th>
			<td style="width: 28%;">&nbsp;&nbsp;&nbsp;</td>
		</tr>
		<tr>
			<td colspan="6">&nbsp;&nbsp;&nbsp; </td>
		</tr>
		<tr>
			<th style="text-align: right; width: 20%;">Upazila(District): </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$upz_name. '('.$dis_name. ')'; ?></td>
			<td style="width: 4%;">&nbsp;&nbsp;&nbsp;</td>
			<th style="text-align: right; width: 20%;">Sub-Division: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$sub_div. '('.$sd_name. ')'; ?></td>
			<td style="width: 28%;">&nbsp;&nbsp;&nbsp;</td>
		</tr>
		<tr>
			<td colspan="6">&nbsp;&nbsp;&nbsp; </td>
		</tr>
		<tr>
			<th style="text-align: right; width: 20%;">Well Type: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$well_type; ?></td>

			<td style="width: 4%;">&nbsp;&nbsp;&nbsp;</td>
			<th style="text-align: right; width: 20%;">Well Data Type: </th>
			<?php
			$sts_name = "";
			foreach($obj->View_colmn_By_Cond("HYDROLOGY.GWM_STATION_TYPE@HYDRO10","TYPE_NAME","ID IN ($data_type)") as $sts_info){
				$sts_name .= "".$sts_info['TYPE_NAME'].",";
			}
			$sts_name = substr($sts_name,0,-1);
			?>
			<td style="width: 30%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$sts_name; ?></td>
			<td style="width: 28%;">&nbsp;&nbsp;&nbsp;</td>

			
		</tr>	
		<tr>
			<td colspan="6">&nbsp;&nbsp;&nbsp; </td>
		</tr>
		<tr>
			<th style="text-align: right; width: 20%;">Sink Dt: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$sink_dt ?></td>

			<td style="width: 4%;">&nbsp;&nbsp;&nbsp;</td>
			<th style="text-align: right; width: 20%;">Latitude: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$lat; ?></td>
			<td style="width: 28%;">&nbsp;&nbsp;&nbsp;</td>

			<!-- <td style="width: 4%;">&nbsp;&nbsp;&nbsp;</td>
			<th style="text-align: right; width: 20%;">Longitude: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$long; ?></td>
			<td style="width: 28%;">&nbsp;&nbsp;&nbsp;</td> -->
		</tr>
		<tr>
			<td colspan="6">&nbsp;&nbsp;&nbsp; </td>
		</tr>
		<tr>
			<th style="text-align: right; width: 20%;">Parapet Hgt: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$para_hgt; ?></td>

			<td style="width: 4%;">&nbsp;&nbsp;&nbsp;</td>
			<th style="text-align: right; width: 20%;">Longitude: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$long; ?></td>
			<td style="width: 28%;">&nbsp;&nbsp;&nbsp;</td>

			<!-- <td style="width: 4%;">&nbsp;&nbsp;&nbsp;</td>
			<th style="text-align: right; width: 20%;">Latitude: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$lat; ?></td>
			<td style="width: 28%;">&nbsp;&nbsp;&nbsp;</td> -->
		</tr>
		<tr>
			<td colspan="6">&nbsp;&nbsp;&nbsp; </td>
		</tr>
		<tr>
			<th style="text-align: right; width: 20%;">Rl Parapet: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$ri_para; ?></td>

			<td style="width: 4%;">&nbsp;&nbsp;&nbsp;</td>
			<th style="text-align: right; width: 20%;">Casing Dia: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$c_dia; ?></td>
			<td style="width: 28%;">&nbsp;&nbsp;&nbsp;</td>
		</tr>
		<tr>
			<td colspan="6">&nbsp;&nbsp;&nbsp; </td>
		</tr>
		<tr>
			<th style="text-align: right; width: 20%;">Depth: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$depth; ?></td>

			<td style="width: 4%;">&nbsp;&nbsp;&nbsp;</td>
			<th style="text-align: right; width: 20%;">Opt Status: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$opt; ?></td>
			<td style="width: 28%;">&nbsp;&nbsp;&nbsp;</td>
		</tr>
		<tr>
			<td colspan="6">&nbsp;&nbsp;&nbsp; </td>
		</tr>
        <tr>
			<th style="text-align: right; width: 20%;">Well Dia: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$well_dia; ?></td>

			<td style="width: 4%;">&nbsp;&nbsp;&nbsp;</td>
			<th style="text-align: right; width: 20%;">Strainer: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$str; ?></td>
			<td style="width: 28%;">&nbsp;&nbsp;&nbsp;</td>
		</tr>
		<tr>
			<td colspan="6">&nbsp;&nbsp;&nbsp; </td>
		</tr>
        <tr>
			<th style="text-align: right; width: 20%;">Vill Mound: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$vill_m; ?></td>

			<td style="width: 4%;">&nbsp;&nbsp;&nbsp;</td>
			<th style="text-align: right; width: 20%;">Village/Address: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$village; ?></td>
			<td style="width: 28%;">&nbsp;&nbsp;&nbsp;</td>
		</tr>
		<tr>
			<td colspan="6">&nbsp;&nbsp;&nbsp; </td>
		</tr>
        <tr>
			<th style="text-align: right; width: 20%;">Note: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$note; ?></td>

			<td style="width: 4%;">&nbsp;&nbsp;&nbsp;</td>
			<th style="text-align: right; width: 20%;">Site: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$site; ?></td>
			<td style="width: 28%;">&nbsp;&nbsp;&nbsp;</td>
		</tr>
		<tr>
			<td colspan="6">&nbsp;&nbsp;&nbsp; </td>
		</tr>
        <tr>
			<th style="text-align: right; width: 20%;">Contact Person: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$cont_per; ?></td>
			<td style="width: 4%;">&nbsp;&nbsp;&nbsp;</td>
			<th style="text-align: right; width: 20%;">Mobile No.: </th>
			<td style="width: 28%; border-bottom: 1px dotted;"><?php echo "&nbsp;".$mob_no; ?></td>
			<td style="width: 28%;">&nbsp;&nbsp;&nbsp;</td>
		</tr>
		<tr>
			<td colspan="6">&nbsp;&nbsp;&nbsp; </td>
		</tr>
	</table>
</div>