<div class="container-fluid mt-3 mb-3 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();?>Transport">Transport</a></li>
                <li class="breadcrumb-item">Students</li>
            </ul>
            
            <ul class="nav nav-tabs tab-item-1">
                <li class="nav-item">
                    <a class="nav-link active" href="<?php echo base_url();?>Transport/students">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-list-ol" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5z"/>
                            <path d="M1.713 11.865v-.474H2c.217 0 .363-.137.363-.317 0-.185-.158-.31-.361-.31-.223 0-.367.152-.373.31h-.59c.016-.467.373-.787.986-.787.588-.002.954.291.957.703a.595.595 0 0 1-.492.594v.033a.615.615 0 0 1 .569.631c.003.533-.502.8-1.051.8-.656 0-1-.37-1.008-.794h.582c.008.178.186.306.422.309.254 0 .424-.145.422-.35-.002-.195-.155-.348-.414-.348h-.3zm-.004-4.699h-.604v-.035c0-.408.295-.844.958-.844.583 0 .96.326.96.756 0 .389-.257.617-.476.848l-.537.572v.03h1.054V9H1.143v-.395l.957-.99c.138-.142.293-.304.293-.508 0-.18-.147-.32-.342-.32a.33.33 0 0 0-.342.338v.041zM2.564 5h-.635V2.924h-.031l-.598.42v-.567l.629-.443h.635V5z"/>
                        </svg>
                        All Routes</a>
                </li>
                <li class="nav-item">
                    <a href="<?php echo base_url();?>Transport/list_student" class="nav-link active">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-node-plus-fill" viewBox="0 0 16 16">
                            <path d="M11 13a5 5 0 1 0-4.975-5.5H4A1.5 1.5 0 0 0 2.5 6h-1A1.5 1.5 0 0 0 0 7.5v1A1.5 1.5 0 0 0 1.5 10h1A1.5 1.5 0 0 0 4 8.5h2.025A5 5 0 0 0 11 13zm.5-7.5v2h2a.5.5 0 0 1 0 1h-2v2a.5.5 0 0 1-1 0v-2h-2a.5.5 0 0 1 0-1h2v-2a.5.5 0 0 1 1 0z"/>
                        </svg>  Add New Stuent
                    </a>
                </li>
            </ul>
            
            <div class="table-responsive">
                <table class="table table-bordered table-striped" id="mytable">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Name</th>
                            <th>Edit</th>
                            <th>Fee</th>
                            <th>Status</th>
                            <th>Father's Name</th>
                            <th>Mob. No.</th>
                            <th>Address</th>
                            <th>Course</th>
                            <th>Route</th>
                            
                            
                            
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
                        $table='transport_student_report';
                        $count=0;
                        $get_students_data=$this->TransportModel->get_data($table);
                        if($get_students_data){
                            foreach($get_students_data as $students_data){
                                $count=$count + 1;
                        ?>
                        <tr>
                            <td><?php echo $count;?></td>
                            <?php 
                            $sid=$students_data['sid'];
                            $acedemic_session=$students_data['acedemic_session'];
                            $student_table='student';
                            $get_student_info=$this->TransportModel->get_item_data($sid,$student_table);
                            if($get_student_info){
                                foreach($get_student_info as $student_info){
                            ?>
                            <td><?php echo $student_info['student_name'];?></td>
                            <td><a href="<?php echo base_url();?>Transport/add_student/<?php echo $sid; ?>" class="btn btn-sm btn-warning" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-square" viewBox="0 0 16 16"><path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"/><path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z"/></svg></a></td>
                            <td><a href="<?php echo base_url();?>Transport/fee/<?php echo $sid; ?>" class="btn btn-sm btn-success" target="_blank">Fee</a></td>
                            <td>
                            <?php
                            $status=$students_data['status'];
                            if($status == 1){
                            ?>
                            <button class="btn btn-sm btn-ssuccess">Active</button>
                            <?php
                            }else if($status==0){
                            ?>
                            <button class="btn btn-sm btn-danger">Inactive</button>
                            <?php
                            }
                            ?>
                            </td>
                            <td><?php echo $student_info['father_name'];?></td>
                            <td><?php echo $student_info['contact_no'];?></td>
                            <td><?php echo $student_info['address'];?></td>
                            <?php
                                }
                            }
                            
                            ?>
                            
                            <?php
                            $get_student_courses_data=$this->TransportModel->student_session_info($sid,$acedemic_session);
                            if($get_student_courses_data){
                                foreach($get_student_courses_data as $student_courses_data){
                                    $course_id=$student_courses_data['course_id'];
                                    $course_table='courses';
                                    $get_course_info=$this->TransportModel->get_item_data($course_id,$course_table);
                                    if($get_course_info){
                                        foreach($get_course_info as $course_info){
                            ?>
                            <td><?php echo $course_info['course']; echo " "; echo $course_info['subject_stream'];?></td>
                            <td>
                            <?php                                            
                                        }
                                    }

                                }
                            }
                            $route_id=$students_data['route_no'];
                            $transport_route_table='transport_routes';
                            $get_route_info=$this->TransportModel->get_item_data($route_id,$transport_route_table);
                            if($get_route_info){
                                foreach($get_route_info as $route_info){
                            echo $route_info['route_title']; 
                            
                                }
                            }
                            ?>
                            </td>

                            
                            
                        </tr>
                        <?php
                            }
                        }
                        ?>
                        
                    </tbody>
                </table>
            </div>
            <?php $this->load->view('erp/transport/quick-links');?>
        </div>
        
    </div>
</div>