From 4dbfeb98c74a23468412d8d6ca22f5db807910de Mon Sep 17 00:00:00 2001 From: Arthur Bols Date: Sun, 29 Sep 2019 15:52:35 +0200 Subject: [PATCH] fix 500 --- shiftcounter.php | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/shiftcounter.php b/shiftcounter.php index 124da73..4c1cb76 100644 --- a/shiftcounter.php +++ b/shiftcounter.php @@ -8,9 +8,11 @@ $worklistsData = file_get_contents($worklist_url); preg_match_all('/href="\/worklists\/(\d*)">(.*?)<\/a><\/td>.*?<\/td>(.*?)<\/td>/s', $worklistsData, $lists); $worklists = []; + foreach($lists[1] as $key => $list) { $dateArr = explode(' ', substr($lists[3][$key], 3, 11) . substr($lists[3][$key], 16)); + if (count($dateArr) < 3 || $dateArr[0] === "") continue; $dateArr[1] = $monthTrans[$dateArr[1]]; $date = \DateTimeImmutable::createFromFormat('d M Y H:i', implode(' ', $dateArr)); @@ -61,6 +63,8 @@ if (isset($_GET['worklist']) || count($checkedLists) > 0) { $site = 'https://old.wina.be/worklists/' . $site; $data = file_get_contents($site); + $tempCount = []; + preg_match_all('/
Naam Uren - Shiften + Activiteiten @@ -208,4 +218,3 @@ if ($totalShifted !== 0 & count($nameHours) !== 0) -