changing layout
This commit is contained in:
parent
c1cd5b183c
commit
6ff90fea7b
@ -45,10 +45,16 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Trigger auto backup in background
|
// Trigger crons occasionally (max once per hour per browser)
|
||||||
fetch('<?= get_base_url() ?>api/auto_backup.php').catch(err => console.error('Auto backup trigger failed', err));
|
const lastCron = localStorage.getItem('last_cron_trigger');
|
||||||
// Trigger daily report cron
|
const now = Date.now();
|
||||||
fetch('<?= get_base_url() ?>api/daily_report_cron.php').catch(err => console.error('Daily report cron failed', err));
|
if (!lastCron || (now - parseInt(lastCron)) > 3600000) {
|
||||||
|
localStorage.setItem('last_cron_trigger', now.toString());
|
||||||
|
// Trigger auto backup in background
|
||||||
|
fetch('<?= get_base_url() ?>api/auto_backup.php').catch(err => console.error('Auto backup trigger failed', err));
|
||||||
|
// Trigger daily report cron
|
||||||
|
fetch('<?= get_base_url() ?>api/daily_report_cron.php').catch(err => console.error('Daily report cron failed', err));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@ -10,6 +10,7 @@ require_once __DIR__ . '/../includes/functions.php';
|
|||||||
// But for security, let's at least check if it's a local or authorized request if possible.
|
// But for security, let's at least check if it's a local or authorized request if possible.
|
||||||
// For now, trigger_auto_backup() is safe because it only runs once every 24h.
|
// For now, trigger_auto_backup() is safe because it only runs once every 24h.
|
||||||
|
|
||||||
|
session_write_close();
|
||||||
trigger_auto_backup();
|
trigger_auto_backup();
|
||||||
|
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
|
|||||||
@ -3,7 +3,8 @@ require_once __DIR__ . '/../db/config.php';
|
|||||||
require_once __DIR__ . '/../includes/functions.php';
|
require_once __DIR__ . '/../includes/functions.php';
|
||||||
require_once __DIR__ . '/../includes/WablasService.php';
|
require_once __DIR__ . '/../includes/WablasService.php';
|
||||||
|
|
||||||
header('Content-Type: application/json');
|
session_write_close();
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$settings = get_company_settings();
|
$settings = get_company_settings();
|
||||||
|
|||||||
@ -1,10 +1,15 @@
|
|||||||
console.log('POS Script Loading...');
|
console.log('POS Script Loading...');
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
// Trigger crons silently
|
// Trigger crons silently (max once per hour)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
fetch('api/daily_report_cron.php').catch(e => console.error(e));
|
const lastCron = localStorage.getItem('last_cron_trigger_pos');
|
||||||
fetch('api/auto_backup.php').catch(e => console.error(e));
|
const now = Date.now();
|
||||||
|
if (!lastCron || (now - parseInt(lastCron)) > 3600000) {
|
||||||
|
localStorage.setItem('last_cron_trigger_pos', now.toString());
|
||||||
|
fetch('api/daily_report_cron.php').catch(e => console.error(e));
|
||||||
|
fetch('api/auto_backup.php').catch(e => console.error(e));
|
||||||
|
}
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
console.log('POS Script DOMContentLoaded');
|
console.log('POS Script DOMContentLoaded');
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
# Netscape HTTP Cookie File
|
|
||||||
# https://curl.se/docs/http-cookies.html
|
|
||||||
# This file was generated by libcurl! Edit at your own risk.
|
|
||||||
|
|
||||||
#HttpOnly_127.0.0.1 FALSE / FALSE 1773424134 PHPSESSID p5u70l3ue978cjhaqb88q2fob2
|
|
||||||
Loading…
x
Reference in New Issue
Block a user