Jump to content
Sign in to follow this  

How to pagination

Recommended Posts

hello, im use this module, but between to 50 files i want pagination....

<div class="table-responsive">
            <table class="table table-hover">
            <thead >
                <tr align="center">
                    <th>Tipo de Aeronave</th>
                    <th>Carga Maxima</th>
                <?php if($aircrafts != null){ 
                    foreach($aircrafts as $aircrafts){?>
                    <tr align="center">
                        <td><?php print $aircrafts->fullname;?></td>
                        <td><?php print $aircrafts->registration;?></td>
                        <td><?php print $aircrafts->range;?> <b>Nm </b></td>
                        <td><?php print $aircrafts->airline;?> </td>
                        <td><?php print $aircrafts->maxpax;?> </td>
                        <td><?php print $aircrafts->maxcargo;?> <b>lbs</b></td>
                        <td><a href="<?php echo url('fleet/view/'.$aircrafts->id); ?>"><button class="btn btn-success">Ver</button></a></td>
                <?php }}?>
        <div class="pagination">
            <?php $query = "SELECT * FROM phpvms_aircrafts";
                $total_registros = $aircrafts->id;
                $total_pagina = ceil($aircraft->id/'20');

                print '<a href="https://oneworldv.com/index.php/fleet?pagina=1">'.' Primera '.'</a>';

                for($i=1; $i<=$total_paginas; $i++){
                    print '<a href="https://oneworldv.com/index.php/fleet?pagina='.$i.'">'.$i.'</a>';
                print '<a href="https://oneworldv.com/index.php/fleet?pagina=$total_paginas">'.' Ultima '.'</a>';

but i cant to run....

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this