-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcal.php
More file actions
179 lines (163 loc) · 7.16 KB
/
cal.php
File metadata and controls
179 lines (163 loc) · 7.16 KB
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
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php session_start(); ?>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../bootstrap-3.3.7-dist/css/bootstrap.min.css" >
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="../bootstrap-3.3.7-dist/js/bootstrap.min.js" ></script>
<link rel="stylesheet" href="form-elements.css" type="text/css">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Logo</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><img src="icons/user-512.png" width="20px" height="20px" alt="user"> <?php echo $_SESSION["Username"] ?></span></a></li>
</ul>
</div>
</div>
</nav>
</body>
<?php
$number = $_POST["num_people"];
$home = $_POST["home"];
$food_choice = $_POST["food_choice"];
$water = $_POST["water"];
$household = $_POST["household"];
$garbage = $_POST["garbage"];
$recycle = $_POST["recycle"];
$personal_travel = $_POST["personal_travel"];
$public_travel = $_POST["public_travel"];
/*For number of people sharing the house*/
if($number==1)
$emission_numPeople = 14;
else if($number==2)
$emission_numPeople = 12;
else if($number==3)
$emission_numPeople = 10;
else if($number==4)
$emission_numPeople = 8;
else if($number==5)
$emission_numPeople = 6;
else if($number==6)
$emission_numPeople = 4;
else $emission_numPeople = 2;
//For the size of home
if($home=="SmallHouse")
$emission_home = 4;
else if($home=="Medium")
$emission_home = 7;
else if($home=="LargeHouse")
$emission_home = 10;
else if($home=="Apartment")
$emission_home = 2;
//For the choice of food
if($food_choice=="prepackaged")
$emission_food = 12;
else if($food_choice=="meatDaily")
$emission_food = 10;
else if($food_choice=="meatFew")
$emission_food = 8;
else if($food_choice=="vegetarian")
$emission_food = 4;
else if($food_choice=="vegan")
$emission_food = 2;
if($water=="9")
$emission_water = 3;
else if($water=="4to9")
$emission_water = 2;
else if($water=="1to3")
$emission_water = 1;
else if($water=="none")
$emission_water = 0;
if($household=="7")
$emission_household = 10;
else if($household=="5to7")
$emission_household = 8;
else if($household=="3to5")
$emission_household = 6;
else if($household=="less3")
$emission_household = 4;
else if($household=="none")
$emission_household = 2;
$emission_recycle =24;
if($recycle=="glass")
$emission_recycle -= 4;
if($garbage=="plastic")
$emission_recycle -= 4;
if($garbage=="paper")
$emission_recycle -= 4;
if($garbage=="aluminium")
$emission_recycle -= 4;
if($garbage=="steel")
$emission_recycle -= 4;
if($garbage=="food")
$emission_recycle -= 4;
if($personal_travel=="15k")
$emission_personal_travel = 12;
else if($personal_travel=="10k")
$emission_personal_travel = 10;
else if($personal_travel=="1k")
$emission_personal_travel = 6;
else if($personal_travel=="less1k")
$emission_personal_travel = 4;
else if($personal_travel=="none")
$emission_personal_travel = 0;
if($public_travel=="20k")
$emission_public_travel = 12;
else if($personal_travel=="15k")
$emission_public_travel = 10;
else if($public_travel=="10k")
$emission_public_travel = 6;
else if($public_travel=="1k")
$emission_public_travel = 4;
else if($public_travel=="less1k")
$emission_public_travel = 2;
else if($public_travel=="none")
$emission_public_travel = 0;
$total = $emission_numPeople + $emission_home + $emission_food + $emission_water + $emission_household + $emission_recycle + $emission_personal_travel + $emission_public_travel;
if($total<60)
echo "Small Impact<br>";
else
echo "Large Impact<br>";
if($personal_travel>=6):
?>
<h4>Reduce Your Carbon Footprint From Driving</h4>
<ul>
<li>Alternatives to driving.When possible, walk or ride your bike in order to avoid carbon emissions completely. Carpooling and public transportation drastically reduce CO2 emissions by spreading them out over many riders.</li>
<li>Drive a low carbon vehicle. High mileage doesn’t always mean low CO2 emissions. All vehicles have an estimated miles-per-gallon rating. Electric cars emit no CO2 if they’re charged with clean electricity. If you don’t charge it with your home’s solar panels AND live somewhere like WY, MO, MO, WV, or KY you’re BETTER OFF with a hybrid or high-mileage gas/diesel car. Here’s why. After incentives and gas savings, it essentially costs nothing to switch to an electric car like the the Nissan Leaf.</li>
</ul>
<?php
endif;
if($home=="LargeHouse" && $emission_household>=6):
?>
<h4>Reduce Your Home Energy Carbon Footprint</h4>
<ul>
<li>Appliances. Make energy efficiency a primary consideration when choosing a new furnace, air conditioning unit, dishwasher, or refrigerator. Products bearing the ENERGY STAR label are recognized for having superior efficiency.</li>
<li>Lighting. Turn off lights you’re not using and when you leave the room. Replace incandescent light bulbs with compact flourescent or LED ones.</li>
</ul>
<?php
endif;?>
<h4>Other Ways to Reduce Your Carbon Footprint</h4>
<ul>
<li>Water usage. Lower the amount of energy used to pump, treat, and heat water by washing your car less often, using climate-appropriate plants in your garden, installing drip irrigation so that plants receive only what they need, and making water-efficient choices when purchasing shower heads, faucet heads, toilets, dishwashers and washing machines.</li>
<li>Support clean energy sources. Whenever you can, advocate for clean alternatives to fossil fuels, such as wind, solar, geothermal, and appropriately designed hydroelectric and biomass energy projects.</li>
<li>Reuse and recycle. It has been estimated that 29% of U.S. greenhouse gas emissions result from the “provision of goods,” which means the extraction of resources, manufacturing, transport, and final disposal of “goods” which include consumer products and packaging, building components, and passenger vehicles, but excluding food. By buying used products and reselling or recyling items you no longer use, you dramatically reduce your carbon footprint from the “provision of goods.”</li>
</ul>