moved database-informations to config.php, added sample config
parent
f7774cfc38
commit
98f0a3c717
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
$database = array(
|
||||
'host' => "localhost",
|
||||
'user' => "temp",
|
||||
'password' => "temppw",
|
||||
'database' => "temp",
|
||||
);
|
||||
|
||||
2
draw.php
2
draw.php
|
|
@ -11,13 +11,13 @@ function generateChart($today,$mode,$hours=0,$dateInput){
|
|||
global $day;
|
||||
global $month;
|
||||
global $year;
|
||||
global $db;
|
||||
|
||||
$diffuse=0; # 10min -+ start/end time
|
||||
|
||||
$types=array('ambi1','ambi2','humi1','temp1','temp2','baro1');
|
||||
$dummy=array(array(),array());
|
||||
|
||||
$db=new DBLib('localhost','temp','temppw','temp');
|
||||
$stats="";
|
||||
$selectionStart=$selectionEnd=0;
|
||||
$chartname="";
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
header("Cache-Control: no-cache, must-revalidate");
|
||||
$start=microtime(true);
|
||||
date_default_timezone_set("Europe/Berlin");
|
||||
include('config.php');
|
||||
include('lib/DBLib.php');
|
||||
include('draw.php');
|
||||
include('function.php');
|
||||
|
|
@ -86,6 +87,7 @@ if($mode==1){
|
|||
if(!$error===false){
|
||||
$html.=$error;
|
||||
}else{
|
||||
$db=new DBLib($database['host'],$database['user'],$database['password'],$database['database']);
|
||||
$html.=generateChart($today,$mode,$num,$date);
|
||||
}
|
||||
$runtime=microtime(true)-$start;
|
||||
|
|
|
|||
Loading…
Reference in New Issue