123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- include 'config.php';
- date_default_timezone_set('Europe/Vienna');
- $date = date('d/m/Y h:i:s a', time());
- error_log(" ".$_SERVER['HTTP_CPEE_LABEL'], 3, 'logs.log');
- error_log($date, 3, 'logs.log');
- error_log("\r\n", 3, 'logs.log');
- $rolle = $_POST['rolle'];
- $form = $_POST['form'];
- if (file_exists('../callbacks/DTC_EVENT.txt')) {
- $a =1;
- } else {
- $rolleFile = fopen("../callbacks/DTC_EVENT.txt", "w");
- $txt = "[]";
- fwrite($rolleFile, $txt);
- fclose($rolleFile);
- }
- $filename = $_SERVER['HTTP_CPEE_CALLBACK_ID'];
- $task = $_SERVER['HTTP_CPEE_LABEL'];
- $rolleArray = array('cbid'=> $filename,'role'=>$rolle, 'task'=> $task, 'form'=>$_POST['form']);
- $inp = file_get_contents('../callbacks/DTC_EVENT.txt');
- $tempArray = json_decode($inp);
- array_push($tempArray, $rolleArray);
- $data = json_encode($tempArray);
- $date = date('d/m/Y h:i:s a', time());
- error_log("save data to file", 3, 'logs.log');
- error_log($date, 3, 'logs.log');
- error_log("\r\n", 3, 'logs.log');
- file_put_contents('../callbacks/DTC_EVENT.txt', $data);
- $general = [];
- $general[] = $_SERVER;
- $general[] = $_POST;
- $general[1]["form"] = $formLocation.$form;
- $jsonData = json_encode($general, JSON_PRETTY_PRINT);
- file_put_contents('../callbacks/'.$filename.'.txt', $jsonData);
- header('CPEE_CALLBACK: true');
- exit;
- ?>
|