<script   src="js/scroll.js"></script>

<div class="row text-center">
    <b>
        <?php if($titulo!="d"): ?>
            <?php echo e($titulo); ?>

        <?php endif; ?>
    </b>
</div>

<div class="table-responsive"><br/>
<table width="95%" class="table-bordered table-hover fixed" id="tablaReporte">
    <thead>
        <tr>
            <th colspan="3" style="text-align: center; background: #bababa">Producto</th>
            <th colspan="2" style="text-align: center; background: #bababa">Valor</th>
        </tr>
        <tr style="background: #aa4d0e; color:white">
            <th>Código</th>
            <th>Nombre</th>
            <th>Cantidad</th>
            <th>Total</th>
            <th>Descuento</th>
        </tr>
    </thead>
    <tbody>
        <?php            
            $TTotalDescuento = 0;
            $TTotalPrecio = 0;
        ?>
       <?php foreach($reporte as $repor): ?>
       
    <tr>
        <td align="right"><a href="<?php echo e(url('/detprodes/'.$repor->codpro.'/'.$_REQUEST['fecha1'].'/'.$_REQUEST['fecha2'])); ?>" target="_blank"> <?php echo e($repor->codpro); ?> </a></td>
        <td align="left">&nbsp;&nbsp;&nbsp;<?php echo e($repor->nompro); ?></td>
        <td align="right"><?php echo e($repor->cantidad); ?></td>
        <td align="right"><?php echo e($repor->total); ?></td>
        <td align="right"><?php echo e($repor->descuento); ?></td>        
        <?php 
            $TTotalPrecio += $repor->total;
            $TTotalDescuento += $repor->descuento;
        ?>
    </tr>    
      <?php endforeach; ?>
    </tbody>
    
    <tfoot>
        <tr>
          <td colspan="5"><br/></td>
      </tr>
      <tr>
        <th colspan="3" style="text-align: right">Total:</th>
        <th style="text-align: right"><?php echo e($TTotalPrecio); ?></th>
        <th style="text-align: right"><?php echo e($TTotalDescuento); ?></th>        
      </tr>
      <tr>
          <td colspan="5"><br/></td>
      </tr>
    </tfoot> 
    
    
    
    
</table>
</div>