refactor: replace the javascript popup with sweetalert which prevent some devices to purchase data plans and packages via captive portal, clean up footer template and improve script formatting
This commit is contained in:
parent
27fd677a0a
commit
0a29ec9a86
@ -1,16 +1,16 @@
|
||||
</section>
|
||||
</div>
|
||||
{if isset($_c['CompanyFooter'])}
|
||||
<footer class="main-footer">
|
||||
<footer class="main-footer">
|
||||
{$_c['CompanyFooter']}
|
||||
<div class="pull-right">
|
||||
<a href="javascript:showPrivacy()">Privacy</a>
|
||||
•
|
||||
<a href="javascript:showTaC()">T & C</a>
|
||||
</div>
|
||||
</footer>
|
||||
</footer>
|
||||
{else}
|
||||
<footer class="main-footer">
|
||||
<footer class="main-footer">
|
||||
PHPNuxBill by <a href="https://github.com/hotspotbilling/phpnuxbill" rel="nofollow noreferrer noopener"
|
||||
target="_blank">iBNuX</a>, Theme by <a href="https://adminlte.io/" rel="nofollow noreferrer noopener"
|
||||
target="_blank">AdminLTE</a>
|
||||
@ -19,7 +19,7 @@
|
||||
•
|
||||
<a href="javascript:showTaC()">T & C</a>
|
||||
</div>
|
||||
</footer>
|
||||
</footer>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@ -50,22 +50,22 @@
|
||||
<script src="{$app_url}/ui/ui/scripts/custom.js?2025.2.5"></script>
|
||||
|
||||
{if isset($xfooter)}
|
||||
{$xfooter}
|
||||
{$xfooter}
|
||||
{/if}
|
||||
|
||||
{if $_c['tawkto'] != ''}
|
||||
<!--Start of Tawk.to Script-->
|
||||
<script type="text/javascript">
|
||||
<!--Start of Tawk.to Script-->
|
||||
<script type="text/javascript">
|
||||
var isLoggedIn = false;
|
||||
var Tawk_API = {
|
||||
onLoad: function() {
|
||||
onLoad: function () {
|
||||
Tawk_API.setAttributes({
|
||||
'username' : '{$_user['username']}',
|
||||
'service' : '{$_user['service_type']}',
|
||||
'balance' : '{$_user['balance']}',
|
||||
'account' : '{$_user['account_type']}',
|
||||
'phone' : '{$_user['phonenumber']}'
|
||||
}, function(error) {
|
||||
'username': '{$_user['username']}',
|
||||
'service': '{$_user['service_type']}',
|
||||
'balance': '{$_user['balance']}',
|
||||
'account': '{$_user['account_type']}',
|
||||
'phone': '{$_user['phonenumber']}'
|
||||
}, function (error) {
|
||||
console.log(error)
|
||||
});
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
email: '{$_user['email']}',
|
||||
phone: '{$_user['phonenumber']}'
|
||||
};
|
||||
(function() {
|
||||
(function () {
|
||||
var s1 = document.createElement("script"),
|
||||
s0 = document.getElementsByTagName("script")[0];
|
||||
s1.async = true;
|
||||
@ -86,11 +86,11 @@
|
||||
s1.setAttribute('crossorigin', '*');
|
||||
s0.parentNode.insertBefore(s1, s0);
|
||||
})();
|
||||
</script>
|
||||
<!--End of Tawk.to Script-->
|
||||
{/if}
|
||||
</script>
|
||||
<!--End of Tawk.to Script-->
|
||||
{/if}
|
||||
|
||||
<script>
|
||||
<script>
|
||||
const toggleIcon = document.getElementById('toggleIcon');
|
||||
const body = document.body;
|
||||
const savedMode = localStorage.getItem('mode');
|
||||
@ -118,22 +118,22 @@
|
||||
localStorage.setItem('mode', 'dark');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
|
||||
{literal}
|
||||
<script>
|
||||
<script>
|
||||
var listAtts = document.querySelectorAll(`[api-get-text]`);
|
||||
listAtts.forEach(function(el) {
|
||||
$.get(el.getAttribute('api-get-text'), function(data) {
|
||||
listAtts.forEach(function (el) {
|
||||
$.get(el.getAttribute('api-get-text'), function (data) {
|
||||
el.innerHTML = data;
|
||||
});
|
||||
});
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function () {
|
||||
var listAtts = document.querySelectorAll(`button[type="submit"]`);
|
||||
listAtts.forEach(function(el) {
|
||||
listAtts.forEach(function (el) {
|
||||
if (el.addEventListener) { // all browsers except IE before version 9
|
||||
el.addEventListener("click", function() {
|
||||
el.addEventListener("click", function () {
|
||||
$(this).html(
|
||||
`<span class="loading"></span>`
|
||||
);
|
||||
@ -143,7 +143,7 @@
|
||||
}, false);
|
||||
} else {
|
||||
if (el.attachEvent) { // IE before version 9
|
||||
el.attachEvent("click", function() {
|
||||
el.attachEvent("click", function () {
|
||||
$(this).html(
|
||||
`<span class="loading"></span>`
|
||||
);
|
||||
@ -153,28 +153,47 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
$(function() {
|
||||
$(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
function ask(field, text){
|
||||
var txt = field.innerHTML;
|
||||
if (confirm(text)) {
|
||||
function ask(field, text) {
|
||||
const txt = field.innerHTML;
|
||||
|
||||
field.innerHTML = `<span class="loading"></span>`;
|
||||
field.setAttribute("disabled", true);
|
||||
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: text,
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Yes, proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
}).then((result) => {
|
||||
let delay = result.isConfirmed ? 400 : 500;
|
||||
|
||||
setTimeout(() => {
|
||||
field.innerHTML = field.innerHTML.replace(`<span class="loading"></span>`, txt);
|
||||
field.innerHTML = txt;
|
||||
field.removeAttribute("disabled");
|
||||
}, 5000);
|
||||
return true;
|
||||
|
||||
if (result.isConfirmed) {
|
||||
const form = field.closest('form');
|
||||
if (form) {
|
||||
form.submit(); // manually submit the form
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
field.innerHTML = field.innerHTML.replace(`<span class="loading"></span>`, txt);
|
||||
field.removeAttribute("disabled");
|
||||
}, 500);
|
||||
return false;
|
||||
//fallback if not in a form
|
||||
const href = field.getAttribute("href") || field.dataset.href;
|
||||
if (href) window.location.href = href;
|
||||
}
|
||||
}
|
||||
}, delay);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function setCookie(name, value, days) {
|
||||
var expires = "";
|
||||
@ -196,10 +215,10 @@
|
||||
}
|
||||
return null;
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
{/literal}
|
||||
<script>
|
||||
setCookie('user_language', '{$user_language}', 365);
|
||||
setCookie('user_language', '{$user_language}', 365);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user