<?php
session_start();
include "../../db.php";

if(isset($_POST['id']) && isset($_POST['status'])){
    $id = intval($_POST['id']);
    $status = mysqli_real_escape_string($con, $_POST['status']);

    $update = mysqli_query($con, "UPDATE student_admissions SET admission_status='$status' WHERE id='$id' AND admin_id='".$_SESSION['uid']."'");

    if($update){
        echo "success";
    } else {
        echo "error";
    }
} else {
    echo "error";
}
?>