<?php
include('config.php');
$id = $_GET['id'];
$request=$_GET['request'];
 
if($request=='nri_2024'){
    if(isset($id)){
        $sql="SELECT * FROM nri_2024 WHERE id='$id'";
        $result=mysqli_query($conn, $sql);
        $numrows=mysqli_num_rows($result);
       
        if($numrows > 0){
            $fetchArr=mysqli_fetch_array($result);
            $name=$fetchArr['fname'].' '.$fetchArr['lname'];
            $newsql = "UPDATE nri_2024 SET status='2' WHERE id='$id' ";
            $newquery=mysqli_query($conn, $newsql);
            if($newquery){
                echo "<script type='text/javascript'>
                        alert('$name Deleted Successfully. Thank you.');
                        window.location.href='https://avcampusadmissions.com/admin/dashboard1.php';
                    </script>"; 
            }else{
                 echo "<script type='text/javascript'>
                    alert('Please try after sometime. Thank you.');
                    window.location.href='https://avcampusadmissions.com/admin/dashboard1.php';
                </script>"; 
            }
        }
    }else{
         echo "<script type='text/javascript'>
            alert('Please try after sometime. Thank you.');
            window.location.href='https://avcampusadmissions.com/admin/dashboard1.php';
        </script>"; 
    }
    
}

