<?php
include "../db.php";

if (isset($_POST['associate_id']) && isset($_POST['employee'])) {
    $associate_id = mysqli_real_escape_string($con, $_POST['associate_id']);
    $employee = mysqli_real_escape_string($con, $_POST['employee']);

    $sql = "UPDATE users SET admin_ref = '$employee' WHERE uid = '$associate_id'";
    if (mysqli_query($con, $sql)) {
        echo "Employee updated successfully!";
    } else {
        echo "Error updating employee: " . mysqli_error($con);
    }
}
?>