diff options
author | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-02-04 20:35:16 +0100 |
---|---|---|
committer | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-02-04 20:35:16 +0100 |
commit | a84a6d99aa654c7ce4a88ce36f6807a887e1572f (patch) | |
tree | f07b9e25fd3b7c4d5acc2584196a35d482da922e | |
parent | cors (diff) | |
download | gimsisextclient-a84a6d99aa654c7ce4a88ce36f6807a887e1572f.tar gimsisextclient-a84a6d99aa654c7ce4a88ce36f6807a887e1572f.tar.gz gimsisextclient-a84a6d99aa654c7ce4a88ce36f6807a887e1572f.tar.bz2 gimsisextclient-a84a6d99aa654c7ce4a88ce36f6807a887e1572f.tar.lz gimsisextclient-a84a6d99aa654c7ce4a88ce36f6807a887e1572f.tar.xz gimsisextclient-a84a6d99aa654c7ce4a88ce36f6807a887e1572f.tar.zst gimsisextclient-a84a6d99aa654c7ce4a88ce36f6807a887e1572f.zip |
-rw-r--r-- | main.php | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -54,7 +54,7 @@ Errors: class gimsisextClient { private $username; private $password; - public $version = array(0, 9, 1); + public $version = array(0, 9, 2); private $programname = "gimsisextclient"; private $programdomain = 'gimsisextclient.gimb.tk'; private $cookiedir; // set at runtime, ker je get_curerent_user, v login() @@ -580,10 +580,6 @@ Errors: $postbody=$postvars.'&'.urlencode('ctl00$ModalMasterBody$edtZadeva').'='.urlencode($zadeva).'&'.urlencode('ctl00$ModalMasterBody$edtBesediloExt').'='.urlencode($telo).'&__EVENTTARGET=ctl00%24ModalMasterBody%24btnDogodekShrani&__EVENTARGUMENT=&'.urlencode('ctl00$ModalMasterBody$hfPrejemniki').'='.urlencode($prejemnikst); curl_setopt($ch, CURLOPT_POSTFIELDS, $postbody); $posljisporocilo_output = curl_exec($ch); - // file_put_contents("/tmp/psio.html", $posljisporocilo_init_output); // debug - // file_put_contents("/tmp/pso.html", $posljisporocilo_output); // debug - // file_put_contents("/tmp/pb.html", $postbody); // debug - // file_put_contents("/tmp/p.html", $prejemnikst); // debug return; } public function setgeslo($geslo, $spremenigeslovobjektu = true) { // geslo @@ -768,17 +764,27 @@ Errors: } else { $zacasna = 0; } - $ocene[] = array( + $ocenaarray = array( "datum" => str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $datum))), "profesor" => str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ucitelj))), "predmet" => str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $predmet))), "naslov" => str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocenjevanje))), "vrsta" => str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $vrsta))), "rok" => str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $rok))), - "rok" => str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $rok))), "ocena" => intval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocena)))), "zacasna" => boolval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $zacasna)))) ); + if(sizeof($sn->getElementsByTagName("span")) > 1) { + $ocenaarray["novaocena"] = DOMinnerHTML($sn->getElementsByTagName("span")[1]); + if(explode(" ", $sn->getElementsByTagName("span")[1]->getAttribute("class"))[1] == "ocVmesna") { + $ocenaarray["novazacasna"] = 1; + } else { + $ocenaarray["novazacasna"] = 0; + } + $ocenaarray["novaocena"] = intval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocenaarray["novaocena"])))); + $ocenaarray["novazacasna"] = boolval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocenaarray["novazacasna"])))); + } + $ocene[] = $ocenaarray; } } return $ocene; |