Further improvements to deposit and registrar pages

This commit is contained in:
Pinga 2023-09-05 12:30:36 +03:00
parent c4b69480d9
commit 97f0c1db88
3 changed files with 85 additions and 105 deletions

View file

@ -25,6 +25,11 @@ class FinancialsController extends Controller
public function deposit(Request $request, Response $response)
{
return view($response,'admin/financials/deposit.twig');
$db = $this->container->get('db');
$registrars = $db->select("SELECT id, clid, name FROM registrar");
return view($response,'admin/financials/deposit.twig', [
'registrars' => $registrars
]);
}
}

View file

@ -1,6 +1,6 @@
{% extends "layouts/app.twig" %}
{% block title %}{{ __('Price Management') }}{% endblock %}
{% block title %}{{ __('Registrar Deposit') }}{% endblock %}
{% block content %}
<div class="page-wrapper">
@ -14,28 +14,9 @@
Overview
</div>
<h2 class="page-title">
{{ __('Price Management') }}
{{ __('Registrar Deposit') }}
</h2>
</div>
<!-- Page title actions -->
<div class="col-auto ms-auto d-print-none">
<div class="btn-list">
<span class="d-none d-sm-inline">
<a href="#" class="btn">
New view
</a>
</span>
<a href="#" class="btn btn-primary d-none d-sm-inline-block" data-bs-toggle="modal" data-bs-target="#modal-report">
<!-- Download SVG icon from http://tabler-icons.io/i/plus -->
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><line x1="12" y1="5" x2="12" y2="19" /><line x1="5" y1="12" x2="19" y2="12" /></svg>
Create new report
</a>
<a href="#" class="btn btn-primary d-sm-none btn-icon" data-bs-toggle="modal" data-bs-target="#modal-report" aria-label="Create new report">
<!-- Download SVG icon from http://tabler-icons.io/i/plus -->
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><line x1="12" y1="5" x2="12" y2="19" /><line x1="5" y1="12" x2="19" y2="12" /></svg>
</a>
</div>
</div>
</div>
</div>
</div>
@ -44,47 +25,41 @@
<div class="container-xl">
<div class="col-12">
<div class="card">
<div class="card-body border-bottom py-3">
<h2 class="text-center">Registrar Deposit</h2>
<div class="row mt-4">
<div class="col-md-8 offset-md-2">
<div class="card-body">
<form id="depositForm">
<!-- Registrar Dropdown -->
<div class="mb-3">
<label for="registrarSelect" class="form-label">Registrar</label>
<select class="form-select" id="registrarSelect" required>
<select class="form-select" id="registrarSelect" name="registrar" required>
<option selected disabled value="">Choose Registrar...</option>
<!-- Sample options. You'd dynamically populate this in a real scenario -->
<option value="1">Registrar A</option>
<option value="2">Registrar B</option>
{% for registrar in registrars %}
<option value="{{ registrar.id }}">{{ registrar.name }}</option>
{% endfor %}
</select>
</div>
<!-- Deposit Info -->
<div class="deposit-info">
<h5>Current Funds for <span id="registrarName"></span></h5>
<p class="fs-4">$<span id="currentFunds">0.00</span></p>
</div>
<!-- Amount Input -->
<div class="mb-3">
<label for="amount" class="form-label">Amount</label>
<input type="number" step="0.01" class="form-control" id="amount" placeholder="Enter deposit amount" required>
</div>
<!-- Description Input -->
<div class="mb-3">
<label for="description" class="form-label">Description</label>
<textarea class="form-control" id="description" rows="3" placeholder="Optional deposit description"></textarea>
</div>
<!-- Submit Button -->
<button type="submit" class="btn btn-primary">Submit Deposit</button>
</div>
<div class="card-footer">
<div class="row align-items-center">
<div class="col-auto">
<button type="submit" class="btn btn-primary">Add Deposit</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<script>
const registrarSelect = document.getElementById('registrarSelect');

View file

@ -28,7 +28,7 @@
<a href="#" class="btn btn-primary d-none d-sm-inline-block" data-bs-toggle="modal" data-bs-target="#modal-report">
<!-- Download SVG icon from http://tabler-icons.io/i/plus -->
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><line x1="12" y1="5" x2="12" y2="19" /><line x1="5" y1="12" x2="19" y2="12" /></svg>
Create new report
Create new registrar
</a>
<a href="#" class="btn btn-primary d-sm-none btn-icon" data-bs-toggle="modal" data-bs-target="#modal-report" aria-label="Create new report">
<!-- Download SVG icon from http://tabler-icons.io/i/plus -->
@ -59,14 +59,14 @@
</div>
</div>
</div>
</div>
<div class="table-responsive">
<div class="table-responsive mt-3">
<div id="registrarTable"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer footer-transparent d-print-none">
<div class="container-xl">
<div class="col-12 col-lg-auto mt-3 mt-lg-0">