function yxSimpan(){
   Swal.fire({
  title: "Berhasil",
  text: "Data Berhasil Disimpan",
  icon: "success"
});
}

function nxSimpan(){
    let timerInterval
    Swal.fire({
        icon: 'error',
        title: 'Gagal Disimpan',
        showConfirmButton: false,
      timer: 1050,
      timerProgressBar: false,
      didOpen: () => {
      
        timerInterval = setInterval(() => {
          const content = Swal.getContent()
          if (content) {
            const b = content.querySelector('b')
            if (b) {
              b.textContent = Swal.getTimerLeft()
            }
          }
        }, 100)
      }
    })
}

function ySimpan(url){
    let timerInterval
    Swal.fire({
        icon: 'success',
        title: 'Berhasil Disimpan',
        showConfirmButton: false,
      timer: 1050,
      timerProgressBar: false,
      didOpen: () => {
      
        timerInterval = setInterval(() => {
          const content = Swal.getContent()
          if (content) {
            const b = content.querySelector('b')
            if (b) {
              b.textContent = Swal.getTimerLeft()
            }
          }
        }, 100)
      },
      willClose: () => {
        document.location=url;
      }
    })
}

function nSimpan(url){
    let timerInterval
    Swal.fire({
        icon: 'error',
        title: 'Gagal Disimpan',
        showConfirmButton: false,
      timer: 1050,
      timerProgressBar: false,
      didOpen: () => {
      
        timerInterval = setInterval(() => {
          const content = Swal.getContent()
          if (content) {
            const b = content.querySelector('b')
            if (b) {
              b.textContent = Swal.getTimerLeft()
            }
          }
        }, 100)
      },
      willClose: () => {
        document.location=url;
      }
    })
}

//hapus
function nHapus(url){
    let timerInterval
    Swal.fire({
        icon: 'error',
        title: 'Gagal Dihapus',
        showConfirmButton: false,
      timer: 1050,
      timerProgressBar: false,
      didOpen: () => {
      
        timerInterval = setInterval(() => {
          const content = Swal.getContent()
          if (content) {
            const b = content.querySelector('b')
            if (b) {
              b.textContent = Swal.getTimerLeft()
            }
          }
        }, 100)
      },
      willClose: () => {
        document.location=url;
      }
    })
}

function yHapus(url){
    let timerInterval
    Swal.fire({
        icon: 'success',
        title: 'Berhasil Dihapus',
        showConfirmButton: false,
      timer: 1050,
      timerProgressBar: false,
      didOpen: () => {
      
        timerInterval = setInterval(() => {
          const content = Swal.getContent()
          if (content) {
            const b = content.querySelector('b')
            if (b) {
              b.textContent = Swal.getTimerLeft()
            }
          }
        }, 100)
      },
      willClose: () => {
        document.location=url;
      }
    })
}






function v(url){
    Swal.fire({
    icon: 'success',
    title: 'Berhasil Disimpan',
    showConfirmButton: false,
    })

    setTimeout(function(){ 
        document.location=url;
        
    }, 1100);
}