function buscarResolu(b, a){
  const parametros = new FormData();
  parametros.append("txtNum", document.formResolu.txtNum.value);

  $.ajax({
    data:  parametros,
    url:   "busResolu/data.php",
    type:  "post",
    contentType: false,
    processData: false,
    beforeSend: function () {
      alLoad("Consultando...")
    },
    success: function (jsonPhp) {
      const jsonJS = JSON.parse(jsonPhp);

      tblClear("tblResolu");
      jsonJS.resolu.forEach(function(i){
        addRowResolu(i.res_num, i.res_fec, i.res_serie, i.res_ini, i.res_fin, i.res_fecven, i.res_stat);
      });

      $("#tblResolu tbody tr").dblclick(function() {
        selectResolu(a, $(this));
      });

      $("#tblResolu tbody #btnSelecResolu").click(function() {
        selectResolu(a, $(this).parents("tr"));
      });

      alClose();
    }
  });
}

function addRowResolu(num, fec, serie, ini, fin, fecven, stat) {
  const markup =  "<tr>"
                    +"<td>"+num+"</td>"
                    +"<td>"+YMDToDMY(fec)+"</td>"
                    +"<td>"+serie+"</td>"
                    +"<td>"+ini+"</td>"
                    +"<td>"+fin+"</td>"
                    +"<td>"+YMDToDMY(fecven)+"</td>"
                    +"<td>"+stat+"</td>"
                    +"<td><button class='btn btn-sm btn-warning badge' id='btnSelecResolu'>"+textBtnSelec+"</button></td>"
                  +"</tr>";
  $("#tblResolu tbody").append(markup);
}

function selectResolu(a, tr) {
  $("#pills-"+a+"-tab").click();
  $("#"+inputResolu).val(tr.find("td:eq(0)").text());
  $("#"+inputResolu).trigger("change");
  tblClear("tblResolu");
}