foreach ($deviceSensorList['sensors'] as $key => $val) { if (in_array($sensorType, $val['sensorList'])) { $sensoridDisplay[$val['sensorIndex']] = $val['sensorID']; } } $displaySensorList[$sensorType] = $sensoridDisplay; } /* print_r($deviceSensorList[sensors]); echo '<hr>'; print_r($deviceSensorList[sensors][0]); echo '<hr>'; print_r($displaySensorList); */ foreach ($SensorsList as $sensorType) { $tmpList = $sensors->get_sensor_type($sensorType); foreach ($tmpList as $row) { $typeName = $row['name']; $typeUnit = $row['unit']; } $rawDisplay = '<tr><th><font size="5">' . $typeName . '</font></th>'; if (count($displaySensorList[$sensorType]) > 0) { for ($iColumn = 0; $iColumn < count($deviceSensorList[sensors]); $iColumn++) { if (empty($displaySensorList[$sensorType][$iColumn])) { $rawDisplay = $rawDisplay . '<td></td>'; } else { $sensorID = $displaySensorList[$sensorType][$iColumn] . $sensorType; $tmpList = $sensors->get_sensor_list($sensorID); foreach ($tmpList as $row) { $alarm_MAX = $row['alarm_max']; $alarm_MIN = $row['alarm_min'];