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

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

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