fixes for new winasite

This commit is contained in:
2019-03-04 17:06:17 +01:00
parent 6507402ca2
commit 5a3f051e63

View File

@@ -1,6 +1,6 @@
<?php
$worklist_url = 'https://www.wina.be/worklists';
$worklist_url = 'https://old.wina.be/worklists';
$worklistsData = file_get_contents($worklist_url);
preg_match_all('/href="\/worklists\/(\d*)">(.*?)<\/a>/s', $worklistsData, $lists);
@@ -11,7 +11,7 @@ foreach($lists[1] as $key => $list) {
}
for($i = 0; $i < 2; $i++) {
$url = 'https://www.wina.be/worklists/past?page=' . $i;
$url = 'https://old.wina.be/worklists/past?page=' . $i;
$worklistsData = file_get_contents($url);
preg_match_all('/href="\/worklists\/(\d*)">(.*?)<\/a>/s', $worklistsData, $lists);
@@ -24,7 +24,7 @@ natsort($worklists);
$checkedLists = $_GET['worklist'];
$monthTrans = ['jan' => 'Jan', 'feb' => 'Feb', 'maa' => 'Mar', 'apr' => 'Apr', 'mei' => 'May', 'jul' => 'Jul', 'aug' => 'Aug', 'sep' => 'Sep',
$monthTrans = ['jan' => 'Jan', 'feb' => 'Feb', 'mrt' => 'Mar', 'apr' => 'Apr', 'mei' => 'May', 'jul' => 'Jul', 'aug' => 'Aug', 'sep' => 'Sep',
'okt' => 'Oct', 'nov' => 'Nov', 'dec' => 'Dec'];
$all_names = [];
@@ -32,7 +32,7 @@ $totalShifted = 0;
$total = 0;
foreach ($checkedLists as $site) {
$site = 'https://www.wina.be/worklists/' . $site;
$site = 'https://old.wina.be/worklists/' . $site;
$data = file_get_contents($site);
preg_match_all('/<div id="(data_shift.*?<table.*?>.*?<\/table>)/s', $data, $shiften);
@@ -131,7 +131,7 @@ $avg = $totalShifted / count($all_names);
<footer class="mt-5">
<div class="container">
<span class="text-muted">© 2018 Arthur Bols <a href="https://git.principis.be/Principis/shiftcounter">source</span>
<span class="text-muted">© 2018 - 2019 Arthur Bols <a href="https://git.principis.be/Principis/shiftcounter">source</span>
</div>
</footer>
@@ -153,3 +153,4 @@ $avg = $totalShifted / count($all_names);
</script>
</body>
</html>