
  <div class="container">
 
 <div class="row">
  
  <div class="col-xs-12 col-sm-6 col-lg-12">
  
		<div class="panel panel-success" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
					
					
					
				Student Details
				
            	</div>
            </div>
			<div class="panel-body">

			
										
					<div class="row">
						<div class="col-md-12">
							
							<div class="panel-body">
							
				
  
        			 <?php

 if(!is_array($students)) 

 {


echo "<tr>";
  echo "<td colspan='10'>";
    
       echo '<div class="alert alert-danger text-center">There is no such Data found. click here to :'?> <a href="<?php echo base_url(). "/admin/viewstudents"; ?>" class="btn btn-primary">Refresh Data</a> <?php '.</div>';
  echo "</td>";
  echo "</tr>";
    }else {
?>
   
             <?php foreach ($students as $c): 
        $status=$c->status;
         $studentid= $c->studentid;

             ?>

		<table width="100%" border="1" cellpadding="2" style="text-align: left">
				  <tr>
					
				  <tr>
					<td><strong>Name</strong></td>
					
					<td> <?php echo $c->surname ."  ".$c->firstname; ?></td>
					<td><strong>Id Number</strong></td>
						<td> <?php echo $c->idno ;?></td>
				  </tr>
				    <tr>
					<td><strong>Gender</strong></td>
					
					<td> <?php echo $c->gender ; ?></td>
					<td><strong>Date OF Birth</strong></td>
						<td> <?php echo $c->dob ;?></td>
				  </tr>
				   <tr>
					<td><strong>Relegion</strong></td>
					
					<td> 
					    <?php
 $religionid= $c->religion;
$religion = $this->nationmodel->getreligionbyid($religionid);


if(is_array($religion)) {

   foreach($religion as $religionrow){
echo $religionrow->name;

}} else {
echo "No religion selected";
}
  ?>					
					
					
					</td>
					<td><strong>Status</strong></td>
						<td> <?php echo $c->status ;?></td>
				  </tr>
				     <tr>
					<td><strong>Village Name (Birth place)</strong></td>
					
					<td> <?php echo $c->bp_village ; ?></td>
					<td><strong>Location Name (Birth place)</strong></td>
						<td> <?php echo $c->bp_location ;?></td>
				  </tr>
				    <tr>
					<td><strong>Division (Birth place) </strong></td>
					
					<td> <?php echo $c->bp_division ; ?></td>
					<td><strong>District Name (Birth place)</strong></td>
						<td> 
												 <?php
 $mydistrictid= $c->bp_district;
$mydistrict = $this->districtmodel->getdistrictbyitsid($mydistrictid);


if(is_array($mydistrict)) {

   foreach($mydistrict as $mydistrictrow){

    ?>
	    <?=$mydistrictrow->name;?>

   
    <?php

}} else {
 echo" No District Asigned";
}
    ?>
						
						
						
						
						
						
						
						
						
						
						
						
						</td>
				  </tr>
				  
				    <tr>
					<td><strong>County (Birth place) </strong></td>
					
					<td> <?php
					
					
				
 $mycountyid= $c->bp_county;
$mycounty = $this->countymodel->getcountybyid($mycountyid);


if(is_array($mycounty)) {

   foreach($mycounty as $mycountyrow){

 
	  echo $mycountyrow->name;

   
   

}} else {
echo "No county Asigned";
}
	
					
				?>	
					
					
					
					
				</td>
					<td><strong>Province Name (Birth place)</strong></td>
						<td> 
						
						 <?php
 $myprovinceid= $c->bp_province;
$myprovince = $this->provincemodel->getprovincebyid($myprovinceid);


if(is_array($myprovince)) {

   foreach($myprovince as $myprovincerow){

    ?>
	<?=$myprovincerow->name;?></option>

   
    <?php

}} else {
echo "No Province Asigned";
}
	?>	
						
						
						
						
						
						
						
						
						
						</td>
				  </tr>
				   <tr>
					<td><strong>Chief (Birth place) </strong></td>
					
					<td> <?php echo $c->bp_chief ; ?></td>
					<td></td>
						<td></td>
				  </tr>
				  
				  
				  
				  
				  
				  
				  
				  
				  
				  
				  <tr>
					<td><strong>Village Name (Permanent place)</strong></td>
					
					<td> <?php echo $c->pr_village ; ?></td>
					<td><strong>Location Name (Permanent place)</strong></td>
						<td> <?php echo $c->pr_location ;?></td>
				  </tr>
				    <tr>
					<td><strong>Division (Permanent place) </strong></td>
					
					<td> <?php echo $c->pr_division ; ?></td>
					<td><strong>District Name (Permanent place)</strong></td>
						<td> 
						
						 <?php
 $mydistrictid= $c->pr_district;
$mydistrict = $this->districtmodel->getdistrictbyitsid($mydistrictid);


if(is_array($mydistrict)) {

   foreach($mydistrict as $mydistrictrow){

    ?>
	    <?=$mydistrictrow->name;?>

   
    <?php

}} else {
 echo" No District Asigned";
}
    ?>
						
						
						
						
						
						
						
						
						
						
						
						</td>
				  </tr>
				  
				    <tr>
					<td><strong>County (Permanent place) </strong></td>
					
					<td> <?php 
					
					
									
 $mycountyid= $c->pr_county;
$mycounty = $this->countymodel->getcountybyid($mycountyid);


if(is_array($mycounty)) {

   foreach($mycounty as $mycountyrow){

 
	  echo $mycountyrow->name;

   
   

}} else {
echo "No county Asigned";
}
	
					
					
					
					
					
					
					
					
					
					
					?></td>
					<td><strong>Province Name (Permanent place)</strong></td>
						<td> 
						
						
								
   <?php
 $myprovinceid= $c->pr_province;
$myprovince = $this->provincemodel->getprovincebyid($myprovinceid);


if(is_array($myprovince)) {

   foreach($myprovince as $myprovincerow){

    ?>
	<?=$myprovincerow->name;?></option>

   
    <?php

}} else {
echo "No Province Asigned";
}
	?>					
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						</td>
				  </tr>
				   <tr>
				   <td><strong>Assistance Chief  </strong></td>
				   	<td> <?php echo $c->pr_asschief ; ?></td>
					<td><strong>Chief (Permanent place) </strong></td>
					
					<td> <?php echo $c->pr_chief ; ?></td>
						
				  </tr>
				  
				  
				  <tr>
				     <td><strong>Town (Permanent place) </strong></td>
							
					<td> <?php echo $c->pr_town ; ?></td>
					<td><strong>Nationality </strong></td>
					
					<td> <?php
					
					
					
 $countryid= $c->nationality;
$country = $this->nationmodel->getcountrybyid($countryid);


if(is_array($country)) {

   foreach($country as $countryrow){

    ?>
	  <?=$countryrow->name;?>

   
    <?php

}} else {
echo "No Country Selected";
}

					
					
					
					
					
					
					
					
					
					
					
					?></td>
						
				  </tr>
				  <tr>
				     <td><strong>Physically Challange? </strong></td>
							
					<td> <?php echo $c->imparement ; ?></td>
					<td><strong>Challange Type </strong></td>
					
					<td> <?php echo $c->imparementdetails ; ?></td>
						
				  </tr>
				
				  	  <tr>
				     <td><strong>Date Created </strong></td>
							
					<td> <?php echo $c->createddate ; ?></td>
					<td><strong>Date Updated </strong></td>
					
					<td> <?php echo $c->updatedate ; ?></td>
						
				  </tr>
				  
				  
				</table>

<?php 

 endforeach;  }
?>				<br>
 <table cellpadding="0" cellspacing="0" border="1" class="table  table-bordered" id="viewtable" style="border-color:#CCCCCC" >

 
  <tr>
    <th colspan="5" class="col-md-12 text-center"><h3>Guardian Details</h3></th>  

   

    

  </tr>
  <tr>
    <th>Category</th>  
<th>Surname</th>
    <th>Other Name</th>

    <th>Occupation</th>    

    <th>Id Number</th>    

    

  </tr>

<?php 

		


if(is_array($family)) {

   foreach($family as $row){

  echo "<tr>";
 echo "<td>". $row->category ."</td>";
     echo "<td>". $row->	surname ."</td>";
 echo "<td>". $row->firstname ."</td>";
   

    echo "<td>". $row->occupation ."</td>";

    echo "<td>". $row->idno ."</td>";
 
  echo "</tr>"; 
 

}} else { echo "<tr>";echo "<td colspan='5'>";
 
	       echo '<div class="alert alert-danger text-center">The student has not yet submitted the Gauidamce details :'?> <a href="<?php echo base_url(). "/admin/viewstudents"; ?>" class="btn btn-primary">Refresh Data</a> <?php '.</div>';
  echo "</td>"; 
  echo "</tr>"; 
}

  




?>




</table>
				<br></br>	
 <table cellpadding="0" cellspacing="0" border="1" class="table  table-bordered" id="viewtable" style="border-color:#CCCCCC" >

 
  <tr>
    <th colspan="5" class="col-md-12 text-center"><h3>Previous School Details</h3></th>  

   

    

  </tr>
  <tr>
    <th>Category</th>  
<th>School Name</th>
    <th>School Box</th>
   <th>Grade</th>  
    <th>School town</th>    
 <th>From Date:</th> 
  <th>To Date:</th> 
    <th>Id Number</th>    

    

  </tr>

<?php 

		


if(is_array($school)) {

   foreach($school as $row){

  echo "<tr>";
 echo "<td>". $row->category ."</td>";
     echo "<td>". $row->schoolname ."</td>";
 echo "<td>". $row->schoolbox ."</td>";
   echo "<td>". $row->grade ."</td>";

    echo "<td>". $row->town ."</td>";

    echo "<td>". $row->fromdate ."</td>";
	echo "<td>". $row->todate ."</td>";
	
 
  echo "</tr>"; 
 

}} else { echo "<tr>";echo "<td colspan='5'>";
 
	       echo '<div class="alert alert-danger text-center">The student has not yet submitted the Previous School details :'?> <a href="<?php echo base_url(). "/admin/viewstudents"; ?>" class="btn btn-primary">Refresh Data</a> <?php '.</div>';
  echo "</td>"; 
  echo "</tr>"; 
}

  




?>




</table>	 


<br></br>	
 <table cellpadding="0" cellspacing="0" border="1" class="table  table-bordered" id="viewtable" style="border-color:#CCCCCC" >

 
  <tr>
    <th colspan="5" class="col-md-12 text-center"><h3>Spouse  Details</h3></th>  

   

    

  </tr>
  <tr>
    <th>Marrital Status</th>  
<th>Surname</th>
    <th>Other Name</th>

      

     

    

  </tr>

<?php 

		


if(is_array($spouse)) {

   foreach($spouse as $row){

  echo "<tr>";
 echo "<td>". $row->marritalstatus ."</td>";
     echo "<td>". $row->	surname ."</td>";
 echo "<td>". $row->firstname ."</td>";
   



 
  echo "</tr>"; 
 
 

 

}} else { echo "<tr>";echo "<td colspan='5'>";
 
	       echo '<div class="alert alert-danger text-center">The student has not yet submitted the Spouse  School details :'?> <a href="<?php echo base_url(). "/admin/viewstudents"; ?>" class="btn btn-primary">Refresh Data</a> <?php '.</div>';
  echo "</td>"; 
  echo "</tr>"; 
}

  




?>




</table>	 
<br></br>	
 <table cellpadding="0" cellspacing="0" border="1" class="table  table-bordered" id="viewtable" style="border-color:#CCCCCC" >

 
  <tr>
    <th colspan="5" class="col-md-12 text-center"><h3>Contact  Details</h3></th>  

   

    

  </tr>
  <tr>
      <th>Category</th>  
<th>Phone Number</th>
    <th>Email</th>
   <th>Box Number</th>  
    <th>Town Name</th>    
 <th>Town Code:</th> 
   

     

    

  </tr>

<?php 

		


if(is_array($contact)) {

   foreach($contact as $row){

  echo "<tr>";
 echo "<td>". $row->category ."</td>";
     echo "<td>". $row->mobileno ."</td>";
 echo "<td>". $row->email ."</td>";
   echo "<td>". $row->boxnumber ."</td>";
     echo "<td>". $row->townname ."</td>";
 echo "<td>". $row->towncode ."</td>";



 
  echo "</tr>"; 
 
 

 

}} else { echo "<tr>";echo "<td colspan='5'>";
 
	       echo '<div class="alert alert-danger text-center">The student has not yet submitted the Contact details :'?> <a href="<?php echo base_url(). "/admin/viewstudents"; ?>" class="btn btn-primary">Refresh Data</a> <?php '.</div>';
  echo "</td>"; 
  echo "</tr>"; 
}

  




?>




</table>


<br></br>	
 <table cellpadding="0" cellspacing="0" border="1" class="table  table-bordered" id="viewtable" style="border-color:#CCCCCC" >

 
  <tr>
    <th colspan="5" class="col-md-12 text-center"><h3>Sport and Club  Details</h3></th>  

   

    

  </tr>
  <tr>
      <th>Sport OF Choice</th>  
<th>Sport Of Participation</th>
  <th>Clubs OF Choice</th>  
   

     

    

  </tr>

<?php 

		


if(is_array($sport)) {

   foreach($sport as $row){

  echo "<tr>";
 echo "<td>". $row->sportname ."</td>";
     echo "<td>". $row->sportparticipated ."</td>";
 echo "<td>". $row->clubsofchoice ."</td>";



 
  echo "</tr>"; 
 
 

 

}} else { echo "<tr>";echo "<td colspan='5'>";
 
	       echo '<div class="alert alert-danger text-center">The student has not yet submitted the Previous School details :'?> <a href="<?php echo base_url(). "/admin/viewstudents"; ?>" class="btn btn-primary">Refresh Data</a> <?php '.</div>';
  echo "</td>"; 
  echo "</tr>"; 
}

  




?>




</table>





 <table cellpadding="0" cellspacing="0" border="1" class="table  table-bordered" id="viewtable" style="border-color:#CCCCCC" >
             <thead>
			  <tr>  <th colspan="5" class="col-md-12 text-center"><h3>Course Details</h3></th> </tr> 

         <tr>
  

	<th>Surname</th>
	
    <th>Campus</th>         
	<th>Course</th> 
	<th>Department</th> 
	<Th>Registration Number</th>
	

                 </tr>
             </thead>
<?php
echo $this->session->flashdata('msg'); 

 if(!is_array($studentdetails)) 

 {



   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='5'>";
    
       echo '<div class="alert alert-danger text-center">The student Is not found in database.</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  
  	foreach ($studentdetails as $c): 

		 

             ?>



             <tr>
                
            <?php 
		
	 
 $id=$c->id;
?>

      
		
			
					<td><?php echo $c->firstname ; ?></td> 

              
				 
				 
				      <td><?php 
					 
					 
					 	 $campusnamecode=$c->campusname;


$campus = $this->campusmodel->getcampusbycode($campusnamecode);


if(is_array($campus)) {

   foreach($campus as $campusrow){

   //echo $courserow->coursename;
    ?>
 <?php echo $campusrow->name; ?> 

	<?php

}} else {
    echo 'No Campus Asigned to you.';
}

?>
			 
					</td> 
                     <td><?php 
					 
					 
					 	$cosecode=$c->coursename;


$course = $this->departmentmodel->populatecoursebyid($cosecode);


if(is_array($course)) {

   foreach($course as $courserow){

   //echo $courserow->coursename;
    ?>
  <?php echo $courserow->coursename; ?> 

	<?php

}} else {
    echo 'No course for this code.. try again.';
}

?>
			 
					</td>   
					  <td><?php 
					  
					  
					  
					  
					  
					  
					  
					  
					  
					  $depcode=$c->department;
$updatedepartment = $this->departmentmodel->populatedepartmentbyid($depcode);


if(is_array($updatedepartment)) {

   foreach($updatedepartment as $deprow){

  
echo $deprow->name;
 
   

}} else {
    echo 'No department.... try again.';
}

?>
					  
					  
					  
					  
					  
					  
					</td>  
					   <td>
            <?php echo $c->regno ; ?> 
         </td>
          
             </tr>

             <?php endforeach; ?>

              <?php }?>

        </table>
		
		
		
		
		
		
		
								
			<?php 

if(is_array($documets)) {

?>

  <table cellpadding="0" cellspacing="0" border="0" class="table  table" id="example" style="border-color:#CCCCCC; width:100%;"  >

  <tr>

    

    <th>Document Name</th>    



      
<th>Date uploaded</th> 
<th>Document Status</th>
<th> Status Comment</th>
<th> Date Approved/ Rejected</th>


<th>View document </th>   

  </tr>
  <?php


   foreach($documets as $row){

  echo "<tr>";

    $status=$row->status;
   

 echo "<td>". $row->documentname ."</td>";
 
      echo "<td>". $row->createddate ."</td>";
if($status == 0){

    echo "<td style='color:orange'><b>".'Not yet Approved'."</b></td>";

    echo "<td style='color:orange'><b>".'No Comment yet '."</b></td>";
	    echo "<td style='color:orange'><b>".'Not yet Approved'."</b></td>";



}else if ($status == 1){
  echo "<td style='color:green'><b>" .'Already Approved' ."</b></td>";
  echo "<td style='color:green'><b>" .'Correct document uploaded' ."</b></td>";
        echo "<td style='color:green'><b>" .$row->actiondate ."</b></td>";


}else if ($status == 2){
  echo "<td style='color:red'><b>" .'Rejected' ."</b></td>";
   echo "<td style='color:red'><b>" .$row->message ."</b></td>";
      echo "<td style='color:red'><b>" .$row->actiondate ."</b></td>";


}




$document=$row->document;
?>
<td  style='color:green'> 
		 
 <a href="<?php echo base_url();?>studentdocs/<?php echo  $row->document;?>" class="btn btn-success"> view </a>	 

 </td>



<?php
			    
  
}} else {
 //$this->session->set_flashdata('msg', '<div class="alert alert-danger text-center">There is no any course application  that you have submitted.... Please apply now...</div>');

 // echo 'There is no any course application  that you have submitted.... Please apply now....';
   echo '<div class="alert alert-danger text-center">There is no documents uploaded for the approval from the student side...</div>';
}

 echo "</tr>";   




?>

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

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

</div>




















































