--- alx-src/branches/alx-web-070/index.php 2016/02/08 14:05:46 8553 +++ alx-src/branches/alx-web-070/index.php 2017/08/30 14:57:46 10658 @@ -5,9 +5,12 @@ session_start(); //session_register('alx_sort_krit'); session_register('alx_sort_onfirst'); session_register('alx_sort_loc'); -$_SESSION['alx_sort_krit'] = $alx_sort_krit; -$_SESSION['alx_sort_onfirst'] = $alx_sort_onfirst; -$_SESSION['alx_sort_loc'] = $alx_sort_loc; +if(isset($_SESSION['alx_sort_krit'])) $alx_sort_krit = $_SESSION['alx_sort_krit']; +if(isset($_SESSION['alx_sort_onfirst'])) $alx_sort_onfirst = $_SESSION['alx_sort_onfirst']; +if(isset($_SESSION['alx_sort_loc'])) $alx_sort_loc = $_SESSION['alx_sort_loc']; + +// fix reload php debug message +if(!isset($reload)) $reload = 'not set'; $locations = sqlarr('SELECT location FROM client_locations where enabled="1"', '', 'location'); $locations[] = ''; @@ -53,8 +56,8 @@ if($_SESSION['alx_sort_onfirst']) { - if($a['online'] && !$b['online']) return -1; - if($b['online'] && !$a['online']) return 1; + if(isset($a['online']) && !isset($b['online'])) return -1; + if(isset($b['online']) && !isset($a['online'])) return 1; } if($_SESSION['alx_sort_krit']=='hostname') { @@ -70,7 +73,7 @@ else return ''; } -$comps = sqlarr("select client_serials.serial, client_serials.enabled, client_serials.location, client_serials.mac, cfg_network.hostname, state_connected.mtime, state_connected.netboot from client_serials left join cfg_network on client_serials.serial=cfg_network.serial left join state_connected on client_serials.serial=state_connected.serial", "serial"); +$comps = sqlarr("select client_serials.serial, client_serials.enabled, client_serials.location, client_serials.mac, cfg_network.hostname, state_connected.mtime, state_connected.netboot, client_version.arch from client_serials left join cfg_network on client_serials.serial=cfg_network.serial left join state_connected on client_serials.serial=state_connected.serial left join client_version on client_serials.serial=client_version.serial", "serial"); sqlforeach('SELECT state_connected.serial, state_connected.ip, cfg_network.hostname, state_connected.mac FROM state_connected left join cfg_network on cfg_network.serial=state_connected.serial', 'check_online', null); usort($comps, 'sortcomp'); @@ -91,7 +94,7 @@ echo '