Update fetch.php
This commit is contained in:
+4
-4
@@ -44,7 +44,7 @@ function make_login_request($username, $password) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parse_teacher($onmouseover) {
|
function parse_teacher($onmouseover) {
|
||||||
if ($onmouseover == null) {
|
if (explode("Učitel:", $onmouseover)[0] == $onmouseover) { // neni ucitel
|
||||||
$onmouseover = " Učitel:~ ~ ";
|
$onmouseover = " Učitel:~ ~ ";
|
||||||
}
|
}
|
||||||
$explode_on_teacher = explode("Učitel:", $onmouseover); // [0] => something, [1] => teacher and something, 0 can be ignored
|
$explode_on_teacher = explode("Učitel:", $onmouseover); // [0] => something, [1] => teacher and something, 0 can be ignored
|
||||||
@@ -85,14 +85,15 @@ function parse_cell($cell, $cell_counter, $times) {
|
|||||||
if (!$is_empty && $cell->filter("table")->filter(".KuvSuplovanaHodina")->count() == 0) {
|
if (!$is_empty && $cell->filter("table")->filter(".KuvSuplovanaHodina")->count() == 0) {
|
||||||
$name = $cell->filter(".KuvBunkaRozvrhNadpis")->first()->text();
|
$name = $cell->filter(".KuvBunkaRozvrhNadpis")->first()->text();
|
||||||
$maybe_place = $cell->filter(".KuvBunkaRozvrhText")->first()->html();
|
$maybe_place = $cell->filter(".KuvBunkaRozvrhText")->first()->html();
|
||||||
if ($maybe_place == null) {
|
if (strstr($maybe_place, "<br>") == null) {
|
||||||
$maybe_place = " <br> ";
|
$maybe_place = " <br> ";
|
||||||
}
|
}
|
||||||
$place = explode("<br>", $maybe_place)[1];
|
$place = explode("<br>", $maybe_place)[1];
|
||||||
if ($place == null) {
|
if ($place == " ") {
|
||||||
$place = "";
|
$place = "";
|
||||||
}
|
}
|
||||||
$teacher = parse_teacher($cell->filter("table")->filter("td")->first()->attr("onmouseover"));
|
$teacher = parse_teacher($cell->filter("table")->filter("td")->first()->attr("onmouseover"));
|
||||||
|
if ($teacher == " ") $teacher = "";
|
||||||
$is_substitute = parse_substitute($cell->filter(".KuvSuplujiciHodina"));
|
$is_substitute = parse_substitute($cell->filter(".KuvSuplujiciHodina"));
|
||||||
$number = $cell_counter;
|
$number = $cell_counter;
|
||||||
$start = get_time($times, $cell_counter)[0]; // gives [start, end]
|
$start = get_time($times, $cell_counter)[0]; // gives [start, end]
|
||||||
@@ -233,4 +234,3 @@ if (!isset($_POST["username"]) || !isset($_POST["password"])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user