Data['id'] > 1 ){ $NodeID = intval($_POST['NID']); $SiteID = intval($_POST['SITE']); $QS = "SELECT * FROM nodes WHERE id={$NodeID}"; $Data = array(); $result = $DATABASE->Query( $QS, false ); if( count( $result ) ){ $T = $result[0]; $AID = $T['aux_id']; $QS = "SELECT * FROM lrf_sensors WHERE id={$AID}"; $result = $DATABASE->Query( $QS, false ); if( count($result) ){ $CS = $result[0]; $K['name'] = $T['name']; $K['data_status'] = intval( $CS['data_status'] ); $K['online'] = intval( $T['online']); switch( intval( $CS['type_id'] ) ){ case 1: case 2: case 3: case 4:{ $K['profile_id'] = intval( $CS['detection_profile_id'] ); $K['profiles'] = array(); $QS = "SELECT `id` FROM `lrf_detection_profiles` WHERE `aux_id`={$AID} and `master`=b'1' ORDER BY `profile_id`"; foreach( $DATABASE->Query( $QS ) as $Z ) $K['profiles'][] = intval($Z['id']); //if( $K['profile_id'] == 0 ) $K['profile_id'] = K['profiles'][0]; $QS = "SELECT * FROM `lrf_masks` WHERE `sensor_id`={$AID} ORDER BY `layer`"; $UU = $DATABASE->Query( $QS ); $LL = array( 'N', 'N', 'N', 'N', 'N' ); foreach( $UU as $U ) $LL[intval($U['layer'])] = $U['status']; $K['masks_array'] = $LL; $K['additional'] = ''; break; }; case 5: { $K['additional'] = <<