commit message
This commit is contained in:
BIN
sources/.getOrders.php.swp
Normal file
BIN
sources/.getOrders.php.swp
Normal file
Binary file not shown.
107
sources/getAufgabenTable.php
Normal file
107
sources/getAufgabenTable.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
require('../config.php');
|
||||
|
||||
require('../CrewbrainApi.php');
|
||||
|
||||
use chillerlan\QRCode\{
|
||||
QRCode,
|
||||
QROptions
|
||||
};
|
||||
|
||||
require('../vendor/autoload.php');
|
||||
|
||||
$options = new QROptions([
|
||||
'imageBase64' => false,
|
||||
'qrCodeHeight' => 75,
|
||||
'qrCodeWidth' => 75,
|
||||
'version' => -1,
|
||||
'quietzoneSize' => 1
|
||||
]);
|
||||
|
||||
|
||||
$CrewBrain = new CrewBrain();
|
||||
|
||||
|
||||
|
||||
$result = $CrewBrain->requestCrewBrainApi('api/tasklist/' . CrewBrain_TaskListID . '/tasks');
|
||||
|
||||
|
||||
$data_output = json_decode($result);
|
||||
|
||||
|
||||
foreach ($data_output as $aufgabe) {
|
||||
|
||||
|
||||
|
||||
if ($aufgabe->Geloescht == null) {
|
||||
|
||||
$AufgabeDetail = json_decode($CrewBrain->requestCrewBrainApi('api/task/'.$aufgabe->ID));
|
||||
|
||||
if ($aufgabe->Zieldatum == null) {
|
||||
echo "<tr>";
|
||||
} else {
|
||||
|
||||
$date = new DateTime($aufgabe->Zieldatum);
|
||||
$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_CrewBrainAufgaben) {
|
||||
echo "<td>" . '<div style="width: 5vb;">' . (new QRCode($options))->render(CrewBrain_Connectionprotocol . '://' . CrewBrain_Server . '/aufgaben/' . CrewBrain_TaskListID . '/aufgabe/' . $aufgabe->ID) . "</div></td>";
|
||||
} else {
|
||||
echo "<td>" . $aufgabe->ID . "</td>";
|
||||
}
|
||||
echo "<td>";
|
||||
|
||||
|
||||
foreach($AufgabeDetail->Responsibles as $bearbeiter){
|
||||
echo $bearbeiter->Name;
|
||||
}
|
||||
echo "</td>";
|
||||
echo "<td>" . $aufgabe->Titel . "</td>";
|
||||
if ($aufgabe->Zieldatum != null) {
|
||||
echo "<td>" . date_format(new \DateTime($aufgabe->Zieldatum), 'd.m.Y') . "</td>";
|
||||
} else {
|
||||
echo "<td>nA</td>";
|
||||
}
|
||||
|
||||
|
||||
switch ($aufgabe->Prioritaet) {
|
||||
case -1:
|
||||
echo '<td> <span class="badge badge-primary">Niedrig</span></td>';
|
||||
break;
|
||||
case 0:
|
||||
echo '<td> <span class="badge badge-success">Normal</span></td>';
|
||||
break;
|
||||
case 1:
|
||||
echo '<td> <span class="badge badge-warning">Höher</span></td>';
|
||||
break;
|
||||
case 2:
|
||||
echo '<td> <span class="badge badge-danger">Hoch</span></td>';
|
||||
break;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
?>
|
||||
157
sources/getCheckInTable.php
Normal file
157
sources/getCheckInTable.php
Normal file
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
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?isco=False&cl=' . Epirent_Mandant);
|
||||
|
||||
$data_output = json_decode($result)->payload;
|
||||
|
||||
|
||||
if (SortCheckIn == 2) {
|
||||
|
||||
|
||||
|
||||
// Prüfen, ob $data_output ein Array ist
|
||||
if (is_array($data_output)) {
|
||||
usort($data_output, function ($a, $b) {
|
||||
// Konvertiere time_start von Millisekunden in Sekunden
|
||||
$timeStartA = $a->time_end / 1000; // Zeit in Sekunden
|
||||
$timeStartB = $b->time_end / 1000;
|
||||
|
||||
// Kombiniere date_start mit time_start
|
||||
$datetimeA = strtotime($a->date_end) + $timeStartA;
|
||||
$datetimeB = strtotime($b->date_end) + $timeStartB;
|
||||
|
||||
// Vergleich für die Sortierung
|
||||
return $datetimeA <=> $datetimeB;
|
||||
});
|
||||
|
||||
// Sortierte Daten ausgeben oder weiterverarbeiten
|
||||
// print_r($data_output);
|
||||
} else {
|
||||
echo "Daten konnten nicht verarbeitet werden.";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach ($data_output as $packingjob) {
|
||||
|
||||
|
||||
|
||||
if ($packingjob->is_archived != true) {
|
||||
|
||||
//get OrderDetails
|
||||
$result = $Epi->requestEpiApi('/v1/order/' . $packingjob->order_pk . '?cl=' . Epirent_Mandant);
|
||||
|
||||
$orderdetail_output = json_decode($result)->payload[0];
|
||||
|
||||
$NachbereitungsTimeDetail;
|
||||
|
||||
foreach ($orderdetail_output->order_schedule as $scheduledetail) {
|
||||
|
||||
if ($scheduledetail->name == Rueckpacken_Zeitvariable) {
|
||||
$NachbereitungsTimeDetail = $scheduledetail;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//End Of get Order Details
|
||||
|
||||
|
||||
|
||||
if (CheckIn_UseDispoEndForRowMarking || ($NachbereitungsTimeDetail->date_start == null)) {
|
||||
$date = new DateTime($packingjob->date_end);
|
||||
} else {
|
||||
$date = new DateTime($NachbereitungsTimeDetail->date_start);
|
||||
}
|
||||
$date->setTime(0, 0, 0);
|
||||
$today = new DateTime();
|
||||
$today->setTime(0, 0, 0);
|
||||
$todayFilter = new DateTime();
|
||||
$todayFilter->setTime(0, 0, 0);
|
||||
if (CheckIn_FutureDays == -1 || $date <= ($todayFilter->modify('+' . CheckIn_FutureDays . ' day'))) {
|
||||
//prüfe, ob entweder unbegrenzte (-1) Anzeige Aktiv ist, oder das Datum kleiner oder Gleich heute + Zukunftsspanne ist
|
||||
|
||||
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_CheckIn) {
|
||||
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>";
|
||||
if(!HideCheckOutTimeOnCheckin){
|
||||
if ($NachbereitungsTimeDetail->date_start != null) {
|
||||
echo "<td><small>" . date_format(new \DateTime($packingjob->date_start), 'd.m.Y') . " " . getTimeFromSeconds($packingjob->time_start) . "</small><br><i>" . date_format(new \DateTime($NachbereitungsTimeDetail->date_start), 'd.m.Y') . " " . getTimeFromSeconds($NachbereitungsTimeDetail->time_start) . "</i></td>";
|
||||
} else {
|
||||
echo "<td>" . date_format(new \DateTime($packingjob->date_start), 'd.m.Y') . " " . getTimeFromSeconds($packingjob->time_start) . "</td>";
|
||||
}
|
||||
}
|
||||
if ($NachbereitungsTimeDetail->date_end != null) {
|
||||
echo "<td><small>" . date_format(new \DateTime($packingjob->date_end), 'd.m.Y') . " " . getTimeFromSeconds($packingjob->time_end) . "</small><br><i>" . date_format(new \DateTime($NachbereitungsTimeDetail->date_end), 'd.m.Y') . " " . getTimeFromSeconds($NachbereitungsTimeDetail->time_end) . "</i></td>";
|
||||
} else {
|
||||
echo "<td>" . date_format(new \DateTime($packingjob->date_end), 'd.m.Y') . " " . getTimeFromSeconds($packingjob->time_end) . "</td>";
|
||||
}
|
||||
echo "<td>";
|
||||
|
||||
|
||||
|
||||
if ($packingjob->is_all_in ==0) {
|
||||
echo "<span class='badge badge-success'>";
|
||||
} else {
|
||||
|
||||
echo '<div class="progress"><div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: '.(( $packingjob->pieces_sum_total - abs($packingjob->is_all_out) - abs($packingjob->is_all_in)) / ($packingjob->pieces_sum_total - $packingjob ->is_all_out)) *100 .'%" aria-valuenow="' .( $packingjob->pieces_sum_total - abs($packingjob->is_all_out) - abs($packingjob->is_all_in)) . '" aria-valuemin="0" aria-valuemax="' . ($packingjob->pieces_sum_total - $packingjob ->is_all_out). '"></div></div>';
|
||||
|
||||
echo "<span class='badge badge-info'>";
|
||||
}
|
||||
|
||||
echo ( $packingjob->pieces_sum_total - abs($packingjob->is_all_out) - abs($packingjob->is_all_in)) . "/" . ($packingjob->pieces_sum_total - $packingjob ->is_all_out) . " (" . $packingjob->pieces_sum_total.")";
|
||||
echo "</span><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;
|
||||
}
|
||||
|
||||
?>
|
||||
152
sources/getCheckOutTable.php
Normal file
152
sources/getCheckOutTable.php
Normal file
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
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;
|
||||
|
||||
|
||||
|
||||
if (SortCheckOut == 2) {
|
||||
|
||||
|
||||
|
||||
// Prüfen, ob $data_output ein Array ist
|
||||
if (is_array($data_output)) {
|
||||
usort($data_output, function ($a, $b) {
|
||||
// Konvertiere time_start von Millisekunden in Sekunden
|
||||
$timeStartA = $a->time_start / 1000; // Zeit in Sekunden
|
||||
$timeStartB = $b->time_start / 1000;
|
||||
|
||||
// Kombiniere date_start mit time_start
|
||||
$datetimeA = strtotime($a->date_start) + $timeStartA;
|
||||
$datetimeB = strtotime($b->date_start) + $timeStartB;
|
||||
|
||||
// Vergleich für die Sortierung
|
||||
return $datetimeA <=> $datetimeB;
|
||||
});
|
||||
|
||||
// Sortierte Daten ausgeben oder weiterverarbeiten
|
||||
// print_r($data_output);
|
||||
} else {
|
||||
echo "Daten konnten nicht verarbeitet werden.";
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($data_output as $packingjob) {
|
||||
|
||||
|
||||
|
||||
|
||||
if ($packingjob->is_archived != true) {
|
||||
|
||||
//get OrderDetails
|
||||
$result = $Epi->requestEpiApi('/v1/order/' . $packingjob->order_pk . '?cl=' . Epirent_Mandant);
|
||||
|
||||
$orderdetail_output = json_decode($result)->payload[0];
|
||||
|
||||
$VorbereitungsTimeDetail;
|
||||
|
||||
foreach ($orderdetail_output->order_schedule as $scheduledetail) {
|
||||
|
||||
if ($scheduledetail->name == Vorbereitungs_Zeitvariable) {
|
||||
$VorbereitungsTimeDetail = $scheduledetail;
|
||||
}
|
||||
}
|
||||
//End Of get Order Details
|
||||
|
||||
if (CheckOut_UseDispoStartForRowMarking || ($VorbereitungsTimeDetail->date_start == null)) {
|
||||
$date = new DateTime($packingjob->date_start);
|
||||
} else {
|
||||
$date = new DateTime($VorbereitungsTimeDetail->date_start);
|
||||
}
|
||||
|
||||
$date->setTime(0, 0, 0);
|
||||
$today = new DateTime();
|
||||
$today->setTime(0, 0, 0);
|
||||
|
||||
$todayFilter = new DateTime();
|
||||
$todayFilter->setTime(0, 0, 0);
|
||||
if (CheckOut_FutureDays == -1 || $date <= ($todayFilter->modify('+' . CheckOut_FutureDays . ' day'))) {
|
||||
//prüfe, ob entweder unbegrenzte (-1) Anzeige Aktiv ist, oder das Datum kleiner oder Gleich heute + Zukunftsspanne ist
|
||||
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>";
|
||||
if ($VorbereitungsTimeDetail->date_start != null) {
|
||||
echo "<td><small>" . date_format(new \DateTime($packingjob->date_start), 'd.m.Y') . " " . getTimeFromSeconds($packingjob->time_start) . "</small><br><i>" . date_format(new \DateTime($VorbereitungsTimeDetail->date_start), 'd.m.Y') . " " . getTimeFromSeconds($VorbereitungsTimeDetail->time_start) . "</i></td>";
|
||||
} else {
|
||||
echo "<td>" . date_format(new \DateTime($packingjob->date_start), 'd.m.Y') . " " . getTimeFromSeconds($packingjob->time_start) . "</td>";
|
||||
}
|
||||
if(!HideCheckInTimeOnCheckout){
|
||||
if (($VorbereitungsTimeDetail->date_end != null)) {
|
||||
echo "<td><small>" . date_format(new \DateTime($packingjob->date_end), 'd.m.Y') . " " . getTimeFromSeconds($packingjob->time_end) . "</small><br><i>" . date_format(new \DateTime($VorbereitungsTimeDetail->date_end), 'd.m.Y') . " " . getTimeFromSeconds($VorbereitungsTimeDetail->time_end) . "</i></td>";
|
||||
} else {
|
||||
echo "<td>" . date_format(new \DateTime($packingjob->date_end), 'd.m.Y') . " " . getTimeFromSeconds($packingjob->time_end) . "</td>";
|
||||
}
|
||||
}
|
||||
echo "<td>";
|
||||
|
||||
|
||||
if ($packingjob->is_all_out == 0) {
|
||||
echo "<span class='badge badge-success'>";
|
||||
} else {
|
||||
|
||||
echo '<div class="progress"><div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: ' . (($packingjob->pieces_sum_total - abs($packingjob->is_all_out)) / $packingjob->pieces_sum_total) * 100 . '%" aria-valuenow="' . ($packingjob->pieces_sum_total - abs($packingjob->is_all_out)) . '" aria-valuemin="0" aria-valuemax="' . $packingjob->pieces_sum_total . '"></div></div>';
|
||||
|
||||
echo "<span class='badge badge-info'>";
|
||||
}
|
||||
|
||||
echo ($packingjob->pieces_sum_total - abs($packingjob->is_all_out)) . "/" . $packingjob->pieces_sum_total;
|
||||
echo "</span><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;
|
||||
}
|
||||
|
||||
?>
|
||||
12
sources/getFooter.php
Normal file
12
sources/getFooter.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<footer class="py-4 bg-light mt-auto">
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex align-items-center justify-content-between small">
|
||||
<div class="text-muted">Copyright © VT-Media | Leopold Strobl</div>
|
||||
<div>
|
||||
<a href="#">Privacy Policy</a>
|
||||
·
|
||||
<a href="#">Terms & Conditions</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
78
sources/getOrderDetails.php
Normal file
78
sources/getOrderDetails.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Kunde</th>
|
||||
<th>Job</th>
|
||||
<th>Dispo-Start</th>
|
||||
<th>Dispo-Ende</th>
|
||||
<th>Summe Netto (Brutto)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Kunde</th>
|
||||
<th>Job</th>
|
||||
<th>Dispo-Start</th>
|
||||
<th>Dispo-Ende</th>
|
||||
<th>Summe Netto (Brutto)</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
require('../config.php');
|
||||
require('../EpiApi.php');
|
||||
require('../vendor/autoload.php');
|
||||
$Epi = new Epirent();
|
||||
|
||||
|
||||
$result = $Epi->requestEpiApi('/v1/order/filter?ir=True&ico=True&ia=False&icl=False&cl=' . Epirent_Mandant);
|
||||
|
||||
$data_output = json_decode($result)->payload;
|
||||
|
||||
|
||||
foreach ($data_output as $order) {
|
||||
|
||||
|
||||
echo "<a class='button btn' href='/order'>";
|
||||
if ($order->is_confirmed == 1) {
|
||||
if($order->order_state != null){
|
||||
if ($order->order_state->is_invoice == 1) {
|
||||
|
||||
echo "<tr class='bg-info' >";
|
||||
} else {
|
||||
echo "<tr class='bg-success clickable-row'>";
|
||||
}
|
||||
}
|
||||
else{
|
||||
echo "<tr class='clickable-row'>";
|
||||
}
|
||||
} else {
|
||||
echo '<tr>';
|
||||
}
|
||||
echo "<td><a type='button' class='btn btn-secondary' href='../sources/getOrderDetails.php?OrderID=".$order->primary_key."'>" . $order->primary_key . "</a></td>";
|
||||
echo "<td>" . $order->contact->name . "</td>";
|
||||
echo "<td>" . $order->event . "</td>";
|
||||
echo "<td>" . date_format(new \DateTime($order->order_schedule[0]->date_start), 'd.m.Y') . " " . getTimeFromSeconds($order->order_schedule[0]->time_start) . "</td>";
|
||||
echo "<td>" . date_format(new \DateTime($order->order_schedule[0]->date_end), 'd.m.Y') . " " . getTimeFromSeconds($order->order_schedule[0]->time_end) . "</td>";
|
||||
echo "<td>" . $order->sum_net . " (" . $order->sum_gro . ")</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;
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
78
sources/getOrders.php
Normal file
78
sources/getOrders.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Kunde</th>
|
||||
<th>Job</th>
|
||||
<th>Dispo-Start</th>
|
||||
<th>Dispo-Ende</th>
|
||||
<th>Summe Netto (Brutto)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Kunde</th>
|
||||
<th>Job</th>
|
||||
<th>Dispo-Start</th>
|
||||
<th>Dispo-Ende</th>
|
||||
<th>Summe Netto (Brutto)</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
require('../config.php');
|
||||
require('../EpiApi.php');
|
||||
require('../vendor/autoload.php');
|
||||
$Epi = new Epirent();
|
||||
|
||||
|
||||
$result = $Epi->requestEpiApi('/v1/order/filter?ir=True&ico=True&ia=False&icl=False&cl=' . Epirent_Mandant);
|
||||
|
||||
$data_output = json_decode($result)->payload;
|
||||
|
||||
|
||||
foreach ($data_output as $order) {
|
||||
|
||||
|
||||
echo "<a class='button btn' href='/order'>";
|
||||
if ($order->is_confirmed == 1) {
|
||||
if($order->order_state != null){
|
||||
if ($order->order_state->is_invoice == 1) {
|
||||
|
||||
echo "<tr class='bg-info' >";
|
||||
} else {
|
||||
echo "<tr class='bg-success clickable-row'>";
|
||||
}
|
||||
}
|
||||
else{
|
||||
echo "<tr class='clickable-row'>";
|
||||
}
|
||||
} else {
|
||||
echo '<tr>';
|
||||
}
|
||||
echo "<td><a type='button' class='btn btn-secondary' href='orderdetails.php?OrderID=".$order->primary_key."'>" . $order->primary_key . "</a></td>";
|
||||
echo "<td>" . $order->contact->name . "</td>";
|
||||
echo "<td>" . $order->event . "</td>";
|
||||
echo "<td>" . date_format(new \DateTime($order->order_schedule[0]->date_start), 'd.m.Y') . " " . getTimeFromSeconds($order->order_schedule[0]->time_start) . "</td>";
|
||||
echo "<td>" . date_format(new \DateTime($order->order_schedule[0]->date_end), 'd.m.Y') . " " . getTimeFromSeconds($order->order_schedule[0]->time_end) . "</td>";
|
||||
echo "<td>" . $order->sum_net . " (" . $order->sum_gro . ")</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;
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
36
sources/getSidenav.php
Normal file
36
sources/getSidenav.php
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
<nav class="sb-sidenav accordion sb-sidenav-dark" id="sidenavAccordion">
|
||||
<div class="sb-sidenav-menu">
|
||||
<div class="nav">
|
||||
<div class="sb-sidenav-menu-heading">Core</div>
|
||||
<a class="nav-link" href="index.php">
|
||||
<div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
|
||||
Dashboard
|
||||
</a>
|
||||
<a class="nav-link" href=orders.php>
|
||||
<div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
|
||||
Aufträge
|
||||
</a>
|
||||
|
||||
<div class="sb-sidenav-menu-heading">Addons</div>
|
||||
<a class="nav-link" target="_blank" href="../Packmonitor.php">
|
||||
<div class="sb-nav-link-icon"><i class="fas fa-box-open"></i></div>
|
||||
Packmonitor
|
||||
</a>
|
||||
<a class="nav-link" target="_blank" href="../Aufgabenmonitor.php">
|
||||
<div class="sb-nav-link-icon"><i class="fas fa-list"></i></div>
|
||||
Aufgabenmonitor
|
||||
</a>
|
||||
<a class="nav-link" target="_blank" href="../PackAufgabenMonitor.php">
|
||||
<div class="sb-nav-link-icon"><i class="fas fa-list"></i></div>
|
||||
Pack- & Aufgabenmonitor
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sb-sidenav-footer">
|
||||
<div class="small">Zuletzt aktualisiert:</div>
|
||||
<?php
|
||||
echo date("d.m.Y - H:i:s", time());
|
||||
?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user