| 1 | <?php
|
|---|
| 2 | session_start();
|
|---|
| 3 | if (session_is_registered("session_user") && session_is_registered("session_id"))
|
|---|
| 4 | {
|
|---|
| 5 |
|
|---|
| 6 | include_once 'cfg/mysql.php';
|
|---|
| 7 | connectdb();
|
|---|
| 8 |
|
|---|
| 9 | if(isset($_GET['p']))
|
|---|
| 10 | {
|
|---|
| 11 | $page = $_GET['p'];
|
|---|
| 12 | }
|
|---|
| 13 | else
|
|---|
| 14 | {
|
|---|
| 15 | $page = 'bar';
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | if(isset($_GET['r']))
|
|---|
| 19 | {
|
|---|
| 20 | $room = $_GET['r'];
|
|---|
| 21 | setcookie("room", "", time()-3600);
|
|---|
| 22 | setcookie("room", $room, time()+3600);
|
|---|
| 23 | }
|
|---|
| 24 | else
|
|---|
| 25 | {
|
|---|
| 26 | $room = '1';
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | if(isset($_GET['d']))
|
|---|
| 30 | {
|
|---|
| 31 | $description = $_GET['d'];
|
|---|
| 32 | setcookie("description", "", time()-3600);
|
|---|
| 33 | setcookie("description", $description, time()+3600);
|
|---|
| 34 | }
|
|---|
| 35 | else
|
|---|
| 36 | {
|
|---|
| 37 | $description = 'TL1';
|
|---|
| 38 | }
|
|---|
| 39 |
|
|---|
| 40 | ?>
|
|---|
| 41 |
|
|---|
| 42 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|---|
| 43 | <html xmlns="http://www.w3.org/1999/xhtml">
|
|---|
| 44 | <head>
|
|---|
| 45 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|---|
| 46 | <title>SaveEnergy Leiden</title>
|
|---|
| 47 | <link href="css/style.css" rel="stylesheet" type="text/css" />
|
|---|
| 48 | <script type="text/javascript" src="js/swfobject.js"></script>
|
|---|
| 49 | <script type="text/javascript">
|
|---|
| 50 | swfobject.embedSWF(
|
|---|
| 51 | "open-flash-chart.swf", "chart",
|
|---|
| 52 | "100%", "300", "9.0.0", "expressInstall.swf",
|
|---|
| 53 | {"data-file":"graphs/<?php echo $page ?>.txt"});
|
|---|
| 54 |
|
|---|
| 55 | function bar_1(chart_id)
|
|---|
| 56 | {
|
|---|
| 57 | var description = "TL1";
|
|---|
| 58 | var room = chart_id;
|
|---|
| 59 | window.location = ("?p=line&r="+room+"&d="+description);
|
|---|
| 60 | }
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 | </script>
|
|---|
| 64 |
|
|---|
| 65 | </head>
|
|---|
| 66 |
|
|---|
| 67 | <body>
|
|---|
| 68 | <div id="container">
|
|---|
| 69 | <div id="header">
|
|---|
| 70 | <img src="images/Untitled-3_01.jpg" />
|
|---|
| 71 | </div>
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 | <div id="navigation">
|
|---|
| 75 | <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>
|
|---|
| 76 | </div>
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 | <div id="content_wrap">
|
|---|
| 80 | <div id="content_top">
|
|---|
| 81 | </div>
|
|---|
| 82 | <div id="content">
|
|---|
| 83 | <h1>Grafieken</h1>
|
|---|
| 84 | <h2>Uitleg</h2>
|
|---|
| 85 | <p>Alle energiemetingen zijn vermenigvuldigd met een factor 10^3, de temperatuurmetingen zijn onveranderd. <br /><br /> Onder de grafieken is een menu waarmee gekozen kan worden welke meting van de kamer wordt getoond.</p>
|
|---|
| 86 |
|
|---|
| 87 | <div id="chart"></div>
|
|---|
| 88 | <br />
|
|---|
| 89 | <br />
|
|---|
| 90 | <?
|
|---|
| 91 | if($page=='line')
|
|---|
| 92 | {
|
|---|
| 93 | $teller=0;
|
|---|
| 94 | $result = mysql_query("SELECT DISTINCT description FROM sensors WHERE roomID=$room ORDER BY description asc");
|
|---|
| 95 | while ($row=mysql_fetch_array($result))
|
|---|
| 96 | {
|
|---|
| 97 | $menu[$teller]['description']=$row['description'];
|
|---|
| 98 | $teller++;
|
|---|
| 99 | }
|
|---|
| 100 |
|
|---|
| 101 | for($i=0;$i<count($menu);$i++)
|
|---|
| 102 | {
|
|---|
| 103 | echo'<a href=
|
|---|
| 104 | "page1.php?p=line&r='.$room.'&d='.$menu[$i]['description'].'">'.$menu[$i]['description'].'</a>';
|
|---|
| 105 | }
|
|---|
| 106 | }
|
|---|
| 107 | ?>
|
|---|
| 108 | </div>
|
|---|
| 109 |
|
|---|
| 110 | <div id="content_bottom">
|
|---|
| 111 | </div>
|
|---|
| 112 | </div>
|
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 | <div id="footer">
|
|---|
| 116 | Save Energy Leiden is een onderdeel van het <a href="http://www.ict4saveenergy.eu/">Save Energy project</a>.
|
|---|
| 117 | </div>
|
|---|
| 118 | </div>
|
|---|
| 119 | </body>
|
|---|
| 120 |
|
|---|
| 121 | </html>
|
|---|
| 122 | <?
|
|---|
| 123 | }
|
|---|
| 124 | else
|
|---|
| 125 | {
|
|---|
| 126 | header('location:index.php');
|
|---|
| 127 | }
|
|---|
| 128 | ?>
|
|---|