Files
server/resources/views/client/orders.php
Halbe Bruno f37bc712e6 DNSBlock
2025-12-05 19:40:39 -03:00

79 lines
4.8 KiB
PHP

<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 justify-between items-center">
<h3 class="text-lg font-semibold text-gray-800">Ordens Judiciais</h3>
<form action="/client/orders" method="GET" class="relative">
<input type="text" name="q" placeholder="Buscar ordem ou domínio..." value="<?= $_GET['q'] ?? '' ?>"
class="pl-4 pr-10 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500">
<button type="submit" class="absolute right-0 top-0 mt-2 mr-3 text-gray-400 hover:text-primary-600">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
</svg>
</button>
</form>
</div>
<div class="overflow-x-auto">
<table class="w-full">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Título
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tipo</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Início do
Bloqueio</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Ações
</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
<?php if (!empty($orders)): ?>
<?php foreach ($orders as $order): ?>
<tr class="hover:bg-gray-50 transition-colors">
<td class="px-6 py-4 text-sm text-gray-500"><?= $order['id'] ?></td>
<td class="px-6 py-4 text-sm font-medium text-gray-900"><?= htmlspecialchars($order['title']) ?>
</td>
<td class="px-6 py-4 text-sm">
<span
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full <?= $order['type'] == 'block' ? 'bg-red-100 text-red-800' : 'bg-green-100 text-green-800' ?>">
<?= $order['type'] == 'block' ? 'Bloqueio' : 'Desbloqueio' ?>
</span>
</td>
<td class="px-6 py-4 text-sm text-gray-500"><?= date('d/m/Y', strtotime($order['received_at'])) ?>
</td>
<td class="px-6 py-4 text-sm font-medium">
<a href="/client/orders/view/<?= $order['id'] ?>"
class="text-primary-600 hover:text-primary-900 hover:underline">Ver Detalhes</a>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="5" class="px-6 py-4 text-center text-gray-500">Nenhuma ordem encontrada.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<?php if (isset($pagination) && $pagination['total'] > 1): ?>
<div class="px-6 py-4 border-t border-gray-100 flex justify-between items-center">
<div>
<span class="text-sm text-gray-700">
Página <span class="font-medium"><?= $pagination['current'] ?></span> de <span
class="font-medium"><?= $pagination['total'] ?></span>
</span>
</div>
<div class="flex space-x-2">
<?php if ($pagination['prev']): ?>
<a href="?page=<?= $pagination['prev'] ?><?= isset($_GET['q']) ? '&q=' . $_GET['q'] : '' ?>"
class="px-3 py-1 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50">Anterior</a>
<?php endif; ?>
<?php if ($pagination['next']): ?>
<a href="?page=<?= $pagination['next'] ?><?= isset($_GET['q']) ? '&q=' . $_GET['q'] : '' ?>"
class="px-3 py-1 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50">Próxima</a>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
</div>