Neue Statistik

This commit is contained in:
2021-05-28 07:24:22 +02:00
parent c9bfd40728
commit 9bf57f696b
36 changed files with 91139 additions and 4743 deletions

View File

@@ -57,7 +57,7 @@ class AsdUs extends AsdCurl
public function save_us_data($ch,$env) {
$SCHULPORTAL_ASD_BASE_URL = Configure::read('AsdCurl.asdbaseurl.'.$env);
// Maske US 01 01 vom linken Menü aufrufen
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
$viewstate = $this->get_string_between($this->html, 'id="j_id1:javax.faces.ViewState:0" value="', '" autocomplete');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
$post = [
'sideMenu' => 'sideMenu',
@@ -70,7 +70,7 @@ class AsdUs extends AsdCurl
}
//echo $this->html;die;
// In Maske US 01 01 alle Felder leer lassen und "Suchen" ausführen
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
$viewstate = $this->get_string_between($this->html, 'id="j_id1:javax.faces.ViewState:0" value="', '" autocomplete');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
$post = [
'mainForm' => 'mainForm',
@@ -109,14 +109,16 @@ class AsdUs extends AsdCurl
}
//echo $this->html;
// Auf der Ergebnisseite auf "Alle" Klicken
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
$viewstate = $this->get_string_between($this->html, 'id="j_id1:javax.faces.ViewState:0" value="', '" autocomplete');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
$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
//debug($this->html);
$htmlParser->preserveWhiteSpace = false;
$hrefs = $htmlParser->getElementsByTagName('a');
//debug($hrefs);die;
foreach($hrefs as $href) {
if($href->textContent == 'ALLE') {
foreach ($href->attributes as $attribute) {
@@ -197,22 +199,31 @@ class AsdUs extends AsdCurl
}
public function save_up_data($ch,$env) {
//echo $this->html;die;
$SCHULPORTAL_ASD_BASE_URL = Configure::read('AsdCurl.asdbaseurl.'.$env);
// Maske US 01 01 vom linken Menü aufrufen
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
//$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
$viewstate = $this->get_string_between($this->html, 'id="j_id1:javax.faces.ViewState:0" value="', '" autocomplete');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
//debug($viewstate);
//debug($conversationId);
$post = [
'sideMenu' => 'sideMenu',
'javax.faces.ViewState' => $viewstate,
'sideMenu:j_idt52:0:j_idt58:1:j_idt60' => 'sideMenu:j_idt52:0:j_idt58:1:j_idt60',
];
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdup/up_18_01.jsf?cid=' . $conversationId, $post);
//$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdup/up_18_01.jsf?cid=' . $conversationId, $post);
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdup/up_00_00.jsf?cid=' . $conversationId, $post);
if(!($this->status)) {
die($this->error);
}
//echo $this->html;die;
// In Maske US 01 01 alle Felder leer lassen und "Suchen" ausführen
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
//$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
$viewstate = $this->get_string_between($this->html, 'id="j_id1:javax.faces.ViewState:0" value="', '" autocomplete');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
//debug($viewstate);
//debug($conversationId);
$post = [
'mainForm' => 'mainForm',
'referenzBaumAnzeigen' => 'false',
@@ -243,17 +254,21 @@ class AsdUs extends AsdCurl
'mainForm:action_suchen' => 'Suchen',
'javax.faces.ViewState' => $viewstate,
];
//debug($post);
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdup/up_03_01.jsf?cid=' . $conversationId, $post);
if(!($this->status)) {
die($this->error);
}
//debug($this->html);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;
$hrefs = $htmlParser->getElementsByTagName('a');
//debug($hrefs);
foreach($hrefs as $href) {
debug($href->textContent);
if($href->textContent == 'ALLE') {
foreach ($href->attributes as $attribute) {
if($attribute->name == 'onclick') {
@@ -263,10 +278,12 @@ class AsdUs extends AsdCurl
}
}
}
}
//echo $this->html;die;
}
//debug($linkid);
//debug($this->html);die;
// Auf der Ergebnisseite auf "Alle" Klicken
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
//$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
$viewstate = $this->get_string_between($this->html, 'id="j_id1:javax.faces.ViewState:0" value="', '" autocomplete');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
//$mainform = $this->get_string_between($this->html, '\\\':\\\'', '\\\'},\\\'\\\')\');return false\" class=\"ignoreChangeNotification notBold\">ALLE</a>');
//debug($mainform);die;
@@ -285,12 +302,14 @@ class AsdUs extends AsdCurl
'mainForm:istAnzeigeMaske' => 'false',
'javax.faces.ViewState' => $viewstate,
'mainForm:j_idt'.$linkid => 'mainForm:j_idt'.$linkid
//'mainForm:j_idt189' => 'mainForm:j_idt189'
];
//debug($post);
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdup/up_03_02.jsf?cid=' . $conversationId, $post);
if(!($this->status)) {
die($this->error);
}
//echo $this->html;die;
//debug($this->html);die;
// Ergebnisse parsen und in die MySQL - Datenbank schreiben
$htmlParser = new \DOMDocument(); //to parse html using DOMDocument
libxml_use_internal_errors(true); // your HTML gives parser warnings, keep them internal