<?php
include('include/db.php'); // Adjust based on your setup
include('loginCheck.php');

if (isset($_POST['updateBinary'])) {
    $referralPercent = floatval($_POST['directPercent']);

    $updateQuery = "UPDATE meddolic_config_misc_setting SET directPercent = '$referralPercent'";
    if (mysqli_query($con, $updateQuery)) {
        header("Location: referralSetting.php?status=success");
    } else {
        echo "Error updating record: " . mysqli_error($con);
    }
} else {
    header("Location: referralSetting.php");
}
?>
