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