Commit 5342bbfe by tdgiang

Add account nav, creator column, and staff filter to admin transaction views

Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
parent c2f08789
...@@ -16,13 +16,36 @@ ...@@ -16,13 +16,36 @@
</style> </style>
</head> </head>
<body> <body>
<h2>Lịch sử giao dịch</h2> <div class="nav" style="display:flex;gap:16px;font-size:13px;color:var(--color-text-muted);margin-bottom:16px;">
<p><a href="/admin/transactions/new">+ Thêm mới giao dịch</a></p> <span>Xin chào, <strong>{{username}}</strong></span>
{% if isAdmin %}<a href="/admin/accounts" style="color:inherit;text-decoration:none;font-weight:500;">Quản lý tài khoản</a>{% endif %}
<a href="/admin/account/password" style="color:inherit;text-decoration:none;font-weight:500;">Đổi mật khẩu</a>
<form method="POST" action="/admin/logout" style="display:inline;">
<button type="submit" style="all:unset;cursor:pointer;color:inherit;font:inherit;">Đăng xuất</button>
</form>
</div>
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;">
<div>
<h2>Lịch sử giao dịch</h2>
<p><a href="/admin/transactions/new">+ Thêm mới giao dịch</a></p>
</div>
{% if isAdmin %}
<form method="GET" action="/admin/transactions" style="display:flex;gap:8px;align-items:center;">
<select name="staff" onchange="this.form.submit()" style="height:40px;padding:0 10px;border:1px solid var(--color-border);border-radius:8px;font-family:inherit;font-size:13px;">
<option value="">Tất cả nhân viên</option>
{% for s in staffOptions %}
<option value="{{s}}" {% if s == selectedStaff %}selected{% endif %}>{{s}}</option>
{% endfor %}
</select>
</form>
{% endif %}
</div>
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Thời gian</th> <th>Thời gian</th>
<th>Mã giao dịch</th> <th>Mã giao dịch</th>
<th>Người tạo</th>
<th>Khách hàng</th> <th>Khách hàng</th>
<th>SĐT</th> <th>SĐT</th>
<th>Số tiền</th> <th>Số tiền</th>
...@@ -36,6 +59,7 @@ ...@@ -36,6 +59,7 @@
<tr> <tr>
<td>{{tx.createdAt}}</td> <td>{{tx.createdAt}}</td>
<td>{{tx.merTrxId}}</td> <td>{{tx.merTrxId}}</td>
<td class="cell-muted">{{tx.createdByUsername}}</td>
<td>{{tx.customerName}}</td> <td>{{tx.customerName}}</td>
<td>{{tx.customerPhone}}</td> <td>{{tx.customerPhone}}</td>
<td>{{tx.amount}}</td> <td>{{tx.amount}}</td>
......
...@@ -12,6 +12,14 @@ ...@@ -12,6 +12,14 @@
</style> </style>
</head> </head>
<body> <body>
<div class="nav" style="display:flex;gap:16px;font-size:13px;color:var(--color-text-muted);margin-bottom:12px;">
<span>Xin chào, <strong>{{username}}</strong></span>
{% if isAdmin %}<a href="/admin/accounts" style="color:inherit;text-decoration:none;font-weight:500;">Quản lý tài khoản</a>{% endif %}
<a href="/admin/account/password" style="color:inherit;text-decoration:none;font-weight:500;">Đổi mật khẩu</a>
<form method="POST" action="/admin/logout" style="display:inline;">
<button type="submit" style="all:unset;cursor:pointer;color:inherit;font:inherit;">Đăng xuất</button>
</form>
</div>
<h2>Thêm mới giao dịch</h2> <h2>Thêm mới giao dịch</h2>
<p><a href="/admin/transactions">Xem lịch sử giao dịch</a></p> <p><a href="/admin/transactions">Xem lịch sử giao dịch</a></p>
<form id="txForm"> <form id="txForm">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment