<!DOCTYPE html>


</style>






<html lang="en" class="fa-events-icons-ready"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php
$bodega=$_GET["bodega"];
include("../facturacion/datosimpresion.php");
?> 

<?php
use PhpParser\Node\Expr\Isset_;

include("../../controlador/conexion/conexion.php");
$cone=new conexion;
$con=$cone->conectar();
$sent="SELECT * FROM `clientes` INNER JOIN ciudades on clientes.codigociudad=ciudades.CodigoDIAN where credValor>0";
$consultar=$con->query($sent);
$filaa=$consultar->fetch_all(MYSQLI_ASSOC);

?>
   
   <link href="../facturacion/fact/bootstrap.min.css" rel="stylesheet">
    
    <link href="../facturacion/fact/style.css" rel="stylesheet">

   </head>
   <body class="" id="cuerpo" data-new-gr-c-s-check-loaded="" data-gr-ext-installed=""   >
      
         <!-- Container --> 
         <!--  container-fluid Billig-container -->
         <div class=" shadow-sm">
            <!-- Header -->
            <header>
               <div class="row align-items-center ">                

                  <div class="col-4 order-sm-0  ">
                     
                     <strong><?php print($nombreNegocio); ?></strong>
                     <address>
                     <?php print($representante ); ?><br>
                     <?php print($nit ); ?><br>
                      <?php print($tel); ?>
                      <?php print($direccion); ?>
                     </address>
                  </div>

                  <div class="col-4 text-end ">
                     <h4 class="mb-0 text-uppercase">CARTERA CLIENTES  </h4>
                    
                     
                  </div>
               </div>       
              
            </header>
           
            <main>         
         
           
               <div class="card" >
                  <div class="card-body p-0">
                     <div class="">
                        <table class="table-bordered " id="tablap" >
                           <thead>
                           <tr>
                     

                              <td class="col-2 border-1"><strong>Cedula</strong></td>
                              <td class="col-3 border-1"><strong>Nombre</strong></td>
                              <td class="col-3 border-1"><strong>Direccion</strong></td>
                              <td class="col-2 border-1"><strong>Telefono</strong></td>
                                <td class="col-2 border-1"><strong>Valor Credito</strong></td>
                              
                           </tr>
                        </thead>
                           <tbody>
                        
                           <?php


$TOTAL=0;

foreach($filaa as $valor) {
   $codigo=$valor["cedula"];
   $nombre=$valor["Nombre"];
   $apellido=$valor["apellido"];
   $dire=$valor["direccion"];
   $precio=$valor["credValor"];
   $tele=$valor["telefono"];
   $TOTAL=$TOTAL+$precio;
   $ciudad=$valor["Ciudad"];

   echo("
   <tr>  
   
   <td class='col-2'> $codigo
   <td class='col-3 border-1'>$nombre   $apellido
   <td class='col-3 border-1'>$dire  - $ciudad
   <td class='col-2 border-1'>$tele
   <td class='col-2'>". number_format($precio )."
   
   </tr>
   ");


}

?>

               
                              <tr>
                                 
                             
                                <td colspan="<?php echo($col2); ?>" class="bg-light-2 text-end border-0"><strong>TOTAL CARTERA:</strong></td>
                                 <td class="bg-light-2 text-end border-0"><strong><?php echo(number_format($TOTAL)); ?></strong></td>
                                 

                              </tr>
                           
                           </tbody>
                        </table>




         


                     </div>
                  </div>
               </div>
            </main>
            <!-- Footer -->
            <footer class="text-center mt-4">
              
   

               <!-- <p class="text-1"><strong>NOTA :</strong> </p> -->
               
            </footer>
         </div>
        
   
         <script type='text/javascript'>


function imprimir(){
    window.print()
   //  
     let navegador = navigator.userAgent;
     if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)) {
     
        } else{
         setTimeout(window.close, 300);
        }
 

    }

    setTimeout(imprimir,300);




 
</script>
   
</body></html>