This commit is contained in:
2024-02-14 16:08:19 +01:00
commit bf1a81e362
99 changed files with 22740 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
<?php
require('../config.php');
require('../EpiApi.php');
use chillerlan\QRCode\{QRCode, QROptions};
require('../vendor/autoload.php');
$options = new QROptions([
'imageBase64' => false,
'qrCodeHeight' => 75,
'qrCodeWidth' => 75,
'version' =>-1,
'quietzoneSize' => 1
]);
$Epi = new Epirent();
$result = $Epi->requestEpiApi('/v1/packingnote/open?isci=False&cl=' . Epirent_Mandant);
$data_output = json_decode($result)->payload;
foreach ($data_output as $packingjob) {
if($packingjob->is_archived != true){
$date = new DateTime($packingjob->date_start);
$date->setTime(0, 0, 0);
$today = new DateTime();
$today->setTime(0, 0, 0);
if ($date == $today) {
echo "<tr class='text-dark bg-warning'>";
} else if ($date < $today) {
echo "<tr class=' bg-danger'>";
} else {
echo "<tr>";
}
if(Enable_QR_Code_CheckOut){
echo "<td>" .'<div style="width: 5vb;">'.(new QRCode($options))->render($packingjob->packingnote_no)."</div></td>";
}
else {
echo "<td>" . $packingjob->packingnote_no ."</td>";
}
echo "<td>" . $packingjob->contact->name . "</td>";
echo "<td>" . $packingjob->event . "</td>";
echo "<td>" . date_format(new \DateTime($packingjob->date_start), 'd.m.Y') . " " . getTimeFromSeconds($packingjob->time_start) . "</td>";
echo "<td>" . date_format(new \DateTime($packingjob->date_end), 'd.m.Y') . " " . getTimeFromSeconds($packingjob->time_end) . "</td>";
echo "</tr>";
}
}
function getTimeFromSeconds(string $timestring) {
$hours = floor($timestring / 3600);
$mins = floor($timestring / 60 % 60);
$secs = floor($timestring % 60);
$timeFormat = sprintf('%02d:%02d', $hours, $mins);
return $timeFormat;
}
?>