Commit 53b5855f authored by nextime's avatar nextime

Better integration for stats gui section

parent cca71e7f
<? @include_once("../includes/common.php"); ?>
<div class="left-drawer">
<div id="websectionlist" class="panel drawer-container scrollable">
<a href="<?=$BASEGUIPATH."/stats"?>" class="btn btn-block btn-default">Stats Home</a>
<?
$l=DB::query("SELECT websection FROM stats_charts WHERE websection!='home' group by websection order by websection");
foreach($l as $k => $v)
{
?>
<a href="<?=$BASEGUIPATH."/stats/".$v['websection']?>" class="btn btn-block btn-default"><?=$v['websection']?></a>
<?
}
?>
</div>
</div>
<? @include_once("../includes/common.php"); ?>
<div class="row insider">
<iframe width="100%" height="100%" src="/domotika/stats/">
</iframe>
<?
$panels=FALSE;
if($GUISUBSECTION!="" && is_numeric($GUISUBSECTION))
{
$v=DB::query("SELECT * FROM stats_charts WHERE websection='$GUISUBSECTION' AND active=1 order by webposition,id");
if(is_array($v) && count($v)>0) {
$panels=array();
$pos=1;
foreach($v as $pan) {
$panels[]=array('panel_title'=>"Stats $GUISUBSECTION",'panel_type'=>'graph','panel_content'=>'*','panel_websections'=>"$GUISUBSECTION",
'panel_cols'=>'12','panel_height'=>'100%')+$PANELDEFAULTS;
$pos++;
}
}
}
$DEFPANELS = array();
$DEFPANELS[]=array('panel_title'=>'Default stats','panel_type'=>'graph','panel_content'=>'*','panel_websections'=>'home','panel_cols'=>'12','panel_height'=>'100%')+$PANELDEFAULTS;
if(!$panels)
$panels=DB::query("SELECT * FROM user_gui_panels WHERE user='$_DOMOTIKA[username]' AND page='stats' ORDER by panel_position,id");
if(!$panels or count($panels)<1) {
$panels=$DEFPANELS;
foreach($panels as $p) {
$q="INSERT INTO user_gui_panels
(user,page,panel_title,panel_type,panel_cols,panel_height,panel_visible,panel_position,panel_sections,panel_websections,panel_selector,panel_content)
VALUES
('".$_DOMOTIKA['username']."','stats','".$p['panel_title']."','".$p['panel_type']."',
'".$p['panel_cols']."','".$p['panel_height']."','".$p['panel_visible']."','".$p['panel_position']."',
'".$p['panel_sections']."','".$p['panel_websections']."','".$p['panel_selector']."','".$p['panel_content']."')";
DB::query($q);
}
}
include($FSPATH."/panels/include.php");
?>
</div> <!-- row -->
index.php
\ No newline at end of file
......@@ -3,6 +3,7 @@
<div id="websectionlist" class="panel drawer-container scrollable">
<div class="panel-heading"><h2 class="panel-title">Menu</h2></div>
<a href="<?=$BASEGUIPATH."/"?>" class="btn btn-block btn-default rightbtn rightbtn-attuazioni">Attuazioni</a>
<a href="<?=$BASEGUIPATH."/"?>" class="btn btn-block btn-default rightbtn rightbtn-clima">Clima</a>
<a href="<?=$BASEGUIPATH."/video"?>" class="btn btn-block btn-default rightbtn rightbtn-tv">Video & TV</a>
<a href="<?=$BASEGUIPATH."/cameras"?>" class="btn btn-block btn-default rightbtn rightbtn-video">Telecamere</a>
<a href="<?=$BASEGUIPATH."/stats"?>" class="btn btn-block btn-default rightbtn rightbtn-stats">Stats</a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment