<?php

date_default_timezone_get();
require_once("includes/initialize.php");
 $alldept = EDITING:: showdept();
$output = '';
if(isset($_POST["formno"]))  
 {
    $formno = $_POST["formno"];
    $_SESSION['formno'] = $formno;
    $get = EDITING:: check_students($formno);
    foreach ($get as $rows)
    {
        $names = $rows->names;
        $dept = $rows->department;
        $status = $rows->status;
    }

}
?>
                <div class="modal-header" style="padding:20px 50px;">
              <button type="button" class="close" data-dismiss="modal" title="Close">&times;</button>
              <h3 align="center"><b>Update Candidate Form Number <?php echo $formno; ?></b></h3>
            </div>
                
             <form class="form-horizontal" action="dashboard.php?type=mform" name="form" method="post" enctype="multipart/form-data">
                    <div class="form-group">
                        <label class="col-sm-5 control-label">FULL NAME :</label>
                        <div class="col-sm-4">
                          <input type="text" name="surname" class="form-control" value="<?php echo $names;?>" placeholder="" required="required">
                        </div>
                      </div>
                      <div class="form-group">
                      <label class="col-sm-5 control-label">DEPARTMENT :</label> 
                      <div class="col-sm-4">                 
                          <select name="department" id="department" class="form-control action" style="width:150px">
                              <option value="<?php echo $dept;?>"><?php echo $dept;?></option>
                              <?php foreach($alldept as $dep){?>
                              <option value="<?php echo $dep->department;?>"><?php 
                              echo ucwords($dep->department);?></option> <?php }?>
                          </select>
                      </div>
                      </div>
                      <div class="form-group">
                        <label class="col-sm-5 control-label">STATUS :</label>
                        <div class="col-sm-4">
                        <input type="text" name="status" class="form-control" value="<?php echo $status;?>" placeholder="" required="required">
                        </div>
                      </div>
                    <div class="form-group">
                      <label class="col-sm-4 control-label"></label>
                      <div class="col-sm-8">
                        <input type="submit" name="update" class="btn btn-success" value="Update">
                      </div>
                    </div>
                  </form>
          
          