Deploy website via FTP / Deploy (push) Skipped
- Updated .gitignore to exclude new directories and files. - Enhanced config.php with detailed PHPDoc comments for better clarity. - Refactored functions.php to include PHPDoc comments and improve code readability. - Added custom exceptions in exceptions.php with detailed documentation. - Improved utilities.php with better documentation and error handling. - Updated index.php with structured comments and improved readability. - Refined style.css for better visual consistency. - Introduced phpcs.xml for coding style checks and standards enforcement.
104 lines
2.7 KiB
PHP
104 lines
2.7 KiB
PHP
<?php
|
|
/**
|
|
* Main entry point for the Torn Vault Tracker application.
|
|
*
|
|
* PHP version 8.1+
|
|
*
|
|
* @category Main
|
|
* @package TornVaultTracker
|
|
* @author Keith Solomon <ksolmon@gmail.com>
|
|
* @license Unlicense https://unlicense.org/
|
|
* @link https://github.com/ksolmon/torn-vault-tracker
|
|
*/
|
|
require_once __DIR__ . '/config.php';
|
|
require_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>
|
|
<link rel="icon" type="image/png" href="favicon.png">
|
|
|
|
<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">
|
|
</head>
|
|
|
|
<body>
|
|
<h1>Torn Vault Tracker</h1>
|
|
|
|
<div class="grid">
|
|
<div class="gridLeft">
|
|
<h1>Transactions</h1>
|
|
|
|
<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>
|
|
|
|
<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>
|
|
|
|
<div class="gridRight">
|
|
<h1>Balances</h1>
|
|
|
|
<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>
|