<style>
#div-1{
    width:25%;float:left;min-height:130px;background:white;
    padding:15px;
}

#div-2{
    width:25%;float:left;min-height:130px;background:white;
    padding:15px;
}

#inner-div-1{background:white;min-height:100px;box-shadow:0px 0px 10px silver;border-radius:5%;text-align:center;vertical-align:middle;padding-top:15px;padding-bottom:auto;}
@media screen and (max-width: 767px){
    
 #div-1{
    width:100%;float:left;height:200px;background:white;
    padding:15px;
}

#div-2{
    width:100%;float:left;height:200px;background:white;
    padding:15px;
}   
}
</style>

<?php
// $sid=$this->uri->segment('3');

?>
<div class="container-fluid mt-3 mb3 bg-white">
    <div class="row">
        <div class="col-sm-12 pt-3 pb-3">
            
            <ul class="breadcrumb">
                <li class="breadcrumb-item"><a href="<?php echo base_url();?>Welcome">Home</a></li>
                <li class="breadcrumb-item"><a href="<?php echo base_url(); ?>Fee/all_students">Students</a></li>
                <li class="breadcrumb-item">Certificates</li>
                <!--<li class="breadcrumb-item"></li>-->
            </ul>
            
            
            <div class="all-certificates">
                
                <div id="div-1">
                    <div id="inner-div-1">
                        <p>Students</p>
                        <a href="<?php echo base_url();?>Certificate/students" class="btn btn-sm btn-info">View</a>
                    </div>
                </div>
                <div id="div-2">
                    <div id="inner-div-1">
                        <p>Student Certificates</p>
                        <a href="#" class="btn btn-sm btn-info">View</a>
                    </div>
                </div>
                <div id="div-1">
                    <div id="inner-div-1">
                        <p>Transfer Certificates</p>
                        <a href="#" class="btn btn-sm btn-info">View</a>
                    </div>
                </div>
                <div id="div-1">
                    <div id="inner-div-1">
                        
                    </div>
                </div>
                
            </div>
            <div class="all-certificates table-responsive">
                <p class="text-center">Student Transfer Certificate</p>
                <table class="table table-bordered table-striped" id="mytable">
                    <thead>
                        <!--<tr>-->
                            <!--<th class="text-center" colspan="8"></th>-->
                        <!--</tr>-->
                        <tr>
                            <th class="sl_no">Count</th>
                            <th>Sr. No</th>
                            <th>Name</th>
                            <th>Father Name</th>
                            <th>Class</th>
                            <th>Date</th>
                            <th>Doc Type</th>
                            <th>Issued By</th>
                            <th>Copy</th>
                            <th>View</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        $count=0;
                        $tc_table='student_transfer_certificate';
                        $all_tc_docs=$this->CertificateModel->get_data($tc_table);
                        if($all_tc_docs){
                            foreach($all_tc_docs as $tc_docs){
                                $tid=$tc_docs['cat_by'];
                                $staff_table='school_staff';
                                $staff_name='';
                                $staff_info=$this->CertificateModel->get_item_data($tid,$staff_table);
                                if($staff_info){
                                    foreach($staff_info as $staffinfo){
                                        $staff_name=$staffinfo['name'];
                                    }
                                }
                                $count++;
                        ?>
                        <tr>
                            <td><?php echo $count; ?></td>
                            <td><?php echo $tc_docs['id'];?></td>
                            <td><?php echo $tc_docs['student_name'];?></td>
                            <td><?php echo $tc_docs["father_name"]; ?></td>
                            <td><?php echo $tc_docs["course"]; ?></td>
                            <td><?php echo $tc_docs['issuing_date'];?></td>
                            <td><?php echo $tc_docs['doc_type'];?></td>
                            <td><?php echo $staff_name;?></td>
                            <td><?php echo $tc_docs['doc_copy_order'];?></td>
                            <td><a href="<?php echo base_url();?>Certificate/transfer_certificate/<?php echo $tc_docs['id'];?>" class="btn btn-sm btn-info" target="_blank">View</a></td>
                            <td>
                                <!--<a href="<?php echo base_url(); ?>Certificate/update_transfer_certificate/<?php echo $tc_docs['id']; ?>" target="_blank">Edit</a>-->
                                <a href="<?php echo base_url(); ?>Certificate/issue_transfer_certificate/<?php echo $tc_docs['sid']."/".$tc_docs['id'];?>" target="_blank" class="btn btn-sm btn-warning text-white">Edit</a>
                                <!--<form method="post" action="<?php echo base_url(); ?>Certificate/issue_transfer_certificate/<?php echo $tc_docs['sid'];?>">-->
                                <!--    <button type="submit" name="edit" value="<?php echo $tc_docs['id']; ?>">Edit</button>-->
                                <!--</form>-->
                            </td>
                        </tr>
                        <?php
                            }
                        }
                        ?>
                    </tbody>
                </table>
            </div>
            <div class="table-responsive mt-3 mb-3">
                <table class="table table-bordered table-striped" id="mytable1">
                    <thead>
                        <tr>
                            <th class="text-center" colspan="8">Student Bonafied Certificate</th>
                        </tr>
                        <tr>
                            <th>Sr. No</th>
                            <th>Name</th>
                            <th>Date</th>
                            <th>Doc Type</th>
                            <th>Issued By</th>
                            <th>Copy</th>
                            <th>View</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php
                    $doc_table2='student_bonafied_certificate';
                        $all_docs2=$this->CertificateModel->get_data($doc_table2);
                        if($all_docs2){
                            foreach($all_docs2 as $docs2){
                                $tid=$docs2['cat_by'];
                                $staff_table='school_staff';
                                $staff_name='';
                                $staff_info=$this->CertificateModel->get_item_data($tid,$staff_table);
                                if($staff_info){
                                    foreach($staff_info as $staffinfo){
                                        $staff_name=$staffinfo['name'];
                                    }
                                }
                        ?>
                        <tr>
                            <td><?php echo $docs2['id'];?></td>
                            <td><?php echo $docs2['student_name'];?></td>
                            <td><?php echo $docs2['issuing_date'];?></td>
                            <td><?php echo $docs2['doc_type'];?></td>
                            <td><?php echo $staff_name;?></td>
                            <td><?php echo $docs2['doc_copy_order'];?></td>
                            <td><a href="<?php echo base_url();?>Certificate/student_certificate/<?php echo $docs2['id'];?>" class="btn btn-info btn-sm" target="_blank">View</a></td>
                            <td>
                                <a href="<?php echo base_url();?>Certificate/issue_student_certificate/<?php echo $docs2['sid']; ?>/<?php echo $docs2['id'];?>" class="btn btn-warning btn-sm text-white" target="_blank">Edit</a>
                            </td>
                        </tr>
                        <?php
                            }
                        }
                        ?>
                    </tbody>
                </table>
            </div>
            <div class="table-responsive">
                <table class="table table-bordered table-striped" id="mytable2">
                    <thead>
                        <tr>
                            <th class="text-center" colspan="8">Student Reimbursment Cea Certificate</th>
                        </tr>
                        <tr>
                            <th>Sr. No</th>
                            <th>Name</th>
                            <th>Date</th>
                            <th>Doc Type</th>
                            <th>Issued By</th>
                            <th>Copy</th>
                            <th>View</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php
                    $doc_table1='reimbursment_cea_certificate';
                        $all_docs1=$this->CertificateModel->get_data($doc_table1);
                        if($all_docs1){
                            foreach($all_docs1 as $docs){
                                $tid=$docs['cat_by'];
                                $staff_table='school_staff';
                                $staff_name='';
                                $staff_info=$this->CertificateModel->get_item_data($tid,$staff_table);
                                if($staff_info){
                                    foreach($staff_info as $staffinfo){
                                        $staff_name=$staffinfo['name'];
                                    }
                                }
                        ?>
                        <tr>
                            <td><?php echo $docs['id'];?></td>
                            <td><?php echo $docs['student_name'];?></td>
                            <td><?php echo $docs['issuing_date'];?></td>
                            <td><?php echo $docs['doc_type'];?></td>
                            <td><?php echo $staff_name;?></td>
                            <td><?php echo $docs['doc_copy_order'];?></td>
                            <td><a href="<?php echo base_url();?>Certificate/reimbursment_cea_certificate/<?php echo $docs['id'];?>" class="btn btn-info btn-sm" target="_blank">View</a></td>
                            <td><a href="<?php echo base_url();?>Certificate/issue_reimbursment_cea_certificate/<?php echo $docs['sid']; ?>/<?php echo $docs['id'];?>" class="btn btn-warning btn-sm bg-white" target="_blank">Edit</a></td>
                        </tr>
                        <?php
                            }
                        }
                        ?>
                    </tbody>
                </table>
            </div>    
                
            <div class="table-responsive">
                <table class="table table-bordered table-striped" id="mytable3">
                    <thead>
                        <tr>
                            <th class="text-center" colspan="8">Student Fee Certificate</th>
                        </tr>
                        <tr>
                            <th>Sr. No</th>
                            <th>Name</th>
                            <th>Date</th>
                            <th>Doc Type</th>
                            <th>Issued By</th>
                            <th>Copy</th>
                            <th>View</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php
                    $doc_table1='student_fee_certificate';
                        $all_docs1=$this->CertificateModel->get_data($doc_table1);
                        if($all_docs1){
                            foreach($all_docs1 as $docs){
                                $tid=$docs['cat_by'];
                                $staff_table='school_staff';
                                $staff_name='';
                                $staff_info=$this->CertificateModel->get_item_data($tid,$staff_table);
                                if($staff_info){
                                    foreach($staff_info as $staffinfo){
                                        $staff_name=$staffinfo['name'];
                                    }
                                }
                        ?>
                        <tr>
                            <td><?php echo $docs['id'];?></td>
                            <td><?php echo $docs['student_name'];?></td>
                            <td><?php echo $docs['issuing_date'];?></td>
                            <td><?php echo $docs['doc_type'];?></td>
                            <td><?php echo $staff_name;?></td>
                            <td><?php echo $docs['doc_copy_order'];?></td>
                            <td><a href="<?php echo base_url();?>Certificate/student_fee_certificate/<?php echo $docs['id'];?>" class="btn btn-info btn-sm" target="_blank">View</a></td>
                            <td><a href="<?php echo base_url(); ?>Certificate/issue_fee_certificate/<?php echo $docs['sid']."/".$docs['id']; ?>" class="btn btn-sm btn-warning bg-white" target="_blank">Edit</a></td>
                        </tr>
                        <?php
                            }
                        }
                        ?>
                    </tbody>
                </table>
            </div>
            
            
            <div class="table-responsive">
                <table class="table table-bordered table-striped" id="mytable4">
                    <thead>
                        <tr>
                            <th class="text-center" colspan="8">Student Character Certificate</th>
                        </tr>
                        <tr>
                            <th>Sr. No</th>
                            <th>Name</th>
                            <th>Date</th>
                            <th>Doc Type</th>
                            <th>Issued By</th>
                            <th>Copy</th>
                            <th>View</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php
                    $doc_table5='student_character_certificate';
                        $all_docs1=$this->CertificateModel->get_data($doc_table5);
                        if($all_docs1){
                            foreach($all_docs1 as $docs){
                                $tid=$docs['cat_by'];
                                $staff_table='school_staff';
                                $staff_name='';
                                $staff_info=$this->CertificateModel->get_item_data($tid,$staff_table);
                                if($staff_info){
                                    foreach($staff_info as $staffinfo){
                                        $staff_name=$staffinfo['name'];
                                    }
                                }
                        ?>
                        <tr>
                            <td><?php echo $docs['id'];?></td>
                            <td><?php echo $docs['student_name'];?></td>
                            <td><?php echo $docs['issuing_date'];?></td>
                            <td><?php echo $docs['doc_type'];?></td>
                            <td><?php echo $staff_name;?></td>
                            <td><?php echo $docs['doc_copy_order'];?></td>
                            <td><a href="<?php echo base_url();?>Certificate/character_certificate/<?php echo $docs['id'];?>" class="btn btn-info btn-sm" target="_blank">View</a></td>
                            <td><a href="<?php echo base_url(); ?>Certificate/issue_character_certificate/<?php echo $docs['sid']."/".$docs['id']; ?>" class="btn btn-sm btn-warning bg-white" target="_blank">Edit</a></td>
                        </tr>
                        <?php
                            }
                        }
                        ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>