<?php

   include('connect.php');
   include('logging.php');

if( isset( $_POST['benefitid'] ) )
{

$benefitid=$_POST['benefitid'];
$benefitflag=$_POST['benefitflag'];

$flag = '0';

if ($benefitflag == 'Yes') {
    $flag = '1';
} else if ($benefitflag == 'No') {
    $flag = '0';
}

//echo $flag;


	$updateprgf=" UPDATE benefits 
	SET prgf_flag = '$flag'
	WHERE benefitid = $benefitid;";

	if(mysqli_query($db, $updateprgf)) {
      	echo 'Benefit Table Updated successfully';
      } else {
         echo "Error: " . mysqli_error($db);
    }

    

} 
?>