<?php 





//collect the id passed through the url

if(isset ($_GET['xd'] ,  $_GET['id']))

{

	$id = $_GET['xd'];

}


?>








<ul class="breadcrumb">
     <!-- <li><a href="gateway.php?act=view_reports">Reports Menu</a> <span class="divider"></span></li>
      <li><a href="gateway.php?act=view_applicant_reports">Applicants Reports Menu</a> <span class="divider"></span></li>
      <li > <a href="gateway.php?act=view_applicants">Applicants  </a><span class="divider"></span> </li>-->
      <li class="active"> Applicant's Profile   </li>
            
</ul>



<div class="well">



      <ul class="tabs"> 

        

        <li><a href="#view1">Applicants</a></li> 

       
       </ul> 

      

      

      <div class="tabcontents"> 

        <div id="view1">

        

        </div> 

        

        <div id="view1">

        	

        	                   

              <?php //echo view_applicants(); ?>

              

             <div class="row">

           

                <div class="col-md-12">

         				<div class="col-md-8">
                        
                        	<!-- bio data -->
                              <div class="panel panel-success"  >
                              			<a href="javascript:doit()"> <img src="images/print_big.png" border=0  class="pull-right" title="Print" height="30" width="45"> </a>
                                        <?php if(get_applicant_credential($id) == '' ){  ?>  <a class="btn btn-danger btn-sm pull-right" > No Credentials </a> <?php }else{?>
                                        <a class="btn btn-success btn-sm pull-right" target="_blank"   href="https://eportals.ibbuconsult.com.ng/ndp/uploads/credential/<?php echo get_applicant_credential($id); ?>"> View Credentials </a>
                                          <?php } ?> 
                                        <a class="btn btn-success btn-sm pull-right" onclick="history.go(-1)";> Go Back </a>
                                        
                                        <?php if(is_applicant_admitted($id) == '0'){ //check if admitted adn would want to change department?>
                                         
                                       <!--  
                                        <a class="btn btn-info btn-sm" >  Pending </a> -->
                                        
                                        <a href="#" class="btn btn-success" data-toggle="modal" data-target="#myModall_admit_applicant" alt="Click here to admit applicant"  title="Click here to admit applicant" data-placement="top">
                            			 A d m i t -  C a n d i d a t e
                                        </a>
										
											
                                            
                                            
                                        <?php }else if(is_applicant_admitted($id) == '1'){?>  
                                        
                                        
                                        <a href="#" class="btn btn-warning" data-toggle="modal" data-target="#myModall_admit_applicant" alt="Click here to admit applicant"  title="Click here to admit applicant" data-placement="top">
                            			 C h a n g e -  A d m i t t e d - Programme.
                                        </a>
										
										  
										<?php } else{ ?>
                                        
                                       	<?php }  ?>
                                        
                                <div class="panel-heading" role="tab" id="biodata_heading">
                                  <h4 class="panel-title">
                                    <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#biodata" aria-expanded="false" aria-controls="biodata">Biodata</a>
                                  </h4>
                                </div>
                                <div id="biodata" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="biodata_heading">
                                  <div class="panel-body">
                                  
                                  
                                    <?php include('includes/tab_menu/applicants_info/biodata.php') ?>
                                  </div>
                                </div>
                              </div>
                        		
                                
                                    <!-- Contact info-->
                              <div class="panel panel-success">
                                <div class="panel-heading" role="tab" id="ci_heading">
                                  <h4 class="panel-title">
                                    <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#ci" aria-expanded="false" aria-controls="ci">Contact Information</a>
                                  </h4>
                                </div>
                                <div id="ci" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="ci_heading">
                                  <div class="panel-body">
                                    <?php include('includes/tab_menu/applicants_info/contact_info.php') ?>
                                  </div>
                                </div>
                              </div>
                              
                              
                                   <!-- Academic info-->
                              <div class="panel panel-success">
                                <div class="panel-heading" role="tab" id="ai_heading">
                                  <h4 class="panel-title">
                                    <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#ai" aria-expanded="false" aria-controls="ai">Choice of Programme</a>
                                  </h4>
                                </div>
                                <div id="ai" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="ai_heading">
                                  <div class="panel-body">
                                     <?php include('includes/tab_menu/applicants_info/academic_info.php') ?>
                                  </div>
                                </div>
                              </div>
                             
                             
                                 
                             
                                <!-- health info  --> 
                              <div class="panel panel-success">
                                <div class="panel-heading" role="tab" id="headingThree">
                                  <h4 class="panel-title">
                                    <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
                                      Health Information
                                    </a>
                                  </h4>
                                </div>
                                <div id="collapseThree" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingThree">
                                  <div class="panel-body">
                                     <?php include('includes/tab_menu/applicants_info/health_info.php') ?>  
                                  </div>
                                </div>
                              </div>
                              
                              
                        

                         <?php echo date('Y:M:D H:i:s') ; ?>

                      </div> <!-- /.col md 6 --> 

                        

                       <div class="col-md-4">    
                       
                       
                       
                        
                        <h4> Exam Type 1</h4>
                        
                        
                        <?php
			
							  $q = "SELECT `id`, `applicant_id`, `exam_type`, `exam_year`, `exam_month`, `subject1`, `grade1`, `subject2`, 
								   `grade2`, `subject3`, `grade3`, `subject4`, `grade4`, `subject5`, `grade5`, `subject6`, `grade6`, 
								   `subject7`, `grade7`, `subject8`, `grade8`, `subject9`, `grade9`, `exam_no`, `type` 
								   FROM `applicants_olevel` WHERE applicant_id = '$id'";
							  $r = mysqli_query($dbc,$q);
							  
							  //if(mysqli_num_rows($r) > 0 )
			  //				{
				  
								  $rec = mysqli_fetch_array($r,MYSQLI_ASSOC)
								  //while($rec = mysqli_fetch_array($r,MYSQLI_ASSOC))
			  //					{
						  
						  ?>
							  <table class="table table-condensed">
					  
								  <tr>
									  <td width="100%">
									  <label for="edit-olexam1">Exam Number</label>
									  <input VALUE="<?php  echo $rec['exam_no']; ?>" type="text" class="form-control" name="exam_no" readonly="readonly" >
									  </td>
								  </tr>
							  </table>
							  
							  
							  <table class="table table-condensed">
								  <tr>
									<td width="100%">
										<label for="edit-olexam1">OLevel Examination Type (1) </label>
										  <select id="edit-olexam1" name="olexam1" class="form-control"  disabled="disabled">
										  <?php echo select_applicant_exam_type($rec['exam_type']); ?>
										  </select>
									  </td>
									</tr>
								</table>
								
							  
									  <table class="table table-condensed">
										  <tr>
											  <td width="50%">
												  <label for="edit-eyear1">Examination Year <span class="ast" title="This field is required.">*</span></label>
										   <select id="edit-eyear1" name="eyear1" class="form-control" disabled="disabled" >
											  
											  <option value="0">-- Please Select -- </option>
											  <?php  echo year($rec['exam_year']); ?>
										  </select>
											  <td>
											  <td width="50%">
												  <label for="edit-emonth1">Month<span class="ast" title="This field is required.">*</span></label>
										  <select id="edit-emonth1" name="emonth1" class="form-control"  disabled="disabled">
											  <?php echo select_applicant_exam_month($rec['exam_month']); ?>
										  </select>
											  </td>
										  </tr>
									  </table>
									  
									  
									  <table class="table table-condensed">
									  <tr class="active">
												  <td width="5%">S/N</td>
												  <td width="65%">Subjects</td>
												  <td width="30%">Grades</td>
											  </tr>
											  <tr class="active">
												  <td width="5%">1</td>
												  <td width="65%">
													  <select name="sub1" class="form-control"  disabled="disabled">
													   <option value="0">-- Please Select -- </option>
													   <?php  echo select_applicant_subjects($rec['subject1']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select  name="grd1" class="form-control" disabled="disabled">
														  
														  
													  <?php  echo  select_applicant_subject_grade($rec['grade1']); ?>
													  </select>
												  </td>
											  </tr>
											  <tr class="active">
												  <td width="5%">2</td>
												  <td width="65%">
													  <select name="sub2" class="form-control" disabled="disabled">
													  <option value="0">-- Please Select -- </option>
													  <?php  echo select_applicant_subjects($rec['subject2']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="grd2" class="form-control" disabled="disabled">
													  
														  <?php  echo  select_applicant_subject_grade($rec['grade2']); ?>
													  </select>
												  </td>
											  </tr>
											  <tr class="active">
												  <td width="5%">3</td>
												  <td width="65%">
													  <select name="sub3" class="form-control" disabled="disabled">
													  <option value="0">-- Please Select -- </option>
													  <?php echo select_applicant_subjects($rec['subject3']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="grd3" class="form-control" disabled="disabled" >
														  
														  <?php  echo  select_applicant_subject_grade($rec['grade3']); ?>
													  </select>
												  </td>
											  </tr>
											  <tr class="active">
												  <td width="5%">4</td>
												  <td width="65%">
													  <select name="sub4" class="form-control" disabled="disabled">
													  <option value="0">-- Please Select -- </option>
													  <?php  echo select_applicant_subjects($rec['subject4']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="grd4" class="form-control" disabled="disabled">
														  
													  <?php  echo  select_applicant_subject_grade($rec['grade4']); ?>
													  </select>
												  </td>
											  </tr>
											  <tr class="active">
												  <td width="5%">5</td>
												  <td width="65%">
													  <select name="sub5" class="form-control" disabled="disabled">
														<option value="0">-- Please Select -- </option>
														<?php echo select_applicant_subjects($rec['subject5']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="grd5" class="form-control" disabled="disabled">
													  
													  <?php  echo  select_applicant_subject_grade($rec['grade5']); ?>
													  </select>
												  </td>
											  </tr>
											  <tr class="active">
												  <td width="5%">6</td>
												  <td width="65%">
													  <select name="sub6" class="form-control"  disabled="disabled">
													  <option value="0">-- Please Select -- </option>
													  <?php  echo select_applicant_subjects($rec['subject6']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="grd6" class="form-control" disabled="disabled" >
														  
													  <?php  echo  select_applicant_subject_grade($rec['grade6']); ?>
													  </select>
												  </td>
											  </tr>
											  <tr class="active">
												  <td width="5%">7</td>
												  <td width="65%">
													  <select name="sub7" class="form-control"  disabled="disabled">
													  <option value="0">-- Please Select -- </option>
													  <?php   echo select_applicant_subjects($rec['subject7']);?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="grd7" class="form-control" disabled="disabled">
														  
													  <?php   echo  select_applicant_subject_grade($rec['grade7']);?>
													  </select>
												  </td>
											  </tr>
											  <tr class="active">
												  <td width="5%">8</td>
												  <td width="65%">
													  <select name="sub8" class="form-control" disabled="disabled" >
													  <option value="0">-- Please Select -- </option>
													  <?php echo select_applicant_subjects($rec['subject8']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="grd8" class="form-control"  disabled="disabled">
														  
														  <?php echo  select_applicant_subject_grade($rec['grade8']); ?>
													  </select>
												  </td>
											  </tr>
											  
											  <tr class="active">
												  <td width="5%">9</td>
												  <td width="65%">
													  <select name="sub9" class="form-control" disabled="disabled">
													  <option value="0">-- Please Select -- </option>
													  <?php echo select_applicant_subjects($rec['subject9']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="grd9" class="form-control" disabled="disabled">
														  
														  <?php  echo  select_applicant_subject_grade($rec['grade9']); ?>
													  </select>
												  </td>
											  </tr>
										  </table>
										  
							   <?php 
								   // }//end of while
							   // }//end of if 
								  ?>
								
										  
							
                            <hr/>
                             <h4> Exam Type 2</h4>
							
							<?php
						  
							  $q = "SELECT `id`, `applicant_id`, `exam_type`, `exam_year`, `exam_month`, `subject1`, `grade1`, `subject2`, 
								   `grade2`, `subject3`, `grade3`, `subject4`, `grade4`, `subject5`, `grade5`, `subject6`, `grade6`, 
								   `subject7`, `grade7`, `subject8`, `grade8`, `subject9`, `grade9`, `exam_no`, `type` 
								   FROM `applicants_olevel` WHERE applicant_id = '$id'";
							  $r = mysqli_query($dbc,$q);
							  
							  //if(mysqli_num_rows($r) > 0 )
			  //				{
				  
								  $rec2 = mysqli_fetch_array($r,MYSQLI_ASSOC)
								  //while($rec2 = mysqli_fetch_array($r,MYSQLI_ASSOC))
			  //					{
						  
						  ?>
							  <table class="table table-condensed">
					  
								  <tr>
									  <td width="100%">
									  <label for="edit-olexam2">Exam Number</label>
									  <input VALUE="<?php echo $rec2['exam_no']; ?>" type="text" class="form-control" name="exam_no2" readonly="readonly" >
									  </td>
								  </tr>
							  </table>
							  
							  
							  <table class="table table-condensed">
								  <tr>
										<td width="100%">
											<label for="edit-olexam2">OLevel Examination Type (2) </label>
											  <select id="edit-olexam1" name="olexam2" class="form-control" disabled="disabled">
												 <?php echo select_applicant_exam_type($rec2['exam_type']); ?>
											  </select>
										  </td>
									</tr>
								</table>
								
							  
									  <table class="table table-condensed">
										  <tr>
											  <td width="50%">
												  <label for="edit-eyear2">Examination Year </label>
										   <select id="edit-eyear2" name="eyear2" class="form-control"disabled="disabled" >
											  
											  <option value="0">-- Please Select -- </option>
											  <?php echo year($rec2['exam_year']); ?>
										  </select>
											  <td>
											  <td width="50%">
												  <label for="edit-emonth2">Month</label>
										  <select id="edit-emonth2" name="emonth2" class="form-control" disabled="disabled" >
											  <?php echo select_applicant_exam_month($rec2['exam_month']); ?>
										  </select>
											  </td>
										  </tr>
									  </table>
									  
									  
									   <table class="table table-condensed">
									  <tr class="active">
												  <td width="5%">S/N</td>
												  <td width="65%">Subject</td>
												  <td width="30%">Grade</td>
											  </tr>
											  <tr class="active">
												  <td width="5%">1</td>
												  <td width="65%">
													  <select name="s_sub1" class="form-control" disabled="disabled" >
														  <option value="0">-- Please Select -- </option>
													   <?php  echo select_applicant_subjects($rec2['subject1']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select  name="s_grd1" class="form-control" disabled="disabled">
														  
														  
													  <?php  echo  select_applicant_subject_grade($rec2['grade1']);?>
													  </select>
												  </td>
											  </tr>
											  <tr class="active">
												  <td width="5%">2</td>
												  <td width="65%">
													  <select name="s_sub2" class="form-control" disabled="disabled">
													  <option value="0">-- Please Select -- </option>
													  <?php echo select_applicant_subjects($rec2['subject2']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="s_grd2" class="form-control" disabled="disabled">
													  
														  <?php echo  select_applicant_subject_grade($rec2['grade2']); ?>
													  </select>
												  </td>
											  </tr>
											  <tr class="active">
												  <td width="5%">3</td>
												  <td width="65%">
													  <select name="s_sub3" class="form-control" disabled="disabled">
													  <option value="0">-- Please Select -- </option>
													  <?php echo select_applicant_subjects($rec2['subject3']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="s_grd3" class="form-control" disabled="disabled">
														  
														  <?php  echo  select_applicant_subject_grade($rec2['grade3']);?>
													  </select>
												  </td>
											  </tr>
											  <tr class="active">
												  <td width="5%">4</td>
												  <td width="65%">
													  <select name="s_sub4" class="form-control" disabled="disabled" >
													  <option value="0">-- Please Select -- </option>
													  <?php  echo select_applicant_subjects($rec2['subject4']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="s_grd4" class="form-control" disabled="disabled" >
														  
													  <?php  echo  select_applicant_subject_grade($rec2['grade4']); ?>
													  </select>
												  </td>
											  </tr>
											  <tr class="active">
												  <td width="5%">5</td>
												  <td width="65%">
													  <select name="s_sub5" class="form-control" disabled="disabled" >
														   <option value="0">-- Please Select -- </option>
													  <?php echo select_applicant_subjects($rec2['subject5']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="s_grd5" class="form-control" disabled="disabled">
													  
													  <?php  echo  select_applicant_subject_grade($rec2['grade5']); ?>
													  </select>
												  </td>
											  </tr>
											  <tr class="active">
												  <td width="5%">6</td>
												  <td width="65%">
													  <select name="s_sub6" class="form-control" disabled="disabled">
													  <option value="0">-- Please Select -- </option>
													  <?php  echo select_applicant_subjects($rec2['subject6']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="s_grd6" class="form-control" disabled="disabled">
														  
													  <?php echo  select_applicant_subject_grade($rec2['grade6']);?>
													  </select>
												  </td>
											  </tr>
											  <tr class="active">
												  <td width="5%">7</td>
												  <td width="65%">
													  <select name="s_sub7" class="form-control" disabled="disabled">
													  <option value="0">-- Please Select -- </option>
													  <?php  echo select_applicant_subjects($rec2['subject7']);?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="s_grd7" class="form-control" disabled="disabled">
														  
													  <?php  echo  select_applicant_subject_grade($rec2['grade7']); ?>
													  </select>
												  </td>
											  </tr>
											  <tr class="active">
												  <td width="5%">8</td>
												  <td width="65%">
													  <select name="s_sub8" class="form-control" disabled="disabled" >
													  <option value="0">-- Please Select -- </option>
													  <?php  echo select_applicant_subjects($rec2['subject8']);?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="s_grd8" class="form-control" disabled="disabled">
														  
														  <?php  echo  select_applicant_subject_grade($rec2['grade8']);?>
													  </select>
												  </td>
											  </tr>
											  
											  <tr class="active">
												  <td width="5%">9</td>
												  <td width="65%">
													  <select name="s_sub9" class="form-control" disabled="disabled">
													   <option value="0">-- Please Select -- </option>
													
													  <?php  echo select_applicant_subjects($rec2['subject9']); ?>
													  </select>
												  </td>
												  <td width="30%">
													  <select name="s_grd9" class="form-control" disabled="disabled">
														  
														  <?php  echo  select_applicant_subject_grade($rec2['grade9']); ?>
													  </select>
												  </td>
											  </tr>
										  </table>
										  
							   <?php 
								  // }//end of while
								//}//end of if 
								  ?>
						  
				</div> <!-- /.col md 4 -->
                

               

            </div><!-- /col-md-12 -->

            

            </div><!-- /row -->

              

        
        </div>  <!-- /view 1 -->

 

      </div>

</div>



</form>



	
<!--  Modal admit applicant -->
<div class="modal fade" id="myModall_admit_applicant" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Admission tab</h4>
        <span class="help-block"> Select the school and programme you want to admit applicant into</span>
      </div>
      <div class="modal-body">
			
			<form action="gateway.php" method="post" enctype="multipart/form-data">
            
            
            
            
            
            
                             <div class="form-group">	
                                <label for="programme_type">Programme Type  <span class="ast">*</span></label>
                                  <div class="input-group">
                                  <select name="programme_type" class="form-control"  id="search_prog_type_id" >
                                      <?php if(!isset($_SESSION['pt'])){ echo select_programme_type($pt = get_applicant_programme_type_applied_for($id));}else{ echo select_programme_type($_SESSION['pt']);} ?>
                                   </select>
                                    <div class="input-group-addon"> <span class="ast">*</span></div>
                              </div>
                    
                         
                  
                          
                         <br/>
                         
                             <div class="form-group">	
                              <label for="department">Department  </label>
                              
                               <div  class="input-group">
                                   <!-- <div class="input-group">-->
                                    <select name="department" class="form-control"  id="search_department_id">
                                    <option value="0"  > --Please Select-- </option>
                                        <?php if(!isset($_SESSION['dep'])){ echo select_department($dep = get_applicant_department_applied_for($id));}else{ echo select_department($_SESSION['dep']);} ?>
                                     </select>
                                      <div class="input-group-addon"><span class="ast">*</span></div>
                                  
                                  </div>
                              
                            </div>
                        
                         
                         
                         <br/>
                         	 
                             <div class="form-group" id="show_programme">
                           
                            	<div   id="hide_sub_programme" ><!---->
                          
                         	    <img src="images/loader.gif"  id="loader1" alt="please wait" />	
                                  <label  for="sub_programme_id">Programme</label>
                          		   <div class="input-group">
                                      <select   name="sub_programme"  id="sub_programme_id" class="form-control">
      
                                      <option value="">--Choose Programme --</option>
                                     
                                      <?php if(!isset($_SESSION['prog'])){ echo select_programme( get_applicant_programme_applied_for($id));}else{ echo select_programme($_SESSION['prog']);} ?>
                                      </select>	
                                  
                                  	<div class="input-group-addon"><span class="ast">*</span></div>
                                    
                                    </div> 
                             	</div>
                              
                              
                                   <div   id="show_sub_programme"  style="width:100%;min-width:100%;"><!---->
                                 
                                    <?php  //echo select_programme($_SESSION['programme']); ?>
                                    
                                  
                                  </div>
                            
                          	</div>
                            
                            <br/>
                            
                             <div class="form-group">
                                <label for="description" class="control-label">Notes</label>
                                <textarea class="form-control input-sm" id="description" rows="3" name="description" >
                                
                                <?php if(!isset($_SESSION['description'])){ echo get_applicant_admitted_condition($id);}else{ echo get_applicant_admitted_condition($_SESSION['description']);} ?>
                                 
                                </textarea>
                                
                              </div>	
                            
                       
                           
                             <input type="hidden" name="act" value="tab_admit_applicant" />
                             <input type="hidden" name="prog_type" value="<?php echo get_applicant_programme_type_applied_for($id); ?>" />
                             <input type="hidden" name="aid" value="<?php echo $id; ?>" />
                      </div>  
                  
                <div class="modal-footer">
                 <button type="submit"  class="btn btn-success"  value="Admit Candidate"> Admit Candidate</button>
                <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
			  
                
               </div>
               
              </form>
        
          
               
    </div>
  </div>
</div>
<!------------------------------- modal admitting ------------------------------------------------------------------->

	