							<div class="row-fluid">
                                <div class="span12">
                                    
                                    <table id="table" class="table table-striped table-bordered table-hover">
                                        <caption>Registros: <?php echo count($query); ?></caption>
                                        <thead>
                                            <tr>
                                                <th>Orden</th>
                                                <th># Pro.</th>
                                                <th>Proveedor</th>
                                                <th>Captura</th>
                                                <th>Envio</th>
                                                <th>Limite</th>
                                                <th>Responsable</th>
                                                <th>Capturo</th>
                                                <th>Recibe</th>
                                                <th>Recibe</th>
                                                <th>Embarca</th>
                                                <th>Embarca</th>
                                                <th>Pedido</th>
                                                <th>Arribo</th>
                                                <th>Detalle</th>
                                                <th>Impresión</th>
                                                <th>Ampliar</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php 

                                            $cans = 0;
                                            $aplica = 0;

                                            foreach($query as $row){

                                                if($row->aplica == 0)
                                                {
                                                    $ampliar = anchor('compra/orden_ampliar/'.$row->id_orden . '/'. $row->fecha_limite, 'Ampliar');
                                                }else
                                                {
                                                    $ampliar = null;
                                                }

                                            ?>
                                            <tr>
                                                <td><?php echo $row->folprv; ?></td>
                                                <td><?php echo $row->prv; ?></td>
                                                <td><?php echo $row->razo; ?></td>
                                                <td><?php echo $row->fecha_captura; ?></td>
                                                <td><?php echo $row->fecha_envio; ?></td>
                                                <td><?php echo $row->fecha_limite; ?></td>
                                                <td><?php echo $row->responsable; ?></td>
                                                <td><?php echo $row->captura; ?></td>
                                                <td><?php echo $row->recibe; ?></td>
                                                <td><?php echo $row->recibeNombre; ?></td>
                                                <td><?php echo $row->embarca; ?></td>
                                                <td><?php echo $row->embarcaNombre; ?></td>
                                                <td style="text-align: right;"><?php echo number_format($row->cans, 0); ?></td>
                                                <td style="text-align: right;"><?php echo number_format($row->aplica, 0); ?></td>
                                                <td><?php echo anchor('compra/orden_detalle/'.$row->id_orden, 'Detalle'); ?></td>
                                                <td><a href="<?php echo $url . $row->id_orden . '/1'; ?>" target="_blank">Impresión</a></td>
                                                <td><?php echo $ampliar; ?></td>
                                            </tr>
                                            <?php 

                                            $cans = $cans + $row->cans;
                                            $aplica = $aplica + $row->aplica;

                                            } 


                                            ?>
                                        </tbody>
                                        <tfoot>
                                            <tr>
                                                <td colspan="12" style="text-align: right;">Totales: </td>
                                                <td style="text-align: right;"><?php echo number_format($cans, 0); ?></td>
                                                <td style="text-align: right;"><?php echo number_format($aplica, 0); ?></td>
                                                <td colspan="3"></td>
                                            </tr>
                                        </tfoot>
                                    </table>
                            
                                </div>
                            </div>
