Bugfixes Update
This commit is contained in:
@@ -16,6 +16,44 @@ class AsdUs extends AsdCurl
|
||||
$this->error = false;
|
||||
}
|
||||
|
||||
public function hack($ch,$env) {
|
||||
$SCHULPORTAL_ASD_BASE_URL = Configure::read('AsdCurl.asdbaseurl.'.$env);
|
||||
// Anfrage abschicken
|
||||
|
||||
$post = ['<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<ASD_ANFRAGE_SVSW_ASD>
|
||||
<LIEFERUNGSCHLUESSEL>6460632610085</LIEFERUNGSCHLUESSEL>
|
||||
<DIENSTSTELLE>9400</DIENSTSTELLE>
|
||||
<SCHULJAHR>2019</SCHULJAHR>
|
||||
<AUFTRAG>
|
||||
<AUFTRAGSCHLUESSEL>6460632613170</AUFTRAGSCHLUESSEL>
|
||||
<SST_OBJECT_TYPE>UsSchuelerSucheSvswAsd</SST_OBJECT_TYPE>
|
||||
<US_SCHUELER_SUCHE_SVSW_ASD ANFRAGEMODUS="einzelabfrage">
|
||||
<NACHNAME>Trinkl</NACHNAME>
|
||||
<VORNAMEN>Fabian</VORNAMEN>
|
||||
<GEBURTSDATUM>
|
||||
<GEBURTSJAHR>2004</GEBURTSJAHR>
|
||||
<GEBURTSMONAT>1</GEBURTSMONAT>
|
||||
<GEBURTSTAG>1</GEBURTSTAG>
|
||||
</GEBURTSDATUM>
|
||||
<GESCHLECHT>1</GESCHLECHT>
|
||||
<GEBURTSORT>München</GEBURTSORT>
|
||||
<PHONETISCHE_SUCHE>1</PHONETISCHE_SUCHE>
|
||||
</US_SCHUELER_SUCHE_SVSW_ASD>
|
||||
</AUFTRAG>
|
||||
<SCHEMA_VERSION>1.0</SCHEMA_VERSION>
|
||||
<WERTELISTEN_VERSION>183.0.514</WERTELISTEN_VERSION>
|
||||
<CLIENT_VERSION>2.10.295_032_57_by</CLIENT_VERSION>
|
||||
<PLAUSI_VERSION>190809.093</PLAUSI_VERSION>
|
||||
</ASD_ANFRAGE_SVSW_ASD>
|
||||
'
|
||||
];
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asd-sst/sst/any', $post);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
}
|
||||
|
||||
public function save_us_data($ch,$env) {
|
||||
$SCHULPORTAL_ASD_BASE_URL = Configure::read('AsdCurl.asdbaseurl.'.$env);
|
||||
// Maske US 01 01 vom linken Menü aufrufen
|
||||
@@ -73,40 +111,24 @@ class AsdUs extends AsdCurl
|
||||
// Auf der Ergebnisseite auf "Alle" Klicken
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
|
||||
//$mainform = $this->get_string_between($this->html, 'j_idt', 'ALLE');
|
||||
//$mainform = $this->get_string_between($this->html, 'mojarra.jsfcljs(document.getElementById(', 'ALLE');
|
||||
//echo $this->html;
|
||||
//debug($mainform);die;
|
||||
|
||||
|
||||
$htmlParser = new \DOMDocument(); //to parse html using DOMDocument
|
||||
libxml_use_internal_errors(true); // your HTML gives parser warnings, keep them internal
|
||||
$htmlParser->loadHTML($this->html); //Loaded the html string we took from simple xml
|
||||
//$htmlParser->preserveWhiteSpace = false;
|
||||
|
||||
$xpath = new \DOMXPath($htmlParser);
|
||||
$elements = $xpath->query("//a[text()='ALLE']/@onclick");
|
||||
if (!is_null($elements)) {
|
||||
foreach ($elements as $element) {
|
||||
//echo "<br/>[". $element->nodeName. "]";
|
||||
//echo "<br/>[". $element->nodeValue. "]";
|
||||
$text = $element->nodeValue;
|
||||
preg_match_all('!\d+!', $text, $matches);
|
||||
//print_r($matches);
|
||||
$mainform = $matches[0][0];
|
||||
$htmlParser->preserveWhiteSpace = false;
|
||||
$hrefs = $htmlParser->getElementsByTagName('a');
|
||||
foreach($hrefs as $href) {
|
||||
if($href->textContent == 'ALLE') {
|
||||
foreach ($href->attributes as $attribute) {
|
||||
if($attribute->name == 'onclick') {
|
||||
$linktext = $attribute->textContent;
|
||||
preg_match('/j_idt\d\d\d/',$linktext,$matches);
|
||||
$linkid = substr($matches[0],5,3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$mainform='184';
|
||||
//die;
|
||||
|
||||
/*
|
||||
if($env == 'prod') {
|
||||
$mainform = '189';
|
||||
}
|
||||
else {
|
||||
$mainform = '184';
|
||||
}
|
||||
*/
|
||||
$post = [
|
||||
'mainForm' => 'mainForm',
|
||||
'referenzBaumAnzeigen' => 'false',
|
||||
@@ -121,7 +143,7 @@ class AsdUs extends AsdCurl
|
||||
'skipvalidation' => 'true',
|
||||
'mainForm:istAnzeigeMaske' => 'false',
|
||||
'javax.faces.ViewState' => $viewstate,
|
||||
'mainForm:j_idt'.$mainform => 'mainForm:j_idt'.$mainform,
|
||||
'mainForm:j_idt'.$linkid => 'mainForm:j_idt'.$linkid,
|
||||
];
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdus/us_01_02.jsf?cid=' . $conversationId, $post);
|
||||
if(!($this->status)) {
|
||||
@@ -225,6 +247,23 @@ class AsdUs extends AsdCurl
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
|
||||
$htmlParser = new \DOMDocument(); //to parse html using DOMDocument
|
||||
libxml_use_internal_errors(true); // your HTML gives parser warnings, keep them internal
|
||||
$htmlParser->loadHTML($this->html); //Loaded the html string we took from simple xml
|
||||
$htmlParser->preserveWhiteSpace = false;
|
||||
$hrefs = $htmlParser->getElementsByTagName('a');
|
||||
foreach($hrefs as $href) {
|
||||
if($href->textContent == 'ALLE') {
|
||||
foreach ($href->attributes as $attribute) {
|
||||
if($attribute->name == 'onclick') {
|
||||
$linktext = $attribute->textContent;
|
||||
preg_match('/j_idt\d\d\d/',$linktext,$matches);
|
||||
$linkid = substr($matches[0],5,3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//echo $this->html;die;
|
||||
// Auf der Ergebnisseite auf "Alle" Klicken
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
@@ -245,7 +284,7 @@ class AsdUs extends AsdCurl
|
||||
'skipvalidation' => 'true',
|
||||
'mainForm:istAnzeigeMaske' => 'false',
|
||||
'javax.faces.ViewState' => $viewstate,
|
||||
'mainForm:j_idt189' => 'mainForm:j_idt189'
|
||||
'mainForm:j_idt'.$linkid => 'mainForm:j_idt'.$linkid
|
||||
];
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdup/up_03_02.jsf?cid=' . $conversationId, $post);
|
||||
if(!($this->status)) {
|
||||
|
||||
Reference in New Issue
Block a user