<?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();
$objadm = new class_admin();
$val = new validation();

$roll = $val->ValidateString($_REQUEST['roll2']);
$ref = $val->ValidateString($_REQUEST['ref2']);
$search_string = $val->ValidateString($_REQUEST['son2']);

$sr = sqrt($ref - 222);

$objadm->roll_number = $roll;
$objadm->sr = $sr;
$rowStudent = $objadm->GetStudentDetailsbyRollNumber();

$row = mysqli_fetch_array($rowStudent);
$status = $row['stu_status'];
$student_name = $row['name'];
if ($status == 'OK') {
    $OK_status = "checked";
    $PhD_status = "";
    $Comp_status = "";
    $COS_status = "";
    $BS_status = "";
    $MS_status = "";
    $Dip_status = "";
    $Dis_status = "";
}

if ($status == 'PhD') {
    $OK_status = "";
    $PhD_status = "checked";
    $Comp_status = "";
    $COS_status = "";
    $BS_status = "";
    $MS_status = "";
    $Dip_status = "";
    $Dis_status = "";
}

if ($status == 'Comp') {
    $OK_status = "";
    $PhD_status = "";
    $Comp_status = "checked";
    $COS_status = "";
    $BS_status = "";
    $MS_status = "";
    $Dip_status = "";
    $Dis_status = "";
}

if ($status == 'COS') {
    $OK_status = "";
    $PhD_status = "";
    $Comp_status = "";
    $COS_status = "checked";
    $BS_status = "";
    $MS_status = "";
    $Dip_status = "";
    $Dis_status = "";
}

if ($status == 'BS') {
    $OK_status = "";
    $PhD_status = "";
    $Comp_status = "";
    $COS_status = "";
    $BS_status = "checked";
    $MS_status = "";
    $Dip_status = "";
    $Dis_status = "";
}

if ($status == 'MS') {
    $OK_status = "";
    $PhD_status = "";
    $Comp_status = "";
    $COS_status = "";
    $BS_status = "";
    $MS_status = "checked";
    $Dip_status = "";
    $Dis_status = "";
}

if ($status == 'Dip') {
    $OK_status = "";
    $PhD_status = "";
    $Comp_status = "";
    $COS_status = "";
    $BS_status = "";
    $MS_status = "";
    $Dip_status = "checked";
    $Dis_status = "";
}

if ($status == 'Dis') {
    $OK_status = "";
    $PhD_status = "";
    $Comp_status = "";
    $COS_status = "";
    $BS_status = "";
    $MS_status = "";
    $Dip_status = "";
    $Dis_status = "checked";
}
?>
<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">Edit Student Details</h5>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-lg-12">
                            <form action="registration-edit-student.php" method="POST">
                            <table class="table table-bordered align-middle">
                                <tr>
                                    <td><b>Name of the Student</b></td>
                                    <td><?php echo $student_name; ?></td> 
                                </tr>
                                <tr>
                                    <td><b>Roll No</b></td>
                                    <td><?php echo $roll; ?></td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <b>Status</b>
                                        <input type="radio" name="new_status" value="OK" <?php echo $OK_status; ?>>&nbsp;&nbsp;On Roll&nbsp;&nbsp;&nbsp;&nbsp;

                                   <input type="radio" name="new_status" value="PhD" <?php echo $PhD_status; ?>>&nbsp;&nbsp;Doing PhD&nbsp;&nbsp;&nbsp;&nbsp;

                                   <input type="radio" name="new_status" value="Comp" <?php echo $Comp_status; ?>>&nbsp;&nbsp;Completed&nbsp;&nbsp;&nbsp;&nbsp;

                                   <input type="radio" name="new_status" value="COS" <?php echo $COS_status; ?>>&nbsp;&nbsp;COS Exit&nbsp;&nbsp;&nbsp;&nbsp;

                                   <input type="radio" name="new_status" value="BS" <?php echo $BS_status; ?>>&nbsp;&nbsp;BS Exit&nbsp;&nbsp;&nbsp;&nbsp;

                                   <input type="radio" name="new_status" value="MS" <?php echo $MS_status; ?>>&nbsp;&nbsp;MS Exit&nbsp;&nbsp;&nbsp;&nbsp;

                                   <input type="radio" name="new_status" value="Dip" <?php echo $Dip_status; ?>>&nbsp;&nbsp;Diploma Exit&nbsp;&nbsp;&nbsp;&nbsp;

                                   <input type="radio" name="new_status" value="Dis" <?php echo $Dis_status; ?>>&nbsp;&nbsp;Discontinued&nbsp;&nbsp;&nbsp;&nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <input type="hidden" name="roll3" value="<?php echo $roll; ?>">
                <input type="hidden" name="search_s" value="<?php echo $search_string; ?>">
                                        <input type="submit" class="btn btn-danger" style="background: #a9181b;
                                       border: #a9181b; text-align: center;" value="Submit" name="update_profile_btn"/>
                                    </td>
                                </tr>
                            </table>
                            </form>
                        </div>
                     
                    </div>
                </div>
            </div>
        </div>
    </div>

    <?php
    $pagemaincontent = ob_get_contents();
    ob_clean();
    $PAGENAME = 'registration-edit-profile';
    $HTMLTITLE = '';
    $HTMLDESCRIPTION = '';
    $HTMLKEYWORDS = '';
    include("admin-master.php");
    ?>