This commit is contained in:
Halbe Bruno
2025-12-05 19:40:39 -03:00
commit f37bc712e6
4312 changed files with 359196 additions and 0 deletions

View File

@@ -0,0 +1,119 @@
<div class="max-w-3xl mx-auto bg-white rounded-xl shadow-sm border border-gray-100 p-6">
<h3 class="text-lg font-semibold text-gray-800 mb-6">Nova Ordem Judicial</h3>
<?php if (isset($_SESSION['flash_error'])): ?>
<div class="bg-red-50 border-l-4 border-red-500 p-4 mb-6">
<p class="text-sm text-red-700"><?= $_SESSION['flash_error'] ?></p>
</div>
<?php unset($_SESSION['flash_error']); ?>
<?php endif; ?>
<!-- Quill Styles -->
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
<form action="/admin/orders/store" method="POST" enctype="multipart/form-data" class="space-y-6" id="orderForm">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="col-span-2">
<label class="block text-sm font-medium text-gray-700 mb-1">Título / Identificação da Ordem</label>
<input type="text" name="title" required placeholder="Ex: Processo nº 123456 - Bloqueio Jogos"
oninvalid="this.setCustomValidity('Por favor, preencha o título da ordem.')"
oninput="this.setCustomValidity('')"
class="w-full px-4 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 outline-none">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Tipo da Ordem</label>
<select name="type" required oninvalid="this.setCustomValidity('Por favor, selecione o tipo da ordem.')"
oninput="this.setCustomValidity('')"
class="w-full px-4 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 outline-none">
<option value="block">Bloqueio</option>
<option value="unblock">Desbloqueio</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Data de Recebimento</label>
<input type="date" name="received_at"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"
required oninvalid="this.setCustomValidity('Por favor, informe a data de recebimento.')"
oninput="this.setCustomValidity('')">
</div>
<div class="col-span-2">
<label class="block text-sm font-medium text-gray-700 mb-1">Conteúdo do Email / Descrição</label>
<div id="editor" class="bg-white" style="height: 200px;"></div>
<input type="hidden" name="content" id="content">
</div>
<div class="col-span-2">
<label class="block text-sm font-medium text-gray-700 mb-1">Arquivo de Domínios (.csv, .txt)</label>
<div x-data="{ fileName: '' }" class="mt-1">
<label
class="flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer hover:border-primary-500 transition-colors bg-white">
<div class="space-y-1 text-center">
<svg class="mx-auto h-12 w-12 text-gray-400" stroke="currentColor" fill="none"
viewBox="0 0 48 48" aria-hidden="true">
<path
d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<div class="flex text-sm text-gray-600 justify-center">
<span class="font-medium text-primary-600 hover:text-primary-500">Upload um
arquivo</span>
<p class="pl-1">ou arraste e solte</p>
</div>
<p class="text-xs text-gray-500">CSV ou TXT até 10MB</p>
<p class="text-sm font-semibold text-gray-800 mt-2"
x-text="fileName ? 'Selecionado: ' + fileName : ''"></p>
</div>
<input type="file" name="csv_file" class="sr-only" accept=".csv,.txt"
@change="fileName = $event.target.files[0].name" required
oninvalid="this.setCustomValidity('Por favor, selecione um arquivo CSV ou TXT.')"
oninput="this.setCustomValidity('')">
</label>
</div>
</div>
</div>
<div class="flex justify-end space-x-3 pt-4 border-t border-gray-100">
<a href="/admin/orders"
class="px-4 py-2 text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors">Cancelar</a>
<button type="submit"
class="px-4 py-2 text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors">Salvar e
Processar</button>
</div>
</form>
</div>
<!-- Quill Script -->
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
<script>
var quill = new Quill('#editor', {
theme: 'snow',
placeholder: 'Cole o conteúdo do email ou descreva a ordem aqui...',
modules: {
toolbar: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block'],
[{ 'header': 1 }, { 'header': 2 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'direction': 'rtl' }],
[{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }],
[{ 'font': [] }],
[{ 'align': [] }],
['clean'],
['link']
]
}
});
var form = document.getElementById('orderForm');
form.onsubmit = function () {
var content = document.querySelector('input[name=content]');
content.value = quill.root.innerHTML;
};
</script>

View File

@@ -0,0 +1,85 @@
<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 flex justify-between items-center bg-gray-50">
<h3 class="text-lg font-semibold text-gray-800">Ordens Judiciais</h3>
<a href="/admin/orders/create"
class="bg-primary-600 hover:bg-primary-700 text-white px-4 py-2 rounded-lg text-sm font-medium transition-colors flex items-center">
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path>
</svg>
Nova Ordem
</a>
</div>
<?php if (isset($_SESSION['flash_success'])): ?>
<div class="bg-green-50 border-l-4 border-green-500 p-4 m-6">
<p class="text-sm text-green-700"><?= $_SESSION['flash_success'] ?></p>
</div>
<?php unset($_SESSION['flash_success']); ?>
<?php endif; ?>
<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="/admin/orders/view/<?= $order['id'] ?>"
class="text-primary-600 hover:text-primary-900 hover:underline">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'] ?>"
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'] ?>"
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>

View File

@@ -0,0 +1,61 @@
<div class="space-y-6">
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6">
<div class="flex justify-between items-start">
<div>
<h3 class="text-xl font-bold text-gray-900"><?= htmlspecialchars($order['title']) ?></h3>
<p class="text-sm text-gray-500 mt-1">Recebido em
<?= date('d/m/Y H:i', strtotime($order['received_at'])) ?>
</p>
</div>
<span
class="px-3 py-1 rounded-full text-sm font-semibold <?= $order['type'] == 'block' ? 'bg-red-100 text-red-800' : 'bg-green-100 text-green-800' ?>">
<?= $order['type'] == 'block' ? 'Bloqueio' : 'Desbloqueio' ?>
</span>
</div>
<div class="mt-6 border-t border-gray-100 pt-4">
<h4 class="text-sm font-medium text-gray-700">Conteúdo / Descrição</h4>
<style>
.prose a {
color: #2563eb;
text-decoration: underline;
}
.prose a:hover {
color: #1e40af;
}
</style>
<div class="mt-2 text-gray-600 text-sm prose max-w-none"><?= $order['content'] ?></div>
</div>
</div>
<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">
<h3 class="text-lg font-semibold text-gray-800">Domínios Afetados (<?= count($items) ?>)</h3>
</div>
<div class="overflow-x-auto max-h-96">
<table class="w-full text-left border-collapse">
<thead class="bg-gray-50 sticky top-0">
<tr>
<th class="px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider">Domínio</th>
<th class="px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider">Ação Nesta
Ordem</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
<?php foreach ($items as $item): ?>
<tr class="hover:bg-gray-50">
<td class="px-6 py-3 text-sm font-mono text-gray-900"><?= htmlspecialchars($item['name']) ?>
</td>
<td class="px-6 py-3 text-sm">
<span
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full <?= $item['action'] == 'block' ? 'bg-red-100 text-red-800' : 'bg-green-100 text-green-800' ?>">
<?= $item['action'] == 'block' ? 'Bloquear' : 'Desbloquear' ?>
</span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>