add upload anexos pos ordem criada

This commit is contained in:
HalbeBruno
2026-03-18 13:58:20 -03:00
parent b4799a1d42
commit d709d4cb09
5 changed files with 86 additions and 9 deletions

View File

@@ -29,7 +29,6 @@
</div>
</div>
<?php if (!empty($attachments)): ?>
<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
<div class="px-6 py-4 border-b border-gray-100 bg-gray-50 flex items-center gap-2">
<svg class="w-4 h-4 text-gray-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
@@ -37,6 +36,8 @@
</svg>
<h3 class="text-sm font-semibold text-gray-800">Anexos (<?= count($attachments) ?>)</h3>
</div>
<?php if (!empty($attachments)): ?>
<ul class="divide-y divide-gray-100">
<?php foreach ($attachments as $attachment): ?>
<li class="flex items-center justify-between px-6 py-3 hover:bg-gray-50 transition-colors">
@@ -60,8 +61,21 @@
</li>
<?php endforeach; ?>
</ul>
<?php else: ?>
<div class="px-6 py-4 text-sm text-gray-500">
Nenhum anexo salvo para esta ordem.
</div>
<?php endif; ?>
<div class="px-6 py-4 bg-gray-50 border-t border-gray-100">
<form action="/admin/orders/attachments/upload/<?= (int) $order['id'] ?>" method="POST" enctype="multipart/form-data" class="flex flex-col sm:flex-row items-center gap-3">
<input type="file" name="new_attachments[]" multiple class="block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-semibold file:bg-gray-200 file:text-gray-700 hover:file:bg-gray-300 cursor-pointer" accept=".pdf,.png,.jpg,.jpeg,.gif,.doc,.docx,.xls,.xlsx,.txt" required>
<button type="submit" class="px-4 py-2 bg-primary-600 text-white rounded-lg text-sm font-semibold hover:bg-primary-700 w-full sm:w-auto flex-shrink-0 transition-colors">
Adicionar Anexos
</button>
</form>
</div>
</div>
<?php endif; ?>
<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
<div class="px-6 py-4 border-b border-gray-100 bg-gray-50">