<?php 
session_start();
include("../../php_crud/my_class.php");
$obj=new my_class();
$branchid = $_SESSION['LOGIN_BRANCH'];
$xx=$_POST['xx'];
$id=$_POST['id'];
$name=$_POST['name'];
?>

<tr id="<?php echo $id;?>" class="serial">
<!--<td ><?php //echo $xx;?></td>-->
<td >
<?php
$table_name = "_int_fee_head";
$column = "_id,_fee_head";
$where_cond = "_branch_id='$branchid' AND _status='A'  ";
$child_list = $obj->View_all_data_row_column_By_Cond($table_name, $column, $where_cond);


	?>
	<select id="fee_head" name="fh_name[]">
	<option value="">SELECT</option>
	
<?php
foreach($child_list AS $index1 => $child) {
	echo "<option value='".$child['_fee_head']."'>".$child['_fee_head']."</option>";
	//echo  '<option value='.$child['_id'].'>'.$child['_fee_head'].'</option>';
	echo $child['_fee_head'];
	}
?>	
</select> 
</td>
<td class="dbt"><input onkeyup="call_calculation()" type="text" name="fhamount[]" btn_id="<?php echo $id ?>"  id="fhamount_<?php echo $id ?>" ></td>
<td ></td>
<td ><button class="dlt_but" id="rem_<?php echo $id ?>" onClick="reply_click('<?php echo $id;?>')" class="asdf">remove</button></td></tr>

<script>
function reply_click(clicked_id)
{
	var sub = $.trim($('#fhamount_'+clicked_id).val());
	
	var total_amount  = $("#total_amount").val();
	var tot_amount  = $("#tot_amount").val();
	var total_sum = parseInt(total_amount) - parseInt(sub);
	var sum = parseInt(tot_amount) - parseInt(sub);
	
	$("#ttl_amount").html(total_sum);
	$("#thh").html(sum);
	$("#total_amount").val(total_sum);
	$("#tot_amount").val(sum); 
	
	var dlt  = "#"+clicked_id;
	$(dlt).remove();
	
}

</script>			