<?php 


//collect the id passed through the url
if(isset($_GET['id']))
{
	$id = $_GET['id'];
}

?>





<div class="well">

      <ul class="tabs"> 
        
        <li><a href="#view1">Applicants</a></li> 
       	<li><a href="gateway.php?act=view_shortlisted_applicants">Shortlisted Applicants</a></li> 
        <li><a href="gateway.php?act=view_admitted_applicants">Admitted 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="panel panel-info">
                    	<div class="panel-heading" style="height:60px;"> Personal Data 
                        
                      <a href="javascript:doit()"> <img src="images/print_big.png" border=0  class="pull-right" title="Print" height="30" width="45"> </a>
                      
                       <a class="btn btn-primary btn-sm pull-right" onclick="history.go(-1)";>  Go Back </a>
                        
                        </div>
                        
                        <?php 
						//get all passed vs
						
						
						
						$q = "SELECT  u.user_id  AS userid,  u.first_name, u.other_names, u.maiden_name, u.gender,  u.email, 
							  u.birthdate, u.phone_number,  u.address, u.permanent_address, u.image,  u.state_id, 
							  u.lga_id, u.town, u.pin, u.serial_number, u.nok_name, u.nok_address, u.nok_number,
							   u.department_id, u.course_id, u.applied_department, u.applied_course, u.place_of_birth, 
							   u.religion, u.marital_status, u.number_of_children, u.course_considered, u.appointment, 
							   u.appointment1, u.appointment2, u.employer, u.employer1, u.employer2, u.frm, u.frm1, 
							   u.frm2, u.t, u.to1, u.to2, u.prizes, u.ref_name, u.ref_add, u.ref_name1, u.ref_add1, 
							   u.ref_name2, u.ref_add2, u.other_languages, u.disability, u.disability_explain,u.application_number,
								u.result_1, u.result_2, u.primary_cert, u.secondary_cert, u.indigene_cert,  
							  s.id as stateid, s.title as state_title, l.id as lid, l.title as lga_title , l.state_id as lstate_id,
							  d.id as did, d.title as dept_title,
							  c.id as cid , c.title as course_title
							  
						FROM users u,state s, lga l, departments d, courses c
						
						
						WHERE u.lga_id = l.id
						AND l.state_id = s.id
						AND u.applied_department = d.id
						AND u.applied_course = c.id
						AND u.user_id  = '$id'";
						$r = mysqli_query($dbc, $q) ;
						
						if(mysqli_num_rows($r) > 0 )
						{
							$row  = mysqli_fetch_array($r,MYSQLI_ASSOC);
							
								
								?>
                        <div class="panel-body">
                        
                        	
                            <ul class="list-group">
                            	<li class="list-group-item" style="height:130px;">
                                
                                
                                
                                <span class="label label-info"> Profile </span>  &nbsp; &nbsp; &nbsp;
                                <span class="label label-info"> Application No: <?php echo $row['application_number'];?> </span>  &nbsp; &nbsp; &nbsp;
                                
                               
                                
                                <?php
								//show result if he/ she has
								if($row['result_1'] != '')
								{ 
								?>
                                
                                 <span class="label label-info"> 
                                    <a href="../application_files/<?php echo $row['application_number'];?>/<?php echo $row['result_1'] ?>" target="_blank"> 
                                     
                                        Result
                                    </a>
                                 </span>
                                
                                <?php
								}
								
								?>
                                
                                &nbsp; &nbsp; &nbsp;
                                
                                
                                  
                                <?php
								//show result 2 if he/ she has
								if($row['result_2'] != '')
								{ 
								?>
                                
                                 <span class="label label-info"> 
                                    <a href="../application_files/<?php echo $row['application_number'];?>/<?php echo $row['result_2'] ?>" target="_blank"> 
                                     
                                       Result 2
                                    </a>
                                 </span>
                                
                                <?php
								}
								
								?>
                                
                                &nbsp; &nbsp; &nbsp;
                                   
                                <?php
								//show primary_cert if he/ she has
								if($row['primary_cert'] != '')
								{ 
								?>
                                
                                 <span class="label label-info"> 
                                    <a href="../application_files/<?php echo $row['application_number'];?>/<?php echo $row['primary_cert'] ?>" target="_blank"> 
                                     
                                       Primary Cert
                                    </a>
                                 </span>
                                
                                <?php
								}
								
								?>
                                
                                  &nbsp; &nbsp; &nbsp;
                                   
                                <?php
								//show secondary cert if he/ she has
								if($row['secondary_cert'] != '')
								{ 
								?>
                                
                                 <span class="label label-info"> 
                                    <a href="../application_files/<?php echo $row['application_number'];?>/<?php echo $row['secondary_cert'] ?>" target="_blank"> 
                                     
                                       Secondary Cert
                                    </a>
                                 </span>
                                
                                <?php
								}
								
								?>
                               &nbsp; &nbsp; &nbsp;
                                   
                                <?php
								//show indigene cert if he/ she has
								if($row['indigene_cert'] != '')
								{ 
								?>
                                
                                 <span class="label label-info"> 
                                    <a href="../application_files/<?php echo $row['application_number'];?>/<?php echo $row['indigene_cert'] ?>" target="_blank"> 
                                     
                                       Indigene Cert
                                    </a>
                                 </span>
                                
                                <?php
								}
								
								?>
                               
                                
                                 
                                <img class="img-rounded pull-right" src="../uploads/pictures/<?php echo $row['image']; ?>" height="100" width="100" /></li>
                            	<li class="list-group-item">Name: <?php echo $row['first_name'].' ' .$row['other_names'] ?> </li>
                                <li class="list-group-item">Maiden Name: <?php echo $row['maiden_name'] ?></li>
                                <li class="list-group-item">Gender: <?php echo $row['gender'] ?></li>
                                <li class="list-group-item">Religious Dinomination: <?php echo $row['religion'] ?></li>
                                <li class="list-group-item">Applied Department: <?php echo $row['dept_title'] ?></li>
                                <li class="list-group-item">Applied Course: <?php echo $row['course_title'] ?></li>
                                <li class="list-group-item">Alternative course to be condidered : <?php echo get_course_title($row['course_considered']); ?></li>
                                <li class="list-group-item">Email: <?php echo $row['email'] ?></li>
                                 <li class="list-group-item">Place of Birth: <?php echo $row['place_of_birth']; ?></li>
                                <li class="list-group-item">DOB: <?php echo $row['birthdate']; ?></li>
                                <li class="list-group-item">Phone No.: <?php echo $row['phone_number']; ?></li>
                                 <li class="list-group-item">Marital Status: <?php echo $row['marital_status']; ?></li>
                                  <li class="list-group-item">Number of Children: <?php echo $row['number_of_children']; ?></li>
                                 <li class="list-group-item">Town: <?php echo $row['town']; ?></li>
                                <li class="list-group-item">Address: <?php echo $row['address']; ?></li>
                                <li class="list-group-item">Permanent Add: <?php echo $row['permanent_address']; ?></li>
                                <li class="list-group-item">State: <?php echo $row['state_title']; ?></li>
                                <li class="list-group-item">L.G.A: <?php echo $row['lga_title']; ?></li>
                               <?php /*?> <li class="list-group-item">town: <?php echo $row['town']; ?></li><?php */?>
                                <li class="list-group-item">Next of Kin: <?php echo $row['nok_name']; ?></li>
                                <li class="list-group-item">Next of Kin, Tel: <?php echo $row['nok_number']; ?></li>
                                 <li class="list-group-item">Next of Kin, Add: <?php echo $row['nok_address']; ?></li>
                                
                                <li class="list-group-item"><span class="label label-info"> Transaction Details </span></li>
                                <li class="list-group-item">PIN.: <?php echo $row['pin']; ?></li>
                                <li class="list-group-item">S/N.: <?php echo $row['serial_number']; ?></li>
                                
                                <li class="list-group-item"><span class="label label-info">Employment Details </span></li>
                  	            <li class="list-group-item">1. Appointment: <?php echo $row['appointment']; ?> <br/> Employer: <?php echo $row['employer']; ?> <br/> From: <?php echo $row['frm']; ?> <br/> To: <?php echo $row['t']; ?>  </li>
                                
                	             <li class="list-group-item">2. Appointment: <?php echo $row['appointment1']; ?> <br/> Employer: <?php echo $row['employer1']; ?> <br/> From: <?php echo $row['frm1']; ?> <br/> To: <?php echo $row['to1']; ?>  </li>
                                
                              <li class="list-group-item">3. Appointment: <?php echo $row['appointment2']; ?> <br/> Employer: <?php echo $row['employer2']; ?> <br/> From: <?php echo $row['frm2']; ?> <br/> To: <?php echo $row['to2']; ?>  </li>
                                 
                              <li class="list-group-item"><span class="label label-info"> Referees </span></li>
                              <li class="list-group-item">1. Name: <?php echo $row['ref_name']; ?> <br /> Address: <?php echo $row['ref_add']; ?> </li>
                              <li class="list-group-item">2. Name: <?php echo $row['ref_name1']; ?> <br /> Address:  <?php echo $row['ref_add1']; ?> </li>
                              <li class="list-group-item">3. Name: <?php echo $row['ref_name2']; ?> <br /> Address: <?php echo $row['ref_add2']; ?> </li>
                                 
                                 
                    	      <li class="list-group-item"><span class="label label-info"> Others</span></li>
                              <li class="list-group-item">Acadamic Distinctions or Prizes: <?php echo $row['prizes']; ?></li>
                              <li class="list-group-item">Knowledge of languages other than English: <?php echo $row['other_languages']; ?></li>    
                              <li class="list-group-item">Disability: <?php echo $row['disability']; ?></li>
                              <li class="list-group-item">Reason(Disability): <?php echo $row['disability_explain']; ?></li>
                             
                            
                            </ul>
                        
                        <?php 
						
							
						}
                        ?>
                        </div>
                        <div class="panel-footer" style="height:60px;"> <?php echo date('Y:M:D H:i:s') ; ?>
                        
                        
                               
                        <a href="javascript:doit()"> <img src="images/print_big.png" border=0  class="pull-right" title="Print" height="30" width="45"> </a>
                          <a class="btn btn-primary btn-sm pull-right" onclick="history.go(-1)";> 
                        Go Back </a>
                        </div>
                    </div><!-- /panel -->

                
                
                
       
                
               
                
               
            </div><!-- /col-md-12 -->
            
            </div><!-- /row -->
              
         <?php //echo '<a class="btn btn-success btn-sm pull-right" id="shortlist" >  Shortlist </a>';  ?>
        </div>  <!-- /view 1 -->
		<!--<div id="view3"> </div> 
        <div id="view4"></div> 
        <div id="view5"> </div>
        <div id="view6"> </div>
        <div id="view7"> </div> -->
 
      </div>
</div>

</form>
            