-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtracking-sheet.php
More file actions
679 lines (585 loc) · 32.2 KB
/
tracking-sheet.php
File metadata and controls
679 lines (585 loc) · 32.2 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
<?php
session_start();
// initialize the game variables
if($_SESSION['current_yr'] == '') {
$_SESSION['current_yr'] = 0;
$_SESSION['installationCost'][0] = 0;
$_SESSION['newCost'][0] = 0;
$_SESSION['availableCap'][0] = 0;
$_SESSION['availableCap'][1] = 50000;
$_SESSION['availableCap2'][1] = 50000;
$_SESSION['remainingCap'][0] = 0;
$_SESSION['cumulatedSaving'][0] = 0;
$_SESSION['3PercentInterestRate'][0] = 0;
$_SESSION['remainingCapPlusCumulatedSaving'][0] = 0;
$_SESSION['percentageSaving'][0]=0;
}
// create a user folder that is based on the client ip address and the timestamp
if($_SESSION['user_dir'] == '') {
// the name of the user dir
$user_dir = $_SESSION['user_dir'] = md5($_SERVER['REMOTE_ADDR'].time());
mkdir("EEMs/$user_dir", 0775);
}
$current_yr = &$_SESSION['current_yr'];
$eem_version = &$_SESSION['eem_cnt'];
/*
* the function resets the finishedMeasures from the current year to the restarted year
* the function has side effect to the sessions variable such that
* current_yr is set to restart_yr, both yrs are greater than 0
* im is the installedMeasures list that will be reset
* fm is the finishedMeasures list that will be reset
* eem_cnt is the counter for the file of eem version, will be set to current_yr
*/
function resetMeasureYear($restart_yr, &$current_yr, &$im, &$fm) {
$im = &$_SESSION['installed_measures']; // installed measures list in each year (the index is int)
$fm = &$_SESSION['measureFinished']; // finished measures list shows the available of measures
if($restart_yr < 0 || $current_yr < 0) {
echo "cant reset the year < 0";
return 1;
} else {
// undo finishedMeasures from the fm list, so user can re-select the finishedMeasures
for($y = $current_yr-1; $y > $restart_yr-1; $y--) {
foreach($im[$y] as &$m) {
$fm[$m] ='';
}
// remove eem model from the session model
unset($_SESSION['Model'][$y+1]);
// delete eem_#.idf file-dir
removeEEM($y+1);
$yy = $y+1;
`rm EEMs/{$_SESSION['user_dir']}/eem_{$yy}.idf`;
}
// reset the current year to restart_yr
$current_yr = $restart_yr;
$_SESSION['eem_cnt'] = $current_yr;
$_SESSION['cur_model'] = $_SESSION['Model'][$current_yr];
}
}
function removeEEM($eem_version) {
$dir = "./ENERGYPLUS/EEMs/{$_SESSION['user_dir']}/eem_{$eem_version}.idf";
echo `rm -r $dir`;
}
// Do resetMeasureYear
if(isset($_POST['reset'])) resetMeasureYear($_POST['reset'], $current_yr, $_SESSION['installed_measures'], $_SESSION['measureFinished']);
function selectedList($current_yr, $year, $finieshedMeasure, $measures, $measure_i) {
$MeasureIndex =array("none"=>"none","bmsSBChecked"=>"Building Management System","energyStarEquipmentChecked"=>"EnergyStar Equipment","plugLoadChecked"=>"Plug Load Control", "oblsChecked"=>"Occupancy-Based Lighting Sensors","daylightDimmingChecked"=>"Daylight-Based Dimming","OfficefixturedChecked"=> "Office Lighting Fixture Upgrade", "bathroomFixturedChecked"=>"Bathroom Lighting Fixture Upgrade","emergencyLightingChecked"=>"Emergency Lighting Upgrade", "roofInsulationChecked" => "Increase Roof Insulation by R-10", "wallInsulation1Checked" => "Increase Wall Insulation by R-10", "wallInsulation2Checked" => "Increase Wall Insulation by R-20", "windowsUpgradelChecked" => "Window Upgrade", "windowsFilmChecked" => "Window Film", "doorWeatherizationChecked" => "Door Weatherization", "enclosureRecommisChecked" => "Exterior Wall Weatherization*", "airEconChecked" => "Outdoor Air Economizer", "condensingBoilerChecked" => "Condensing Boiler", "sysEffChecked" => "Condensing Unit Replacement");
if($current_yr > $year) {
echo "<b>".$MeasureIndex[$finieshedMeasure]."</b>";
}
else if($current_yr == $year) {
echo "<select name='selected[]' id='install_".$current_yr."_".$measure_i."' onchange='installCostValidate(this, ".$current_yr.");'>
<option value='none'>-none-</option>";
if($measures['bmsSBChecked'] != 'finished') echo "<option value='bmsSBChecked'>Building Management System ($50,000)</option>";
if($measures['energyStarEquipmentChecked'] != 'finished') echo "<option value='energyStarEquipmentChecked'>EnergyStar Equipment ($15,000)</option>";
if($measures['plugLoadChecked'] != 'finished') echo "<option value='plugLoadChecked'>Plug Load Control ($60,000)</option>";
if($measures['oblsChecked'] != 'finished') echo "<option value='oblsChecked'>Occupancy-Based Lighting Sensors ($50,000)</option>";
//if($measures['daylightDimmingChecked'] != 'finished') echo "<option value='daylightDimmingChecked' disabled>Daylight-Based Dimming ($75,000)</option>";
if($measures['OfficefixturedChecked'] != 'finished') echo "<option value='OfficefixturedChecked'>Office Lighting Fixture Upgrade ($200,000)</option>";
if($measures['bathroomFixturedChecked'] != 'finished') echo "<option value='bathroomFixturedChecked'>Bathroom Lighting Fixture Upgrade ($8,000)</option>";
if($measures['emergencyLightingChecked'] != 'finished') echo "<option value='emergencyLightingChecked'>Emergency Lighting Upgrade ($40,000)</option>";
if($measures['roofInsulationChecked'] != 'finished') echo "<option value='roofInsulationChecked'>Increase Roof Insulation by R-10 ($50,000)</option>";
if($measures['wallInsulation1Checked'] != 'finished') echo "<option value='wallInsulation1Checked'>Increase Wall Insulation by R-10 ($100,000)</option>";
if($measures['wallInsulation2Checked'] != 'finished') echo "<option value='wallInsulation2Checked'>Increase Wall Insulation by R-20 ($130,000)</option>";
if($measures['windowsUpgradelChecked'] != 'finished') echo "<option value='windowsUpgradelChecked'>Window Upgrade ($100,000)</option>";
if($measures['windowsFilmChecked'] != 'finished') echo "<option value='windowsFilmChecked'>Window Film ($25,000)</option>";
if($measures['doorWeatherizationChecked'] != 'finished') echo "<option value='doorWeatherizationChecked'>Door Weatherization ($5,000)</option>";
if($measures['enclosureRecommisChecked'] != 'finished') echo "<option value='enclosureRecommisChecked'>Exterior Wall Weatherization* ($25,000)</option>";
//if($measures['airEconChecked'] != 'finished') echo "<option value='airEconChecked' disabled>Outdoor Air Economizer ($26,620 at most)</option>";
if($measures['condensingBoilerChecked'] != 'finished') echo "<option value='condensingBoilerChecked'>Condensing Boiler ($51,225 at most)</option>";
if($measures['sysEffChecked'] != 'finished') echo "<option value='sysEffChecked'>Condensing Unit Replacement ($210,000 at most)</option>";
echo "</select>";
} else {
echo "";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>EEB Hub Energy Retrofit Game</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="eebhub">
<!-- Le styles -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/docs.css" rel="stylesheet">
<style>
body {
width: 2300px;
background: linear-gradient(to bottom, #eee, #ddd, #fff);
}
.container{
width: 2200px;
}
.table-striped{
background: #eee;
}
.table{
text-align: center;
box-shadow: 0px 3px 5px #999;
}
.table-striped th {
color: #333;
font-size: 16px;
text-align: center;
}
.table-striped td {
text-align: center;
font-size: 14px;
}
b {
color: green;
}
table button {
width: 100%;
color: red;
}
#restart-button{
background: #295;
color:white;
position: absolute;
left: 50px;
width: 115px;
opacity: 0;
}
button:disabled{
color: #999;
}
#restart-button:hover {
opacity: 1;
}
#restart-game-button{
padding: 8px;
font-size: 20px;
background: #669933;
color: white;
margin-bottom: 5px;
}
#restart-game-button:hover {
background: #666633;
}
th[data-title]:hover{
background-color: yellow;
position: relative;
}
th[data-title]:hover:after {
content: attr(data-title);
padding: 4px 8px;
color: #333;
position: absolute;
left: 0;
top: 100%;
white-space: nowrap;
z-index: 20px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 0px 0px 4px #222;
-webkit-box-shadow: 0px 0px 4px #222;
box-shadow: 0px 0px 4px #222;
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));
background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
}
.label-name{
color:rgb(135, 174, 154);
/*font-size:14px*/
}
</style>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="../assets/js/html5shiv.js"></script>
<![endif]-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://code.jquery.com/jquery-1.7.js"></script>
<script>
$(document).ready(function(){
$("#install_cost1").focusout(function() {
//alert($("#install_cost1").val());
});
});
</script>
<script>
function install_cost1_cal(){
var temp=parseInt($("#install1_1").val())+ parseInt($("#install1_2").val())+parseInt($("#install1_3").val())+parseInt($("#install1_4").val())+parseInt($("#install1_5").val());
temp=temp.toString();
var temp1 = temp.substring(0, temp.length-3);var temp2 = temp.substring(temp.length-3, temp.length);
if((temp.length-3)>0){$("#install_cost1").html("$ "+temp1 +","+temp2);}else{$("#install_cost1").html("$ "+temp2);}
}
</script>
<script type="text/javascript">
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
var installation_costs = {none: 0, bmsSBChecked: 50000, energyStarEquipmentChecked: 15000,plugLoadChecked: 60000, oblsChecked: 50000,daylightDimmingChecked: 75000,OfficefixturedChecked: 200000,bathroomFixturedChecked:8000,emergencyLightingChecked:40000,roofInsulationChecked:50000,wallInsulation1Checked:100000,wallInsulation2Checked: 130000,windowsUpgradelChecked:100000,windowsFilmChecked:25000,doorWeatherizationChecked:5000,enclosureRecommisChecked:25000,airEconChecked:26620,condensingBoilerChecked:51225,sysEffChecked:210000};
function installCostValidate(this_measure, year){
var install_cost1 = installation_costs[$("#install_"+year+"_0").val()];
var install_cost2 = installation_costs[$("#install_"+year+"_1").val()];
var install_cost3 = installation_costs[$("#install_"+year+"_2").val()];
var install_cost4 = installation_costs[$("#install_"+year+"_3").val()];
var install_cost5 = installation_costs[$("#install_"+year+"_4").val()];
var total_cost = install_cost1 + install_cost2 + install_cost3 + install_cost4 + install_cost5;
//alert(install_cost1+install_cost2+ install_cost3+ install_cost4+ install_cost5);
available_cap = <?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) print($_SESSION['availableCap2'][1]);
else {$currentyear = $_SESSION['current_yr'];$temp = $_SESSION['availableCap2'][$currentyear]-$_SESSION['installationCost'][$currentyear]+132968-$_SESSION['newCost'][$currentyear]+ 50000; print($temp);} ?>;
//alert(available_cap);
available_cap = Math.ceil(available_cap);
if (available_cap - total_cost<0){
alert("You do not have enough money right now to install this measure.");
//reset this measure option to be none
$(this_measure).val('none');
} else {
$("#install_cost"+(year+1)).html("$ "+numberWithCommas(total_cost));
}
}
</script>
</head>
<body>
<!-- Navbar
================================================== -->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container" >
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand pull-left" href="tracking-sheet.php">EEB Hub Energy Retrofit Game</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li>
<a href="index.php">About</a>
</li>
<li>
<a href="#tutorial">Tutorial</a>
</li>
<li>
<a href="building-fact.php">Building101</a>
</li>
<li>
<a href="feedback.php">Feedback</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Container -->
<div class="container">
<h5 style="margin-top: 30px;">You have an annual budget of $50,000 to install energy retrofit measures onto <a href="building-fact.php">Building 101</a>, plus any capital you choose to invest from the energy cost savings from prior years. You can install up to three measures per year. Once you’ve selected your measures, click the "1st year" button under the Simulate column to calculate the energy and cost savings from the newly installed measures. Once you’ve simulated the building, you can compare your results against your % energy savings and investment return goals. All simulations are powered by DOE's OpenStudio SDK & EnergyPlus Engine.</h5>
<h3>Building101 Tracking Sheet</h3>
<!-- Sub-Nav-bar -->
<div class="navbar">
<div class="navbar-inner">
<!--<a class="brand" href="#">EnergyPlus Output</a>-->
<ul class="nav">
<li class="active"><a href="tracking-sheet.php">Tracking Sheet</a></li>
<li><a href="eem_measure.php">Measures</a></li>
<li><a href="./energy-use.php">Energy</a></li>
<li><a href="./energy-cost.php">Energy Costs</a></li>
<li><a href="./zone-component-load.php">Zone Loads</a></li>
<li><a href="eem_scheduler.php">Measure Planning</a></li>
<li><a href="./energy-intensity.php">Energy Intensity</a></li>
<li><a href="all-site-energy.php">EEM Model Example</a></li>
<li><a href="./summary.php">Summary</a></li>
</ul>
</div>
</div>
<!--<h1 style="text-shadow: 0px 1px 5px golden; color: #333;"><center>Energy Retrofit Game - Building 101 Tracking Sheet</center></h1>-->
<h4>$<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) print(number_format($_SESSION['availableCap2'][1]));
else {$currentyear = $_SESSION['current_yr'];$temp = $_SESSION['availableCap2'][$currentyear]-$_SESSION['installationCost'][$currentyear]+132968-$_SESSION['newCost'][$currentyear]+ 50000;echo number_format($temp);} ?>
<span style="color: rgb(45, 149, 143);"> Current Available Capital | </span>
$132,968 <span style="color: rgb(45, 149, 143);"> Baseline Annual Energy Costs</span> </h4>
<form>
<!--button type="submit" name="reset" value="0" formaction="" formmethod="post" id="restart-game-button" style="">RESTART</button-->
<!--button type="submit" name="buy-audit-button" value="0" formaction="" formmethod="post" id="restart-game-button" style="">BUY AUDIT</button-->
<!--button type="submit" name="end-game" formaction="feedback.php" formethod="post" id="restart-game-button" style=""> END GAME</button-->
<table border='1' class="table table-bordered table-striped">
<tr>
<th rowspan="2" data-title="The year when you will install the retrofit measure(s)" style="vertical-align:middle;">Year</th>
<th colspan="3">ENERGY EFFICIENCY MEASURES</th>
<th colspan="3">COSTS</th>
<th colspan="4">SAVINGS</th>
</tr>
<tr>
<th data-title="A list of available retrofit measures. You can install one or more at any year.">Install Measure #1</th>
<th data-title="A list of available retrofit measures. You can install one or more at any year.">Install Measure #2</th>
<th data-title="A list of available retrofit measures. You can install one or more at any year.">Install Measure #3</th>
<th data-title="A list of available retrofit measures. You can install one or more at any year." style="display:none;">Installed 4</th>
<th data-title="A list of available retrofit measures. You can install one or more at any year." style="display:none;">Installed 5</th>
<th data-title="The total cost of the chosen measure(s) to be installed">Installation Cost*</th>
<th data-title="Simulation button to determine the new annual energy use of the building after installing measure(s)">Simulation</th>
<th data-title="New annual energy cost after installing all measures from the beginning of the game">New Annual Energy Cost</th>
<th data-title="Cumulative energy cost savings for simulation years">Cumulative Savings</th>
<th data-title="The remaining capital plus the cumulative energy cost savings">$ Remaining Capital + Saving</th>
<th data-title="Interest if invested at 3% real return">3% real interest rate comparison</th>
<th data-title="%energy cost savings">% Energy Savings</th>
</tr>
<?php
$percent_interest_rate = array(50000, 101500, 154545, 209181, 265457, 323420, 383123, 444617, 507955, 573194);
for($year = 2015; $year < 2025; $year++) {
$j = $year - 2014;
echo " <tr><th style='width: 100px;'>$year";
if($current_yr > $j-1){
echo "<button id='restart-button' type='submit' name='reset' value='".($j-1)."' formaction='' formmethod='post'>Restart Here</button>";
}
echo "</th>";
for($i=0; $i < 5; $i++) {
if (($i==3)||($i==4)){echo '<td style="display:none;">';}
else echo '<td>';
selectedList($current_yr, $j-1, $_SESSION['installed_measures'][$j-1][$i], $_SESSION['measureFinished'],$i);
echo '</td>';
}
echo '
<td><span id="install_cost'.$j.'">$ ';
if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '-';}else if($j<=$_SESSION['current_yr']){
echo number_format($_SESSION['installationCost'][$j]);} else {echo '-';}
echo '</span></td>
<td><button onClick="load();" type="submit" formmethod="post" formaction="measure_list.php" ';
if($current_yr != $j-1) echo "disabled";
if($j == 1) {
echo ">1st year</button></td>";
} else if ($j == 2) {
echo ">2nd year</button></td>";
} else if ($j == 3) {
echo ">3rd year</button></td>";
} else {
$num = $j;
echo ">{$num}th year</button></td>";
}
echo "<td>
$ ";
if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '132,968';}else if($j<=$_SESSION['current_yr']){
echo number_format($_SESSION['newCost'][$j]);} else {$currentyear = $_SESSION['current_yr'];echo number_format($_SESSION['newCost'][$currentyear]);}
echo "</td>
<td>$ ";
if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '0';}else if($j<=$_SESSION['current_yr']){
echo number_format($_SESSION['cumulatedSaving'][$j]);}else {$currentyear = $_SESSION['current_yr'];echo number_format((132968-$_SESSION['newCost'][$currentyear])*($j-$currentyear)+$_SESSION['cumulatedSaving'][$currentyear]);}
echo " </td>
<td>";
if ($j==10) echo "<strong>";
echo "$ ";
//add remainingCapPlusSaving and availableCap2 session if $j = $currentyear
if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo number_format($j*50000);}else if($j<$_SESSION['current_yr']){
echo number_format($_SESSION['remainingCapPlusSaving'][$j]);} else if ($j==$_SESSION['current_yr']){$currentyear = $_SESSION['current_yr'];$_SESSION['remainingCapPlusSaving'][$currentyear]=$_SESSION['availableCap2'][$currentyear]-$_SESSION['installationCost'][$currentyear]+132968-$_SESSION['newCost'][$currentyear];$_SESSION['availableCap2'][$currentyear+1] = $_SESSION['remainingCapPlusSaving'][$currentyear]+50000;echo number_format($_SESSION['remainingCapPlusSaving'][$currentyear]);}
else {$currentyear = $_SESSION['current_yr'];$temp = $_SESSION['availableCap2'][$currentyear]-$_SESSION['installationCost'][$currentyear]+($j+1-$currentyear)*(132968-$_SESSION['newCost'][$currentyear])+($j-$currentyear)*50000;echo number_format($temp);}
if ($j==10) echo "</strong>";
echo "</td>
<td>";
if ($j==10) echo "<strong>";
echo "$ ".number_format($percent_interest_rate[$j-1]);
if ($j==10) echo "</strong>";
echo "</td>
<td>";
if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '-';}else if($j<=$_SESSION['current_yr']){
echo $_SESSION['percentageSaving'][$j];} else {$currentyear = $_SESSION['current_yr'];echo $_SESSION['percentageSaving'][$currentyear];}
echo " %</td>
</tr>";
}
?>
<tr>
<td colspan="11">
<strong>If the game ran 5 more years...</strong>
</td>
</tr>
<tr>
<th>2025</th>
<td colspan="5" style="border: 0px"></td>
<td>$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '132,968';}else {$currentyear = $_SESSION['current_yr'];echo number_format($_SESSION['newCost'][$currentyear]);}
?>
</td>
<td>$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '0';}else {$currentyear = $_SESSION['current_yr'];echo number_format((132968-$_SESSION['newCost'][$currentyear])*(11-$currentyear)+$_SESSION['cumulatedSaving'][$currentyear]);}
?>
</td>
<td>$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0){echo number_format(50000*11);}else {$currentyear = $_SESSION['current_yr'];$temp = $_SESSION['availableCap2'][$currentyear]-$_SESSION['installationCost'][$currentyear]+(11+1-$currentyear)*(132968-$_SESSION['newCost'][$currentyear])+(10-$currentyear)*50000;echo number_format($temp);}
?>
</td>
<td>$ 590,390</td>
<td>
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '-';}else {$currentyear = $_SESSION['current_yr'];echo $_SESSION['percentageSaving'][$currentyear];}
?>
%</td>
</tr>
<tr>
<th>2026</th>
<td colspan="5" style="border: 0px"></td>
<td>
$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '132,968';}else {$currentyear = $_SESSION['current_yr'];echo number_format($_SESSION['newCost'][$currentyear]);}
?>
</td>
<td>$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '0';}else {$currentyear = $_SESSION['current_yr'];echo number_format((132968-$_SESSION['newCost'][$currentyear])*(12-$currentyear)+$_SESSION['cumulatedSaving'][$currentyear]);}
?>
</td>
<td>$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0){echo number_format(50000*12);}else {$currentyear = $_SESSION['current_yr'];$temp = $_SESSION['availableCap2'][$currentyear]-$_SESSION['installationCost'][$currentyear]+(12+1-$currentyear)*(132968-$_SESSION['newCost'][$currentyear])+(10-$currentyear)*50000;echo number_format($temp);}
?>
</td>
<td>$ 608,101</td>
<td><?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '-';}else {$currentyear = $_SESSION['current_yr'];echo $_SESSION['percentageSaving'][$currentyear];}
?>
%</td>
</tr>
<tr>
<th>2027</th>
<td colspan="5" style="border: 0px"></td>
<td>
$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '132,968';}else {$currentyear = $_SESSION['current_yr'];echo number_format($_SESSION['newCost'][$currentyear]);}
?>
</td>
<td>$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '0';}else {$currentyear = $_SESSION['current_yr'];echo number_format((132968-$_SESSION['newCost'][$currentyear])*(13-$currentyear)+$_SESSION['cumulatedSaving'][$currentyear]);}
?>
</td>
<td>$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0){echo number_format(50000*13);}else {$currentyear = $_SESSION['current_yr'];$temp = $_SESSION['availableCap2'][$currentyear]-$_SESSION['installationCost'][$currentyear]+(13+1-$currentyear)*(132968-$_SESSION['newCost'][$currentyear])+(10-$currentyear)*50000;echo number_format($temp);}
?>
</td>
<td>$ 626,345</td>
<td><?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '-';}else {$currentyear = $_SESSION['current_yr'];echo $_SESSION['percentageSaving'][$currentyear];}
?>
%</td>
</tr>
<tr>
<th>2028</th>
<td colspan="5" style="border: 0px"></td>
<td>
$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '132,968';}else {$currentyear = $_SESSION['current_yr'];echo number_format($_SESSION['newCost'][$currentyear]);}
?>
</td>
<td>$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '0';}else {$currentyear = $_SESSION['current_yr'];echo number_format((132968-$_SESSION['newCost'][$currentyear])*(14-$currentyear)+$_SESSION['cumulatedSaving'][$currentyear]);}
?>
</td>
<td>$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0){echo number_format(50000*14);}else {$currentyear = $_SESSION['current_yr'];$temp = $_SESSION['availableCap2'][$currentyear]-$_SESSION['installationCost'][$currentyear]+(14+1-$currentyear)*(132968-$_SESSION['newCost'][$currentyear])+(10-$currentyear)*50000;echo number_format($temp);}
?>
</td>
<td>$ 645,135</td>
<td><?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '-';}else {$currentyear = $_SESSION['current_yr'];echo $_SESSION['percentageSaving'][$currentyear];}
?>
%</td>
</tr>
<tr>
<th>2029</th>
<td colspan="5" style="border: 0px"></td>
<td>
$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '132,968';}else {$currentyear = $_SESSION['current_yr'];echo number_format($_SESSION['newCost'][$currentyear]);}
?>
</td>
<td>$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '0';}else {$currentyear = $_SESSION['current_yr'];echo number_format((132968-$_SESSION['newCost'][$currentyear])*(15-$currentyear)+$_SESSION['cumulatedSaving'][$currentyear]);}
?>
</td>
<td>$
<?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0){echo number_format(50000*15);}else {$currentyear = $_SESSION['current_yr'];$temp = $_SESSION['availableCap2'][$currentyear]-$_SESSION['installationCost'][$currentyear]+(15+1-$currentyear)*(132968-$_SESSION['newCost'][$currentyear])+(10-$currentyear)*50000;echo number_format($temp);}
?>
</td>
<td>$ 664,489</td>
<td><?php if($_SESSION['current_yr']==''||$_SESSION['current_yr']==0) {echo '-';}else {$currentyear = $_SESSION['current_yr'];echo $_SESSION['percentageSaving'][$currentyear];}
?>
%</td>
</tr>
</table>
<div class="pull-right">
<button type="submit" name="reset" value="0" formaction="" formmethod="post" id="restart-game-button" style="">RESTART</button>
<!--a href="feedback.php" class="btn btn-large btn-success"> End Game</a-->
<button type="submit" value="go to feedback" formaction="http://rmt.eebhub.org/game/feedback.php" formmethod="post" id="restart-game-button" style="">END GAME</button>
</div>
<br>
<h3 id="tutorial">Tutorial</h3>
<dl>
<h4><dt class="label-name">1. Building 101 Data Pre-Loaded</dt></h4>
<dd>The current version of the game is pre-loaded with baseline energy data from Building101 (the EEB Hub Headquarters at the Philadelphia Navy Yard). <a href="building-fact.php">Building 101 Statistics & System Details linked here</a> may give you clues on which strategy to pursue.</dd>
<h4><dt class="label-name">2. Steps to Simulate Building Energy Each Year</dt></h4>
<dd>
<ol type="a">
<li>Set your cost-% savings target (say you want to accomplish 20% energy savings over the whole period of the game which is 10 years)</li>
<li>In the Row of 2015, you have starting capital for investment of $50,000</li>
<li>Within your capital budget, choose the retrofit measure(s) that you would like to install from retrofit-list in columns 3-7 (say Bathroom Lighting Upgrade)</li>
<li>There are two measures – the metered interval data and the energy audit – which are not installed in the building. Instead, these provide you with more information to make strategic investment decisions.</li>
<li>After choosing the retrofit measure(s) , Column 8 “Installation Cost” will automatically change to the total cost of installation</li>
<li>Click the “1st year” button to run the simulation (Note the pink tacking line at the top of the screen indicating whether the simulation is complete or not)</li>
<li>When simulation is complete, columns 10-15 are automatically populated with simulation cost results</li>
<li>Now you can compare the “remaining capital and cumulative savings” (Column 13) if it is higher than Column 14 and the “% savings” (Column 15) if it meets your target savings percentage that you set at the beginning</li>
</ol>
</dd>
<h4><dt class="label-name">3. Play for 10 Years</dt></h4>
<dd>To win this game, you need to have the value of Column 13 of the 10th year to be larger than the value in Column 14, and have the value in Column 15 to be the same or higher than your target percent savings. You can also go for a higher savings target and see how the game would change if you track energy savings out to 15 years instead. Enjoy!</dd>
</dl>
<p><i>* Installation Cost Disclaimer: Measure costs are not actual estimates, rather, they are generalized cost figures based on author judgments.</i></p>
<br>
<h5 class="text-left">Built by the <a href="http://www.eebhub.org">Energy Efficient Buildings HUB</a>, a <a href="http://energy.gov/science-innovation/innovation/hubs">U.S. Department of Energy Innovation HUB</a>. Powered by DOE's OpenStudio SDK & EnergyPlus Engine. </h5>
<h5 class="text-left">Our Retrofit Manager Tool team includes PSU, UMaryland, & NREL. <a href="https://github.com/eebhub/platform/blob/master/ACKNOWLEDGEMENT_DISCLAIMER">DOE Acknowledgement & Disclaimer</a>.</h5>
<br>
</form>
</div> <!-- /container -->
<div id="loading-div" style="opacity: 0; box-shadow: 0 1px 5px #888; padding: 20px; text-align: center; width: 60%; background: #eee; z-index: -1; left: 20%; position: fixed; top: 50%;">
<div class="progress" style="width: 100%; height: 30px; background: #bbb;">
<div id="loading-bar" style="background: linear-gradient(to right bottom, #3399ff, blue); height: 30px; width: 0px;"> </div>
</div>
<h4 id="loading-status">Simulation In Progress ...</h4>
</div>
</body>
<script>
/*
* the function shows the loading status
*/
function load() {
// top screen layer
var screen = document.createElement("div");
screen.style.width = "100%";
screen.style.height = "100%";
screen.style.position = "absolute";
screen.style.top="0";
screen.style.background="#aaa";
screen.style.opacity="0.5";
screen.style.left="0";
screen.style.zindex="5";
document.body.appendChild(screen);
$("#loading-div").css("z-index", "9999");
$("#loading-div").css("opacity", "1");
$("#loading-div").fadeIn();
$('html,body').css('overflow', 'hidden');
var progress = 0;
var int=self.setInterval(function(){
loading("loading-bar", Math.round(progress)+"%");
progress += Math.random()*2;
if(progress >= 100) {
loading("loading-bar", "100%");
$("#loading-status").html("Loading ...");
clearInterval(int);
}
},750);
function loading(id, progress) {
//console.log(id);
//console.log(document.getElementById(id).style.width);
var width = document.getElementById(id).style.width = progress;
// update the loading-status (text)
$("#loading-status").html("Simulation In Progress "+progress);
//console.log(width);
}
}
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-26348074-7', 'eebhub.org');
ga('send', 'pageview');
</script>
</html>