connectDB(); //auxs vars initing $countris_abrev = array("Portugal" => "pt", "Italy" => "it", "France" => "fr", "Belgium" => "be", "Slovenia" => "sl"); //lang init if(returnReceivedVariable("lang") != "") $_SESSION["lang"] = returnReceivedVariable("lang"); if($_SESSION["lang"] == "" || !in_array($_SESSION["lang"], $countris_abrev)) $_SESSION["lang"] = "en"; /*if($_SESSION["lang"] == "sl") header('Content-Type: text/html; charset=utf-8'); // else header('Content-Type: text/html; charset=iso-8859-1'); // */ include_once("langs/" . $_SESSION["lang"] . "/lang.php"); //received outside vars $_SESSION["step"] = $step = returnReceivedVariable("step"); $_SESSION["substep"] = $substep = returnReceivedVariable("substep"); if($_SESSION["step"] == "" || ($_SESSION["step"] == "1" && $_SESSION["substep"] == "0")) { $_SESSION["step"] = 1; $_SESSION["substep"] = 0; $_SESSION["tech"] = ""; //TERMAL PHOTO WIND $_SESSION["tech_name"] = ""; $_SESSION["country"] = ""; $_SESSION["country_id"] = ""; $_SESSION["country_abrev"] = ""; $_SESSION["period"] = ""; $_SESSION["zone_id"] = ""; $_SESSION["region"] = ""; $_SESSION["region_id"] = ""; $_SESSION["consumption_average"] = ""; $_SESSION["consumption_improve"] = ""; $_SESSION["consumption"] = ""; $_SESSION["indicator_average"] = ""; $_SESSION["indicator_own"] = ""; $_SESSION["indicator_improve"] = ""; //solar PV specific $_SESSION["days"] = ""; $_SESSION["consumption_aux"] = ""; $_SESSION["production"] = ""; $_SESSION["production_average"] = ""; $_SESSION["power_peak_average"] = ""; } if(returnReceivedVariable("tech") == "wind" || returnReceivedVariable("tech") == "photo" || returnReceivedVariable("tech") == "thermal") { $_SESSION["tech"] = returnReceivedVariable("tech"); if($_SESSION["tech"] == "photo") $_SESSION["tech_name"] = getCurrentLanguage("Photovoltaic"); else if($_SESSION["tech"] == "thermal") $_SESSION["tech_name"] = getCurrentLanguage("Solar Thermal"); else if($_SESSION["tech"] == "wind") $_SESSION["tech_name"] = getCurrentLanguage("Wind"); } if(returnReceivedVariable("country") != "") { $_SESSION["country"] = returnReceivedVariable("country"); $com = "SELECT id, abrev, average_consumption FROM country WHERE name = '" . $_SESSION["country"] . "'"; $res = $CONNECTION->executeQuery($com); $n_rows = $CONNECTION->numRows($res); if($n_rows == 1) { $tmp = $CONNECTION->getLine($res); $_SESSION["country_id"] = $tmp[0]; $_SESSION["consumption_average"] = $tmp[2]; } $_SESSION["country_abrev"] = $countris_abrev[$_SESSION["country"]]; } if(returnReceivedVariable("period") != ""){ //D W M Y $_SESSION["period"] = returnReceivedVariable("period"); if($_SESSION["period"] == "D") $_SESSION["period_factor"] = 1; else if($_SESSION["period"] == "W") $_SESSION["period_factor"] = 7; else if($_SESSION["period"] == "M") $_SESSION["period_factor"] = 30; else if($_SESSION["period"] == "Y") $_SESSION["period_factor"] = 365; } if(returnReceivedVariable("region") != "") $_SESSION["region"] = returnReceivedVariable("region"); if(returnReceivedVariable("consumption") != "") $_SESSION["consumption"] = returnReceivedVariable("consumption"); if(returnReceivedVariable("iconsumption") != "") $_SESSION["consumption_improve"] = returnReceivedVariable("iconsumption"); if(returnReceivedVariable("iproduction") != "") $_SESSION["production_improve"] = returnReceivedVariable("iproduction"); //solar PV specific if(returnReceivedVariable("days") != "") $_SESSION["days"] = returnReceivedVariable("days"); if(returnReceivedVariable("consumption_aux") != "") $_SESSION["consumption_aux"] = returnReceivedVariable("consumption_aux"); if(returnReceivedVariable("production") != "") $_SESSION["production"] = returnReceivedVariable("production"); //defining page to load if(returnReceivedVariable("start") != 1) { if($_SESSION["step"] != 1 || $_SESSION["substep"] != 0) { $page = $_SESSION["tech"] . $_SESSION["step"] . "_" . $_SESSION["substep"] ; $page_title = ""; } else { $page = "home"; $page_title = ""; } } else { $page = "start"; $page_title = ""; $_SESSION["step"] = -1; } /*if($_SESSION["step"] != 1 || $_SESSION["substep"] != 0) { $page = $_SESSION["tech"] . $_SESSION["step"] . "_" . $_SESSION["substep"] ; $page_title = ""; } else { $page = "start"; $page_title = ""; }*/ //defining title if($_SESSION["step"] == 1) $step_title = getCurrentLanguage("Step 1 Name"); else if($_SESSION["step"] == 2) $step_title = getCurrentLanguage("Step 2 Name"); else if($_SESSION["step"] == 3) $step_title = getCurrentLanguage("Step 3 Name"); else if($_SESSION["step"] == 4) $step_title = getCurrentLanguage("Step 4 Name"); //definig sub-title inside page already $bread_crumb = $_SESSION["tech_name"] . " > " . getCurrentLanguage($_SESSION["country"]); if($_SESSION["region"] != "") $bread_crumb .= " > " . $_SESSION["region"]; $periods_txt = array("D" => getCurrentLanguage("Last day"), "W" => getCurrentLanguage("Last week"), "M" => getCurrentLanguage("Last month"), "Y" => getCurrentLanguage("Last year")); if($_SESSION["period"] != "") $bread_crumb .= " > " . str_replace("
", " ", $periods_txt[$_SESSION["period"]]); ?> EnergizAIR
 
>
>