12.12.2023, 12:43
Fill the sequence array with plan IDs for all required users:
Code:
$(function() {
var show = window.showPlan;
var user = window.Globals ? window.Globals.user : '';
var sequence, index = 0;
if (!show) {
return;
}
if (user == 'admin') {
sequence = [ 1, 2, 3 ];
}
else if (user == 'user123') {
sequence = [ 11, 14, 18, 22 ];
}
else {
return;
}
function showNext() {
showPlan(sequence[ index ]);
index = (index + 1) % sequence.length;
}
setInterval(showNext, 10 * 1000);
showNext();
});