Changeset 7887
- Timestamp:
- May 3, 2010, 8:27:08 AM (15 years ago)
- Location:
- code/Website
- Files:
-
- 6 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/Website/cfg/mysql.php
r7878 r7887 2 2 function connectdb() 3 3 { 4 mysql_connect("localhost:3306", "root", " d3nn1s")4 mysql_connect("localhost:3306", "root", "root") 5 5 or die("Error connecting to mysql: " . mysql_error()); 6 6 mysql_select_db('save_energy') -
code/Website/page1.php
r7878 r7887 15 15 $page = 'bar'; 16 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 else25 {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 else36 {37 $description = 'TL1';38 }39 40 17 ?> 41 18 … … 57 34 var description = "TL1"; 58 35 var room = chart_id; 59 window.location = ("?p= line&r="+room+"&d="+description);36 window.location = ("?p="+room); 60 37 } 61 62 38 63 39 </script> … … 82 58 <div id="content"> 83 59 <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 60 <h2>Energieverbruik</h2> 61 <p>Hier de grafiek die het energieverbruik van gisteren per kamer toont.</p> 62 <br /><br /> 87 63 <div id="chart"></div> 88 <br /> 89 <br /> 64 <br /><br /> 65 90 66 <? 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 } 67 if ($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 } 106 79 } 107 ?> 80 closedir($handle); ?> 81 108 82 </div> 109 83
Note:
See TracChangeset
for help on using the changeset viewer.