add all files

This commit is contained in:
Rucus
2026-02-17 09:29:34 -06:00
parent b8c8d67c67
commit 782d203799
21925 changed files with 2433086 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
<?php
// phpcs:ignoreFile
require_once __DIR__ . '/grower-session.php';
require_once __DIR__ . '/inc/dbconfig.php';
require_once __DIR__ . '/inc/opendb.php';
require_once __DIR__ . '/inc/auth.php';
require_once __DIR__ . '/inc/grower_helpers.php';
$username = isset($_SESSION['myusername']) ? $_SESSION['myusername'] : '';
$growerId = isset($_SESSION['growerid']) ? $_SESSION['growerid'] : '';
$member = $username !== '' ? auth_find_member($username) : null;
$memberData = grower_member_defaults($member);
$recentFiles = grower_recent_files($username, 6);
require_once __DIR__ . '/inc/closedb.php';
?>
<div class="grower-dashboard-intro">
<h2>Welcome back, <?php echo htmlspecialchars($username, ENT_QUOTES, 'UTF-8'); ?></h2>
<div class="grower-dashboard-actions">
<a class="dashboard-button" href="/grower-account.php">Manage Account</a>
<a class="dashboard-button" href="/growers/<?php echo rawurlencode($username); ?>/loads.php">Load Data</a>
<a class="dashboard-button" href="/grower-files.php">File Browser</a>
</div>
</div>
<div class="grower-dashboard-cards">
<div class="grower-card">
<h3>Your Details</h3>
<dl class="grower-summary-grid">
<dt>Grower ID</dt>
<dd><?php echo htmlspecialchars((string) $growerId, ENT_QUOTES, 'UTF-8'); ?></dd>
<dt>Last Login</dt>
<dd><?php echo htmlspecialchars(grower_format_datetime($memberData['last_login_at']), ENT_QUOTES, 'UTF-8'); ?></dd>
<dt>Password Changed</dt>
<dd><?php echo htmlspecialchars(grower_format_datetime($memberData['password_last_changed']), ENT_QUOTES, 'UTF-8'); ?></dd>
<dt>Contact Email</dt>
<dd><?php echo $memberData['email'] !== '' ? htmlspecialchars($memberData['email'], ENT_QUOTES, 'UTF-8') : 'Not on file'; ?></dd>
<dt>Phone</dt>
<dd><?php echo $memberData['phone'] !== '' ? htmlspecialchars($memberData['phone'], ENT_QUOTES, 'UTF-8') : 'Not on file'; ?></dd>
</dl>
<p style="margin-top: 12px;"><a href="/grower-account.php">Update contact details</a></p>
</div>
<div class="grower-card">
<h3>Recent Files</h3>
<?php if (!empty($recentFiles)): ?>
<ul class="recent-activity-list">
<?php foreach ($recentFiles as $file): ?>
<li>
<a href="<?php echo htmlspecialchars($file['path'], ENT_QUOTES, 'UTF-8'); ?>" target="_blank"><?php echo htmlspecialchars($file['name'], ENT_QUOTES, 'UTF-8'); ?></a>
<span class="activity-date"><?php echo htmlspecialchars(grower_format_datetime(date('Y-m-d H:i:s', $file['modified'])), ENT_QUOTES, 'UTF-8'); ?></span>
</li>
<?php endforeach; ?>
</ul>
<?php else: ?>
<p class="recent-activity-empty">We haven't spotted any files in your folder yet.</p>
<?php endif; ?>
<p style="margin-top: 12px;"><a href="/grower-files.php">Browse all files</a></p>
</div>
</div>