Files
thetool/Layout/default/Preordernotification/Form.php
2023-01-25 18:28:32 +01:00

181 lines
9.3 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("Network")?>">Vorbestellung</a></li>
<li class="breadcrumb-item">Emailaussendungen</li>
<li class="breadcrumb-item active"><?=($notification->id) ? "bearbeiten" : "Neu" ?></li>
</ol>
</div>
<h4 class="page-title"><?=($notification->id) ? "Emailaussendung bearbeiten" : "Neue Emailaussendung" ?></h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<form class="form-horizontal" method="post" action="<?=self::getUrl("Preordernotification ", "save")?>">
<div class="card">
<div class="card-body">
<input type="hidden" name="id" value="<?=$notification->id?>" />
<h4>Empfänger</h4>
<p>Die Aussendung wird an die Kontaktemailadresse aller Bestellungen versendet. Wählen Sie folgende Konditionen aus, um die Empfänger zu beschränken:</p>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="name">Vorbestellkampagne</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="preordercampaign_id" id="preordercampaign_id" value="<?=$campaign->name?>" disabled="disabled">
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="type">Bestelltyp</label>
<div class="col-lg-10">
<select class="form-control select2" name="type" id="type" multiple="multiple">
<?php if(array_key_exists("interest", $campaign->types)): ?><option value="interest" <?=($notification->type == "interest") ? "selected='selected'" : ""?>>Interessensbekundung</option><?php endif; ?>
<?php if(array_key_exists("provision", $campaign->types)): ?><option value="provision" <?=($notification->type == "provision") ? "selected='selected'" : ""?>>Vorsorgeanschluss</option><?php endif; ?>
<?php if(array_key_exists("order", $campaign->types)): ?><option value="order" <?=($notification->type == "order") ? "selected='selected'" : ""?>>Vollanschluss</option><?php endif; ?>
<?php if(array_key_exists("reorder", $campaign->types)): ?><option value="reorder" <?=($notification->type == "reorder") ? "selected='selected'" : ""?>>Nachbestellung</option><?php endif; ?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="connection_type">Anschlusstyp</label>
<div class="col-lg-10">
<select class="form-control select2" name="connection_type" id="connection_type" multiple="multiple">
<option value="single-dwelling" <?=($notification->connection_type == "single-dwelling") ? "selected='selected'" : ""?>>Einfamilienhaus</option>
<option value="multi-dwelling" <?=($notification->connection_type == "multi-dwelling") ? "selected='selected'" : ""?>>Mehrfamilienhaus</option>
<option value="apartment-building" <?=($notification->connection_type == "apartment-building") ? "selected='selected'" : ""?>>Mehrparteienhaus</option>
<option value="apartment" <?=($notification->connection_type == "apartment") ? "selected='selected'" : ""?>>Wohneinheit in Mehrparteienhaus</option>
<option value="business" <?=($notification->connection_type == "business") ? "selected='selected'" : ""?>>Gewerbebetrieb</option>
</select>
</div>
</div>
<!--div class="form-group row">
<label class="col-lg-2 col-form-label" for="product_id">Vertriebspartner</label>
<div class="col-lg-10">
<select class="form-control select2" name="partner_id" id="partner_id" multiple="multiple">
<option value=""></option>
<?php foreach($partners as $partner): ?>
<option value="<?=$partner->id?>" <?=($notification->id && $notification->partner_id == $partner->id) ? "selected='selected'" : ""?>><?=$partner->getCompanyOrName()?></option>
<?php endforeach; ?>
</select>
</div>
</div-->
<hr />
<h4 class="mt-4">Emailinhalt</h4>
<p>Im folgenden Editor können Sie ein HTML-Email verfassen. Verwenden Sie as Menü und die Werkzeugleiste um den Text zu formatieren:</p>
<textarea id="body_html" name="body_html" placeholder="Bitte geben Sie hier den Emailinhalt ein..." rows="12" style="width: 100%; height: 600px; padding: 10px;"><?=$notification->body_html?></textarea>
<h4 class="mt-4">Dateianhänge</h4>
<div class="row mb-3">
<div class="col-xl-5 input-grop ml-1">
<label class="custom-file-label" for="attachment"><i class="far fa-file-import"></i> Datei(en) auswählen</label>
<input type="file" name="attachment[]" id="attachment" class="custom-file-input" multiple="multiple" />
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="note">Interne Notiz</label>
<div class="col-lg-10">
<textarea id="note" class="form-control" name="note" rows="5"><?=$pop->note?></textarea>
</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>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="<?=self::getResourcePath()?>plugins/tinymce/tinymce.min.js"></script>
<script type="text/javascript" src="<?=self::getResourcePath()?>plugins/bs-custom-file-input/bs-custom-file-input.min.js"></script>
<script type="text/javascript">
$(function () {
tinymce.init({
//font_formats: "Arial=arial,sans-serif;",
selector: '#body_html',
language: 'de',
skin: "tinymce-5",
plugins: 'link autolink lists table',
paste_block_drop: true,
paste_as_text: true,
paste_data_images: false,
promotion: false,
toolbar: 'undo redo | styles | bold italic underline strikethrough | fontfamily fontsize fontcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent | table | link unlink',
content_css: "<?=self::getResourcePath()?>/assets/css/tinymce.css",
font_family_formats: "Arial=arial,sans-serif; Courier New=courier new,courier,monospace; Georgia=georgia,palatino,serif; Helvetica=helvetica,sans-serif; Lucida Sans=lucida sans unicode,sans-serif; Tahoma=tahoma,arial,helvetica,sans-serif; Times New Roman=times new roman,times,serif"
});
bsCustomFileInput.init();
/*$('#body_html').summernote({
height: 400,
lang: "de-DE",
placeholder: "Bitte geben Sie hier den Emailtext ein...",
toolbar: [
['style', ['style']],
['font', ['bold', 'underline', 'clear', 'fontname']],
['fontsize', ['fontsize', 'fontsizeunit']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph', 'height']],
['table', ['table']],
['insert', ['link']],
['view', ['fullscreen', 'codeview', 'help']]
],
fontNames: ["Arial", "Arial Black", "Courier New", "Georgia", "Helvetica", "Lucida Sans Unicode", "Tahoma", "Times New Roman"],
addDefaultFonts: false
});
//$('#body_html').summernote('fontSizeUnit', "pt");
//$('#body_html').summernote("fontSize", 12);*/
});
$(".select2").select2({
allowClear: true,
placeholder: ""
});
</script>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>