fixes for new winasite
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$worklist_url = 'https://www.wina.be/worklists';
|
$worklist_url = 'https://old.wina.be/worklists';
|
||||||
$worklistsData = file_get_contents($worklist_url);
|
$worklistsData = file_get_contents($worklist_url);
|
||||||
preg_match_all('/href="\/worklists\/(\d*)">(.*?)<\/a>/s', $worklistsData, $lists);
|
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++) {
|
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);
|
$worklistsData = file_get_contents($url);
|
||||||
preg_match_all('/href="\/worklists\/(\d*)">(.*?)<\/a>/s', $worklistsData, $lists);
|
preg_match_all('/href="\/worklists\/(\d*)">(.*?)<\/a>/s', $worklistsData, $lists);
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ natsort($worklists);
|
|||||||
|
|
||||||
$checkedLists = $_GET['worklist'];
|
$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'];
|
'okt' => 'Oct', 'nov' => 'Nov', 'dec' => 'Dec'];
|
||||||
|
|
||||||
$all_names = [];
|
$all_names = [];
|
||||||
@@ -32,7 +32,7 @@ $totalShifted = 0;
|
|||||||
$total = 0;
|
$total = 0;
|
||||||
|
|
||||||
foreach ($checkedLists as $site) {
|
foreach ($checkedLists as $site) {
|
||||||
$site = 'https://www.wina.be/worklists/' . $site;
|
$site = 'https://old.wina.be/worklists/' . $site;
|
||||||
$data = file_get_contents($site);
|
$data = file_get_contents($site);
|
||||||
|
|
||||||
preg_match_all('/<div id="(data_shift.*?<table.*?>.*?<\/table>)/s', $data, $shiften);
|
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">
|
<footer class="mt-5">
|
||||||
<div class="container">
|
<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>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
@@ -153,3 +153,4 @@ $avg = $totalShifted / count($all_names);
|
|||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user