Data['id'] > 1 ){ if( $CUser->Data['access'] > 5 ){ $QS = "SELECT * FROM users"; $Result = $DATABASE->Query($QS,false); foreach( $Result as $CD ){ $cnode['id'] = intval( $CD['id'] ); $cnode['status'] = $CD['status']; $cnode['access'] = intval( $CD['access'] ); $cnode['login'] = $CD['login']; $cnode['created']= $CD['create_ts']; $cnode['last'] = $CD['login_ts']; $cnode['lang'] = intval( $CD['language'] ); $cnode['site'] = $CD['selected_site']; $Data['users'][] = $cnode; }; } else { $Data['users'] = array(); }; $Data['totalCount']= count($Data['users']); echo json_encode( $Data ); } else { header('location: /'); }; ?>