
<?php
include 'include/db.php';
//echo '<pre>';
//print_r($_REQUEST);
$id=$_REQUEST['id'];
$refferal_bv=$_REQUEST['refferal_bv'];
$binary_bv=$_REQUEST['binary_bv'];
$performance_bonus=$_REQUEST['performance_bonus'];
$salary=$_REQUEST['salary'];
$pension_one_time=$_REQUEST['pension_one_time'];
$achivement_bonus=$_REQUEST['achivement_bonus'];

    for($i=0;$i<sizeof($id);$i++)
    {
        $query="update member_benefit set refferal_bv='$refferal_bv[$i]',binary_bv='$binary_bv[$i]',performance_bonus='$performance_bonus[$i]',salary='$salary[$i]',pension_one_time='$pension_one_time[$i]',achivement_bonus='$achivement_bonus[$i]' where member_benefit_id='$id[$i]'  ";
        $connection=mysqli_query($conn,$query);
        if($connection)
        {
            //echo 'Updated successfully';
            $msg='Updated successfully';
        }
        else
        {
            //echo 'Not updated';
            $msg='Not updated';
        }
    }
    echo '<script> alert("'.$msg.'"); window.location="refferal_amount.php"; </script>';
    

?>