1
0

debug: affichage des valeurs false, true, on, off

This commit is contained in:
Daniel Tartavel 2022-06-21 09:01:58 +02:00
parent 566fc0e40c
commit c0aef550ab
2 changed files with 22 additions and 1 deletions

View File

@ -39,6 +39,25 @@ function displayStats($ieeeAddress, $fn, $property, $startDate, $endDate)
//print_r($mohaDB); //print_r($mohaDB);
if ($mohaDB->affected_rows != 0) if ($mohaDB->affected_rows != 0)
{ {
$n = $mohaDB->affected_rows;
for($i=0;$i<$n;$i++)
{
//echo $i . "======>";
if (strtolower($datas[$i]["value"]) == "on" or strtolower($datas[$i]["value"]) == "true")
{
//echo "setting value to : 1 =>" . __FILE__ . ":" . __LINE__ . EOLH;
$datas[$i]["value"] = 1;
}elseif (strtolower($datas[$i]["value"]) == "off" or strtolower($datas[$i]["value"]) == "false")
{
//echo "setting value to : 0 =>" . __FILE__ . ":" . __LINE__ . EOLH;
$datas[$i]["value"] = 0;
}
/*else
{
//echo "strange value : " . $datas[$i]["value"] . " => " . __FILE__ . ":" . __LINE__ .EOLH;
}*/
//var_dump($datas);
}
print diagramDisplay($datas); print diagramDisplay($datas);
}else }else
{ {

View File

@ -23,7 +23,7 @@ if (empty($indexIeeeAddress))
// print_r($devices); // print_r($devices);
print '<form method="GET" action="display_stats.php">'; print '<form method="GET" action="display_stats.php">';
//print '<input type="hidden" name="fn" value="">'; //print '<input type="hidden" name="fn" value="">';
print '<label for="devicesSelectList">' . _("Choose a device:") . '</label> print '<label for="devicesSelectList">' . _("Choose a property to display:") . '</label>
<select name="device" id="devicesSelectList">' ; <select name="device" id="devicesSelectList">' ;
foreach ($devices as $value) foreach ($devices as $value)
{ {
@ -33,6 +33,8 @@ if (empty($indexIeeeAddress))
$devicesList[$value["device"]][] = $value["property"]; $devicesList[$value["device"]][] = $value["property"];
} }
} }
array_multisort($devicesList);
//$devicesList = array_intersect_key($indexIeeeAddress, $tmp); //$devicesList = array_intersect_key($indexIeeeAddress, $tmp);
//print_r($devicesList); //print_r($devicesList);
foreach($devicesList as $ieeeAddress => $array) foreach($devicesList as $ieeeAddress => $array)