<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">
            <h4>Complemento de pago</h4>
        </div>

        <p>
            Si existe el <strong>Pago</strong> podra cargar el XML del complemento de pago
            
        </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">Folio pagos</label>
                            <select required class="form-control" name="pagosxml" id="pagosxml" onchange="xml_pagos()" >
                                <option value="" disabled selected>Selecciona una opción</option>
                                    <?php if($objJasonpagos){ 
                                                foreach ($objJasonpagos as $traepagos) { ?>
                                        <option value="<?php echo $traepagos->id ?>" ><?php echo htmlentities($traepagos->folio) ?></option>
                                    <?php       } 
                                        }
                                    ?>
                            </select>
                    </div>
                </div></p>
        

            <div id="pagosdexml"></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">Complemento XML:</label>
                        <input type="file" id="filessubirx"  name="filessubirx[]" multiple accept=".xml" onChange="onLoadXML(event.target.files)">
                </div>
                <div class="row">
                    <div class="table-responsive text-center">
                    <table class="table table-responsive-sm align-items-center table-flush table-hover table_minimize">
                        <thead class="thead-light">
                            <tr style="font-size: 13px">
                                <th class="tabla1" scope="col">#</th>
                                <th class="tabla1" scope="col">UUID</th>
                                <th class="tabla1" scope="col">RFC Emisor</th>
                                <th class="tabla1" scope="col">Nombre Emisor</th>
                                <th class="tabla1" scope="col">RFC Receptor</th>
                                <th class="tabla1" scope="col">Nombre Receptor</th>
                                <th class="tabla1" scope="col">Fecha Emisión</th>
                                <th class="tabla1" scope="col">Monto</th>
                                <th class="tabla1" scope="col">Moneda</th>
                                <th class="tabla1" scope="col">Tipo Comprobante</th>
                                <th class="tabla1" scope="col"></th>
                            </tr>
                        </thead>
                        <tbody id="tbody_upload_xml">
                            <?php if($traecontxml){ 
                                 foreach ($traecontxml as $xmls) { ?>
                                <tr style="font-size: 11.5px">
                                    <td></td>
                                    <td><?php echo $xmls->UUID ?></td>
                                    <td><?php echo $xmls->rfc_emisor ?></td>
                                    <td><?php echo $xmls->emisor ?></td>
                                    <td><?php echo $xmls->rfc_receptor ?></td>
                                    <td><?php echo $xmls->receptor ?></td>
                                    <td><?php echo $xmls->f_emision ?></td>
                                    <td><?php echo $xmls->monto ?></td>
                                    <td><?php echo $xmls->moneda ?></td>
                                    <td><?php echo $xmls->tipo_c ?></td>
                                    <td><div class="btn-group"><button type="button" class="btn boton-delete btn-sm" title="Eliminar" onclick="quitar_xml('quitarxml','x','<?php echo $id ?>','<?php echo $oc ?>','<?php echo $rfc ?>','<?php echo $fobra ?>',<?php echo $idusuario ?>,<?php echo $userrol ?>,'<?php echo $cadena ?>',<?php echo $xmls->id ?>,<?php echo $xmls->posiscion ?>,<?php echo $xmls->id_arch ?>)"><i class="fas fa-trash-alt"></i></button></div></td>
                                    
                                </tr>
                            <?php } 
                             } ?>
                        </tbody>
                    </table>
                    </div>
                </div>
            <table>
            <tbody id="tbody_fix_xml">
                </tbody>
            </table>
            <div class="row" id="textosaldos" style="margin-left:17px ;"></div>
            <div class="row" style="margin-left:5px;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="subir_archivo_xml_cp()">Crear </button>
                                            
                    <button  class="btn btn-danger" onclick="cerrar_cap_cp('traeprovee','<?php echo $idusuario ?>','<?php echo $userrol?>')">Cancelar </button>
                </div>
            </div>
                                
        </form>

</div>

