Enhance README and refactor code structure for improved functionality
🚀 Deploy website via FTP / 🎉 Deploy (push) Failing after 8s
🚀 Deploy website via FTP / 🎉 Deploy (push) Failing after 8s
- Updated README.md with detailed project description, features, and installation instructions. - Refactored functions.php to include configuration settings and improved database handling. - Modified index.php for better user experience and added pagination controls. - Introduced new utility functions for API handling and database interactions. - Added CSS styles for improved layout and visibility of elements. - Removed vault.csv as data is now managed through the database. - Implemented FTP deployment workflow for automated deployment. - Added exception handling classes for better error management. - Created JavaScript functions for pagination of transaction records.
This commit is contained in:
@@ -1,42 +1,92 @@
|
||||
<?php include('functions.php'); ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/config.php';
|
||||
include_once __DIR__ . '/functions.php';
|
||||
|
||||
if (dbNew()) {
|
||||
foreach (USER_KEYS as $key => $value) {
|
||||
firstRun($key);
|
||||
}
|
||||
header('Location: /');
|
||||
} else {
|
||||
foreach (USER_KEYS as $key => $value) {
|
||||
getLog($key);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Torn Vault Tracker</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Torn Vault Tracker</title>
|
||||
<link rel="icon" type="image/png" href="favicon.png">
|
||||
|
||||
<link rel="stylesheet" href="style.css?v=<?php echo filemtime('style.css'); ?>">
|
||||
<link rel="stylesheet" href="style.css?v=<?php echo filemtime('style.css'); ?>">
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital@0;1&display=swap" rel="stylesheet">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital@0;1&display=swap" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Torn Vault Tracker</h1>
|
||||
<h1>Torn Vault Tracker</h1>
|
||||
|
||||
<div class="grid">
|
||||
<div class="gridLeft">
|
||||
<h1>Transactions</h1>
|
||||
<div class="grid">
|
||||
<div class="gridLeft">
|
||||
<h1>Transactions</h1>
|
||||
|
||||
<?php vaultTxns($csv); ?>
|
||||
</div>
|
||||
<table id="data">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><h4>User</h4></th>
|
||||
<th><h4>Date / Time (TCT)</h4></th>
|
||||
<th><h4>Operation</h4></th>
|
||||
<th><h4>Amount</h4></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<div class="gridRght">
|
||||
<h1>Balances</h1>
|
||||
<tbody>
|
||||
<?php buildTable(); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="pagination-controls">
|
||||
<button onclick="changePage(-999)">«</button>
|
||||
<button onclick="changePage(-1)">‹</button>
|
||||
<div id="page-info">Page x of y</div>
|
||||
<button onclick="changePage(1)">›</button>
|
||||
<button onclick="changePage(999)">»</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php vaultBalance($csv); ?>
|
||||
<div class="gridRight">
|
||||
<h1>Balances</h1>
|
||||
|
||||
<div class="grid">
|
||||
<?php userBalances($csv); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<section class="vault">
|
||||
<h2>Vault Balance: $<?php echo generateBalance(); ?></h2>
|
||||
<h3>Space left: $<?php echo getSpace(); ?></h3>
|
||||
</section>
|
||||
|
||||
<h2>Shares</h2>
|
||||
<div class="grid">
|
||||
<?php foreach (USER_KEYS as $key => $value) { ?>
|
||||
<section class="user">
|
||||
<h3><?php echo ucfirst($key); ?> balance: $<?php echo generateBalance($key); ?></h3>
|
||||
<h4>Share left: $<?php echo getSpace($key); ?></h4>
|
||||
</section>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="script.js"></script>
|
||||
<script>
|
||||
let rowsPerPage = <?php echo ROWS_PER_PAGE; ?>; // Set in config.php
|
||||
|
||||
paginate();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user