-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
166 lines (147 loc) · 7.99 KB
/
home.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?php
/** DATABASE SETUP **/
include('database_variables.php');
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); // Extra Error Printing
$mysqli = new mysqli($SERVER, $USERNAME, $PASSWORD, $DATABASE);
$user = null;
session_start();
// If the user's username is not set in the session, then it's not
// a valid session (they didn't get here from the login page),
// so we should send them over to log in first before doing
// anything else!
if ($_SESSION["username"] == "") {
header("Location: index.php");
exit();
}
//join or start cookie
//setcookie("username", "", time()+3600); //what should be put as these key value pairs be?? COME BACK TO!
//initially set cookie when set website b
?><!-- Rena Wolinsky rjw3kk and Colin Buyck cjb2utf
URL to project on CS4640 server
cs4640.cs.virginia.edu/rjw3kk/sprint4/
cs4640.cs.virginia.edu/cjb2utf/sprint4/
-->
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="styles.css">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Rena Wolinsky and Colin Buyck">
<meta name="description" content="Home page for website where users can search for climate footprints of companies to educate and empower consumers">
<meta name="keywords" content="Climate, CO2, Footprint, green washing, companies, sustainability, consumerism ">
<title>CEV</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<script
src="https://code.jquery.com/jquery-3.6.0.js"
integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk="
crossorigin="anonymous"></script>
<script> //jquery script to get mcdonalds sustainabiity info onto card after button click
$(document).ready(function(){
// console.log("inside j query");
$("#mcdonaldsCard").click(function(){
$("#mcdonaldsText").append("<b>Today, McDonalds is approximately 78% of the way toward our ambition to source all packaging from renewable, recycled and certified sources.</b>");
//console.log("appended");
});
});
</script>
</head>
<body>
<!-- Navigation bar code -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" aria-label="Main Navigation Bar">
<div class="container-xl">
<a class="navbar-brand" href="home.php"><img src="cevLogo.png" width="30" height="30" class="d-inline-block align-top" alt="cev Logo"> Corporate Emissions Viewer</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsTop" aria-controls="navbarsTop" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarsTop">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link href="home.php">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="industries.php">Explore Corporations</a>
</li>
<li class="nav-item">
<a class="nav-link" href="climate-itionSearch.php">Climate-ition</a>
</li>
<li class="nav-item">
<a class="nav-link" href="searchOneCompany.php">Search One Company</a>
</li>
<li class="nav-item">
<a class="nav-link" href="my_list.php">My List</a>
</li>
</ul>
<span class="navbar-text">
Hello, <?= $_SESSION["username"]?>!
</span>
<a style="margin-left: 15px" class="btn btn-danger" href="logout.php">Log out</a>
</div>
</div>
</nav>
<!-- div class for CEV (dark green part) that explains website's purpose and leads to actionable buttons for climate-ition and search one company-->
<div class="p-5 mb-4 text-white bg-darkGreen sbg-gradient">
<div class="container py-5">
<h1 class="display-5 fw-bold">Corporate Emissions Viewer</h1>
<h5 class="col-md-8 fs-4">Curious about whether your favorite companies have sustainable practices or are just green washing? Look no further...</h5>
<p> Click "Climate-ition" below to compare two companies' sustainability efforts side by side, or click "Search One Company" to see the sustainability efforts of one company. </p>
<a class="btn btn-danger btn-lg climate-itionButton" href="climate-itionSearch.php">Climate-ition</a>
<a class="btn btn-danger btn-lg oneCompanyButton" href="searchOneCompany.php">Search One Company</a>
</div>
</div>
<!-- Section where various popular companies will be listed along with links to pages with their sustainability info-->
<h2 style="margin-left: 50px; ">Explore Popular Companies </h2>
<div class="bg-darkBlue mx-auto">
<div class="container">
<div class="row" style="padding-top:50px;">
<!-- Columns start at 50% wide on mobile and bump up to 33.3% wide on desktop -->
<!-- 3 cards for 3 separate companies (all fast food in the example) -->
<div class="card mx-auto mcdonaldsIndexCard bg-darkBlue" id="mcdonaldsCard" style="width: 18rem;">
<img class="card-img-top mcdonaldsLogo" src="mcdonaldsLogo.png" alt="McDonald's Logo">
<div class="card-body">
<h5 class="card-title">McDonalds</h5>
<p class="card-text" id="mcdonaldsText"></p>
<button id="McD" class="btn btn-info">Sustainability Info</button>
</div>
</div>
<div class="card mx-auto chipotleIndexCard" style="width: 18rem;">
<img class="card-img-top chipotleLogo" src="chipotleLogo.png" alt="Chipotle Logo">
<div class="card-body">
<h5 class="card-title">Chipotle</h5>
<p class="card-text"></p>
<button onclick="unavailable('Chip');" id="Chip" class="btn btn-info">Sustainability Info</button>
</div>
</div>
<div class="card mx-auto cookoutIndexCard" style="width: 18rem;">
<img class="card-img-top" src="cookoutLogo.png" alt="CookOut Logo">
<div class="card-body">
<h5 class="card-title">CookOut</h5>
<p class="card-text"></p>
<button onclick="unavailable('Cook');" id="Cook" class="btn btn-info">Sustainability Info</button>
</div>
</div>
</div>
</div>
</div>
<!-- Copyright and footer code below-->
<div class="container">
<footer class="d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top">
<p class="col-md-4 mb-0 text-muted">© 2021 Rena Wolinsky and Colin Buyck</p>
<ul class="nav col-md-4 justify-content-end">
<li class="nav-item"><a href="home.php" class="nav-link px-2 text-muted">Home</a></li>
<li class="nav-item"><a href="climate-itionSearch.php" class="nav-link px-2 text-muted">Climate-ition</a></li>
<li class="nav-item"><a href="searchOneCompany.php" class="nav-link px-2 text-muted">Search One Company</a></li>
</ul>
</footer>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-/bQdsTh/da6pkI1MST/rWKFNjaCP5gBSY4sEBT38Q/9RBh9AH40zEOg7Hlq2THRZ" crossorigin="anonymous"></script>
<script> //function for cards where sustainability info is unavailable
unavailable = (id) => {
var elem = document.getElementById(id);
elem.disabled = true;
alert("This information is not yet available.");
}
</script>
</body>
</html>