<?php
include_once("../header.php");
include_once("../php/config.php");

$sql_clientes = mysql_query("select * from clientes order by nombre asc") or die(mysql_error());


?>
<style>
    .titulos{
        font-family: verdana;
        font-size: 12px;
    }
</style>
<br>
    <div class="container" style="background:white; padding:18px; ">
    <!-- Breadcrumbs-->
          

               
   <form id="frm" name="frm" action="" method="post">           
    <div class="row">
       
        <div class="col-md-12">
            <h3 class="text-rojo"><i class="fa fa-calendar"></i> Historial de cliente</h3>
            <hr>
                 <div class="row">
                        <div class="col-md-1">
                            <b>Clientes</b>
                        </div>
                        <div class="col-md-3">
                            <select  class="form-control  mb-2" id="clientes">

                                <option value="" selected>Seleccione un cliente</option>
                                <?php while ($r = mysql_fetch_array($sql_clientes)) { ?>
                                    <option value="<?php echo $r['nombre'] ?>"><?php echo $r['nombre'] ?></option>
                                <?php } ?>
                            </select>
                        </div>
						
						 <div class="col-md-1">
                            <b>Moneda</b>
                        </div>
						
						 <div class="col-md-2">
                            <select  class="form-control  mb-2" id="moneda">

                                <option value="" selected>Todas</option>
								<option value="">Pesos</option>
								<option value="Gourde">Gourde</option>
								<option value="Dolar">Dolar</option>
                                
                            </select>
                        </div>
                     
                     
                       
                     
                     
					</div>
				  
				  
                                
       
            
            
          
        <hr>
        <br> 
        <a href="#" onClick="reporte()" class="btn btn-rojo"><i class="bi bi-search"></i>Generar Reporte</a>
        </div>
                    
    </div>
    </form>     
            
            
</div>
          


          
</div>
    </div>



        	<!---Modal mora-->
	<div class="modal" id="modalMora" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <h5 class="modal-title" id="exampleModalLabel">Ajuste de mora manual</h5>
            <button class="close" type="button" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">×</span>
            </button>
          </div>
          <div class="modal-body">
              <div class="row">
                  <label for="monto_mora" class="col-sm-4 col-form-label" >Monto</label>
                  <div class="col-sm-8">
                      <input autocomplete="off" type="number"  class="form-control mb-2" id="monto_mora" name="monto_mora" value="">
                  </div>
              </div>
          </div>
          <div class="modal-footer">
          <button  onClick="ajuste_mora()" class="btn btn-warning"  data-dismiss="modal"><i class="fa fa-check"></i>Aceptar</button>
           <button class="btn btn-default"  data-dismiss="modal"><i class="fa fa-home"></i>Salir</button>
          </div>
        </div>
      </div>
    </div>
        
        
	<?php
	include_once("../footer.php");
 
	?>
            
                <script>    
                    $("#clientes").select2()
                    function reporte(){
                        var clientes = $("#clientes").val();
						var moneda = $("#moneda").val();
                        
                        
                        var param="";
                       
                        param+="&clientes="+clientes;
						 param+="&moneda="+moneda;
                        
                        window.open('rptHistorial.php?'+param,'_blank', 'toolbar=no,scrollbars=no,resizable=no,top=500,left=500,width=800,height=700');
                        
                        
                    }
                </script>