Zeiterfassung Fahrzeugverwaltung neue Features:

* KM-Stand History
* Journal
* Neue Felder
This commit is contained in:
Daniel Spitzer
2025-03-14 10:06:47 +01:00
parent 93987b4341
commit c69d8b84d5
6 changed files with 160 additions and 7 deletions

View File

@@ -39,6 +39,19 @@ if ($timerecordingcar->mileage_now && $timerecordingcar->mileage_timestamp) {
color: #218200;
opacity: 0.7;
}
.del-journal
{
cursor: pointer;
position: absolute;
right: 5px;
top: 5px;
z-index: 2000;
}
.del-mileage-history
{
cursor: pointer;
z-index: 2000;
}
</style>
<!-- start page title -->
<div class="row">
@@ -178,8 +191,8 @@ if ($timerecordingcar->mileage_now && $timerecordingcar->mileage_timestamp) {
<tr>
<td></td>
<td><?= $timeRecordingCarMileagehistory->mileage ?> KM
(<?= date("d.m.Y", $timeRecordingCarMileagehistory->mileage_timestamp) ?>
)
(<?= date("d.m.Y", $timeRecordingCarMileagehistory->mileage_timestamp) ?>)
<span class="float-right"><i data-id="<?= $timeRecordingCarMileagehistory->id ?>" class="fas fa-trash del-mileage-history text-danger"></i></span>
</td>
</tr>
<?php
@@ -351,7 +364,8 @@ if ($timerecordingcar->mileage_now && $timerecordingcar->mileage_timestamp) {
<?php foreach ($timerecordingCarJournal as $timerecordingjournal): ?>
<div class="card mb-1 mt-1">
<div class="card-body ">
<i data-id="<?= $timerecordingjournal->id ?>" class="fas fa-trash del-journal text-danger"></i>
<div class="card-body p-2">
<div class="row">
<div class="col-12 mb-0 pl-1">
<div class="pl-2 pt-1"><?= date("d.m.Y", $timerecordingjournal->timestamp) ?>
@@ -392,6 +406,36 @@ if ($timerecordingcar->mileage_now && $timerecordingcar->mileage_timestamp) {
}
});
$('body').on('click', '.del-journal', function () {
var id = $(this).data("id");
var thisis = $(this);
if (!confirm("Journaleintrag wirklich löschen?")) {
return false;
}
$.ajax({
url: "<?= self::getUrl("TimerecordingCar", "api",['do'=>'deleteJournal']) ?>",
type: "POST",
data: {id: id},
success: function (data) {
thisis.closest("div").remove();
}
});
});
$('body').on('click', '.del-mileage-history', function () {
var id = $(this).data("id");
var thisis = $(this);
if (!confirm("Kilometerstand wirklich löschen?")) {
return false;
}
$.ajax({
url: "<?= self::getUrl("TimerecordingCar", "api",['do'=>'deleteMilageHistory']) ?>",
type: "POST",
data: {id: id},
success: function (data) {
thisis.closest("tr").remove();
}
});
});
});
</script>
<script type="text/javascript"