<script language="javascript"> <script>
document.addEventListener("DOMContentLoaded", function () {
const checkButton = document.getElementById("Check-BTN");
checkButton.addEventListener("click", function () {
// Mostrar el SweetAlert2 para ingresar IMEI o SN
Swal.fire({
title: '<i class="fas fa-cloud"></i> iCloud Check',
html: '<label for="IMEI">IMEI or SN:</label><input type="text" id="IMEI" class="swal2-input" placeholder="Enter IMEI or SN">',
showCancelButton: true,
confirmButtonText: 'Check',
cancelButtonText: 'Cancel',
showLoaderOnConfirm: true,
preConfirm: () => {
const imeiValue = document.getElementById("IMEI").value;
return fetch('../config/fmi_check/check.php', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: 'imei=' + encodeURIComponent(imeiValue),
})
.then(response => {
if (!response.ok) {
throw new Error(response.statusText);
}
return response.json();
})
.catch(error => {
Swal.showValidationMessage(`Request failed: ${error}`);
});
},
allowOutsideClick: () => !Swal.isLoading()
}).then((result) => {
if (result.isConfirmed) {
Swal.fire({
title: 'Result Check',
html: result.value.response,
icon: 'info',
confirmButtonText: 'OK'
});
}
});
});
});
</script></script>
© 2023 Quttera Ltd. All rights reserved.