<?php
include '../connect.php';
$id=$_POST['intern_id'];
$program_id=$_POST['program_id'];
$capacity=$_POST['Capacity'];
$sql="UPDATE program_intern SET status='accepted' WHERE intern_id=$id AND status='pending'";
$query="UPDATE program SET currentCapacity=$capacity+1 WHERE id=$program_id";
$_result=mysqli_query($con,$query);
$result=mysqli_query($con,$sql);
if($result){
    echo "Accepted";
}
else{
echo mysqli_error($con);
}
?>