SmartHome
 All Data Structures Files Functions Variables
statistics.php File Reference

Functions

 selectdb ($dbname, $connection)
 
 fetch ()
 
 insert ($vals, $table)
 
 addstatistics ($device_id, $data, $value)
 
 getDetails ($devid)
 
 goback ()
 
 send_command ($command)
 

Variables

 PHP
 
if(!$fgmembersite->CheckLogin()) $sondefa
 
 $current
 
 $current2
 
 $timestamp_array =array()
 
 $timestamp1
 
 $timestamp2
 
 $con = mysql_connect($server,$user,$password)
 
 $con_raspberry
 
 $server ="mysql.felixaestheticus.net"
 
 $user ="e1702299"
 
 $password ="KVIDyY4I8f"
 
 $devid1 ='3'
 
 $sql3
 
 $i = 0
 
 $result3 = mysql_query($sql3)
 
 $devid2 ='10'
 
PHP global $timestamp_array2
 
 $sum =$current2+$current
 

Function Documentation

addstatistics (   $device_id,
  $data,
  $value 
)

addstatistics function

Parameters
string$device_id
string$data
string$value
fetch ( )

fetch function (Fetch all the devices in smarthome_server_db.devices)

getDetails (   $devid)

getDetails function (for a given device id it gets the details such as status, power consumption ..etc)

Parameters
string$devid
Returns
int $i
goback ( )

goback function

insert (   $vals,
  $table 
)

insert function

Parameters
string$vals
string$table
selectdb (   $dbname,
  $connection 
)

selectdb function

Parameters
string$dbname
string$connection
send_command (   $command)

send_command function

Parameters
string$command

produce command data array here!

Variable Documentation

$con = mysql_connect($server,$user,$password)
$con_raspberry
global $current
PHP global $current2
$devid1 ='3'
$devid2 ='10'
$i = 0
$password ="KVIDyY4I8f"
$result3 = mysql_query($sql3)
$server ="mysql.felixaestheticus.net"
if (!$fgmembersite->CheckLogin()) $sondefa

Variables

$sql3
Initial value:
= "(SELECT timestamp
FROM (
SELECT timestamp,device_id
FROM statistics
where device_id = $devid1 and sensor_data = 'power_cons'
ORDER BY timestamp DESC
LIMIT 10
) AS s
where s.device_id = " . $devid1 .")"
$sum =$current2+$current
$timestamp1
$timestamp2
PHP global $timestamp_array =array()

End of File

PHP global $timestamp_array2
$user ="e1702299"
PHP

SmartHome Project - Developed by Tranquillum statistics.php Purpose: This Page Shows statistics about the power consumption for all appliances

Author
Abdullah
Version
1.0 30/05/13

Check the login (if the user is not logged in then redirect to the login page)