
All checks were successful
Build / Build (push) Successful in 28s
This commit introduces the timesheet submission feature and displays pending payments in the bank UI. The following changes were made: - Added a "Submit Timesheet" action tile to the bank UI. - Implemented the `handleTimesheet` function in `script.js` to handle timesheet submissions. - Updated the UI to display pending payments based on player rating and a server-side multiplier. - Modified server-side event handling to process timesheet submissions and calculate payments. - Added a refresh timer to update player data every 30 seconds. - Updated the player load event to include the player's rating.
111 lines
4.3 KiB
HTML
111 lines
4.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<!--
|
|
Dynamic Resource Loading
|
|
The following script loads CSS and JavaScript files dynamically using the A3API
|
|
This approach is used instead of static HTML imports to work with Arma 3's file system
|
|
-->
|
|
<script>
|
|
Promise.all([
|
|
// Load CSS file
|
|
A3API.RequestFile("z\\forge_client\\addons\\bank\\ui\\_site\\styles.css"),
|
|
// Load JavaScript file
|
|
A3API.RequestFile("z\\forge_client\\addons\\bank\\ui\\_site\\script.js")
|
|
]).then(([css, js]) => {
|
|
// Apply CSS
|
|
const style = document.createElement('style');
|
|
style.textContent = css;
|
|
document.head.appendChild(style);
|
|
|
|
// Load and execute JavaScript
|
|
const script = document.createElement('script');
|
|
script.text = js;
|
|
document.head.appendChild(script);
|
|
|
|
// Initialize the bank interface
|
|
initializeBank();
|
|
});
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<header>
|
|
<div class="header-content">
|
|
<h1>Federal Deposit Insurance Corporation</h1>
|
|
<div class="balance-display">
|
|
<div class="balance-item">
|
|
<div class="balance-info">
|
|
<span class="balance-label">Wallet Balance</span>
|
|
<span class="balance-amount" id="walletBalance">$0</span>
|
|
</div>
|
|
</div>
|
|
<div class="balance-divider"></div>
|
|
<div class="balance-item">
|
|
<div class="balance-info">
|
|
<span class="balance-label">Account Balance</span>
|
|
<span class="balance-amount" id="accountBalance">$0</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<main class="container">
|
|
<div class="actions-grid">
|
|
<!-- Transfer Between Accounts -->
|
|
<div class="action-tile">
|
|
<h2>Transfer Money</h2>
|
|
<div class="form-group">
|
|
<label for="transferType">Transfer From</label>
|
|
<select id="transferType" required>
|
|
<option value="to_wallet">Account to Wallet</option>
|
|
<option value="to_account">Wallet to Account</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="transferAmount">Amount</label>
|
|
<input type="number" id="transferAmount" min="1" step="1" required>
|
|
</div>
|
|
<button type="button" class="submit-btn" onclick="handleTransfer()">Transfer</button>
|
|
</div>
|
|
|
|
<!-- Transfer to Player -->
|
|
<div class="action-tile">
|
|
<h2>Transfer to Player</h2>
|
|
<div class="form-group">
|
|
<label for="playerSelect">Player</label>
|
|
<select id="playerSelect" required>
|
|
<option value="" disabled selected>Select Player</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="playerTransferAmount">Amount</label>
|
|
<input type="number" id="playerTransferAmount" min="1" step="1" required>
|
|
</div>
|
|
<button type="button" class="submit-btn" onclick="handlePlayerTransfer()">Send Money</button>
|
|
</div>
|
|
|
|
<!-- Submit Timesheet -->
|
|
<div class="action-tile">
|
|
<h2>Submit Timesheet</h2>
|
|
<div class="pending-amount">
|
|
<div class="amount-label">Pending Payment</div>
|
|
<div class="amount-value" id="pending">$0</div>
|
|
</div>
|
|
<button type="button" class="submit-btn" onclick="handleTimesheet()">Submit Timesheet</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Transaction History -->
|
|
<section class="history-section">
|
|
<h2>Transaction History</h2>
|
|
<ul class="history-list" id="transactionHistory">
|
|
<!-- Transactions will be added here dynamically -->
|
|
</ul>
|
|
</section>
|
|
</main>
|
|
</body>
|
|
|
|
</html> |