source: code/Website/page1.php@ 7887

Last change on this file since 7887 was 7887, checked in by dennisw, 15 years ago
File size: 2.2 KB
Line 
1<?php
2session_start();
3if (session_is_registered("session_user") && session_is_registered("session_id"))
4{
5
6include_once 'cfg/mysql.php';
7connectdb();
8
9if(isset($_GET['p']))
10{
11 $page = $_GET['p'];
12}
13else
14{
15 $page = 'bar';
16}
17?>
18
19<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
20<html xmlns="http://www.w3.org/1999/xhtml">
21<head>
22<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
23<title>SaveEnergy Leiden</title>
24<link href="css/style.css" rel="stylesheet" type="text/css" />
25<script type="text/javascript" src="js/swfobject.js"></script>
26<script type="text/javascript">
27swfobject.embedSWF(
28 "open-flash-chart.swf", "chart",
29 "100%", "300", "9.0.0", "expressInstall.swf",
30 {"data-file":"graphs/<?php echo $page ?>.txt"});
31
32function bar_1(chart_id)
33{
34 var description = "TL1";
35 var room = chart_id;
36 window.location = ("?p="+room);
37}
38
39</script>
40
41</head>
42
43<body>
44<div id="container">
45 <div id="header">
46 <img src="images/Untitled-3_01.jpg" />
47 </div>
48
49
50 <div id="navigation">
51 <a href="index.php">Home</a> <a href="page1.php?p=bar" "style='color:#f7921c'">Grafieken</a> <a href="page2.php">Uitleg</a> <a href="page3.php">Info</a>
52 </div>
53
54
55 <div id="content_wrap">
56 <div id="content_top">
57 </div>
58 <div id="content">
59 <h1>Grafieken</h1>
60 <h2>Energieverbruik</h2>
61 <p>Hier de grafiek die het energieverbruik van gisteren per kamer toont.</p>
62<br /><br />
63<div id="chart"></div>
64<br /><br />
65
66<?
67if ($handle = opendir('graphs/')) {
68 $i=0;
69 while (false !== ($file = readdir($handle))) {
70 if ($file != "." && $file != "..") {
71 $i++;
72 $page_name=substr($file, 0, strpos($file, "."));
73 echo "<a href=page1.php?p=$page_name>$page_name</a>";
74 if($i==14)
75 {echo "<br>";
76 $i=1;}
77 }
78 }
79}
80closedir($handle); ?>
81
82 </div>
83
84 <div id="content_bottom">
85 </div>
86 </div>
87
88
89 <div id="footer">
90 Save Energy Leiden is een onderdeel van het <a href="http://www.ict4saveenergy.eu/">Save Energy project</a>.
91 </div>
92</div>
93</body>
94
95</html>
96<?
97}
98else
99{
100header('location:index.php');
101}
102?>
Note: See TracBrowser for help on using the repository browser.