-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98df66c
commit 8a063ec
Showing
11 changed files
with
447 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** footer is always at the bottom of the page */ | ||
body { | ||
/* Your CSS properties here */ | ||
overflow-y: scroll; | ||
display: flex; | ||
flex-direction: column; | ||
min-height: 100vh; | ||
} | ||
|
||
/** make the h1-h6 a little smaller than normal */ | ||
h1 { | ||
font-size:1.75em; | ||
} | ||
h2 { | ||
font-size: 1.5rem; | ||
} | ||
|
||
main { | ||
flex: 1; | ||
} | ||
|
||
footer { | ||
flex-shrink: 0; | ||
background-color: #f5f5f5; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,32 @@ | ||
<?php | ||
session_start(); | ||
require_once 'functions.php'; | ||
|
||
switch($_SERVER['REQUEST_URI']) { | ||
case '/': | ||
do_layout('pages/home'); | ||
break; | ||
case '/otherstuff': | ||
echo 'goodbye'; | ||
case '/profile': | ||
do_layout('pages/profile'); | ||
break; | ||
case '/post/login': | ||
do_login(); | ||
break; | ||
case '/logout': | ||
do_logout(); | ||
break; | ||
case '/post/register': | ||
do_register(); | ||
break; | ||
case '/login': | ||
do_layout('pages/login'); | ||
break; | ||
case '/register': | ||
do_layout('pages/register'); | ||
break; | ||
default: | ||
// set http response code to 404 | ||
http_response_code(404); | ||
echo '404'; | ||
break; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
|
||
</main> | ||
<footer> | ||
<p> © | ||
<?php echo date('Y'); ?> New England Crop Insurance | ||
<footer class="bg-dark text-light py-5"> | ||
<div class="container"> | ||
<p> © <?php echo date('Y'); ?> New England Crop Insurance </p> | ||
</div> | ||
</footer> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script> | ||
</body> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
<meta charset="UTF-8"> | ||
<title>New England Crop Insurance Stuff</title> | ||
|
||
|
||
|
||
<!-- bootstrap 5 CDN --> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> | ||
|
||
|
@@ -12,14 +14,54 @@ | |
|
||
<body> | ||
<header> | ||
<h1>New England Crop Insurance</h1> | ||
<nav> | ||
<ul> | ||
<li><a href="/">Management Dashboard</a></li> | ||
<li><a href="/about">My Profile</a></li> | ||
</ul> | ||
</nav> | ||
<nav class="navbar navbar-expand-lg navbar-light bg-light"> | ||
<div class="container-fluid"> | ||
<a class="navbar-brand" href="#">Crop Insurance Alerts</a> | ||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<div class="collapse navbar-collapse" id="navbarSupportedContent"> | ||
<ul class="navbar-nav me-auto mb-2 mb-lg-0"> | ||
<li class="nav-item"> | ||
<a class="nav-link active" aria-current="page" href="/">Management Dashboard</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="/profile">My Grower Profile</a> | ||
</li> | ||
</ul> | ||
</div> | ||
<!-- login/logout --> | ||
<div class="d-flex"> | ||
<?php if (isset($_SESSION['user_id'])) : ?> | ||
<span class="me-3">Welcome, <?php echo $_SESSION['firstname']; ?></span> | ||
<a href="/logout" class="btn btn-danger">Logout</a>= | ||
<?php else : ?> | ||
<a href="/login" class="btn btn-primary me-2">Login</a> | ||
<a href="/register" class="btn btn-secondary">Register</a> | ||
<?php endif; ?> | ||
</div> | ||
</div> | ||
</nav> | ||
</header> | ||
|
||
<main id="app"> | ||
<main id="app" class="mt-4 mb-4"> | ||
<?php if (isset($_SESSION['error'])) : ?> | ||
<div class="alert alert-danger" role="alert"> | ||
<?php | ||
echo $_SESSION['error']; | ||
unset($_SESSION['error']); | ||
?> | ||
|
||
</div> | ||
<?php endif; ?> | ||
|
||
<?php if (isset($_SESSION['success'])) : ?> | ||
<div class="alert alert-success" role="alert"> | ||
<?php | ||
echo $_SESSION['success']; | ||
unset($_SESSION['success']); | ||
?> | ||
|
||
</div> | ||
<?php endif; ?> | ||
|
Oops, something went wrong.