166 lines
9.1 KiB
PHP
166 lines
9.1 KiB
PHP
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
|
|
|
|
<!-- 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("MaintenanceNotification")?>">Wartungsmeldungen</a></li>
|
|
<li class="breadcrumb-item active"><?=($notification && $notification->id) ? "Bearbeiten" : "Neu" ?></li>
|
|
</ol>
|
|
</div>
|
|
<h4 class="page-title"><?=($notification->id) ? "Wartungsmeldung bearbeiten" : "Neue Wartungsmeldung" ?></h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end page title -->
|
|
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
|
|
<form class="form-horizontal" method="post" action="<?=self::getUrl("MaintenanceNotification", "save")?>" enctype="multipart/form-data">
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
|
|
<input type="hidden" name="id" value="<?=$notification->id?>" />
|
|
|
|
<label class="form-label" for="from">Wartungsfenster Von *:</label>
|
|
<div class="form-group row">
|
|
<div class="col-2">
|
|
<input type="text" class="form-control datepicker" name="from_date" id="from_date" placeholder="Datum" value="<?=($notification && $notification->from) ? date("d.m.Y", $notification->from) : ""?>" />
|
|
</div>
|
|
<div class="col-2">
|
|
<input type="text" class="form-control timepicker" name="from_time" id="from_time" placeholder="Uhrzeit" value="<?=($notification && $notification->from) ? date("H:i", $notification->from) : ""?>" />
|
|
</div>
|
|
</div>
|
|
|
|
<label class="form-label" for="from">Wartungsfenster Bis *:</label>
|
|
<div class="form-group row">
|
|
<div class="col-2">
|
|
<input type="text" class="form-control datepicker" name="to_date" id="to_date" placeholder="Datum" value="<?=($notification && $notification->to) ? date("d.m.Y", $notification->to) : ""?>"/>
|
|
</div>
|
|
<div class="col-2">
|
|
<input type="text" class="form-control timepicker" name="to_time" id="to_time" placeholder="Uhrzeit" value="<?=($notification && $notification->to) ? date("H:i", $notification->to) : ""?>"/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row col-12">
|
|
<label class="form-label" for="from">PLZ-Bereich *:</label>
|
|
<textarea class="form-control" name="plz" id="from" style="height: 86px;"><?=($notification && $notification->plzs) ? implode(", ", $notification->plzs) : ""?></textarea>
|
|
<small class="text-primary">PLZ' mit Leerzeichen oder Komma getrennt</small>
|
|
</div>
|
|
|
|
<hr />
|
|
|
|
<div class="form-group row mt-3 col-12">
|
|
<label class="form-label" for="subject_id">Betreff *:</label>
|
|
<select name="subject_id" id="subject_id" class="form-control" onchange="changeText(this)">
|
|
<option></option>
|
|
<?php foreach(MaintenanceNotificationTemplate::getAll() as $tpl): ?>
|
|
<option value="<?=$tpl->id?>" <?=($notification && $notification->subject_id == $tpl->id) ? "selected='selected'" : ""?> data-text-template="<?=htmlentities($tpl->text)?>"><?=htmlentities($tpl->subject)?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
|
|
<label class="form-label" for="text">Wartungsmeldung Text *:</label>
|
|
<textarea id="text" name="text" placeholder="Bitte geben Sie hier den Emailinhalt ein..." rows="12" style="width: 100%; height: 600px; padding: 10px;"><?= htmlentities($notification->text)?></textarea>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
|
|
<h4>Versand</h4>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="tosend_day">Versandzeitpunkt</label>
|
|
<div class="col-lg-2">
|
|
<label>Datum</label>
|
|
<input type="text" class="form-control datepicker" name="sendts_day" id="sendts_day" value="<?=($notification->send_ts) ? date("d.m.Y", $notification->send_ts) : ""?>" />
|
|
<small>Emailversand wird zu diesem Zeitpunkt gestartet</small>
|
|
</div>
|
|
<div class="col-lg-2">
|
|
<label>Uhrzeit</label>
|
|
<select name="sendts_hour" class="form-control">
|
|
<?php for($h = 0; $h < 24; $h++): ?>
|
|
<option value="<?=$h?>" <?=($notification->send_ts && date('H', $notification->send_ts) == $h) ? "selected='selected'" : ""?>><?=str_pad($h, 2, "0", STR_PAD_LEFT)?>:00</option>
|
|
<?php endfor; ?>
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<hr />
|
|
|
|
<!--div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="testmail_to">Test Email versenden</label>
|
|
<div class="col-lg-10">
|
|
<div class="row">
|
|
<div class="col-6">
|
|
|
|
<div class="input-group mb-3">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text"><i class="fas fa-envelope"></i></span>
|
|
</div>
|
|
<input type="text" class="form-control" name="testmail_to" id="testmail_to" value="" placeholder="Testempfänger" />
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-6">
|
|
<button type="submit" name="send_testmail" value="1" class="btn btn-outline-success"><i class="far fa-paper-plane"></i> Testmail jetzt abschicken</button>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div-->
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2"></label>
|
|
<div class="col-lg-10">
|
|
<button type="submit" name="return" value="form" class="btn btn-primary mr-1">Speichern</button>
|
|
<button type="submit" name="return" value="index" class="btn btn-primary">Speichern und zur Übersicht</button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('.datepicker').datepicker({
|
|
language: 'de',
|
|
format: "dd.mm.yyyy",
|
|
showWeekDays: true,
|
|
todayBtn: 'linked',
|
|
orientation: "bottom",
|
|
autoclose: true
|
|
});
|
|
$('.timepicker').timepicker({
|
|
format: "HH:mm"
|
|
});
|
|
});
|
|
|
|
function changeText(elem) {
|
|
var text = $(elem).find(":selected").data("text-template");
|
|
$("#text").text(text);
|
|
}
|
|
</script>
|
|
|
|
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|