<?php
	include "db_connection/db_connection.php";
	include "config/config.php";
	
	
	$SLCT = "SELECT * FROM billing_det_test ORDER BY billing_det_id ASC";
	$QURY = mysqli_query($connect,$SLCT);

	while($FTCH = mysqli_fetch_object($QURY))
	{

		if($FTCH->bill_tax_lable == "IGST")
		{
			echo "IGST";
			echo "<br>";
			echo
			$bill_tot_tax_amt = $FTCH->bill_tax_amt;
			echo "<br>";
		}
		else if($FTCH->bill_tax_lable == "SGST,  CGST")
		{
			echo "SGST, IGST";
			echo "<br>";
			$bill_tax_amt	  = split(", ", $FTCH->bill_tax_amt);
			echo
			$bill_tot_tax_amt = $bill_tax_amt[0] * 2;
			echo "<br>";
		}
		else
		{	
			echo "NULL";
			echo "<br>";
			echo
			$bill_tot_tax_amt = $FTCH->bill_tax_amt;
			echo "<br>";
		}

		echo $UPDATE = "UPDATE billing_det_test SET bill_tot_tax_amt = '$bill_tot_tax_amt' WHERE billing_det_id = $FTCH->billing_det_id";
		mysqli_query($connect,$UPDATE);
	}
?>