<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="2" style="text-align: center; background: #FCFB98">Crédito</th>
            <th colspan="3" style="text-align: center; background: #FCFB98">Valor</th>
            <th colspan="2" style="text-align: center; background: #bababa">Otros datos</th>
        </tr>
        <tr style="background: #aa4d0e; color:white">
            <th>Código</th>
            <th>Fecha</th>
            <th>Compra</th>
            <th>Abonado</th>
            <th>Restante</th>
            <th>Cliente</th>            
            <th>Usuario</th>
        </tr>
    </thead>
    <tbody>
        <?php
            $TTotalCom = 0;
            $TTotalAbo = 0;            
        ?>
       <?php foreach($reporte as $repor): ?>
       
    <tr>
        <td align="right"><a href="<?php echo e(url('/detcreaboc/'.$repor->idcredito.'/'.$repor->IdVenta_Fin.'/'.$repor->Cedula)); ?>" target="_blank"><?php echo e($repor->IdVenta_Fin); ?></a></td>
        <td align="right">&nbsp;&nbsp;&nbsp;<?php echo e($repor->created_at); ?></td>
        <td align="right"><?php echo e($repor->vcompra); ?></td>
        <td align="right"><?php echo e($repor->vpagado); ?></td>
        <td align="right"><?php echo e($repor->vcompra-$repor->vpagado); ?></td>
        <td align="left">&nbsp;&nbsp;&nbsp;<?php echo e($repor->nomcli." ".$repor->apecli); ?></td>        
        <td align="left">&nbsp;&nbsp;&nbsp;<?php echo e($repor->Nombres." ".$repor->Apellidos); ?></td>
        <?php            
            $TTotalCom += $repor->vcompra;
            $TTotalAbo += $repor->vpagado;            
        ?>
    </tr>    
      <?php endforeach; ?>
    </tbody>
    
    <tfoot>
        <tr>
          <td colspan="7"><br/></td>
      </tr>
      <tr>
        <th colspan="2" style="text-align: right">Total:</th>
        <th style="text-align: right"><?php echo e($TTotalCom); ?></th>
        <th style="text-align: right"><?php echo e($TTotalAbo); ?></th>
        <th style="text-align: right"><?php echo e($TTotalCom-$TTotalAbo); ?></th>
        <th colspan="2" style="text-align: right"></th>
      </tr>
      <tr>
          <td colspan="7"><br/></td>
      </tr>
    </tfoot> 
    
    
    
    
</table>
</div>
