<?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();

if($_POST['fac_status_btn']){
    $fac_code = $val->ValidateString($_REQUEST['fac_code']);
    $fac_new_status = $val->ValidateString($_REQUEST['fac_status']);
    
    	if($fac_new_status != '') {
		
            $qup = "update isr_faculty_tbl set fac_status = '$fac_new_status' where roll = '$fac_code'";
	    $ObjDB->sproc_name = $qup;
            $ObjDB->ExecuteQuery();
            
            header("Location: people-faculty.php");
                
	}
}

$query = $objadm->GetFacultyList();


$fac_code = $val->ValidateString($_REQUEST['fac_code']);

$objadm->fac_roll = $fac_code;



$row = mysqli_fetch_array($query);
$roll = $row['roll'];
$name = $row['name'];
$discipline = $row['dept'];
$dob = $row['dob'];
$email = $row['email'];
$fac_status = $row['fac_status'];

?>
<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">Faculty Status</h5>

                </div>
                <div class="card-body">
                    <table class="table table-bordered">
                        <tr>
                        <!--<td class=this rowspan=8><img src="<?php echo $photo; ?>" height="150" border="0" alt="">-->
                            <td class=this>Roll<td class=this><?php echo $roll; ?></a>
                        <tr><td class=this>Name<td class=this><?php echo $name; ?>
                        <tr><td class=this>Discipline<td class=this><?php echo $discipline; ?>
                        <tr><td class=this>DoB<td class=this><?php echo $dob; ?>
                        <tr><td class=this>Email<td class=this><?php echo $email; ?>
                        <tr><td class=this>Current Status<td class=this><?php echo $fac_status; ?>
                    </table><br/>
                    
                    <table border=0 cellpadding=3 cellspacing=0 class=this2 width="100%" class="table table-bordered">

<tr class=this3><td class=this2><font color="blue"><big>Select New Status</big></font>
<td class=this2 align=right>
<tr><td class=this2 colspan=2>
<form method="post" action="">
<select name="fac_status">
		<option value="" selected>  - - - Select - - -  
		<option value="Away"> Away
		<option value="Emeritus"> Emeritus
		<option value="Full"> Full 
		<option value="Left"> Left 
</select>
<input type="hidden" name="fac_code" value=<?php echo $roll; ?>>
<input type="submit" name="fac_status_btn" value="Submit">	
</form>
                    </table>
                    
                </div>
            </div>

        </div>

    </div>
</div>

<?php
$pagemaincontent = ob_get_contents();
ob_clean();
$PAGENAME = 'people-faculty-status';
$HTMLTITLE = '';
$HTMLDESCRIPTION = '';
$HTMLKEYWORDS = '';
include("admin-master.php");
?>