--- alx-src/branches/alx-web-070/index.php 2016/02/08 14:05:46 8553 +++ alx-src/branches/alx-web-070/index.php 2019/07/10 08:54:02 13245 @@ -3,11 +3,14 @@ include('include/basesql.php'); include('include/common-functions.php'); -session_start(); +if(session_status() !== PHP_SESSION_ACTIVE) 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[] = ''; @@ -22,9 +25,17 @@ if(isset($_GET['s_krit'])) { $_SESSION['alx_sort_krit']=$_GET['s_krit']; - $_SESSION['alx_sort_onfirst']=0+$_GET['s_on']; - $_SESSION['alx_sort_loc']['DEAD']=$_GET['s_dead']; - foreach($locations as $l) $_SESSION['alx_sort_loc'][$l]=$_GET['s_'.$l]; + + if(isset($_GET['s_on'])) $_SESSION['alx_sort_onfirst']=0+$_GET['s_on']; + else $_SESSION['alx_sort_onfirst']=0+NULL; + + if(isset($_GET['s_dead'])) $_SESSION['alx_sort_loc']['DEAD']=$_GET['s_dead']; + else $_SESSION['alx_sort_loc']['DEAD']=NULL; + + foreach($locations as $l) { + if(isset($_GET['s_'.$l])) $_SESSION['alx_sort_loc'][$l]=$_GET['s_'.$l]; + else $_SESSION['alx_sort_loc'][$l]=NULL; + } } function check_online($dat, $bla) @@ -53,8 +64,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') { @@ -91,7 +102,7 @@ echo '