<?php 
	session_start();
	$user_id=$_SESSION['LOGIN_USERID'];
	include("../../php_crud/my_class.php");
	$obj = new my_class();
	extract($_GET); 
	//print_r($_GET);
	
	$district_info = $obj->Details_By_Cond("AQUATIC.TBLGWH_DISTRICTINFO@AQUATIC227","ID='$sel_id'");
	$sel_div_id = $district_info['DIVISIONCODE'];
	$sel_sub_div_id = $district_info['SUBDIVISIONCODE'];
	
	
?>
<input type="hidden" name="e_sel_id" id="e_sel_id" value="<?php echo $sel_id; ?>" >
<div class="row-fluid">
	<div class="row-fluid">
		<div class="span12">	
			<div class="control-group">
				<label class="control-label" for="form-field-1"><b>Division <font color="#FF0000">*</font></b></label>
				<div class="controls">
					<select style="width: 98%;" class="form_control" name="e_division_code" id="e_division_code" onchange="e_load_sub_div(this.value)">
						<option value="">Select Division</option>
						<?php
							$table_name = "AQUATIC.TBLGWH_DIVISIONINFO@AQUATIC227";
							$where_cond = "FLAG='A' ORDER BY DIVISIONNAME ASC";
							$row = $obj->View_all_data_row_column_By_Cond($table_name,' * ',$where_cond);
							foreach($row AS $index=>$value){
								$is_selected = "";
								if($value['ID']==$sel_div_id){
									$is_selected = "selected";
								}
						?>
								<option value="<?php echo $value['ID']; ?>" <?php echo $is_selected; ?> ><?php echo $value['DIVISIONNAME'];?></option>
							<?php }
						?>
					</select>
				</div> 
			</div>
		</div>
	</div>
	<div class="row-fluid">
		<div class="span12">
			<div class="control-group">
				<label class="control-label" for="form-field-1"><b>Sub Division <font color="#FF0000">*</font></b></label>
				<div class="controls" id="e_sub_div_list_holder">
					<select style="width: 98%;" class="form_control" name="sub_division_code" id="sub_division_code">
						<option value="">Select Sub Division</option>
						<?php
							$table_name = "AQUATIC.TBLGWH_SUBDIVISIONINFO@AQUATIC227";
							$where_cond = "DIVISIONCODE='$sel_div_id' AND FLAG='A' ORDER BY SUBDIVISIONNAME ASC";
							$row = $obj->View_all_data_row_column_By_Cond($table_name,' * ',$where_cond);
							foreach($row AS $index=>$value){
								$is_selected = "";
								if($value['ID']==$sel_sub_div_id){
									$is_selected = "selected";
								}
						?>
								<option value="<?php echo $value['ID']; ?>" <?php echo $is_selected; ?> ><?php echo $value['SUBDIVISIONNAME'];?></option>
							<?php }
						?>
					</select>
				</div> 
			</div>
		</div>
	</div>
	<div class="row-fluid">
		<div class="span12">
			<div class="control-group">
				<label class="control-label" for="form-field-1"><b>District Code <font color="#FF0000">*</font></b></label>
				<div class="controls">
					<input style="width: 98%;"  type="text" name="e_district_code" id="e_district_code" class="form-control" placeholder="District Code" value="<?php echo $district_info['DISTRICTCODE']; ?>" >
				</div> 
			</div>
		</div>
	</div>
	<div class="row-fluid">
		<div class="span12">
			<div class="control-group">
				<label class="control-label" for="form-field-1"><b>District Name <font color="#FF0000">*</font></b></label>
				<div class="controls">
					<input style="width: 98%;"  type="text" name="e_district_name" id="e_district_name" class="form-control" placeholder="District Name" value="<?php echo $district_info['DISTRICTNAME']; ?>" >
				</div> 
			</div>
		</div>
	</div>
</div>