getComponents($device_id,$options); $response[] = array( 'id' => '', 'label' => ' ', 'status' => '', 'disable' => '', 'ignore' => '', ); foreach ($COMPONENTS[$device_id] as $ID => $AVP) { $response[] = array( 'id' => $ID, 'type' => $AVP['type'], 'label' => $AVP['label'], 'status' => ($AVP['status'] ? "Normal" : "Alert"), 'disable' => '', 'ignore' => '', ); }//end foreach $output = array( 'current' => $current, 'rowCount' => $rowCount, 'rows' => $response, 'total' => count($COMPONENTS[$device_id]), ); echo _json_encode($output);