<?php
include_once '../session/admin-session.php';
include_once '../classes/class_admin.php';
include_once '../classes/validation.php';
include_once '../classes/common.php';
include_once 'read-configration.php';

ob_start();

$ObjDB = new class_db();
$log = new common();
$objadm = new class_admin();
$val = new validation();

$LATEMSG = "";
$stu_roll = $val->ValidateString($_REQUEST["stu_roll"]);
$admin_roll = $_SESSION['user_sesroll'];
$display = 'none';

$objadm->roll_number = $stu_roll;
$RollNumberArr = $objadm->GetStudentDetailsbyRollNumber();
$row = mysqli_fetch_array($RollNumberArr);
$batch = $row["batch"] ;
$reg_file = "isr_reg_".$batch."_tbl";
$datetime = date("Y-m-d H:i:s");

$query="UPDATE isr_stu_main_tbl SET sem_now = '4', reg_status = 'C', cgpa_OK = 'N' WHERE roll = '$stu_roll'";
$ObjDB->sproc_name = $query;
$ObjDB->ExecuteQuery();


$query ="delete from $reg_file where sem = '5' and stu_roll = '$stu_roll'";
$ObjDB->sproc_name = $query;
$ObjDB->ExecuteQuery();

$LATEMSG = "$stu_roll is deregistered";
 	
$activity = "$stu_roll reg opened $last_date";
$query1= "INSERT INTO actions (roll, activity, datetime) VALUES('".$admin_roll."','".$activity."','".$datetime."')";
	
?>

<div class="container-fluid">
    <div class="row">
        <div class="col-xl-12 col-xxl-12 col-sm-12">
            <div class="card">
                <div class="card-header">
                    <h5 class="card-title">De-Register Status</h5>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-lg-12">
                            <span style="color: green;"><?php echo $LATEMSG; ?></span>
                        </div>
                        <div class="col-lg-12">
                            <a href="control-permit-late-reg.php">Return To De-Register</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php
$pagemaincontent = ob_get_contents();
ob_clean();
$PAGENAME = 'control-de-register-save';
$HTMLTITLE = '';
$HTMLDESCRIPTION = '';
$HTMLKEYWORDS = '';
include("admin-master.php");
?>