<?php
session_start();
include("../../php_crud/my_class.php");
$obj = new my_class();
extract($_GET);

$curr_date = date('d-m-Y');
$curr_date =  strtotime($curr_date);
$is_readonly = "";
$call_key_up_function = "";
?>

<style type="text/css">
  select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input {
  display: inline-block;
  height: 1px!important;
  padding: 8px 3px!important;
  margin-bottom: 2px!important;
  font-size: 13px!important;
  line-height: 23px!important;
  color: #555;
  vertical-align: middle;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
}
.table{
   width: 100%;
   margin-letf: 20%;

}
.table th, .table td {
  padding: 2px!important;
  line-height: 20px;
  text-align: left;
  vertical-align: top;
  border: none;
}
.button{
position: relative;
top: -20px;
}
.tbl{
position: relative;
top: -15px;
}
.table tr{
  border: none ;
}
</style>

<table id="gwq_data_table" class="table table-hover" >

<button type="button" style="margin-right: 1px;  font-size: 12px; float:right; " id="btn2" class="btn  btn-small btn-primary" onclick="load_new_row()"><i class="icon-plus"></i><b>Add New</b></button>
  <div class="row-fluid" style="margin-bottom:5px;">
  <div class="control-group" style="float:right;">
    <div class="controls"></div>
  </div>
</div>
<thead>
    <tr>
    <th style="text-align:center;"></th>
    <th style="text-align:center;"></th>
    <th style="text-align:center;"></th>
    </tr>
</thead>
<tbody id = "gwq_tbl_body">
  <?php
   $cond = "WELL_ID='$well_id' AND TO_CHAR(DT, 'DD-MON-YY')= '$date'";
   //echo $cond;
   $cols = "DT,TEMPERATURE,PH,EH,ELC_CNDUC,TDS,CALCIUM,MAGNESIUM,SODIUM,POTASSIUM,CHLORIDE,CARBONATE,BICARBONATE,SULPHATE,NITRATE,IRON,MANGANESE,BORON,SILICA,ARSENIC,FLUORIDE,IODIDE,CARBONDIOXIDE,DISSOLVEDOXYGEN,HARDNESS,SAR,TURBILITY,ORP,SALINITY,PHOSPHATE,BROMIDE,ALUMINIUM,COPPER,ZINC,
   CHROMIUM";

   $gwq_info = $obj->View_column_details_By_Cond("HYDROLOGY.GWQ_DATA_TBL@HYDRO10", $cols, $cond);
   $show_date =  date('d-M-y',strtotime($gwq_info['DT'])); 
   //echo $show_date;
   ////--ID--////
   $date_id = "e_date";
   $bic_id = "e_bicarbonate";
   $tur_id = "e_turbidity"; 

   $temp_id = "e_tempareture";
   $sul_id = "e_sulphate";
   $orp_id = "e_orp";

   $ph_id = "e_ph";
   $nit_id = "e_nitrate";
   $sal_id = "e_salinity";

   $eh_id = "e_eh";
   $irn_id = "e_iron";
   $pho_id = "e_phosphate";

   $ec_id = "e_ec";
   $man_id = "e_manganese";
   $bro_id = "e_bromide";

   $tds_id = "e_tds";
   $bor_id = "e_boron";
   $alu_id = "e_aluminium";

   $cal_id = "e_calcium";
   $sil_id = "e_silica";
   $cop_id = "e_copper";

   $mag_id = "e_magnisium";
   $ars_id = "e_arsenic";
   $zin_id = "e_zinc";

   $sod_id = "e_sodium";
   $flu_id = "e_fluoried";
   $cho_id = "e_chromium";

   $pot_id = "e_potassium";
   $iod_id = "e_iodide";

   $chl_id = "e_chloride";
   $car_id = "e_carbondioxide";

   $cab_id = "e_carbonate";
   $dis_id = "e_dissolvedoxygen";

   $har_id = "e_hardness";
   $sar_id = "e_sar";
   ////--ID--//// 

   ////--Value--////
   ////--Data Formating--////
   $bic_val = "";
   $tur_val = "";
   $temp_val = "";
   $sul_val = "";
   $orp_val = "";
   $ph_val = "";
   $nit_val = "";
   $sal_val = "";
   $eh_val = "";
   $irn_val = "";
   $pho_val = "";
   $ec_val = "";
   $man_val = "";
   $bro_val = "";
   $tds_val = "";
   $bor_val = "";
   $alu_val = "";
   $cal_val = "";
   $sil_val = "";
   $cop_val = "";
   $mag_val = "";
   $ars_val = "";
   $zin_val = "";
   $sod_val = "";
   $flu_val = "";
   $cho_val = "";
   $pot_val = "";
   $iod_val = "";
   $chl_val ="";
   $car_val = "";
   $cab_val = "";
   $dis_val = "";
   $har_val = "";
   $sar_val = "";
   ////--Data Formating--////
   //--Row-01--//
   $date = $date;
   if($gwq_info['BICARBONATE'] != ""){
    
      $bic_val =  number_format((float)$gwq_info['BICARBONATE'], 2, '.', '');
   }else{
      $bic_val = $gwq_info['BICARBONATE'];
   }
   if($gwq_info['TURBILITY'] != ""){
    
      $tur_val =  number_format((float)$gwq_info['TURBILITY'], 2, '.', '');
   }else{
      $tur_val = $gwq_info['TURBILITY'];
   }
   //--Row-01--//
   //--Row-02--//
   if($gwq_info['TEMPERATURE'] != ""){
    
      $temp_val =  number_format((float)$gwq_info['TEMPERATURE'], 2, '.', '');
   }else{
      $temp_val = $gwq_info['TEMPERATURE'];
   }
   if($gwq_info['SULPHATE'] != ""){
    
      $sul_val =  number_format((float)$gwq_info['SULPHATE'], 2, '.', '');
   }else{
      $sul_val = $gwq_info['SULPHATE'];
   }
   if($gwq_info['ORP'] != ""){
    
      $orp_val =  number_format((float)$gwq_info['ORP'], 2, '.', '');
   }else{
      $orp_val = $gwq_info['ORP'];
   }
   //--Row-02--//
   //--Row-03--//
   if($gwq_info['PH'] != ""){
      $ph_val =  number_format((float)$gwq_info['PH'], 2, '.', '');
   }else{
      $ph_val = $gwq_info['PH'];
   }
   if($gwq_info['NITRATE'] != ""){
      $nit_val =  number_format((float)$gwq_info['NITRATE'], 2, '.', '');
   }else{
      $nit_val = $gwq_info['NITRATE'];
   }
   if($gwq_info['SALINITY'] != ""){
      $sal_val =  number_format((float)$gwq_info['SALINITY'], 2, '.', '');
   }else{
      $sal_val = $gwq_info['SALINITY'];
   }
   //--Row-03--//

   //--Row-04--//
   if($gwq_info['EH'] != ""){
      $eh_val =  number_format((float)$gwq_info['EH'], 2, '.', '');
   }else{
      $eh_val = $gwq_info['EH'];
   }
   if($gwq_info['IRON'] != ""){
      $irn_val =  number_format((float)$gwq_info['IRON'], 2, '.', '');
   }else{
      $irn_val = $gwq_info['IRON'];
   }
   if($gwq_info['PHOSPHATE'] != ""){
      $pho_val =  number_format((float)$gwq_info['PHOSPHATE'], 2, '.', '');
   }else{
      $pho_val = $gwq_info['PHOSPHATE'];
   }
   //--Row-04--//

   //--Row-05--//
   if($gwq_info['ELC_CNDUC'] != ""){
      $ec_val =  number_format((float)$gwq_info['ELC_CNDUC'], 2, '.', '');
   }else{
      $ec_val = $gwq_info['ELC_CNDUC'];
   }
   if($gwq_info['MANGANESE'] != ""){
      $man_val =  number_format((float)$gwq_info['MANGANESE'], 2, '.', '');
   }else{
      $man_val = $gwq_info['MANGANESE'];
   }
   if($gwq_info['BROMIDE'] != ""){
      $bro_val =  number_format((float)$gwq_info['BROMIDE'], 2, '.', '');
   }else{
      $bro_val = $gwq_info['BROMIDE'];
   }
   //--Row-05--//

   //--Row-06--//
   if($gwq_info['TDS'] != ""){
      $tds_val =  number_format((float)$gwq_info['TDS'], 2, '.', '');
   }else{
      $tds_val = $gwq_info['TDS'];
   }
   if($gwq_info['BORON'] != ""){
      $bor_val =  number_format((float)$gwq_info['BORON'], 2, '.', '');
   }else{
      $bor_val = $gwq_info['BORON'];
   }
   if($gwq_info['ALUMINIUM'] != ""){
      $alu_val =  number_format((float)$gwq_info['ALUMINIUM'], 2, '.', '');
   }else{
      $alu_val = $gwq_info['ALUMINIUM'];
   }
   //--Row-06--//

   //--Row-07--//
   if($gwq_info['CALCIUM'] != ""){
      $cal_val =  number_format((float)$gwq_info['CALCIUM'], 2, '.', '');
   }else{
      $cal_val = $gwq_info['CALCIUM'];
   }
   if($gwq_info['SILICA'] != ""){
      $sil_val =  number_format((float)$gwq_info['SILICA'], 2, '.', '');
   }else{
      $sil_val = $gwq_info['SILICA'];
   }
   if($gwq_info['COPPER'] != ""){
      $cop_val =  number_format((float)$gwq_info['COPPER'], 2, '.', '');
   }else{
      $cop_val = $gwq_info['COPPER'];
   }
   //--Row-07--//

   //--Row-08--//
   if($gwq_info['MAGNESIUM'] != ""){
      $mag_val =  number_format((float)$gwq_info['MAGNESIUM'], 2, '.', '');
   }else{
      $mag_val = $gwq_info['MAGNESIUM'];
   }
   if($gwq_info['ARSENIC'] != ""){
      $ars_val =  number_format((float)$gwq_info['ARSENIC'], 2, '.', '');
   }else{
      $ars_val = $gwq_info['ARSENIC'];
   }
   if($gwq_info['ZINC'] != ""){
      $zin_val =  number_format((float)$gwq_info['ZINC'], 2, '.', '');
   }else{
      $zin_val = $gwq_info['ZINC'];
   }
   //--Row-08--//
   //--Row-09--//
   if($gwq_info['SODIUM'] != ""){
      $sod_val =  number_format((float)$gwq_info['SODIUM'], 2, '.', '');
   }else{
      $sod_val = $gwq_info['SODIUM'];
   }
   if($gwq_info['FLUORIDE'] != ""){
      $flu_val =  number_format((float)$gwq_info['FLUORIDE'], 2, '.', '');
   }else{
      $flu_val = $gwq_info['FLUORIDE'];
   }
   if($gwq_info['CHROMIUM'] != ""){
      $cho_val =  number_format((float)$gwq_info['CHROMIUM'], 2, '.', '');
   }else{
      $cho_val = $gwq_info['CHROMIUM'];
   }
   //--Row-09--//
   //--Row-10--//
   if($gwq_info['POTASSIUM'] != ""){
      $pot_val =  number_format((float)$gwq_info['POTASSIUM'], 2, '.', '');
   }else{
      $pot_val = $gwq_info['POTASSIUM'];
   }
   if($gwq_info['IODIDE'] != ""){
      $iod_val =  number_format((float)$gwq_info['IODIDE'], 2, '.', '');
   }else{
      $iod_val = $gwq_info['IODIDE'];
   }
   //--Row-10--//

   //--Row-11--//
   if($gwq_info['CHLORIDE'] != ""){
      $chl_val =  number_format((float)$gwq_info['CHLORIDE'], 2, '.', '');
   }else{
      $chl_val = $gwq_info['CHLORIDE'];
   }
   if($gwq_info['CARBONDIOXIDE'] != ""){
      $car_val =  number_format((float)$gwq_info['CARBONDIOXIDE'], 2, '.', '');
   }else{
      $car_val = $gwq_info['CARBONDIOXIDE'];
   }
   //--Row-11--//

   //--Row-12--//
   if($gwq_info['CARBONATE'] != ""){
      $cab_val =  number_format((float)$gwq_info['CARBONATE'], 2, '.', '');
   }else{
      $cab_val = $gwq_info['CARBONATE'];
   }
   if($gwq_info['DISSOLVEDOXYGEN'] != ""){
      $dis_val =  number_format((float)$gwq_info['DISSOLVEDOXYGEN'], 2, '.', '');
   }else{
      $dis_val = $gwq_info['DISSOLVEDOXYGEN'];
   }
   //--Row-12--//

   //--Row-13--//
   if($gwq_info['HARDNESS'] != ""){
      $har_val =  number_format((float)$gwq_info['HARDNESS'], 2, '.', '');
   }else{
      $har_val = $gwq_info['HARDNESS'];
   }
   if($gwq_info['SAR'] != ""){
      $sar_val =  number_format((float)$gwq_info['SAR'], 2, '.', '');
   }else{
      $sar_val = $gwq_info['SAR'];
   }
   //--Row-13--//
   ////--Value--////
   
  ?>
	<!--Row-01-->  
  <tr>
    <td style="width: 33%; font-weight: bold;">
		<table style="width: 100%;">
			<tr>
				<td style="text-align: right; width: 50%;">Date</td>
				<td style="width: 30%;"><input type="text" id="<?php echo $date_id; ?>" class="input-mini month_date gwq_date" 
					style="text-align: center; font-weight: bold; width: 98%;" value="<?php echo  $date; ?>" 
					onkeyup="call_next_val_loader_for_edit(event,'<?php echo $date_id; ?>','<?php echo $temp_id; ?>')" readonly/>
				</td>
				<td style="width: 20%;"></td>
			</tr>
		</table>
    </td>
	<td style="text-align: right; width: 33%; font-weight: bold;">Calcium Ca<sup>2+</sup>
		<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_bic"
		style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $cal_id;?>"
		value="<?php echo  $cal_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $cal_id; ?>','<?php echo $mag_id; ?>')">&nbsp;(mg/l)
    </td>
     <td style="text-align: right; width: 33%; font-weight: bold;">Arsenic As
		<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
		style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $ars_id;?>"
		value="<?php echo  $ars_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $ars_id; ?>','<?php echo $irn_id; ?>')">&nbsp;(mg/l)
    </td>    
  </tr>
<!--Row-01-->  
<!--Row-02-->  
  <tr>
    <td style="width: 33%; font-weight: bold;">
		<table style="width: 100%;">
			<tr>
				<td style="text-align: right; width: 50%;">Temperature</td>
				<td style="width: 30%;"> <input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_bic"
					style="text-align: center; font-weight: bold; width: 98%;" id="<?php echo $temp_id;?>"
					value="<?php echo  $temp_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $temp_id; ?>','<?php echo $tur_id; ?>')"> 
				</td>
				<td style="width: 20%;">&nbsp;(<sup>o</sup>C)</td>
			</tr>
		</table>
    </td> 
	<td style="text-align: right; width: 33%; font-weight: bold;">Magnesium Mg<sup>2+</sup>
		<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_bic"
		style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $mag_id;?>"
		value="<?php echo  $mag_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $mag_id; ?>','<?php echo $nit_id; ?>')">&nbsp;(mg/l)
    </td> 
	<td style="text-align: right; width: 33%; font-weight: bold;">Iron Fe<sup>+</sup>
		 <input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
		style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $irn_id;?>"
		value="<?php echo  $irn_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $irn_id; ?>','<?php echo $man_id; ?>')">&nbsp;(mg/l)
    </td>   
  </tr>
<!--Row-02-->  
<!--Row-03-->  
	<tr>
		<td style="width: 33%; font-weight: bold;">
			<table style="width: 100%;">
				<tr>
					<td style="text-align: right; width: 50%;">Turbidity</td>
					<td style="width: 30%;"> <input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
						style="text-align: center; font-weight: bold; width: 98%;" id="<?php echo $tur_id;?>"
						value="<?php echo  $tur_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $tur_id; ?>','<?php echo $ph_id; ?>')">
					</td>
					<td style="width: 20%;">&nbsp;(NTU)</td>
				</tr>
			</table>
		</td>
		<td style="text-align: right; width: 33%; font-weight: bold;">Nitrate NO<sub>3</sub><sup>-</sup>
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $nit_id;?>"
			value="<?php echo  $nit_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $nit_id; ?>','<?php echo $sul_id; ?>')">&nbsp;(mg/l)
		</td>
		<td style="text-align: right; width: 33%; font-weight: bold;">Manganese Mn<sup>2+</sup>
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $man_id;?>"
			value="<?php echo  $man_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $man_id; ?>','<?php echo $bor_id; ?>')">&nbsp;(mg/l)
		</td>
	</tr>
<!--Row-03-->  

<!--Row-04-->  
	<tr>
		<td style="width: 33%; font-weight: bold;">
			<table style="width: 100%;">
				<tr>
					<td style="text-align: right; width: 50%;">pH</td>
					<td style="width: 30%;"><input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_bic"
		style="text-align: center; font-weight: bold; width: 98%;" id="<?php echo $ph_id;?>"
		value="<?php echo  $ph_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $ph_id; ?>','<?php echo $dis_id; ?>')">
					</td>
					<td style="width: 20%;"></td>
				</tr>
			</table>
		</td> 
		<td style="text-align: right; width: 33%; font-weight: bold;">Sulphate SO<sub>4</sub><sup>2-</sup>
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $sul_id;?>"
			value="<?php echo  $sul_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $sul_id; ?>','<?php echo $pho_id; ?>')">&nbsp;(mg/l)
		</td>
		<td style="text-align: right; width: 33%; font-weight: bold;">Boron B<sup>+</sup>
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $bor_id;?>"
			value="<?php echo  $bor_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $bor_id; ?>','<?php echo $sil_id; ?>')">&nbsp;(mg/l)
		</td>
	  </tr>
<!--Row-04--> 

<!--Row-05-->  
	<tr>
		<td style="width: 33%; font-weight: bold;">
			<table style="width: 100%;">
				<tr>
					<td style="text-align: right; width: 50%;">Dissolved Oxygen (DO)</td>
					<td style="width: 30%;"><input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
		style="text-align: center; font-weight: bold; width: 98%;" id="<?php echo $dis_id;?>"
		value="<?php echo  $dis_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $dis_id; ?>','<?php echo $eh_id; ?>')"> 
					</td>
					<td style="width: 20%;">&nbsp;(mg/l)</td>
				</tr>
			</table>
		</td>
		<td style="text-align: right; width: 33%; font-weight: bold;">Phosphate PO<sub>4</sub><sup>3-</sup>
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $pho_id;?>"
			value="<?php echo  $pho_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $pho_id; ?>','<?php echo $car_id; ?>')">&nbsp;(mg/l)
		</td>
		<td style="text-align: right; width: 33%; font-weight: bold;">Silica Si<sup>+</sup>
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $sil_id;?>"
			value="<?php echo  $sil_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $sil_id; ?>','<?php echo $alu_id; ?>')">&nbsp;(mg/l)
		</td> 
	</tr>
<!--Row-05--> 

<!--Row-06-->  
	<tr>
		<td style="width: 33%; font-weight: bold;">
			<table style="width: 100%;">
				<tr>
					<td style="text-align: right; width: 50%;">ORP (Eh)</td>
					<td style="width: 30%;"><input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_bic"
		style="text-align: center;  font-weight: bold; width: 98%;" id="<?php echo $eh_id;?>"
		value="<?php echo  $eh_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $eh_id; ?>','<?php echo $ec_id; ?>')">
					</td>
					<td style="width: 20%;">&nbsp;(Mv)</td>
				</tr>
			</table>
		</td>
		<td style="text-align: right; width: 33%; font-weight: bold;">Carbondioxide CO<sub>2</sub><sup>2-</sup>
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $car_id;?>"
			value="<?php echo  $car_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $car_id; ?>','<?php echo $cab_id; ?>')">&nbsp;(mg/l)
		</td>
		<td style="text-align: right; width: 33%; font-weight: bold;">Aluminium Al
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $alu_id;?>"
			value="<?php echo  $alu_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $alu_id; ?>','<?php echo $cop_id; ?>')">&nbsp;(mg/l)
		</td>
	</tr>
<!--Row-06--> 

<!--Row-07-->  
	<tr>
		<td style="width: 33%; font-weight: bold;">
			<table style="width: 100%;">
				<tr>
					<td style="text-align: right; width: 50%;">Ec</td>
					<td style="width: 30%;"><input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_bic"
		style="text-align: center; font-weight: bold; width: 98%;" id="<?php echo $ec_id;?>"
		value="<?php echo  $ec_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $ec_id; ?>','<?php echo $tds_id; ?>')">
					</td>
					<td style="width: 20%;">&nbsp;(µS/cm)</td>
				</tr>
			</table>
		</td>
		<td style="text-align: right; width: 33%; font-weight: bold;">Carbonate CO<sub>3</sub><sup>2-</sup>
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_bic"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $cab_id;?>"
			value="<?php echo  $cab_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $cab_id; ?>','<?php echo $bic_id; ?>')">&nbsp;(mg/l)
		</td>  
		<td style="text-align: right; width: 33%; font-weight: bold;">Copper Cu
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $cop_id;?>"
			value="<?php echo  $cop_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $cop_id; ?>','<?php echo $zin_id; ?>')">&nbsp;(mg/l)
		</td>
	</tr>
<!--Row-07-->


<!--Row-08-->  
	<tr>
	   <td style="width: 33%; font-weight: bold;">
			<table style="width: 100%;">
				<tr>
					<td style="text-align: right; width: 50%;">TDS</td>
					<td style="width: 30%;"><input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_bic"
		style="text-align: center; font-weight: bold; width: 98%;" id="<?php echo $tds_id;?>"
		value="<?php echo  $tds_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $tds_id; ?>','<?php echo $sal_id; ?>')"> 
					</td>
					<td style="width: 20%;">&nbsp;(mg/l)</td>
				</tr>
			</table>

		</td> 
		<td style="text-align: right; width: 33%; font-weight: bold;">Bicarbonate HCO<sub>3</sub><sup>-</sup>
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_bic"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $bic_id;?>"
			value="<?php echo  $bic_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $bic_id; ?>','<?php echo $flu_id; ?>')">&nbsp;(mg/l)
		</td>
		<td style="text-align: right; width: 33%; font-weight: bold;">Zinc Zn
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $zin_id;?>"
			value="<?php echo  $zin_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $zin_id; ?>','<?php echo $cho_id; ?>')">&nbsp;(mg/l)
		</td> 
	  </tr>
<!--Row-08-->

<!--Row-09-->  
	<tr>
	  <td style="width: 33%; font-weight: bold;">
		<table style="width: 100%;">
				<tr>
					<td style="text-align: right; width: 50%;">Salinity</td>
					<td style="width: 30%;"><input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
		style="text-align: center; font-weight: bold; width: 98%;" id="<?php echo $sal_id;?>"
		value="<?php echo  $sal_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $sal_id; ?>','<?php echo $har_id; ?>')">
					</td>
					<td style="width: 20%;">&nbsp;(ppt)</td>
				</tr>
		</table>
	   
		</td>
		<td style="text-align: right; width: 33%; font-weight: bold;">Fluoride F<sup>-</sup>
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $flu_id;?>"
			value="<?php echo  $flu_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $flu_id; ?>','<?php echo $bro_id; ?>')">&nbsp;(mg/l)
		</td>
		<td style="text-align: right; width: 33%; font-weight: bold;">Chromium Cr
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $cho_id;?>"
			value="<?php echo  $cho_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $cho_id; ?>','<?php echo $sar_id; ?>')">&nbsp;(mg/l)
		</td>
	</tr>
<!--Row-09-->

<!--Row-10-->  
	<tr>
		<td style="width: 33%; font-weight: bold;">
			<table style="width: 100%;">
					<tr>
						<td style="text-align: right; width: 50%;">Hardness CaCO<sub>3</sub></td>
						<td style="width: 30%; padding-left: 5px;"><input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_bic"
			style="text-align: center; font-weight: bold; width: 98%;" id="<?php echo $har_id;?>"
			value="<?php echo  $har_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $har_id; ?>','<?php echo $sod_id; ?>')">
						</td>
						<td style="width: 20%;">&nbsp;(mg/l)</td>
					</tr>
			</table>
		</td>
		<td style="text-align: right; width: 33%; font-weight: bold;">Bromide Br<sup>-</sup>
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $bro_id;?>"
			value="<?php echo  $bro_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $bro_id; ?>','<?php echo $iod_id; ?>')">&nbsp;(mg/l)
		</td>   
		<td style="text-align: right; width: 33%; font-weight: bold;">SAR
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $sar_id;?>"
			value="<?php echo  $sar_val; ?>" onkeyup = "select_save_for_edit(event)">&nbsp;(mg/l)
		</td>  
	</tr>
<!--Row-10-->

<!--Row-11-->  
	<tr>
		<td style="width: 33%; font-weight: bold;">
			<table style="width: 100%;">
					<tr>
						<td style="text-align: right; width: 50%;">Sodium Na<sup>+</sup></td>
						<td style="width: 30%;"><input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_bic"
			style="text-align: center; font-weight: bold; width: 98%;" id="<?php echo $sod_id;?>"
			value="<?php echo  $sod_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $sod_id; ?>','<?php echo $pot_id; ?>')">
						</td>
						<td style="width: 20%;">&nbsp;(mg/l)</td>
					</tr>
			</table>
		</td> 
		<td style="text-align: right; width: 33%; font-weight: bold;">Iodide I<sup>2-</sup>
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_tur"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $iod_id;?>"
			value="<?php echo  $iod_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $iod_id; ?>','<?php echo $chl_id; ?>')">&nbsp;(mg/l)
		</td> 
		<td style="text-align: right; width: 33%;"></td>   
	  </tr>
<!--Row-11-->

<!--Row-12-->  
	<tr>
		<td style="width: 33%; font-weight: bold;">
			<table style="width: 100%;">
					<tr>
						<td style="text-align: right; width: 50%;">Potassium K<sup>+</sup></td>
						<td style="width: 30%;"><input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_bic"
			style="text-align: center; font-weight: bold; width: 98%;" id="<?php echo $pot_id;?>"
			value="<?php echo  $pot_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $pot_id; ?>','<?php echo $cal_id; ?>')">
						</td>
						<td style="width: 20%;">&nbsp;(mg/l)</td>
					</tr>
			</table>
		</td>
		<td style="text-align: right; width: 33%; font-weight: bold;">Chloride Cl<sup>-</sup>
			<input onkeypress="return isNumericInput(event)" type="text" class="input-mini gwq_bic"
			style="text-align: center; font-weight: bold; width: 30%;" id="<?php echo $chl_id;?>"
			value="<?php echo  $chl_val; ?>" onkeyup="call_next_val_loader_for_edit(event,'<?php echo $chl_id; ?>','<?php echo $ars_id; ?>')">&nbsp;(mg/l)
		</td>
		<td style="text-align: right; width: 33%;"></td>    
	</tr>
</tbody> 
</table>
 <div class="row-fluid" style="margin-bottom:5px;">
  <div class="control-group" style="float:right;">
    <div class="controls">
       <button id="" type="button" style="margin-right: 1px;  font-size: 12px;" 
       class="btn btn-small btn-danger" onclick="gwq_multiple_delete('<?php echo $well_id; ?>','<?php echo $date; ?>')"><i class="icon-delete"></i><b>Delete</b></button>
      <button id="gwq_sva_btn_1" type="button" style="margin-right: 1px;  font-size: 12px;" 
      class="btn btn-small btn-success " onclick="gwq_multiple_update()"><i class="icon-save"></i><b>Save</b></button>
    </div>
  </div>
</div>

<script>
function validateInput(input) {
  var regex = /(\b(on\w+)=|javascript:|(<\s*)(\/*)script)/i;
  if (input.length > 100 || regex.test(input)) {
    return false;
  }
  return true;
}
</script>

<script>
function call_next_val_loader_for_edit(event, sel_col_id,next_col_id){
  // alert('call_next_val_loader_for_edit');
   if (event.keyCode == 13 || event.keyCode == 'Enter' || event.keyCode == 'Tab') {
    //  alert(sel_col_id);
      var curr_val = $("#"+sel_col_id).val();
      //alert(next_col_id);
      
      //$("#"+sel_col_id).val(curr_val);
      $("#"+next_col_id).select();

    }
}   
function show_alert(){
    alert('You cannot enter for any day after today');
  }
</script>
<script>
function select_save_for_edit(event){
	if(event.keyCode==13 || event.keyCode == 'Enter' || event.keyCode == 'Tab'){
		//alert("select_save_for_edit");
		gwq_multiple_update();
	}
}
</script>  
 
<!-- Alpha-Numeric Checking-->
<script>
let inputReset = false; // Track whether input should be reset

function isNumericInput(event) {
const key = event.keyCode || event.which;
const keyChar = String.fromCharCode(key);

const regex = /[0-9]|\.|\-/;

// Only allow numeric, decimal, or minus sign input
if (!regex.test(keyChar)) {
  event.preventDefault();
  return false;
}

const input = event.target;
const currentValue = input.value;

// If the input already contains a decimal point or minus sign, disallow another one
if ((keyChar === "." && currentValue.indexOf(".") !== -1) || 
    (keyChar === "-" && currentValue.indexOf("-") !== -1)) {
  event.preventDefault();
  event.target.value = "";
  event.target.value += keyChar;
  return false;
}

// If input should be reset, do so and allow new input
if (inputReset) {
  input.value = "";
  inputReset = false;
}

// If the input would result in more than 2 decimal places, set inputReset flag
const parts = currentValue.split(".");
if (parts.length === 2 && parts[1].length >= 2 && keyChar !== "-") {
  event.preventDefault();
  event.target.value = "";
  event.target.value += keyChar;
  return false;
}

if (currentValue === "0" && keyChar !== "." && keyChar !== "-" && currentValue.indexOf(".") === -1) {
  event.preventDefault();
  return false;
}

return true;
}
</script>
<!-- Alpha-Numeric Checking-->