示例#1
0
文件: index.php 项目: haukur46/vma
<?php 
header('Content-type: text/html; charset=utf-8');
require_once 'weather/weather.php';
require_once 'vma/vma.php';
$weather = new Weather();
$weatherData = $weather->getWeather();
if (isset($weatherData['image'])) {
    $weatherData['image'] = "http://www.vma-forfoll.net/weather/images/" . $weatherData['image'] . ".png";
}
$vma = new VMA();
$vmaData = $vma->getAbsence();
$months = array(1 => "jan.", 2 => "feb.", 3 => "mars", 4 => "apr.", 5 => "maí", 6 => "júní", 7 => "júlí", 8 => "ágúst", 9 => "sept.", 10 => "okt.", 11 => "nóv.", 12 => "des.");
?>
<!DOCTYPE HTML>
<html lang="is-IS">
<head>
  <meta charset="utf-8">
  <meta name="description" content="Vef app sem sýnir kennslufall / forföll kennara í Verkmenntaskólanum á Akureyri (VMA)" />
  <meta name="keywords" content="VMA, mobile, kennarar, veikir, veikindi, kennslufall, kenna ekki, forföll, forföll kennara, Verkmenntaskólinn á Akureyri, vef app VMA, app VMA" />
  <title>Forföll kennara í VMA (vef app)</title>
  <meta property="og:url" content="http://www.vma-forfoll.net" />
  <meta property="og:title" content="VMA - Forföll kennara (vef app)" />
  <meta property="og:description" content="Vef app sem sýnir kennslufall / forföll kennara í Verkmenntaskólanum á Akureyri (VMA)" />
  <meta property="og:image" content="http://www.vma-forfoll.net/images/meme.jpg" />
  <meta property="og:type" content="website" />
  <meta property="fb:admins" content="1113339718" />
  <meta name="HandheldFriendly" content="true" />
  <meta name="format-detection" content="telephone=no" />
  <meta name="theme-color" content="#13ABE0">
  <meta name="mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-title" content="VMA" />
<?php

require "weatherAPI.php";
//Get Current Weather for Lisboa
/*
$w = new Weather(false);
$w->getWeather("Lisboa, PT");

Debug($w->getCurrent());        //Get Current State
Debug($w->getCity());           //Get City
Debug($w->getTemp());           //Get Current Temp
Debug($w->getTempInterval());   //Get Temp Interval for the day
Debug($w->getCountry());        //Get Country
*/
echo "<hr>";
$city = "Lisboa,PT";
$w = new Weather($city);
$w->getWeather();
echo "<br>";
echo $w->getCurrent();
echo "<br>";
$w->getWeatherForecast();
echo "<br>";
echo "<br>";
示例#3
0
session_start();
// Naam van de website
$businessName = "Hogeschool Meppel";
$feed = "en_en";
// include Feed.php (voor het verwerken van de feed)
require_once "includes/Feed.php";
// include Weather.php (voor het verwerken van het weer)
require_once "includes/Weather.php";
// include Language.php (voor het verwerken van de urls)
require_once "includes/Language.php";
// Nieuwe weer
$weather = new Weather();
// Temperatuur en zonsopkomstt in Meppel
$weather->setLocation("Meppel");
$w = $weather->getWeather();
$sunrise = new DateTime();
$sunrise->setTimezone(new DateTimeZone('europe/amsterdam'));
$sunrise->setTimestamp($w->sys->sunrise);
//var_dump($url);
$langUrl = "?";
foreach ($_GET as $key => $val) {
    if ($key != "lang") {
        $langUrl .= $key . "=" . $val . "&";
    }
}
function generateJavascriptErrors($id, $error)
{
    $script = '
      var error = document.createElement("span");
        error.setAttribute("class", "error");