<script>
    $('#fcontra').select2({
            placeholder: "Selecciona una opción",
             width: '100%',
            containerCssClass: 'dropdown-estilo',
            dropdownCssClass: 'contenedor-estilo',
            allowClear: false // Para habilitar un botón de limpiar
    });


    $('#fcontexml').select2({
            placeholder: "Selecciona una opción",
             width: '100%',
            containerCssClass: 'dropdown-estilo',
            dropdownCssClass: 'contenedor-estilo',
            allowClear: false // Para habilitar un botón de limpiar
    });
    
</script>
<style>
    .dropdown-estilo {
        display: block;
        width: 100%;
        height: calc(2.25rem + 2px);
        padding: .375rem .75rem;
        font-size: 1rem;
        line-height: 1.5;
        color: #495057;
        background-color: #fff;
        background-clip: padding-box;
        border: 1px solid #ced4da;
        border-radius: .25rem;
        transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out
    }

    .contenedor-estilo {
        width: 100%;
        color: #495057;
        background-color: #fff;
        background-clip: padding-box;
        border: 1px solid #ced4da;
        border-radius: .25rem;
    }

    .select2-container.form-control {
        
        border: 1px solid #ced4da;
        border-radius: .25rem;
        
    }


    .select2-container.form-control {
        padding: 0;
        border: 1px solid #ced4da;
        border-radius: 0.25rem;
        height: calc(2.25rem + 2px);
    }

    .select2-container--default .select2-selection--single {
        height: calc(2.25rem + 2px);
        line-height: calc(2.25rem + 2px);
    }

</style>
<div id="formcontrar" class="col-md-12" style="display: none;margin-top: 10px;width: 98%;">
    <div class="row" >
        <div class="col-sm">
            <h3>Pagos</h3>
        </div>

        <p>
            Si existe el <strong>contra recibo</strong> podra realizar pagos
            
        </p> 
    </div>
    
        <form id="proveedorp" style="margin-left:15px ;">

                <div class="row">
                    <input type="hidden" id="idUsuario" name="idUsuario" value="<?php echo $_SESSION['idUsuario'] ?>">
                    <input type="hidden" id="userrol" name="userrol" value="<?php echo $_SESSION['userrol'] ?>">
                    <p><div class="form-group col-lg-3 col-md-6 col-md-12">
                        <label class="mb-2 tag">Proveedores</label>
                            <select required class="form-control" name="fcontra" id="fcontra" onchange="traecontrarecibos()" >
                                <option value=""></option>
                                    <?php foreach ($objJasoncontrareciboc as $contra) { ?>
                                        <option value="<?php echo $contra->iduser ?>" rfcuser="<?php echo $contra->rfc ?>" <?php echo !empty($fcontra) ? selected($fcontra,$contra->iduser ) : '' ?> ><?php echo htmlentities($contra->nombre) ?></option>
                                    <?php } ?>
                            </select>
                    </div>
                    <div class="form-group col-lg-3 col-md-6 col-md-12">
                        <label class="mb-2 tag">Folio contra recibos</label>
                            <select required class="form-control" name="fcontexml" id="fcontexml" onchange="xml_contrarecibo()" >
                                <option value=""></option>
                                    <?php if($objJasoncontrareciboxml){ 
                                                foreach ($objJasoncontrareciboxml as $traecontr) { ?>
                                        <option value="<?php echo $traecontr->idcr ?>" ><?php echo htmlentities($traecontr->folio_cr) ?></option>
                                    <?php       } 
                                        }
                                    ?>
                            </select>
                    </div>
                </div></p>
        

            <div id="facturasxml"></div>
            <div id="docpagos" style=" display: none;margin-left:17px;">
                <div class="form-group col-lg-4 col-md-6 col-md-12">
                        <label class="mb-2 tag">Recibo:</label>
                        <input type="file" id="filessubirr"  name="filessubirr[]" multiple accept=".pdf,.jpg,.jpeg" >
                </div>
            
                <div class="row" id="textosaldos" style="margin-left:17px ;"></div>
            </div>
            <div class="row" style="margin-top:5px ;">
                <div class="form-group col-lg-6 col-md-6 col-md-12">
                    <button id="sign_in" class="btn btn-success" onclick="crear_contrar_pagos()">Crear </button>
                                            
                    <button  class="btn btn-danger" onclick="cerrar_cap_cp('traeprovee','<?php echo $idusuario ?>','<?php echo $userrol?>')">Cancelar </button>
                </div>
            </div>
                                
        </form>

</div>

