refreshData(); } // osvežimo podatke nastavitev static function refreshData() { // nastavitve sistema self::getSystemSetting(); // nastavitve ankete // nastavitve uporabika } static function getSystemSetting() { //$stringSystemSetting = "SELECT * FROM srv_settng " } /** @desc: polovi sistemske filtre */ private static $_systemFilters = array(); private static $_systemFiltersArray; static function GetSystemFilters($filter=null) { if (!$filter) { if (isset(self::$_systemFiltersArray)) { return self::$_systemFiltersArray; } else { $result = array(); $stringSystemSetting_filters = "SELECT * FROM srv_sys_filters ORDER BY type, filter ASC"; $sqlSystemSetting_filters = sisplet_query($stringSystemSetting_filters ); while ( $rowSystemSetting_filters = mysqli_fetch_assoc($sqlSystemSetting_filters) ) { $result[] = $rowSystemSetting_filters; } self::$_systemFiltersArray = $result; return self::$_systemFiltersArray; } } else { if (isset(self::$_systemFilters[$filter])) return self::$_systemFilters[$filter]; else { $stringSystemSetting_filters = "SELECT * FROM srv_sys_filters where filter = '".$filter."'"; $sqlSystemSetting_filters = sisplet_query($stringSystemSetting_filters ); $result = mysqli_fetch_assoc($sqlSystemSetting_filters); self::$_systemFilters[$filter] = $result; return $result; } } } // vrne array z sistemskimi filtri private static $_systemFiltersValues; static function GetSystemFiltersValues() { if (isset(self::$_systemFiltersValues)) { return self::$_systemFiltersValues; } else { $result = array(); $stringSystemSetting_filters = "SELECT filter FROM srv_sys_filters ORDER BY type, filter ASC"; $sqlSystemSetting_filters = sisplet_query($stringSystemSetting_filters ); while ( $rowSystemSetting_filters = mysqli_fetch_assoc($sqlSystemSetting_filters) ) { $result[$rowSystemSetting_filters['filter']] = $rowSystemSetting_filters['filter']; } self::$_systemFiltersValues = $result; return self::$_systemFiltersValues; } } private static $_systemFiltersByType = array(); static function GetSystemFlterByType($type) { if (isset(self::$_systemFiltersByType[$type])) return self::$_systemFiltersByType[$type]; else { $result = array(); $stringSystemSetting_filters = "SELECT * FROM srv_sys_filters WHERE type = '".$type."' ORDER BY filter ASC"; $sqlSystemSetting_filters = sisplet_query($stringSystemSetting_filters ); while ( $rowSystemSetting_filters = mysqli_fetch_assoc($sqlSystemSetting_filters) ) { $result[] = $rowSystemSetting_filters; } self::$_systemFiltersByType[$type] = $result; return self::$_systemFiltersByType[$type]; } } /** desc: vrnemo sistemsko privzete nastavtive filtrov * (v opisnih statistikah so vsi filtri vključeni, v frekvencah pa izključeni) */ private static $_systemFiltersDefaultValues = array(); static function GetSystemFlterDefaultValues($fid) { if (isset(self::$_systemFiltersDefaultValues[$fid])) return self::$_systemFiltersDefaultValues[$fid]; else { $result = array('means'=>false, 'crosstab'=>false, 'frequencies'=>false, 'descriptives'=>true); self::$_systemFiltersByType[$fid] = $result; return self::$_systemFiltersByType[$fid]; } } // vrne true če je $key v tabeli z filtri private static $_systemFiltersValue; static function isSystemFiltersValue($key) { $stringSystemSetting_filters = "SELECT count(id) as cnt FROM srv_sys_filters where filter = '".$key."'"; $sqlSystemSetting_filters = sisplet_query($stringSystemSetting_filters ); $row = mysqli_fetch_assoc($sqlSystemSetting_filters); return $row['cnt']; } static function AddSystemFilters( $filter, $text, $fid) { $insertString = "INSERT INTO srv_sys_filters (fid,filter,text,uid,type) ". "VALUES ('".$fid."', '".$filter."', '".$text."', '".self::$uid."', '3');"; self::$mySqlResult = sisplet_query($insertString); self::$mySqlErrNo = mysqli_errno($GLOBALS['connect_db']); } static function DeleteSystemFilters( $id) { $deleteString = "DELETE FROM srv_sys_filters WHERE id = '".$id."'"; self::$mySqlResult = sisplet_query($deleteString); self::$mySqlErrNo = mysqli_errno($GLOBALS['connect_db']); } static function SaveSystemFilters($id,$filter,$text) { $updateString = "UPDATE srv_sys_filters " . "SET filter = '".$filter."', text = '".$text."' ". "WHERE id = '".$id."'"; self::$mySqlResult = sisplet_query($updateString); self::$mySqlErrNo = mysqli_errno($GLOBALS['connect_db']); } private static $_systemSysVarFlterData = array(); static function GetSystemSysVarFlterData($id) { if (isset(self::$_systemSysVarFlterData[$id])) { return self::$_systemSysVarFlterData[$id]; } else { $stringSystemSetting_filters = "SELECT * FROM srv_sys_filters WHERE id = '".$id."'"; $sqlSystemSetting_filters = sisplet_query($stringSystemSetting_filters ); $result = mysqli_fetch_assoc($sqlSystemSetting_filters); self::$_systemSysVarFlterData[$id] = $result; return self::$_systemSysVarFlterData[$id]; } } /** Hendla prikaz filtrov v nastavitvah * */ static function DisplaySystemFilters($mode='normal') { global $lang; global $s; $filtri = self::GetSystemFilters(); if ( $mode=='normal' ) { echo ''; echo '' .$lang['srv_settings_filter_edit_mode']. ''; echo '
'; echo '