Versão inicial em produção
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
$titulo_pagina = 'Operações';
|
||||
$pagina_ativa = 'operacoes';
|
||||
require __DIR__ . '/includes/header.php';
|
||||
|
||||
$historico = [
|
||||
['data' => '20/08/2026', 'ativo' => 'PETR4', 'operacao' => 'Compra', 'qtd' => 100, 'preco' => 37.90],
|
||||
['data' => '18/08/2026', 'ativo' => 'PETR4C40', 'operacao' => 'Venda', 'qtd' => 500, 'preco' => 1.24],
|
||||
['data' => '12/08/2026', 'ativo' => 'VALE3', 'operacao' => 'Compra', 'qtd' => 150, 'preco' => 63.80],
|
||||
];
|
||||
?>
|
||||
|
||||
<h1 class="ao-page-title">Registrar operação</h1>
|
||||
|
||||
<div class="ao-card" style="max-width: 480px; margin-bottom: var(--ao-space-6);">
|
||||
<form method="post" action="#">
|
||||
<div class="ao-field" style="margin-bottom: var(--ao-space-4);">
|
||||
<label for="ativo">Código do ativo</label>
|
||||
<input type="text" id="ativo" name="ativo" placeholder="Ex: PETR4">
|
||||
</div>
|
||||
<div class="ao-row" style="gap: var(--ao-space-4); margin-bottom: var(--ao-space-4); align-items: flex-start;">
|
||||
<div class="ao-field" style="flex: 1;">
|
||||
<label for="quantidade">Quantidade</label>
|
||||
<input type="number" id="quantidade" name="quantidade" placeholder="100">
|
||||
</div>
|
||||
<div class="ao-field" style="flex: 1;">
|
||||
<label for="preco">Preço</label>
|
||||
<input type="text" id="preco" name="preco" placeholder="38,42">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ao-field" style="margin-bottom: var(--ao-space-5);">
|
||||
<label for="operacao">Operação</label>
|
||||
<select id="operacao" name="operacao">
|
||||
<option>Compra</option>
|
||||
<option>Venda</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="ao-btn ao-btn-primary">Registrar</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="ao-card">
|
||||
<div class="ao-card-header"><strong>Histórico recente</strong></div>
|
||||
<table class="ao-table">
|
||||
<thead>
|
||||
<tr><th>Data</th><th>Ativo</th><th>Operação</th><th>Qtd.</th><th>Preço</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($historico as $h): ?>
|
||||
<tr>
|
||||
<td class="ao-numeric"><?= htmlspecialchars($h['data']) ?></td>
|
||||
<td class="ao-numeric"><?= htmlspecialchars($h['ativo']) ?></td>
|
||||
<td><span class="ao-badge <?= $h['operacao'] === 'Compra' ? 'ao-badge-alta' : 'ao-badge-baixa' ?>"><?= htmlspecialchars($h['operacao']) ?></span></td>
|
||||
<td class="ao-numeric"><?= $h['qtd'] ?></td>
|
||||
<td class="ao-numeric">R$ <?= number_format($h['preco'], 2, ',', '.') ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php require __DIR__ . '/includes/footer.php'; ?>
|
||||
Reference in New Issue
Block a user