<?php
require_once("includes/initialize.php");

?>
<div align="center">
<a href="?type=editing" class="btn btn-primary">Back to Search</a></div>
<!-- <p><a href="?type=form_editing" target="_new"><input type="button" class="btn btn-success" value="Back to Search" /></p></div> -->
<?php 
      if (isset($_SESSION['formno']))
      {
        $formno = $_SESSION['formno'];         
      
        $edit_by_formno = EDITING::search($formno);
        if ($edit_by_formno)
        {        
          $formno = $edit_by_formno->formno;
        $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->maritalStatus;
        $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->reg_date;


        $sb1 = $edit_by_formno->sb1;
        $grd1 = $edit_by_formno->grd1;
        $sb2 = $edit_by_formno->sb2;
        $grd2 = $edit_by_formno->grd2;
        $sb3 = $edit_by_formno->sb3;
        $grd3 = $edit_by_formno->grd3;
        $sb4 = $edit_by_formno->sb4;
        $grd4 = $edit_by_formno->grd4;
        $sb5 = $edit_by_formno->sb5;
        $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->examno1;
        $exam_type1 = $edit_by_formno->exam_type1;
        $exam_year1 = $edit_by_formno->exam_year1;
        $examno2 = $edit_by_formno->examno2;
        $exam_type2 = $edit_by_formno->exam_type2;
        $exam_year2 = $edit_by_formno->exam_year2;

        $j_reg_no = $edit_by_formno->j_reg_no;
        $j_eng = $edit_by_formno->j_eng;
        $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;
        $j_total = $edit_by_formno->j_total;
        $ol_total_score = $edit_by_formno->ol_total_score;
        $higher1 = $edit_by_formno->higher1;
        $qual1 = $edit_by_formno->qual1;
        $grade1 = $edit_by_formno->grade1;
        $yr1 = $edit_by_formno->yr1;
        $higher2 = $edit_by_formno->higher2;
        $qual2 = $edit_by_formno->qual2;
        $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;

      ?>

              <form class="form-horizontal"  method="post" name="form">
                <input type="hidden" name="new" value="1" />
                <input name="id" type="hidden" value="<?php echo $id;?>" />
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Student Details Table
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <th>FORM NO</th>
                                            <th>SURNAME</th>
                                            <th>OTHER NAMES</th>
                                            <th>DEPARTMENT</th>
                                            <th>PROGRAMME</th>
                                            <th>E-Mail</th>
                                            <th>STATUS</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr >
                                            <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><a href="?action=2018_update_student&opr=upd&rs_id=<?php //echo $row['id'];?>" title="Update"><img src="images/icon-48-edit.png" /></a></td> -->
                                        </tr>
                                    </tbody>
                          
                                </table>
                            </div>
                            <!-- /.table-responsive -->                            
                        </div>
                        <!-- /.panel-body -->
                    </div>
              </form>

      <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">Detail 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>
        </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-4 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-4 col-xs-6">
              <label class="col-sm-5 control-label">ExamYear 1:</label><br>
              <input type="text" name="trans" class="form-control" value="<?php echo $exam_year1; ?>"readonly="readonly" required="required">
            </div>
            <div class="col-lg-4 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-4 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>
                            </tr>
                    </tbody>
          
                </table>
            </div>
            <!-- /.table-responsive -->                            
        </div>
        <!-- /.panel-body -->
    </div>

    <?php
      if ($type == 'PU')
      {
        ?>
          <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>Subject 1</th>
                              <th>Subject 2| Grade</th>            
                              <th>Subject 3| Grade</th>
                              <th>Subject 4| Grade</th>
                              <th>Total</th>
                              <th>College Choice</th>
                          </tr>
                      </thead>
                      <tbody>
                          <tr >
                              <td><?php echo $j_reg_no; ?></td>
                              <td><?php echo $j_eng.'|'.$jgrd1; ?></td>
                              <td><?php echo $jsb2.'|'.$jgrd2; ?></td>
                              <td><?php echo $jsb3.'|'.$jgrd3; ?></td>
                              <td><?php echo $jsb4.'|'.$jgrd4; ?></td>
                              <td><?php echo $j_total; ?></td>
                              <td><?php echo $poly_of_choice; ?></td>
                            </tr>
                      </tbody>
            
                  </table>
              </div>
              <!-- /.table-responsive -->                            
          </div>
          <!-- /.panel-body -->
      </div>

        <?php
      }
    
    ?>  

<?php
      if ($type == '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</th>
                          </tr>
                      </thead>
                      <tbody>
                          <tr >
                              <td><?php echo $higher1; ?></td>
                              <td><?php echo $qual1; ?></td>
                              <td><?php echo $grade1; ?></td>
                              <td><?php echo $yr1; ?></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>Purpose</th>
                              <th>From</th>            
                              <th>To</th>
                          </tr>
                      </thead>
                      <tbody>
                          <tr >
                              <td><?php echo $company; ?></td>
                              <td><?php echo $purpose; ?></td>
                              <td><?php echo $from_year; ?></td>
                              <td><?php echo $to_year; ?></td>
                            </tr>
                      </tbody>
            
                  </table>
              </div>
              <!-- /.table-responsive -->                            
          </div>
          <!-- /.panel-body -->
      </div>
      <?php
      }
    
    ?> 
    <div align="center">
<p><a href="?type=print" target="_new"><input type="button" class="btn btn-success" value="Print Form" /></p></div>

<?php } } ?>

 
    <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 type="text/javascript" charset="utf-8" language="javascript" src="assets/js/dataTables.min.js"></script> -->

                    <!--  -->
                    <!-- this function is for modal -->