<?php foreach ($student_dtl as $student) {
if(count($certificate_dtl[$student->person_id]) <= 0){
    continue;
}
?>
    <div class="col-sm-12 gray_ttc" style="padding-top: 10px;padding-bottom: 10px;">
        <div class="col-sm-12">
            <div class="col-sm-3"><?php echo $student->person_first_name . ' ' . $student->person_last_name ?></div>                    
            <div class="col-sm-3 text-center"><?php echo $student->person_email ?></div>
            <div class="col-sm-3 text-center"><?php echo $crtf_count = count($certificate_dtl[$student->person_id]) ?></div>
            <div class="col-sm-3 text-center">
                <?php if($crtf_count > 0){?>
                <a href="javascript:void(0)" id="showCertificateList<?php echo $student->url ?>">
                    <i class="fa fa-caret-square-o-down" aria-hidden="true"></i>
                </a>
                <?php }?>
            </div>
        </div>
        <div class="col-sm-12" style="background-color: #FFF; border: none; padding: 2px 2px; margin: 5px"></div>
        <div class="col-sm-12 gray" id="certificateList<?php echo $student->url ?>" style="background-color: #FFF; margin-top: 10px; display: none;">
            <div class="col-sm-12" style="border-bottom: 2px solid #8CC73F;padding-top: 10px;padding-bottom: 10px;">
                <div class="col-sm-3">Course Name</div>
                <div class="col-sm-3 text-center">Course Batch Name</div>
                <div class="col-sm-3 text-center">Roll Number</div>                    
                <div class="col-sm-3 text-center">Action</div>                    
            </div>
            <div class="col-sm-12"><br></div>
            <?php foreach($certificate_dtl[$student->person_id] as $certificate){?>            
            <div class="col-sm-12" style="padding-top: 10px;padding-bottom: 10px;">
                <div class="col-sm-3"><?php echo $certificate->course_name?></div>                    
                <div class="col-sm-3 text-center"><?php echo $certificate->course_batch_name; ?></div>
                <div class="col-sm-3 text-center"><?php echo $certificate->student_roll_number; ?></div>
                <div class="col-sm-3 text-center">
                    <a href="<?php echo base_url('admin/edit-certificate/'.$certificate->student_roll_number) ?>" target="_blank">
                        <i class="fa fa-pencil-square-o" aria-hidden="true"></i>
                    </a>&nbsp;&nbsp;
                    <a href="<?php echo base_url('admin/view-certificate/'.$certificate->student_roll_number) ?>" target="_blank">
                        <i class="fa fa-graduation-cap" aria-hidden="true"></i>
                    </a>
                </div>
            </div>
            <?php } ?>
        </div>
    </div>
<?php } ?>