init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
66
ilo_route.php
Normal file
66
ilo_route.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
error_reporting(E_ALL); ini_set('display_errors',1);
|
||||
$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($mysql, 'utf8');
|
||||
|
||||
header("Content-Type: text/html; charset=utf-8");
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
$GLOBALS['mysql']->insert("UPDATE ilonexs_route SET test=8");
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
//$url='https://api.ilonexs.de/php/schnittstellen_url.php?api=MbL~9X2kZU~&schnittstelle=1&';
|
||||
$url='https://api.ilonexs.de/php/schnittstellen_url.php?api=MbL~9X2kZU~&schnittstelle=5&wz=1&gefl=1&preis=1&ta=1&';
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
$saveTo = 'iloroute.xls';
|
||||
$fp = fopen($saveTo, 'w+');
|
||||
|
||||
//If $fp is FALSE, something went wrong.
|
||||
if($fp === false){
|
||||
throw new Exception('Could not open: ' . $saveTo);
|
||||
}
|
||||
|
||||
//Create a cURL handle.
|
||||
$ch = curl_init($url);
|
||||
|
||||
//Pass our file handle to cURL.
|
||||
curl_setopt($ch, CURLOPT_FILE, $fp);
|
||||
|
||||
//Timeout if the file doesn't download after 20 seconds.
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
|
||||
|
||||
//Execute the request.
|
||||
curl_exec($ch);
|
||||
|
||||
//If there was an error, throw an Exception
|
||||
if(curl_errno($ch)){
|
||||
throw new Exception(curl_error($ch));
|
||||
}
|
||||
|
||||
//Get the HTTP status code.
|
||||
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
||||
//Close the cURL handler.
|
||||
curl_close($ch);
|
||||
|
||||
//Close the file handler.
|
||||
fclose($fp);
|
||||
|
||||
if($statusCode == 200){
|
||||
echo 'Downloaded!';
|
||||
} else{
|
||||
echo "Status Code: " . $statusCode;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// echo "<pre>"; print_r($data); echo "</pre>";
|
||||
//echo "<pre>"; print_r($output); echo "</pre>";
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue