Files
thetool/Layout/default/TimerecordingCar/Form.php
Spitzer Daniel acbdb7b2aa Zeiterfassungs Update
* neue Migration für Personaladministration (Aktive Verrechnung)
 * Verrechnung Anpassungen Black P.
 * superexpertEnabled Implementation Verrechnung/Personaladministration
 * Personaladministration (Aktive Verrechnung/Zeiterfassung Enddatum)
2024-04-04 18:05:16 +02:00

169 lines
9.9 KiB
PHP

<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php");
if (isset($_GET['returnto']) && $_GET['returnto'] == "detail") {
$cancelUrl = self::getUrl("TimerecordingCar", "Detail", ["id" => $timerecordingcars->id]);
} else {
$cancelUrl = self::getUrl("TimerecordingCar");
}
foreach ($timerecordingusers as $timerecordinguser) {
$timerecordingUsers[$timerecordinguser->name] = $timerecordinguser->id;
}
ksort($timerecordingUsers);
?>
<link href="<?= self::getResourcePath() ?>assets/css/select2-cstm.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="<?= self::getUrl("Dashboard") ?>"><?= MFAPPNAME_SLUG ?></a>
</li>
<li class="breadcrumb-item"><a
href="<?= self::getUrl("TimerecordingCar") ?>">Fahrzeuge</a></li>
<li class="breadcrumb-item active"><?= ($timerecordingcars->id) ? "bearbeiten" : "Neu" ?></li>
</ol>
</div>
<h4 class="page-title"><?= ($timerecordingcars->id) ? "Fahrzeug bearbeiten" : "Neues Fahrzeug" ?></h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-12">
<div class="card bg-light">
<div class="card-body">
<h4 class="header-title mb-2"><?= ($timerecordingcars->id) ? "Fahrzeug bearbeiten" : "Neues Fahrzeug" ?></h4>
<form class="form-horizontal" method="post"
action="<?= self::getUrl("TimerecordingCar", "save", ["returnto" => $_GET["returnto"]]) ?>">
<div class="card no-shadow">
<div class="card-body">
<input type="hidden" name="id" value="<?= $timerecordingcars->id ?>"/>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="number_plate">Kennzeichen *</label>
<div class="col-lg-1">
<input required="required" type="text" id="number_plate" name="number_plate"
class="form-control"
value="<?= $timerecordingcars->number_plate ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="brand">Fahrzeugverwalter</label>
<div class="col-lg-2">
<select id="user_id_select" name="user_id"
class="select2 form-control" required="required">
<option value="-">&nbsp</option>
<?php foreach ($timerecordingUsers as $key => $timerecordingUser): ?>
<option <?= ($timerecordingcars->user_id==$timerecordingUser) ? 'selected="selected' : "" ?> value="<?= $timerecordingUser ?>"><?= $key ?></option>
<?php
endforeach; ?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="brand">Marke *</label>
<div class="col-lg-3">
<input required="required" type="text" id="brand" name="brand"
class="form-control"
value="<?= $timerecordingcars->brand ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="model">Model/Typ *</label>
<div class="col-lg-3">
<input required="required" type="text" id="model" name="model"
class="form-control"
value="<?= $timerecordingcars->model ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="initial_approval">Erstzulassung</label>
<div class="col-lg-2">
<input type="month" id="initial_approval"
name="initial_approval"
class="form-control"
value="<?= ($timerecordingcars->initial_approval) ? date('Y-m', $timerecordingcars->initial_approval) : "" ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="first_approval">Erste §57a nach</label>
<div class="col-lg-2">
<select id="first_approval" name="first_approval" class="select2 form-control">
<option value=" ">&nbsp;</option>
<option value="1" <?= ($timerecordingcars->first_approval == "1") ? "selected='selected'" : "" ?>>
1 Jahr
</option>
<option value="2" <?= ($timerecordingcars->first_approval == "2") ? "selected='selected'" : "" ?>>
2 Jahren
</option>
<option value="3" <?= ($timerecordingcars->first_approval == "3") ? "selected='selected'" : "" ?>>
3 Jahren
</option>
<option value="4" <?= ($timerecordingcars->first_approval == "4") ? "selected='selected'" : "" ?>>
4 Jahren
</option>
<option value="5" <?= ($timerecordingcars->first_approval == "5") ? "selected='selected'" : "" ?>>
5 Jahren
</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="mileage">Kilometerstand</label>
<div class="col-lg-1">
<input type="number" id="mileage" name="mileage"
class="form-control"
value="<?= $timerecordingcars->mileage ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label"
for="timerecording">Digitales Fahrtenbuch</label>
<div class="col-lg-3">
<div class="form-check">
<input id="timerecording"
class="form-check-input" <?= ($timerecordingcars->timerecording) ? 'checked="checked"' : '' ?>
type="checkbox" name="timerecording" value="1"/>
</div>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2"></label>
<div class="col-lg-10">
<button type="submit" class="btn btn-primary">Speichern</button>
<a href="<?= $cancelUrl ?>">
<button type="button" class="btn btn-secondary">Abbrechen</button>
</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(".select2").select2({placeholder: ""});
// disable mousewheel on a input number field when in focus
$('form').on('focus', 'input[type=number]', function (e) {
$(this).on('wheel.disableScroll', function (e) {
e.preventDefault()
})
});
$('form').on('blur', 'input[type=number]', function (e) {
$(this).off('wheel.disableScroll')
});
</script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>