Added image upload to ConstructionConsent Form

This commit is contained in:
Frank Schubert
2025-01-13 19:06:50 +01:00
parent 15bfe7c734
commit f2cfefc7a2
6 changed files with 83 additions and 5 deletions

View File

@@ -328,7 +328,9 @@
<div class="borderpoint">
<h3>Übersichtsplan / Planskizze</h3>
<img src="<?=$ressourcePathPrefix?>/borderpoint-cc.png" style="width: 600px; border: 1px solid #000" />
<?php if($consent->file): ?>
<img src="<?=$consent->file->file->asDataUrl()?>" style="max-width: 600px; border: 1px solid #000" />
<?php endif; ?>
</div>
<div class="signature-line mt-4">

View File

@@ -25,7 +25,7 @@
<?= ($Action == "add") ? "Neue " : "" ?>Zustimmungserklärung <?= ($Action == "edit") ? "bearbeiten " : "" ?>
</h4>
<form class="form-horizontal" method="post" action="<?= self::getUrl("ConstructionConsent", "save") ?>">
<form class="form-horizontal" method="post" action="<?= self::getUrl("ConstructionConsent", "save") ?>" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?=isset($item) ? $item->id : ""?>"/>
<div class="card">
@@ -151,6 +151,17 @@
</div>
</div>
<hr />
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="name">Planskizze / Bilddatei</label>
<div class="col-lg-10">
<input type="file" class="form-control" name="consent_plan_image" id="consent_plan_image" />
</div>
</div>
<hr />
<div class="form-group row mt-3">
<label class="col-lg-2 col-form-label" for="note">Interne Notiz</label>

View File

@@ -102,6 +102,14 @@ $pagination_entity_name = "Adressen";
</tr><tr>
<th>GSTNR</th>
<td><?=$item->gstnr?></td>
</tr><tr>
<th>Plan/Skizze</th>
<td>
<?php if($item->file): ?>
<!--img src="<?=self::getUrl("File", "Download", ["id" => $item->file->file_id])?>" style="max-width: 480px;"/-->
<img src="<?=$item->file->file->asDataUrl()?>" style="max-width: 480px;" />
<?php endif; ?>
</td>
</tr><tr>
<th></th>
<td></td>
@@ -113,6 +121,8 @@ $pagination_entity_name = "Adressen";
<td class="text-monospace"><?=date("d.m.Y H:i:s", $item->edit)?> (<?=$item->editor->name?>)</td>
</tr>
</table>
</div>
</div>
</div>