132 lines
5.3 KiB
PHP
132 lines
5.3 KiB
PHP
<?php
|
||
// phpcs:ignoreFile
|
||
|
||
session_start();
|
||
error_reporting(E_ERROR);
|
||
|
||
require_once __DIR__ . '/inc/dbconfig.php';
|
||
require_once __DIR__ . '/inc/opendb.php';
|
||
require_once __DIR__ . '/inc/auth.php';
|
||
|
||
$myusername = isset($_POST['myusername']) ? trim($_POST['myusername']) : '';
|
||
$mypassword = isset($_POST['mypassword']) ? trim($_POST['mypassword']) : '';
|
||
$loginError = '';
|
||
|
||
if (
|
||
$_SERVER['REQUEST_METHOD'] === 'POST'
|
||
&& $myusername !== ''
|
||
&& $mypassword !== ''
|
||
) {
|
||
$member = auth_attempt_login($myusername, $mypassword);
|
||
|
||
if ($member !== null) {
|
||
$_SESSION['myusername'] = $member['username'];
|
||
$_SESSION['mypassword'] = $member['password'];
|
||
$_SESSION['growerid'] = $member['growerid'];
|
||
|
||
header('Location: growers/' . rawurlencode($myusername) . '/index.php');
|
||
exit();
|
||
}
|
||
|
||
$loginError = 'Invalid username or password.';
|
||
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||
$loginError = 'Please enter both your username and password.';
|
||
}
|
||
|
||
require_once __DIR__ . '/inc/closedb.php';
|
||
|
||
$pageTitle = 'Grower Login';
|
||
$metaDescription = 'Log in to the LASUCA grower portal to review load data, tickets, and alerts.';
|
||
$activeNav = 'login';
|
||
$extraStyles = array('/new/css/grower-auth.css');
|
||
$bodyClass = 'auth-page';
|
||
require __DIR__ . '/inc/theme-header.php';
|
||
?>
|
||
|
||
<main>
|
||
<header class="hero hero-auth">
|
||
<div class="container">
|
||
<div class="hero-content">
|
||
<span class="badge">Grower access</span>
|
||
<h1>Log in to manage loads, reports, and alerts.</h1>
|
||
<p>
|
||
The LASUCA grower portal keeps your harvest data, scale tickets, and mill status in one place. Sign in to stay in sync with the factory team and keep your records current.
|
||
</p>
|
||
<p class="mt-3 mb-0 text-white-50 small">Need an account? Call the LASUCA main office at <strong>(337) 394-3785</strong> and ask for Grower Relations.</p>
|
||
</div>
|
||
</div>
|
||
</header>
|
||
|
||
<section class="auth-section py-5">
|
||
<div class="container">
|
||
<div class="row g-4 justify-content-center">
|
||
<div class="col-lg-5">
|
||
<div class="auth-card">
|
||
<h2 class="auth-title">Member login</h2>
|
||
<p class="auth-subtitle">Enter the grower ID and password provided by the cooperative.</p>
|
||
<?php if ($loginError !== ''): ?>
|
||
<div class="alert alert-warning" role="alert">
|
||
<?php echo htmlspecialchars($loginError, ENT_QUOTES, 'UTF-8'); ?>
|
||
</div>
|
||
<?php endif; ?>
|
||
<form method="post" action="" class="auth-form" novalidate>
|
||
<div class="mb-3">
|
||
<label for="myusername" class="form-label">Grower ID</label>
|
||
<input
|
||
type="text"
|
||
class="form-control form-control-lg"
|
||
id="myusername"
|
||
name="myusername"
|
||
value="<?php echo htmlspecialchars($myusername, ENT_QUOTES, 'UTF-8'); ?>"
|
||
placeholder="Enter your grower ID"
|
||
autocomplete="username"
|
||
required
|
||
/>
|
||
</div>
|
||
<div class="mb-4">
|
||
<label for="mypassword" class="form-label">Password</label>
|
||
<input
|
||
type="password"
|
||
class="form-control form-control-lg"
|
||
id="mypassword"
|
||
name="mypassword"
|
||
placeholder="Enter your password"
|
||
autocomplete="current-password"
|
||
required
|
||
/>
|
||
</div>
|
||
<div class="d-grid">
|
||
<button type="submit" name="Submit" class="btn btn-primary btn-lg">Sign in</button>
|
||
</div>
|
||
</form>
|
||
<div class="auth-footnote">
|
||
<p class="mb-1">Forgot your password? Call us and we will reset it for you immediately.</p>
|
||
<p class="mb-0">Support available daily from 5:00 a.m. – 9:00 p.m. during harvest.</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="col-lg-5">
|
||
<div class="info-card h-100">
|
||
<h3>What you’ll find inside</h3>
|
||
<ul class="list-unstyled text-white-50 mb-4">
|
||
<li class="mb-2">• Live scale ticket feed with tonnage, net, and timestamp.</li>
|
||
<li class="mb-2">• Organized PDF archives for daily load reports.</li>
|
||
<li class="mb-2">• Mill performance snapshots and downtime alerts.</li>
|
||
<li class="mb-0">• Account tools to update contact information and passwords.</li>
|
||
</ul>
|
||
<div class="support-callout">
|
||
<h4>Need help?</h4>
|
||
<p class="mb-1">Call <strong>(337) 394-3785 ext. 244</strong> or email <a href="mailto:support@lasuca.com" class="text-decoration-none">support@lasuca.com</a>.</p>
|
||
<p class="mb-0">We’re ready to assist with account setup and troubleshooting.</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</main>
|
||
|
||
<?php
|
||
require __DIR__ . '/inc/theme-footer.php';
|
||
?>
|