
function loading(){
    $('.btn-save').prop("disabled", true);
      // add spinner to button
      $('.btn-save').html(
        '<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> Loading...'
      );
     window.setTimeout(function () {
      $('.btn-save').prop("disabled", false);
      $('.btn-save').html('Simpan');
    }, 2000);
}


function downloadID() {
  html2canvas(document.getElementById("idCard")).then(canvas => {
    const link = document.createElement("a");
    link.download = "id-card.jpg";
    link.href = canvas.toDataURL("image/jpeg", 0.95);
    link.click();
  });
}


/** Print Data */
$('.btn-print').click(function (e) {
    var url = "../siswa-print-idcard";
    window.open(url, '_blank');
});