scripts added

This commit is contained in:
2026-08-28 12:28:39 +02:00
parent 45e62fda5f
commit c30efbc8d9
237 changed files with 7310 additions and 1 deletions
@@ -0,0 +1,47 @@
// last execution: 2026-08-28 02:00:01
$par_Aantal_dagen_oud=120;
/////////////////////////////////////////////////////////////////////////////////////////////
// Script start
/////////////////////////////////////////////////////////////////////////////////////////////
log('warning', 'Executing ', name);
logAdd(log);
$p_days = $par_Aantal_dagen_oud;
logAdd(log, 'info', '#Dagen als parameter: ', $p_days);
ifThenElse($p_days,
ifThenElse($p_days < 3,
$p_days = 3;
,
ifThen($p_days > 120,
$p_days = 120;
);
);
,
$p_days = 90;
);
logAdd(log, 'info', '#Dagen na correctie: ', $p_days);
/////////////////////////////////////////////////////////////////////////////////////////////
// Opschonen ledenupdates
/////////////////////////////////////////////////////////////////////////////////////////////
$cleanup_date = datetime\addDays(datetime\now(), -1 * $p_days);
$ids = record\findMany('Ledenupdates', 'createdAt', 'desc', 'createdAt<', $cleanup_date);
$cnt = array\length($ids);
logAdd(log, 'info', '#Ledenupdates om te verwijderen: ', $cnt);
$i = 0;
$n = $cnt;
while($i < $n,
$id = array\at($ids, $i);
record\update('Ledenupdates', $id, 'deleted', true);
$i = $i + 1;
);
logAdd(log, 'info', 'Voor ', $cnt, ' records deleted = true gezet');