DNSBlock
This commit is contained in:
74
resources/views/admin/clients/form.php
Normal file
74
resources/views/admin/clients/form.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<div class="max-w-2xl 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"><?= isset($client) ? 'Editar Cliente' : 'Novo Cliente' ?></h3>
|
||||
|
||||
<form action="<?= isset($client) ? '/admin/clients/update/' . $client['id'] : '/admin/clients/store' ?>"
|
||||
method="POST">
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Razão Social / Nome</label>
|
||||
<input type="text" name="name" value="<?= $client['name'] ?? '' ?>"
|
||||
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">ASN (ex: AS12345)</label>
|
||||
<input type="text" name="asn" value="<?= $client['asn'] ?? '' ?>"
|
||||
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"
|
||||
required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Telegram ID (Opcional)</label>
|
||||
<input type="text" name="telegram_id" value="<?= $client['telegram_id'] ?? '' ?>"
|
||||
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Email Principal (Login)</label>
|
||||
<input type="email" name="email" value="<?= $client['email'] ?? '' ?>"
|
||||
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"
|
||||
required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Email Financeiro</label>
|
||||
<input type="email" name="financial_email" value="<?= $client['financial_email'] ?? '' ?>"
|
||||
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Senha de Acesso
|
||||
<?= isset($client) ? '<span class="text-gray-400 font-normal">(Deixe em branco para manter)</span>' : '' ?></label>
|
||||
<input type="password" name="password"
|
||||
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"
|
||||
<?= isset($client) ? '' : 'required' ?>>
|
||||
</div>
|
||||
|
||||
<?php if (isset($client)): ?>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Status</label>
|
||||
<select name="status"
|
||||
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent">
|
||||
<option value="active" <?= $client['status'] == 'active' ? 'selected' : '' ?>>Ativo</option>
|
||||
<option value="inactive" <?= $client['status'] == 'inactive' ? 'selected' : '' ?>>Inativo</option>
|
||||
</select>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<input type="hidden" name="status" value="active">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-end space-x-3">
|
||||
<a href="/admin/clients"
|
||||
class="px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-lg transition-colors">Cancelar</a>
|
||||
<button type="submit"
|
||||
class="px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors">
|
||||
<?= isset($client) ? 'Salvar Alterações' : 'Criar Cliente' ?>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
57
resources/views/admin/clients/index.php
Normal file
57
resources/views/admin/clients/index.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<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">Clientes Cadastrados</h3>
|
||||
<a href="/admin/clients/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>
|
||||
Novo Cliente
|
||||
</a>
|
||||
</div>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-left border-collapse">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider bg-gray-50">Nome
|
||||
</th>
|
||||
<th class="px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider bg-gray-50">ASN</th>
|
||||
<th class="px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider bg-gray-50">Email
|
||||
</th>
|
||||
<th class="px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider bg-gray-50">Status
|
||||
</th>
|
||||
<th class="px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider bg-gray-50">Ações
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100">
|
||||
<?php if (!empty($clients)): ?>
|
||||
<?php foreach ($clients as $client): ?>
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-6 py-4 text-sm font-medium text-gray-900"><?= htmlspecialchars($client['name']) ?>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500"><?= htmlspecialchars($client['asn']) ?></td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500"><?= htmlspecialchars($client['email']) ?></td>
|
||||
<td class="px-6 py-4 text-sm">
|
||||
<span
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full <?= $client['status'] == 'active' ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800' ?>">
|
||||
<?= $client['status'] == 'active' ? 'Ativo' : 'Inativo' ?>
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm font-medium">
|
||||
<a href="/admin/clients/edit/<?= $client['id'] ?>"
|
||||
class="text-[#1e3a8a] hover:text-blue-900 mr-3">Editar</a>
|
||||
<a href="/admin/clients/delete/<?= $client['id'] ?>" onclick="return confirm('Tem certeza?')"
|
||||
class="text-red-600 hover:text-red-900">Excluir</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td colspan="5" class="px-6 py-4 text-center text-gray-500">Nenhum cliente encontrado.</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user