<style>
body {
  font-family: Verdana, sans-serif;
  margin: 0;
}

* {
  box-sizing: border-box;
}

 .column {
  padding: 0 8px;
}

.row:after {
  content: "";
  display: table;
  clear: both;
}

.column {
  float: left !important;
  width: 18%;
  height:150px;
}

/* The Modal (background) */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: black;
}

/* Modal Content */
.modal-content {
  /*position: relative;*/
  background-color: #fefefe;
  margin: auto;
  padding: 0;
  width: 90%;
  max-width: 1200px;
}

/* The Close Button */
.close {
  color: white;
  position: absolute;
  top: 10px;
  right: 25px;
  font-size: 35px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: #999;
  text-decoration: none;
  cursor: pointer;
}

.mySlides {
  display: none;
}

.cursor {
  cursor: pointer;
}

/* Next & previous buttons */
.prev,
.next {
  cursor: pointer;
  position: absolute;
  top: 30%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 20px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  -webkit-user-select: none;
}

/* Position the "next button" to the right */
.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

/* On hover, add a black background color with a little bit see-through */
.prev:hover,
.next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Number text (1/3 etc) */
.numbertext {
  color: #f2f2f2;
  font-size: 12px;
  padding: 8px 12px;
  position: absolute;
  top: 0;
}

img {
  margin-bottom: -4px;
}

.caption-container {
  text-align: center;
  background-color: black;
  padding: 2px 16px;
  color: white;
}

.demo {
  opacity: 0.6;
}

.active,
.demo:hover {
  opacity: 1;
}

img.hover-shadow {
  transition: 0.3s;
}

.hover-shadow:hover {
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
</style>

<style>
.profile-div{width:100% !important;}
.img-div{float:left;padding:5px; width:50%;}
.img-div label{width:100% !important; background:#263571;text-align:center;}
.profile-pics{width:100%; height:150px;}    

.document-div{width:150px;height:auto; float:left;margin-right:20px;}
.document-div img{width:150px;height:100px;box-shadow: 0 0 1px #263571;}
.document-div label{width:100% !important; background:#263571;text-align:center;font-size:14px;}

/*.mySlides{float:left;}*/
.modal-content .clm1 {width:20%;float:left !important;}
.clm1 img{width:100%;height:150px;}

@media screen and (max-width: 450px){
.document-div{width:100%;height:auto; float:left;margin-right:20px;}
.document-div img{width:100%;height:auto;box-shadow: 0 0 1px #263571;}
.document-div label{width:100% !important; background:#263571;text-align:center;}
    
    
    
    
.modal-content .clm1 {width:20%;float:left !important;padding:0px;}    
.clm1 img{width:100%;height:70px;}    
}
</style>

<div class="container user-dashboard mt-3 mb-3 bg-white pt-3 pb-3">
<div class="row">
<div class="col-sm-8">


<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<?php echo base_url();?>StudentFee/dashboard">Home</a></li>
<li class="breadcrumb-item"><a href="<?php echo base_url();?>Student/profile/<?php if($this->uri->segment(3)){echo $sid = $this->uri->segment(3);}?>">Profile</a></li>
<li class="breadcrumb-item"><a href="<?php echo base_url();?>Student/documentation/<?php echo $sid; ?>">Documentation</a></li>
<li class="breadcrumb-item"><a href="<?php echo base_url();?>StudentFee/profile/<?php if($this->uri->segment(3)){echo $sid = $this->uri->segment(3);}?>"><?php if($this->uri->segment(3)){echo $sid = $this->uri->segment(3);}?></a></li>
</ul> 


<?php $table="student";
$data_student = $this->FeeModel->fetch_single_student($table,$sid);
if($data_student){
$count = 1;
foreach($data_student as $records){
$sid=$records['id'];
?>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<!--<thead>-->
<!--<tr><th></th></tr>    -->
<!--</thead>    -->
<tbody>
<tr>
<td>Scholar No.</td><td><?php echo $records['sch_no'];?></td></tr>
<tr><td>Student Name</td><td><?php echo $student_name= $records['student_name'];?></td></tr>
<tr><td>Father's Name</td><td><?php echo $father_name= $records['father_name'];  $mother_name=$records['mother_name'];?></td></tr>
<tr></tr><td>Class : <?php echo $records['class'];?></td><td>Section : <?php echo $records['section'];?></td></tr>
<tr><td>D.O.B. </td><td><?php echo $records['dob'];?></td></tr>
<tr><td>Contact No.</td><td><?php echo $records['contact_no'];?></td></tr>
<tr><td>Alternate No.</td><td><?php echo $records['alternate_no'];?></td></tr>
<tr><td>Address </td><td><?php echo $records['address'];?></td></tr>
<tr><td>Admission Date : </td><td><?php echo $records['admission_date'];?></td></tr>
<tr><td>Bill Book Number</td><td><?php echo $records['bill_book_number']; ?></td></tr>

</tbody>
</table>    
</div>
<!--<div class="table-responsive">-->
<!--<table class="table table-responsive table-bordered">-->
<!--<tr><th><ul><li>Student Documents</li></ul></th></tr>-->
<!--<tr><td><ul><li><a href="<?php echo base_url();?>student/leaving_certificate/<?php echo $records['id'];?>">SCHOOL LEAVING CERTIFICATE</a></li></ul></td></tr>-->
<!--<tr><td><ul><li><a href="<?php echo base_url();?>student/student_certificate/<?php echo $records['id'];?>">SCHOOL CERTIFICATE</a></li></ul></td></tr>-->
<!--</table>-->
<!--</div>-->
<?php } }?>

</div>



<?php 
$table1='student_data';
$student_documents_data=$this->StudentModel->get_student_documents_data($sid,$table1);
if($student_documents_data){
foreach($student_documents_data as $student_data){
?>

<div class="col-sm-4">
<div class="profile-div">
<div class="img-div">
<img class="img-responsive profile-pics" src="<?php echo base_url();?>student-data/profile-img/<?php echo $student_data['profile_pic']; ?>">
<br>
<label class="text-white  p-1"><?php echo $student_name; ?></label>
</div>
<div class="img-div"><img class="img-responsive profile-pics" src="<?php echo base_url();?>student-data/mothers-profile-pics/<?php echo $student_data['mothers_profile_pic']; ?>">
<br><label class="text-white  p-1"><?php if($mother_name !=''){echo $mother_name;} else{ echo "No Data Found"; } ?></label>
</div>
<div class="img-div">
<img class="img-responsive profile-pics" src="<?php echo base_url();?>student-data/fathers-profile-pics/<?php echo $student_data['fathers_profile_pic']; ?>">
<br><label class="text-white  p-1"><?php echo $father_name;?></label>
</div>

</div>
</div>

<div class="col-sm-12 mt-3 mb-3">
<h4 class="bg-info p-2 text-white font-weight-bolder">Other Important Documents</h4>    
<div class="column document-div">
<img src="<?php echo base_url();?>student-data/previous-class-report-card/<?php echo $student_data['previous_report_card']; ?>" style="width:100%" onclick="openModal();currentSlide(1)" class="hover-shadow cursor">
<br><label class="text-white  p-1">Previous class report card</label>
</div>

<div class="column document-div">
<img src="<?php echo base_url();?>student-data/previous-school-tc/<?php echo $student_data['previous_school_tc']; ?>" style="width:100%" onclick="openModal();currentSlide(2)" class="hover-shadow cursor">
<br><label class="text-white  p-1">Previous School TC</label>
</div>

<div class="column document-div">
<img src="<?php echo base_url();?>student-data/birth-certificate/<?php echo $student_data['birth_certificate']; ?>" style="width:100%" onclick="openModal();currentSlide(3)" class="hover-shadow cursor">
<br><label class="text-white  p-1">Student Birth Certificate</label>
</div>
  
<div class="column document-div">
<img src="<?php echo base_url();?>student-data/application-form-front-back/<?php echo $student_data['registration_form_front']; ?>" style="width:100%" onclick="openModal();currentSlide(4)" class="hover-shadow cursor">
<br><label class="text-white  p-1">Registration form front image</label>
</div>

<div class="column document-div">
<img src="<?php echo base_url();?>student-data/application-form-front-back/<?php echo $student_data['registration_form_back']; ?>" style="width:100%" onclick="openModal();currentSlide(5)" class="hover-shadow cursor">
<br><label class="text-white  p-1">Registration form back image</label>
</div>
  
</div>

<div id="myModal" class="modal">
  <span class="close cursor" onclick="closeModal()">&times;</span>
  <div class="modal-content">

    <div class="mySlides">
      <div class="numbertext">1 / 5</div>
      <img src="<?php echo base_url();?>student-data/previous-class-report-card/<?php echo $student_data['previous_report_card']; ?>" style="width:100%">
    </div>

    <div class="mySlides">
      <div class="numbertext">2 / 5</div>
      <img src="<?php echo base_url();?>student-data/previous-school-tc/<?php echo $student_data['previous_school_tc']; ?>" style="width:100%">
    </div>

    <div class="mySlides">
      <div class="numbertext">3 / 5</div>
      <img src="<?php echo base_url();?>student-data/birth-certificate/<?php echo $student_data['birth_certificate']; ?>" style="width:100%">
    </div>
    
    <div class="mySlides">
      <div class="numbertext">4 / 5</div>
      <img src="<?php echo base_url();?>student-data/application-form-front-back/<?php echo $student_data['registration_form_front']; ?>" style="width:100%">
    </div>
    
        <div class="mySlides">
      <div class="numbertext">5 / 5</div>
      <img src="<?php echo base_url();?>student-data/application-form-front-back/<?php echo $student_data['registration_form_back']; ?>" style="width:100%">
    </div>
    
    <a class="prev" onclick="plusSlides(-1)">&#10094;</a>
    <a class="next" onclick="plusSlides(1)">&#10095;</a>

    <div class="caption-container">
      <p id="caption"></p>
    </div>

<div  class="flex-row">
    <div class="column clm1">
      <img class="demo cursor" src="<?php echo base_url();?>student-data/previous-class-report-card/<?php echo $student_data['previous_report_card']; ?>"  onclick="currentSlide(1)" alt="Student Report Card">
    </div>
    <div class="column clm1">
      <img class="demo cursor" src="<?php echo base_url();?>student-data/previous-school-tc/<?php echo $student_data['previous_school_tc']; ?>"  onclick="currentSlide(2)" alt="Student TC">
    </div>
    <div class="column clm1">
      <img class="demo cursor" src="<?php echo base_url();?>student-data/birth-certificate/<?php echo $student_data['birth_certificate']; ?>"  onclick="currentSlide(3)" alt="Birth Cirtificate">
    </div>
    <div class="column clm1">
      <img class="demo cursor" src="<?php echo base_url();?>student-data/application-form-front-back/<?php echo $student_data['registration_form_front']; ?>"  onclick="currentSlide(4)" alt="Application Form Front">
    </div>
    
    <div class="column clm1">
      <img class="demo cursor" src="<?php echo base_url();?>student-data/application-form-front-back/<?php echo $student_data['registration_form_back']; ?>"  onclick="currentSlide(5)" alt="Application Form Back">
    </div> 
    
</div>    
  </div>
  
  
</div>  
<?php
}    
}
?>    
  


</div>
</div>

<script>
function openModal() {
  document.getElementById("myModal").style.display = "block";
}

function closeModal() {
  document.getElementById("myModal").style.display = "none";
}

var slideIndex = 1;
showSlides(slideIndex);

function plusSlides(n) {
  showSlides(slideIndex += n);
}

function currentSlide(n) {
  showSlides(slideIndex = n);
}

function showSlides(n) {
  var i;
  var slides = document.getElementsByClassName("mySlides");
  var dots = document.getElementsByClassName("demo");
  var captionText = document.getElementById("caption");
  if (n > slides.length) {slideIndex = 1}
  if (n < 1) {slideIndex = slides.length}
  for (i = 0; i < slides.length; i++) {
      slides[i].style.display = "none";
  }
  for (i = 0; i < dots.length; i++) {
      dots[i].className = dots[i].className.replace(" active", "");
  }
  slides[slideIndex-1].style.display = "block";
  dots[slideIndex-1].className += " active";
  captionText.innerHTML = dots[slideIndex-1].alt;
}
</script>