$(".pic").on("input", function () {
  // console.log('KEYUP:', pic);
  let pic = $(this).val();
    console.log(pic);
    let idcustomer = $(".idcustomer").val();
    console.log(idcustomer);


  if (pic.length >= 2) {
    $.ajax({
      url: "asset/autocomplete_pic.php",
      type: "POST",
      data: {
        pic: pic,
        idcustomer: idcustomer,
      },
      success: function (data) {
        // console.log("RESPONSE:", data);
        $(".picList").html(data).show();
      },
    });
  } else {
    $(".picList").hide();
  }
});

$(document).on("click", ".pic-item", function () {
  $(".pic").val($(this).data("nama"));
  $("#telep").val($(this).data("telep"));
  $("#note").val($(this).data("note"));
  $(".picList").hide();
});
