67 lines
2.9 KiB
PHP
67 lines
2.9 KiB
PHP
<div id="photoModal" class="modal">
|
|
<div class="modal-content final-wide" style="max-width:800px; position:relative;">
|
|
|
|
<!-- X per chiudere -->
|
|
<button id="photoModalCloseX"
|
|
style="position:absolute; top:10px; right:15px; font-size:1.7rem; background:none; border:none; cursor:pointer;">
|
|
×
|
|
</button>
|
|
|
|
<h3 id="photoModalTitle">Carica Foto</h3>
|
|
<p id="photoModalSubtitle"></p>
|
|
|
|
<div id="photoMessageSuccess"
|
|
style="display:none; margin-bottom:10px; padding:8px 12px; border-radius:8px; background:#dcfce7; color:#166534; font-weight:500; text-align:left;">
|
|
✅ Foto caricata correttamente.
|
|
</div>
|
|
|
|
<div id="photoMessageError"
|
|
style="display:none; margin-bottom:10px; padding:8px 12px; border-radius:8px; background:#fee2e2; color:#b91c1c; font-weight:500; text-align:left;">
|
|
⚠️ Errore durante il caricamento.
|
|
</div>
|
|
|
|
<form id="photoForm" enctype="multipart/form-data">
|
|
<input type="hidden" name="production_id" id="photoProductionId">
|
|
<input type="hidden" name="photo_type" id="photoType">
|
|
<input type="hidden" name="param_position" id="photoParamPosition">
|
|
|
|
<!-- ✅ input file DENTRO al form -->
|
|
<input type="file" name="photo" id="photoInput"
|
|
accept="image/*;capture=camera"
|
|
style="display:none;">
|
|
|
|
<div class="mb-3">
|
|
<label><strong>Carica o scatta una foto:</strong></label>
|
|
<button type="button" class="modal-btn" id="choosePhotoBtn">Scegli foto</button>
|
|
<span id="selectedPhotoName" style="margin-left:8px; font-size:0.85rem; color:#64748b;"></span>
|
|
</div>
|
|
|
|
<!-- 🔥 loader -->
|
|
<div id="photoLoading"
|
|
style="display:none; margin-top:10px; font-size:0.9rem; color:#64748b;">
|
|
⏳ Caricamento in corso...
|
|
</div>
|
|
|
|
<div id="singlePhotoInfo"
|
|
style="display:none; margin-top:10px; font-size:0.9rem; color:#b91c1c; text-align:left;">
|
|
Per questo parametro è già presente una foto.
|
|
Se vuoi sostituirla, chiedi all'amministratore di cancellare quella esistente.
|
|
</div>
|
|
|
|
|
|
<div class="modal-buttons" style="margin-top:1.5rem;">
|
|
<button type="button" id="photoCancel" class="modal-btn modal-cancel">Annulla</button>
|
|
<button type="submit" class="modal-btn modal-confirm">Carica</button>
|
|
</div>
|
|
</form>
|
|
|
|
<hr style="margin:1.5rem 0;">
|
|
|
|
<h4 style="font-size:1rem; margin-bottom:0.7rem;">Foto già registrate per questa tipologia</h4>
|
|
|
|
<div id="photoGallery" class="photo-gallery"
|
|
style="display:flex; flex-wrap:wrap; gap:10px; max-height:220px; overflow-y:auto; padding:4px 0;">
|
|
<!-- thumbnails caricati via JS -->
|
|
</div>
|
|
</div>
|
|
</div> |