120 lines
No EOL
5.4 KiB
PHP
120 lines
No EOL
5.4 KiB
PHP
<?php
|
|
/*
|
|
$kw_aktuell = (int)date('W');
|
|
$jahr = (int)date('Y');
|
|
|
|
require('lib/config.php');
|
|
require('lib/mysql.class.php');
|
|
$GLOBALS['mysql'] = new mysql(CONFIG_MYSQL_HOST,CONFIG_MYSQL_USER,CONFIG_MYSQL_PW,CONFIG_MYSQL_DB);
|
|
mysqli_set_charset($GLOBALS['mysql'], 'utf8');
|
|
|
|
header("Content-Type: text/html; charset=utf-8");
|
|
//----------------------------------------------------------------------------------------------------------------
|
|
for($i=0; $i < 5; $i++) {
|
|
//----------------------------------------------------------------------------------------------------------------
|
|
$scandaten = $GLOBALS['mysql']->query_single("SELECT * FROM ilonexs WHERE status NOT IN (0,88,193) AND checkedv!=1");
|
|
//----------------------------------------------------------------------------------------------------------------
|
|
if($scandaten['num_rows']==0) {
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET checkedv=0 WHERE status!=0"); echo "reset wird ausgeführt!";
|
|
} else {
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET checkedv=1 WHERE id='".$scandaten['id']."'");
|
|
|
|
//----------------------------------------------------------------------------------------------------------------
|
|
echo "in bearbeitung: ".$scandaten['label']; echo "</br>";
|
|
$url='https://api.ilonexs.de/php/schnittstellen_url.php?api=MbL~9X2kZU~&schnittstelle=4&belegnr='.$scandaten['label'].'&';
|
|
$headers = @get_headers($url);
|
|
if ($headers[0]!='HTTP/1.1 200 OK') { echo "Verbindungsfehler"; break; }
|
|
$xml = simplexml_load_file($url);
|
|
for ($i = 0; $i <= 100; $i++ ) {
|
|
if (strlen($xml->pod[$i]->liefername)<2) { echo 'Abbruch in Zeile: '.$i.'</br>'; break; }
|
|
|
|
$datum=substr($xml->pod[$i]->datum, 0, 10);
|
|
echo $datum."</pre>";
|
|
|
|
if (strlen($scandaten['name'])<2) {
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET name='".$xml->pod[$i]->liefername."' WHERE id='".$scandaten['id']."'");
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET plz='".$xml->pod[$i]->lieferplz."' WHERE id='".$scandaten['id']."'");
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET ort='".$xml->pod[$i]->lieferort."' WHERE id='".$scandaten['id']."'");
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET collie='".$xml->pod[$i]->collie."' WHERE id='".$scandaten['id']."'");
|
|
}
|
|
|
|
if (strlen($xml->pod[$i]->datum)>0) {
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET datum='".$xml->pod[$i]->datum."' WHERE id='".$scandaten['id']."'");
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET date='".$datum."' WHERE id='".$scandaten['id']."'");
|
|
}
|
|
|
|
if (strlen($xml->pod[$i]->status)>0) {
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET status='".$xml->pod[$i]->status."' WHERE id='".$scandaten['id']."'"); }
|
|
|
|
if (strlen($xml->pod[$i]->status)>0) {
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET statustext1='".$xml->pod[$i]->beschreibung."' WHERE id='".$scandaten['id']."'"); }
|
|
|
|
if (strlen($xml->pod[$i]->status)>0) {
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET scanort='".$xml->pod[$i]->scannort."' WHERE id='".$scandaten['id']."'"); }
|
|
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET empfaenger='".$xml->pod[$i]->empfaenger."' WHERE id='".$scandaten['id']."'");
|
|
|
|
echo '-'.$i.'</br>';
|
|
if (strlen($xml->pod[$i]->status)>0) {
|
|
if ($xml->pod[$i]->status==0) {
|
|
break; echo '- Abbruch mit Status 0'.$i.'</br>';
|
|
}
|
|
}
|
|
}
|
|
echo "---------------------------------------------------------</br>";
|
|
}
|
|
/*
|
|
foreach($xml->pod as $xmldata) {
|
|
echo "<pre>"; print_r($xmldata); echo "</pre>";
|
|
echo "---------------------------------------------------------</br>";
|
|
|
|
if (strlen($scandaten['name'])<2) {
|
|
$temp=' '; $temp=$xmldata->liefername;
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET name='".$temp."' WHERE id='".$scandaten['id']."'");
|
|
$temp=' '; $temp=$xmldata->lieferplz;
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET plz='".$temp."' WHERE id='".$scandaten['id']."'");
|
|
$temp=' '; $temp=$xmldata->lieferort;
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET ort='".$temp."' WHERE id='".$scandaten['id']."'");
|
|
}
|
|
|
|
$temp=' '; $temp=$xmldata->datum; echo $temp."</br>";
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET datum='".$temp=$xmldata->datum."' WHERE id='".$scandaten['id']."'");
|
|
|
|
$temp=' '; $temp=$xmldata->zweiteanfahrt; echo $temp."</br>";
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET zweiteanfahrt='".$temp."' WHERE id='".$scandaten['id']."'");
|
|
|
|
$temp=' '; $temp=$xmldata->wartezeit; echo $temp."</br>";
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET wartezeit='".$temp."' WHERE id='".$scandaten['id']."'");
|
|
|
|
$temp=' '; $temp=$xmldata->collie; echo $temp."</br>";
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET collie='".$temp."' WHERE id='".$scandaten['id']."'");
|
|
|
|
$temp=' '; $temp=$xmldata->status; echo $temp."</br>";
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET status='".$xmldata->status."' WHERE id='".$scandaten['id']."'");
|
|
|
|
$temp=' '; $temp=$xmldata->beschreibung; echo $temp."</br>";
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET statustext1='".$temp."' WHERE id='".$scandaten['id']."'");
|
|
|
|
$temp=' '; $temp=$xmldata->scannort; echo $temp."</br>";
|
|
$GLOBALS['mysql']->insert("UPDATE ilonexs SET scannort='".$temp."' WHERE id='".$scandaten['id']."'");
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//echo "<pre>"; print_r($xmldata); echo "</pre>";
|
|
//echo "<pre>"; print_r($output); echo "</pre>";
|
|
*/
|
|
?>
|