<?php 

error_reporting(E_ALL);
ini_set('display_errors',1);

require_once("./includes/initialize3.php");

 $alldept = EDITING::showdept();

 $mlga = EDITING::lga();
 $mState = EDITING::state();

 $mSubject = EDITING::subject();

 //print_r($mSubject);

// $user='';
// $id = $session->user_id;

// $user= ADMINACCOUNT::find_by_id($id);
// $email='';
// if (isset($_POST['btnsearch']) && !empty($_POST['btnsearch'])) {
// $email=$_POST['searchtxt'];
// $stuid= UPDATESTUACCOUNT::findid($email);
// echo "Surname: ".$stuid->surname;
// }

$_SESSION['user'] = $user->surname;
?>
           <!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>  -->
           <!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />  -->
           <!--<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>  -->
           <!--<script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script>            -->
           <!--<link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" />-->
<head> 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" /> 
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker.css" />
    
    <script>
      <!--
        var ScrollMsg= "OSCOTECH || 2019/2020 Form Editing "
        var CharacterPosition=0;
        function StartScrolling() {
        document.title=ScrollMsg.substring(CharacterPosition,ScrollMsg.length)+
        ScrollMsg.substring(0, CharacterPosition);
        CharacterPosition++;
        if(CharacterPosition > ScrollMsg.length) CharacterPosition=0;
        window.setTimeout("StartScrolling()",150); }
        StartScrolling();
      // -->
    </script>
</head>
    <body>       
		<div class="container" align="center" style="width: 100%">
			<!-- <h2 align="center">Welcome :: <?php echo ucwords($user->surname); ?> </h2><br/> -->
      <!-- <div class="container"> -->
      <div class="panel panel-primary chat-panel">
        <div class="panel-heading ">
          <h3 align="center">FORM EDITING FOR NEW APPLICATION</h3>
        </div><br/>
    	<!-- <form method="post" action="" role="form"> -->
        <form class="form-horizontal" name="form" method="post"  role="form" enctype="multipart/form-data">
          <div class="form-group input-group" align="center">
            <div class="col-lg-12 col-xs-6">
              <span class="input-group-btn">
                <input type="text" class="form-control" placeholder="FORM NUMBER OR E-MAIL "name="searchtxt" title="Enter form number or e-mail for search " autocomplete="off">
                </div>
                </div>
                
                </span>
                
                
            <!--    <div class="form-group input-group" align="center">-->
            <!--<div class="col-lg-12 col-xs-6">-->
            <!--  <span class="input-group-btn">-->
                    
            <!--       <select class="form-control" name="op">-->
                       
            <!--           <option value="name">Edit Name</option>-->
            <!--           <option value="biodata">Edit Biodata</option>-->
            <!--           <option value="academics">Edit Academics</option>-->
            <!--       </select> -->
            <!--    </span></div></div>-->
                
               
                <span>
                <input type="submit" class="btn btn-danger" name="btnsearch" value="Search" id="button-search" title="Search Student">
                <!-- <div align="center"><a href="?type=form_editing" class="btn btn-primary">Reprint</a></div> -->
                </span>
              </div>
            </div>        	
        </form>
      </div>
      <?php
        // $formno=$_REQUEST['formno'];
      if (isset($_POST['btnsearch']))
      {

       $data =$_POST['searchtxt'];  
       
       
         $table = substr($data,2,2);  
        
               switch($table){
                   
                 case 20:
                     $table='form_data';
                     break;
                     
                 case 21:
                     $table='form_data21';
                     break;
               } 
        
        // $edit_by_formno = EDITING::search_by_formno($formno);
        $edit_by_formno = EDITING::search($table, $data);
        if ($edit_by_formno)
        {        

            
       echo $pix = $edit_by_formno->pix;
          $formno = $edit_by_formno->formno;
          $_SESSION['formno'] = $formno;
          $_SESSION['acc_id'] = $edit_by_formno->acc_id;
        $surname = $edit_by_formno->surname;
        $othernames = $edit_by_formno->othernames;
        $dob = $edit_by_formno->dob;
        $nationality = $edit_by_formno->nationality;
        $state = $edit_by_formno->state;
        $lga = $edit_by_formno->lga;
        $hometown = $edit_by_formno->hometown;
        $sex = $edit_by_formno->sex;
        $maritalStatus = $edit_by_formno->marital;
        $religion = $edit_by_formno->religion;
        $phone = $edit_by_formno->phone;
        $email = $edit_by_formno->email;
        $department = $edit_by_formno->department;
        $level = $edit_by_formno->level;
        $status = $edit_by_formno->status;
        $session = $edit_by_formno->session;
        $reg_date = $edit_by_formno->date;


        $sb1 = $edit_by_formno->sub1;
        $sub = explode(":", $sb1);
        
        $sb1=$sub[0];
        $grd1 =$sub[1];
        $sb2 = $edit_by_formno->sub2;
        
        $sub2 = explode(":", $sb2);
        
         $sb2=$sub2[0];
        $grd2 =$sub2[1];
        //$grd2 = $edit_by_formno->grd2;
        $sb3 = $edit_by_formno->sub3;
        
        $sub3 = explode(":", $sb3);
        
         $sb3=$sub3[0];
        $grd3 =$sub3[1];
        //$grd3 = $edit_by_formno->grd3;
        $sb4 = $edit_by_formno->sub4;
        
        $sub4 = explode(":", $sb4);
        
         $sb4=$sub4[0];
        $grd4 =$sub4[1];
      
      
        $sb5 = $edit_by_formno->sub5;
        
        $sub5 = explode(":", $sb5);
        
         $sb5=$sub5[0];
        $grd5 =$sub5[1];
        
        // $grd5 = $edit_by_formno->grd5;
        // $sb6 = $edit_by_formno->sb6;
        // $grd6 = $edit_by_formno->grd6;
        // $sb7 = $edit_by_formno->sb7;
        // $grd7 = $edit_by_formno->grd7;
        // $sb8 = $edit_by_formno->sb8;
        // $grd8 = $edit_by_formno->grd8;
        // $sb9 = $edit_by_formno->sb9;
        // $grd9 = $edit_by_formno->grd9;
        $examno1 = $edit_by_formno->examno;
        $exam_type1 = $edit_by_formno->exam_type1;
        $exam_year1 = $edit_by_formno->examyear;
        $examno2 = $edit_by_formno->examno2;
        $exam_type2 = $edit_by_formno->exam_type2;
        $exam_year2 = $edit_by_formno->examyear2;

        $jregno = $edit_by_formno->jregno;
        $jscore = $edit_by_formno->jscore;
        $jgrd1 = $edit_by_formno->jgrd1;
        $jsb2 = $edit_by_formno->jsb2;
        $jgrd2 = $edit_by_formno->jgrd2;
        $jsb3 = $edit_by_formno->jsb3;
        $jgrd3 = $edit_by_formno->jgrd3;
        $jsb4 = $edit_by_formno->jsb4;
        $jgrd4 = $edit_by_formno->jgrd4;
        $jscore = $edit_by_formno->jscore;
        $jinstitution = $edit_by_formno->jinstitution;
        $institution = $edit_by_formno->institution;
        $grag = $edit_by_formno->grag;
        $gragD = $edit_by_formno->gragD;
        $itcompany = $edit_by_formno->itcompany;
        $dstarted = $edit_by_formno->dstarted;
        $dcompleted = $edit_by_formno->dcompleted;
        $grade2 = $edit_by_formno->grade2;
        $yr2 = $edit_by_formno->yr2;

        $poly_of_choice = $edit_by_formno->poly_of_choice;
        $company = $edit_by_formno->company;
        $purpose = $edit_by_formno->purpose;
        $from_year = $edit_by_formno->from_year;
        $to_year = $edit_by_formno->to_year;
        $type = $edit_by_formno->type;
        
        $fm = substr($formno,0,2);

      ?>
                    <div class="panel panel-default">
                        <!-- <div class="panel-heading">
                            Student Details Table
                        </div> -->
                        <!-- /.panel-heading -->
                        <div class="box-header with-border">
                          <i class="fa fa-bullhorn"></i>
                          <h2 class="box-title">Student Details Table </h2>
                        </div>
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <!--<th>Picture</th>-->
                                            <th>FORM NO</th>
                                            <th>SURNAME</th>
                                            <th>OTHER NAMES</th>
                                            <th>DEPARTMENT</th>
                                            <th>PROGRAMME</th>
                                            <th>E-Mail</th>
                                            <th>STATUS</th>
                                            <th>Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr >
                                            <!--<td><img src="<?php //echo $pix; ?>" alt="Pix" width="50px" class="hoo"></br></br>-->
                                            <!--<button type="button" data-toggle="modal" data-target="#edit" class="btn btn-success">Edit-Pix</button></td>-->
                                            <td><?php echo $formno; ?></td>
                                            <td><?php echo $surname; ?></td>
                                            <td><?php echo $othernames; ?></td>
                                            <td><?php echo $department; ?></td>
                                            <td><?php echo $level; ?></td>
                                            <td><?php echo $email; ?></td>
                                            <td><?php echo $status; ?></td>
                                            <td><button type="button" data-toggle="modal" data-target="#edit1" class="btn btn-success">Edit</button></p></td>
                                        </tr>
                                    </tbody>
                          
                                </table>
                            </div>
                            <!-- /.table-responsive -->                            
                        </div>
                        <!-- /.panel-body -->
                    </div>


                     
      <!-- Main content -->
    <!-- <section class="content"> -->
      <!-- Small boxes (Stat box) -->
      <!-- <div class="row">
        <div class="col-lg-3 col-xs-6">
          <label class="col-sm-5 control-label">Surname:</label>
            <div class="col-sm-10">
              <input type="text" name="trans" class="form-control" value="<?php echo $surname; ?>" required="required">
            </div>
        </div> -->
        <!-- ./col -->
      <!-- </div> -->


      <div class="row">
        <div class="col-md-6">
          <div class="box box-default">
            <div class="box-header with-border">
              <i class="fa fa-bullhorn"></i>

              <h3 class="box-title">Details 1</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="col-lg-4 col-xs-6 callout callout-info">
                <label class="col-sm-5 control-label">Nationality:</label><br>
                <input type="text" name="trans" class="form-control" value="<?php echo $nationality; ?>"readonly="readonly" required="required">
              </div>
              <div class="col-lg-4 col-xs-6 callout callout-info">
                <label class="col-sm-5 control-label">DoB:</label><br>
                <input type="text" name="trans" class="form-control" value="<?php echo $dob; ?>"readonly="readonly" required="required">
              </div>
              <div class="col-lg-4 col-xs-6 callout callout-info">
                <label class="col-sm-5 control-label">State:</label><br>
                <input type="text" name="trans" class="form-control" value="<?php echo $state; ?>"readonly="readonly" required="required">
              </div>
              <div class="col-lg-4 col-xs-6 callout callout-info">
                <label class="col-sm-5 control-label">LGA:</label><br>
                <input type="text" name="trans" class="form-control" value="<?php echo $lga; ?>"readonly="readonly" required="required">
              </div>
              <div class="col-lg-4 col-xs-6 callout callout-info">
                <label class="col-sm-5 control-label">HomeTown:</label><br>
                <input type="text" name="trans" class="form-control" value="<?php echo $hometown; ?>"readonly="readonly" required="required">
              </div>
              <div class="col-lg-4 col-xs-6 callout callout-info">
                <label class="col-sm-5 control-label">Gender:</label><br>
                <input type="text" name="trans" class="form-control" value="<?php echo $sex; ?>"readonly="readonly" required="required">
              </div>
              
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
        <!-- /.col -->

        <div class="col-md-6">
          <div class="box box-default">
            <div class="box-header with-border">
              <i class="fa fa-bullhorn"></i>

              <h3 class="box-title">Details 2</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="col-lg-4 col-xs-6 callout callout-info">
                <label class="col-sm-5 control-label">Religion:</label>
                <input type="text" name="trans" class="form-control" value="<?php echo $edit_by_formno->religion; ?>"readonly="readonly" required="required">
              </div>
              <div class="col-lg-4 col-xs-6 callout callout-info">
                <label class="col-sm-5 control-label">MaritalStatus:</label><br>
                <input type="text" name="trans" class="form-control" value="<?php echo $maritalStatus; ?>"readonly="readonly" required="required">
              </div>
              <div class="col-lg-4 col-xs-6 callout callout-info">
                <label class="col-sm-5 control-label">PhoneNo:</label><br>
                <input type="text" name="trans" class="form-control" value="<?php echo $phone; ?>"readonly="readonly" required="required">
              </div>
              <div class="col-lg-4 col-xs-6 callout callout-info">
                <label class="col-sm-5 control-label">Session:</label><br>
                <input type="text" name="trans" class="form-control" value="<?php echo $session; ?>"readonly="readonly" required="required">
              </div>
              <div class="col-lg-4 col-xs-6 callout callout-info">
                <label class="col-sm-5 control-label">Type:</label><br>
                <input type="text" name="trans" class="form-control" value="<?php echo $type; ?>"readonly="readonly" required="required">
              </div>
              <div class="col-lg-4 col-xs-6 callout callout-info">
                <label class="col-sm-5 control-label">Reg.Date:</label><br>
                <input type="text" name="trans" class="form-control" value="<?php echo $reg_date; ?>"readonly="readonly" required="required">
              </div>              
            </div>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
          <button type="button" data-toggle="modal" data-target="#edit2" class="btn btn-success">Edit</button></p>
        </div>
        <!-- /.col -->
      </div>
      

      <div class="panel panel-default">
        <div class="panel-heading">
            <h4>Candidate SSCE Scores</h4>
        </div>
        <!-- /.panel-heading -->

        
        <div class="callout callout-info">
          <div class="box-body">
            <div class="col-lg-6 col-xs-6">
              <label class="col-sm-5 control-label">ExamNo 1:</label><br>
              <input type="text" name="trans" class="form-control" value="<?php echo $examno1; ?>" readonly="readonly" required="required">
            </div>
            <!--<div class="col-lg-4 col-xs-6 ">-->
            <!--  <label class="col-sm-5 control-label">ExamType1:</label><br>-->
            <!--  <input type="text" name="trans" class="form-control" value="<?php //echo $exam_type1; ?>" readonly="readonly" required="required">-->
            <!--</div>-->
            <div class="col-lg-6 col-xs-6">
              <label class="col-sm-5 control-label">ExamYear 1:</label><br>
              <input type="text" name="examyear" class="form-control" value="<?php echo $exam_year1; ?>"readonly="readonly" required="required">
            </div>
            <div class="col-lg-6 col-xs-6 ">
              <label class="col-sm-5 control-label">ExamNo 2:</label><br>
              <input type="text" name="trans" class="form-control" value="<?php echo $examno2; ?>"readonly="readonly" required="required">
            </div>
            <!--<div class="col-lg-4 col-xs-6">-->
            <!--  <label class="col-sm-5 control-label">ExamType2:</label><br>-->
            <!--  <input type="text" name="trans" class="form-control" value="<?php //echo $exam_type2; ?>"readonly="readonly" required="required">-->
            <!--</div>-->
            <div class="col-lg-6 col-xs-6">
              <label class="col-sm-5 control-label">ExamYear2:</label><br>
              <input type="text" name="trans" class="form-control" value="<?php echo $exam_year2; ?>"readonly="readonly" required="required">
            </div>
          </div>
            <div class="dataTable_wrapper">
                <table class="table table-bordered table-hover">
                    <thead>
                        <tr>
                            <th>Subject 1| Grade</th>
                            <th>Subject 2| Grade</th>
                            <th>Subject 3| Grade</th>            
                            <th>Subject 4| Grade</th>
                            <th>Subject 5| Grade</th>
                            <!--<th>Subject 6| Grade</th>-->
                            <!--<th>Subject 7| Grade</th>-->
                            <!--<th>Subject 8| Grade</th>-->
                            <!--<th>Subject 9| Grade</th>-->
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr >
                            <td><?php echo $sb1.'|'.$grd1; ?></td>
                            <td><?php echo $sb2.'|'.$grd2; ?></td>
                            <td><?php echo $sb3.'|'.$grd3; ?></td>
                            <td><?php echo $sb4.'|'.$grd4; ?></td>
                            <td><?php echo $sb5.'|'.$grd5; ?></td>
                            <!--<td><?php //echo $sb6.'|'.$grd6; ?></td>-->
                            <!--<td><?php //echo $sb7.'|'.$grd7; ?></td>-->
                            <!--<td><?php //echo $sb8.'|'.$grd8; ?></td>-->
                            <!--<td><?php //echo $sb9.'|'.$grd9; ?></td>-->
                            <td><button type="button" data-toggle="modal" data-target="#edit3" class="btn btn-success">Edit</button></p></td>
                            </tr>
                    </tbody>
          
                </table>
            </div>
            <!-- /.table-responsive -->                            
        </div>
        <!-- /.panel-body -->
    </div>

    <?php
    
      if (($fm == 'PU') OR ($fm == 'DP'))
      {
        ?>
          <div class="panel panel-default">
          <div class="panel-heading">
              <h4>Candidate JAMB Scores</h4>
          </div>
          <!-- /.panel-heading -->          
          <div class="callout callout-info">
              <div class="dataTable_wrapper">
                  <table class="table table-bordered table-hover">
                      <thead>
                          <tr>
                              <th>JAMB Reg. No</th>
                              
                              <th>JAMB Score</th>
                              <th>Institution of Choice</th>
                              <th>Action</th>
                          </tr>
                      </thead>
                      <tbody>
                          <tr >
                              <td><?php echo $jregno; ?></td>
                               <td><?php echo $jscore; ?></td>
                             <td><?php echo $jinstitution; ?></td>
                              
                             
                              <td><button type="button" data-toggle="modal" data-target="#edit4" class="btn btn-success">Edit</button></p></td>
                            </tr>
                      </tbody>
            
                  </table>
              </div>
              <!-- /.table-responsive -->                            
          </div>
          <!-- /.panel-body -->
      </div>

        <?php
      }
    
    ?>  

<?php
      if ($fm == 'FT')
      {
        ?>

      <div class="panel panel-default">
          <div class="panel-heading">
              <h4>Candidate <b>National Diploma</b> Details </h4>
          </div>
          <!-- /.panel-heading -->          
          <div class="callout callout-info">
              <div class="dataTable_wrapper">
                  <table class="table table-bordered table-hover">
                      <thead>
                          <tr>
                              <th>College</th>
                              <!--<th>Programme</th>-->
                              <th>Class</th>            
                              <th>Year Graduated</th>
                              <!--<th>Institution (JAMB)</th>-->
                              <!--<th>Reg. No (JAMB)</th> -->
                              <!--<th>JAMB Score</th>-->
                              <th>Action</th>
                          </tr>
                      </thead>
                      <tbody>
                          <tr >
                              <td><?php echo $institution; ?></td>
                              <td><?php echo $grag; ?></td>
                              <td><?php echo $gragD; ?></td>
                             
                              <td><button type="button" data-toggle="modal" data-target="#edit5" class="btn btn-success">Edit</button></p></td>
                            </tr>
                      </tbody>
            
                  </table>
              </div>
              <!-- /.table-responsive -->                            
          </div>
          <!-- /.panel-body -->
      </div>

      <div class="panel panel-default">
          <div class="panel-heading">
              <h4>Candidate <b>IT</b> Details </h4>
          </div>
          <!-- /.panel-heading -->          
          <div class="callout callout-info">
              <div class="dataTable_wrapper">
                  <table class="table table-bordered table-hover">
                      <thead>
                          <tr>
                              <th>Company</th>
                             
                              <th>From</th>            
                              <th>To</th>
                              <th>Action</th>
                          </tr>
                      </thead>
                      <tbody>
                          <tr >
                             <td><?php echo $itcompany; ?></td>
                             
                              <td><?php echo $dstarted; ?></td>
                              <td><?php echo $dcompleted; ?></td>
                              <td><button type="button" data-toggle="modal" data-target="#edit6" class="btn btn-success">Edit</button></p></td>
                            </tr>
                      </tbody>
            
                  </table>
              </div>
              <!-- /.table-responsive -->                            
          </div>
          <!-- /.panel-body -->
          <div align="center">
<a href="?type=show_details" class="btn btn-primary">Print Form</a></div>
      </div>
      
      
      <?php
      }
    
    ?>  


<?php } else {?>
  <div class="panel panel-default">
  <div class="panel-heading">
      No Record for FORM NUMBER: <?php echo $formno?>
  </div>
  </div>
  <?php
  }
 } ?>


<div class="modal fade" id="edit" role="dialog">
        <div class="modal-dialog">
        
          <!-- Modal content-->
          <div class="modal-content">
            <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 PIC for Form Number <?php echo $formno; ?></b></h3>
            </div>
            <div class="modal-body" style="padding:10px 50px;">

              <form class="form-horizontal" action="dashboard.php?type=update_form" name="form" method="post" enctype="multipart/form-data">
                <input type="file" name="pix" id="pix">

                <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>

            </div>
          </div>
        </div>
      </div>


 <!-- this modal is for UPDATES -->
 <div class="modal fade" id="edit1" role="dialog">
        <div class="modal-dialog">
        
          <!-- Modal content-->
          <div class="modal-content">
            <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>
            <div class="modal-body" style="padding:10px 50px;">

              <form class="form-horizontal" action="dashboard.php?type=update_form" name="form" method="post" enctype="multipart/form-data">
                <!--<input type="file" name="pix" id="pix"><input type="text" name="pic" class="form-control" readonly="readonly" value="<?php //echo $pix;?>">-->
                
                <br />
                <div class="form-group">
                    <label class="col-sm-5 control-label">SURNAME :</label>
                    <div class="col-sm-4">
                      <input type="text" name="surname" class="form-control" value="<?php echo $surname;?>" placeholder="" required="required">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">Other NAMES :</label>
                    <div class="col-sm-4">
                    <input type="text" name="othername" class="form-control" value="<?php echo $othernames;?>" 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="update1" class="btn btn-success" value="Update">
                  </div>
                </div>
              </form>

            </div>
          </div>
        </div>
      </div>


      <div class="modal fade" id="edit2" role="dialog">
        <div class="modal-dialog">
        
          <!-- Modal content-->
          <div class="modal-content">
            <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 Details with Form Number <?php echo $formno; ?></b></h3>
            </div>
            <div class="modal-body" style="padding:10px 50px;">

              <form class="form-horizontal" action="dashboard.php?type=update_form" name="form" method="post" enctype="multipart/form-data">

              <div class="form-group">
                    <label class="col-sm-5 control-label">Religion :</label>
                    <div class="col-sm-4">
                    <select name="reli" id="reli" class="form-control action" style="width:150px">
                          <option value="<?php echo $religion;?>"><?php echo $religion;?></option>
                          <option value="Christianity">Christianity</option>
                            <option value="Islam">Islam</option>
                            <option value="Others">Others</option>
                      </select>
                    </div>
                  </div> 
                  <div class="form-group">
                    <label class="col-sm-5 control-label">MaritalStatus :</label>
                    <div class="col-sm-4">
                    <input type="text" name="matsta" class="form-control" value="<?php echo $maritalStatus;?>" placeholder="" required="required">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">Gender :</label>
                    <div class="col-sm-4">
                        <select name="sex" id="sex" class="form-control action" style="width:150px">
                          <option value="<?php echo $sex;?>"><?php echo $sex;?></option>
                          <option value="Male">Male</option>
                            <option value="Female">Female</option>
                      </select>
                    </div>
                  </div><div class="form-group">
                    <label class="col-sm-5 control-label">PhoneNo :</label>
                    <div class="col-sm-4">
                    <input type="text" name="phone" class="form-control" value="<?php echo $phone;?>" placeholder="" required="required">
                    </div>
                  </div>
                  <!--<div class="form-group">-->
                  <!--  <label class="col-sm-5 control-label">ProgrammeType :</label>-->
                  <!--  <div class="col-sm-4">-->
                  <!--  <input type="text" name="type" class="form-control" value="<?php //echo $type;?>" placeholder="" required="required">-->
                  <!--  </div>-->
                  <!--</div>-->
              <div class="form-group">
                    <label class="col-sm-5 control-label">Nationality :</label>
                    <div class="col-sm-4">                    
                    <input type="text" name="nat" class="form-control" value="<?php echo $nationality;?>" placeholder="" required="required">
                    </div>
                  </div>
                  <div class="form-group">
                    <!-- <label class="col-sm-5 control-label">DoB :</label> -->
                    <!-- <div class="col-sm-4">
                    <input type="text" name="dob" class="form-control" value="<?php echo $dob;?>" placeholder="" required="required">
                    </div> -->
                    <div class="input-append date" id="datepicker1">
                      <label class="col-sm-5 control-label">DoB :</label>
                      <div class="col-sm-4">
                        <input class="form-control" size="16" type="text" name="dob" value="<?php echo $dob;?>" placeholder="yyyy-mm-dd" required="required">
                        <span class="add-on"><i class="icon-th"></i></span>
                      </div>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">State :</label>
                    <div class="col-sm-4">
                    <select name="state" id="state" class="form-control action" style="width:150px">
                          <option value="<?php echo $state;?>"><?php echo $state;?></option>
                          <?php foreach($mState as $row){?>
                          <option value="<?php echo $row->name;?>"><?php 
                          echo ucwords($row->name);?></option> <?php }?>
                      </select>
                    </div>
                  </div>
                  <div class="form-group">
                  <label class="col-sm-5 control-label">LGA :</label> 
                  <div class="col-sm-4">                 
                      <select name="lga" id="lga" class="form-control action" style="width:150px">
                          <option value="<?php echo $lga;?>"><?php echo $lga;?></option>
                          <?php foreach($mlga as $row){?>
                          <option value="<?php echo $row->name;?>"><?php 
                          echo ucwords($row->name);?></option> <?php }?>
                      </select>
                  </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">HomeTown :</label>
                    <div class="col-sm-4">
                    <input type="text" name="home" class="form-control" value="<?php echo $hometown;?>" 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="update2" class="btn btn-success" value="Update">
                  </div>
                </div>
              </form>

            </div>
          </div>
        </div>
      </div>





      <div class="modal fade" id="edit3" role="dialog">
        <div class="modal-dialog">
        
          <!-- Modal content-->
          <script type="text/javascript" src="javascripts/subjects.js"></script>
          <div class="modal-content">
            <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 SSCE Candidate With Form Number: <?php echo $formno; ?></b></h3>
            </div>
            <div class="modal-body" style="padding:10px 50px;">

              <form class="form-horizontal" action="dashboard.php?type=update_form" name="form" method="post" enctype="multipart/form-data">
                
            <div class="form-group">
              <label class="col-sm-5 control-label">ExamNo 1:</label>
              <div class="col-sm-4">
                <input type="text" name="examno" class="form-control" value="<?php echo $examno1; ?>" required="required">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-5 control-label">ExamType1:</label>
              <div class="col-sm-4">
                <select class="form-control" name="exam_type1"  id="exam_type1" tabindex="19">
                  <option value="<?php echo $exam_type1; ?>"><?php echo $exam_type1;?></option>
                  <option value="MAY/JUN WAEC SSCE"> MAY/JUN WAEC SSCE</option>
                  <option value="JUN/JUL NECO SSCE">JUN/JUL NECO SSCE</option>
                  <option value="NOV/DEC WAEC SSCE">NOV/DEC WAEC SSCE</option>
                  <option value="NOV/DEC NECO SSCE">NOV/DEC NECO SSCE</option>
                  <option value="NABTEB MAY/JUNE">NABTEB MAY/JUNE</option>
                  <option value="NABTEB NOV/DEC">NABTEB NOV/DEC</option>
                </select>
              </div>
            </div>
            <div class="form-group">
              <!-- <label class="col-sm-5 control-label">ExamYear 1:</label> -->
              <!-- <div class="col-sm-4"> -->
              <div class="input-append date" id="datepicker">
                      <label class="col-sm-5 control-label">ExamYear 1 :</label>
                      <div class="col-sm-4">
                        <input class="form-control" size="16" type="text" name="examyear" value="<?php echo $exam_year1;?>" placeholder="yyyy" required="required">
                        <span class="add-on"><i class="icon-th"></i></span>
                      </div>
                    </div>
                    <!-- <select class="form-control" name="exam_year1"  id="exam_year1" tabindex="20"></select>
                      <script language="javascript">print_year("exam_year1");</script> -->
                    <!-- <script language="javascript">print_year("exam_year1");</script> -->
                <!-- <input type="text" name="trans" class="form-control" value="<?php //echo $examno1; ?>" required="required"> -->
              <!-- </div> -->
            </div>
            <div class="form-group">
              <label class="col-sm-5 control-label">ExamNo 2:</label>
              <div class="col-sm-4">
                <input type="text" name="examno2" class="form-control" value="<?php echo $examno2; ?>">
            </div>
            </div>
            <div class="form-group">
              <label class="col-sm-5 control-label">ExamType2:</label>
              <div class="col-sm-4">
              <select class="form-control" name="exam_type2"  id="exam_type2" tabindex="19">
              <option value="<?php echo $exam_type2; ?>"> <?php echo $exam_type2; ?></option>
                  <option value="MAY/JUN WAEC SSCE"> MAY/JUN WAEC SSCE</option>
                  <option value="JUN/JUL NECO SSCE">JUN/JUL NECO SSCE</option>
                  <option value="NOV/DEC WAEC SSCE">NOV/DEC WAEC SSCE</option>
                  <option value="NOV/DEC NECO SSCE">NOV/DEC NECO SSCE</option>
                  <option value="NABTEB MAY/JUNE">NABTEB MAY/JUNE</option>
                  <option value="NABTEB NOV/DEC">NABTEB NOV/DEC</option>
                </select>
            </div>
            </div>
            <div class="form-group">
              <div class="input-append date" id="datepicker2">
                <label class="col-sm-5 control-label">ExamYear 2 :</label>
                <div class="col-sm-4">
                  <input class="form-control" size="16" type="text" name="exam_year2" value="<?php echo $exam_year2;?>" placeholder="yyyy">
                  <span class="add-on"><i class="icon-th"></i></span>
                </div>
              </div>
            </div>


            <div class="form-group">
              <label class="col-sm-5 control-label"><?php echo 'Subject 1'; ?>:</label>
              <div class="col-sm-4">
                <input type="text" name="sb1" class="form-control" value="<?php echo $sb1; ?>" readonly>
                <input type="text" name="grd1" class="form-control" value="<?php echo $grd1; ?>" required="required">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-5 control-label"><?php echo 'Subject 2'; ?>:</label>
              <div class="col-sm-4">
                <input type="text" name="sb2" class="form-control" value="<?php echo $sb2; ?>" readonly> 
                <input type="text" name="grd2" class="form-control" value="<?php echo $grd2; ?>" required="required">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-5 control-label"><?php echo 'Subject 3'; ?>:</label>
              <div class="col-sm-4">
                <select name="sb3" class="form-control action" style="width:150px">
                    <option value="<?php echo $sb3;?>"><?php echo $sb3;?></option>
                    <?php foreach($mSubject as $row){?>
                    <option value="<?php echo $row->name;?>"><?php 
                    echo ucwords($row->name);?></option> <?php }?>
                </select> 
                <input type="text" name="grd3" class="form-control" value="<?php echo $grd3; ?>" required="required">
            </div>
            </div>
            <div class="form-group">
              <label class="col-sm-5 control-label"><?php echo 'Subject 4'; ?></label>
              <div class="col-sm-4">
              <select name="sb4" class="form-control action" style="width:150px">
                    <option value="<?php echo $sb4;?>"><?php echo $sb4;?></option>
                    <?php foreach($mSubject as $row){?>
                    <option value="<?php echo $row->name;?>"><?php 
                    echo ucwords($row->name);?></option> <?php }?>
                </select>
                <input type="text" name="grd4" class="form-control" value="<?php echo $grd4; ?>" required="required">
            </div>
            </div>
            <div class="form-group">
              <label class="col-sm-5 control-label"><?php echo 'Subject 5'; ?>:</label>
              <div class="col-sm-4">
              <select name="sb5" class="form-control action" style="width:150px">
                    <option value="<?php echo $sb5;?>"><?php echo $sb5;?></option>
                    <?php foreach($mSubject as $row){?>
                    <option value="<?php echo $row->name;?>"><?php 
                    echo ucwords($row->name);?></option> <?php }?>
                </select>
                <input type="text" name="grd5" class="form-control" value="<?php echo $grd5; ?>" 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="update3" class="btn btn-success" value="Update">
                  </div>
                </div>


          </form>

            </div>
          </div>
        </div>
      </div>




      <div class="modal fade" id="edit4" role="dialog">
        <div class="modal-dialog">
        
          <!-- Modal content-->
          <div class="modal-content">
            <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 JAMB Details for Candidate with Form Number <?php echo $formno; ?></b></h3>
            </div>
            <div class="modal-body" style="padding:10px 50px;">

              <form class="form-horizontal" action="dashboard.php?type=update_form" name="form" method="post" enctype="multipart/form-data">

                <div class="form-group">
                    <label class="col-sm-5 control-label">JAMB REG NO:</label>
                    <div class="col-sm-4">
                    <input type="text" name="jregno" class="form-control" value="<?php echo $jregno;?>" placeholder="" required="required">
                    </div>
                  </div>
                  
                 
                  
                  <div class="form-group">
                    <label class="col-sm-5 control-label">JAMB Score :</label>
                    <div class="col-sm-4">
                    <input type="text" name="jscore" class="form-control" value="<?php echo $jscore;?>" placeholder="" required="required">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">College Choice :</label>
                    <div class="col-sm-4">
                    <input type="text" name="jinstitution" class="form-control" value="<?php echo $jinstitution;?>" 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="update4" class="btn btn-success" value="Update">
                  </div>
                </div>
              </form>

            </div>
          </div>
        </div>
      </div>



      <div class="modal fade" id="edit6" role="dialog">
        <div class="modal-dialog">
        
          <!-- Modal content-->
          <div class="modal-content">
            <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 IT for Candidate with Form Number <?php echo $formno; ?></b></h3>
            </div>
            <div class="modal-body" style="padding:10px 50px;">

              <form class="form-horizontal" action="dashboard.php?type=update_form" name="form" method="post" enctype="multipart/form-data">

                <div class="form-group">
                    <label class="col-sm-5 control-label">Company :</label>
                    <div class="col-sm-4">
                    <input type="text" name="itcompany" class="form-control" value="<?php echo $itcompany;?>" placeholder="" required="required">
                    </div>
                  </div>
                 
                  <div class="form-group">
                    <label class="col-sm-5 control-label">Form Year:</label>
                    <div class="col-sm-4">
                    <input type="text" name="dstarted" class="form-control" value="<?php echo $dstarted;?>" placeholder="" required="required">  
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">To Year :</label>
                    <div class="col-sm-4">
                    <input type="text" name="dcompleted" class="form-control" value="<?php echo $dcompleted;?>" 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="update6" class="btn btn-success" value="Update">
                  </div>
                </div>
              </form>

            </div>
          </div>
        </div>
      </div>



      <div class="modal fade" id="edit5" role="dialog">
        <div class="modal-dialog">
        
          <!-- Modal content-->
          <div class="modal-content">
            <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 National Diploma for Candidate with Form Number <?php echo $formno; ?></b></h3>
            </div>
            <div class="modal-body" style="padding:10px 50px;">

              <form class="form-horizontal" action="dashboard.php?type=update_form" name="form" method="post" enctype="multipart/form-data">

                <div class="form-group">
                    <label class="col-sm-5 control-label">College :</label>
                    <div class="col-sm-4">
                    <input type="text" name="institution" class="form-control" value="<?php echo $institution;?>" placeholder="" required="required">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">Class :</label>
                    <div class="col-sm-4">
                    <input type="text" name="grag" class="form-control" value="<?php echo $grag;?>" placeholder="" required="required">
                    </div>
                  </div>
                  
                  <div class="form-group">
                    <label class="col-sm-5 control-label">Year of Graduation :</label>
                    <div class="col-sm-4">
                    <input type="text" name="gragD" class="form-control" value="<?php echo $gragD;?>" placeholder="" required="required">
                    </div>
                  </div>
                  
                  
                  <div class="form-group">
                    <label class="col-sm-5 control-label">Instituion Chosen (Jamb) :</label>
                    <div class="col-sm-4">
                    <input type="text" name="jinstitution" class="form-control" value="<?php echo $jinstitution;?>" placeholder="" >
                    </div>
                  </div>
                  
                  <div class="form-group">
                    <label class="col-sm-5 control-label">Jamb Reg Number :</label>
                    <div class="col-sm-4">
                    <input type="text" name="jregno" class="form-control" value="<?php echo $jregno;?>" placeholder="" >
                    </div>
                  </div>
                  
                  <div class="form-group">
                    <label class="col-sm-5 control-label">Jamb Score :</label>
                    <div class="col-sm-4">
                    <input type="text" name="jscore" class="form-control" value="<?php echo $jscore;?>" placeholder="">
                    </div>
                  </div>
                  
                  
                <div class="form-group">
                  <label class="col-sm-4 control-label"></label>
                  <div class="col-sm-8">
                    <input type="submit" name="update5" class="btn btn-success" value="Update">
                  </div>
                </div>
              </form>

            </div>
          </div>
        </div>
      </div>




    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>  
    <script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>  
    <script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script> 
    <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.js"></script>-->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.js"></script>

     <!-- <script type="text/javascript" charset="utf-8" language="javascript" src="assets/js/dataTables.min.js"></script> -->

                    <!--  -->
                    <!-- this function is for modal -->
    <script>
      $(document).ready(function()
      {
        $("#myBtn").click(function()
        {
          $("#myModal").modal();
        });
      });
    </script>
    <script>
      $(document).ready(function()
      {
        $('#datepicker1').datepicker({
          todayBtn:'linked',
          format: "yyyy-mm-dd",
          autoclose: true
         });

        $('#datepicker').datepicker({
          todayBtn:'linked',
          format: " yyyy",
        //   viewMode: "years", 
          minViewMode: "years"
          autoclose: true
          });

          $('#datepicker2').datepicker({
          todayBtn:'linked',
        //   viewMode: "years", 
          minViewMode: "years"
          format: " yyyy",
          autoclose: true
          });
      });
    </script>