Podatki - geslo se izpise v tabeli kot parapodatek, ce so identifikatorji povezani
This commit is contained in:
parent
fdadf91093
commit
60f8fd3242
@ -508,299 +508,303 @@ class SurveyDataDisplay{
|
|||||||
static public function setUpFilter() {
|
static public function setUpFilter() {
|
||||||
|
|
||||||
# nastavimo filter po statusih
|
# nastavimo filter po statusih
|
||||||
|
|
||||||
if (self::$headFileName != null && self::$headFileName != '' && file_exists(self::$headFileName)) {
|
if (self::$headFileName != null && self::$headFileName != '' && file_exists(self::$headFileName)) {
|
||||||
|
|
||||||
# kadar zbiramo sistemske, moramo obvezno zbirati tudi podatke, ne smemo pa full meta
|
# kadar zbiramo sistemske, moramo obvezno zbirati tudi podatke, ne smemo pa full meta
|
||||||
if (self::$_VARS[VAR_SHOW_SYSTEM]){
|
if (self::$_VARS[VAR_SHOW_SYSTEM]){
|
||||||
self::$_VARS[VAR_DATA] = true;
|
self::$_VARS[VAR_DATA] = true;
|
||||||
self::$_VARS[VAR_META] = true;
|
self::$_VARS[VAR_META] = true;
|
||||||
self::$_VARS[VAR_METAFULL] = false;
|
self::$_VARS[VAR_METAFULL] = false;
|
||||||
self::$_VARS[VAR_SHOW_DATE] = false;
|
self::$_VARS[VAR_SHOW_DATE] = false;
|
||||||
}
|
}
|
||||||
# filtriranje po statusih
|
|
||||||
self::$_CURRENT_STATUS_FILTER = SurveyStatusProfiles :: getStatusAsAWKString();
|
|
||||||
|
|
||||||
if (self::$dataFileStatus >= 0) {
|
|
||||||
self::$_HEADERS = unserialize(file_get_contents(self::$headFileName));
|
|
||||||
|
|
||||||
# ali imamo filter na testne podatke
|
|
||||||
if (isset(self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence']) && (int)self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'] > 0) {
|
|
||||||
$test_data_sequence = self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'];
|
|
||||||
$filter_testdata = SurveyStatusProfiles :: getStatusTestAsAWKString($test_data_sequence);
|
|
||||||
}
|
|
||||||
# filtriranje po časih
|
|
||||||
$_time_profile_awk = SurveyTimeProfiles :: getFilterForAWK(self::$_HEADERS['unx_ins_date']['grids']['0']['variables']['0']['sequence']);
|
|
||||||
|
|
||||||
# ali imamo filter na uporabnost
|
|
||||||
if (isset(self::$_HEADERS['usability']['variables'][0]['sequence']) && (int)self::$_HEADERS['usability']['variables'][0]['sequence'] > 0) {
|
|
||||||
$usability_data_sequence = self::$_HEADERS['usability']['variables'][0]['sequence'];
|
|
||||||
$filter_usability = SurveyStatusProfiles :: getStatusUsableAsAWKString($usability_data_sequence);
|
|
||||||
}
|
|
||||||
|
|
||||||
# če nismo v indikatorjih (sistemske)
|
|
||||||
if (self::$_VARS[VAR_SHOW_SYSTEM] == false) {
|
|
||||||
# dodamo še ife
|
|
||||||
SurveyConditionProfiles :: setHeader(self::$_HEADERS);
|
|
||||||
$_condition_profile_AWK = SurveyConditionProfiles:: getAwkConditionString();
|
|
||||||
|
|
||||||
# dodamo še ife za inspect
|
|
||||||
$SI = new SurveyInspect(self::$sid);
|
|
||||||
$_inspect_condition_awk = $SI->generateAwkCondition();
|
|
||||||
}
|
|
||||||
|
|
||||||
# dodamo pogoj za filter prepoznave uporabnika iz cms
|
|
||||||
# vklopljeno more bit prepoznava userja iz cms
|
|
||||||
if (self::$doCMSUserFilter == true) {
|
|
||||||
$CMSUserCondition = self::createCMSUserFilter();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (($_condition_profile_AWK != "" && $_condition_profile_AWK != null )
|
# filtriranje po statusih
|
||||||
|| ($_inspect_condition_awk != "" && $_inspect_condition_awk != null)
|
self::$_CURRENT_STATUS_FILTER = SurveyStatusProfiles :: getStatusAsAWKString();
|
||||||
|| ($_time_profile_awk != "" && $_time_profile_awk != null)
|
|
||||||
|| ($CMSUserCondition != "" && $CMSUserCondition != null)
|
if (self::$dataFileStatus >= 0) {
|
||||||
|| ($filter_testdata != null)
|
self::$_HEADERS = unserialize(file_get_contents(self::$headFileName));
|
||||||
|| ($filter_usability != null)) {
|
|
||||||
self::$_CURRENT_STATUS_FILTER = '('.self::$_CURRENT_STATUS_FILTER;
|
# ali imamo filter na testne podatke
|
||||||
if ($_condition_profile_AWK != "" && $_condition_profile_AWK != null ) {
|
if (isset(self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence']) && (int)self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'] > 0) {
|
||||||
self::$_CURRENT_STATUS_FILTER .= '&&'.$_condition_profile_AWK;
|
$test_data_sequence = self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'];
|
||||||
}
|
$filter_testdata = SurveyStatusProfiles :: getStatusTestAsAWKString($test_data_sequence);
|
||||||
if ($_inspect_condition_awk != "" && $_inspect_condition_awk != null ) {
|
}
|
||||||
self::$_CURRENT_STATUS_FILTER .= ' && '.$_inspect_condition_awk;
|
# filtriranje po časih
|
||||||
}
|
$_time_profile_awk = SurveyTimeProfiles :: getFilterForAWK(self::$_HEADERS['unx_ins_date']['grids']['0']['variables']['0']['sequence']);
|
||||||
if ($_time_profile_awk != "" && $_time_profile_awk != null) {
|
|
||||||
self::$_CURRENT_STATUS_FILTER .= '&&'.$_time_profile_awk;
|
# ali imamo filter na uporabnost
|
||||||
}
|
if (isset(self::$_HEADERS['usability']['variables'][0]['sequence']) && (int)self::$_HEADERS['usability']['variables'][0]['sequence'] > 0) {
|
||||||
if ($CMSUserCondition != "" && $CMSUserCondition != null) {
|
$usability_data_sequence = self::$_HEADERS['usability']['variables'][0]['sequence'];
|
||||||
self::$_CURRENT_STATUS_FILTER .= '&&'.$CMSUserCondition;
|
$filter_usability = SurveyStatusProfiles :: getStatusUsableAsAWKString($usability_data_sequence);
|
||||||
}
|
}
|
||||||
if ($filter_testdata != null ) {
|
|
||||||
self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_testdata.')';
|
# če nismo v indikatorjih (sistemske)
|
||||||
}
|
if (self::$_VARS[VAR_SHOW_SYSTEM] == false) {
|
||||||
if ($filter_usability != null ) {
|
# dodamo še ife
|
||||||
self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_usability.')';
|
SurveyConditionProfiles :: setHeader(self::$_HEADERS);
|
||||||
}
|
$_condition_profile_AWK = SurveyConditionProfiles:: getAwkConditionString();
|
||||||
self::$_CURRENT_STATUS_FILTER .= ')';
|
|
||||||
}
|
# dodamo še ife za inspect
|
||||||
|
$SI = new SurveyInspect(self::$sid);
|
||||||
# preštejemo vse zapise ki ustrezajo filtru po statusu
|
$_inspect_condition_awk = $SI->generateAwkCondition();
|
||||||
if (IS_WINDOWS) {
|
}
|
||||||
$awk_string = 'awk -F"'.STR_DLMT.'" "'.self::$_CURRENT_STATUS_FILTER.' {cnt++} END {print cnt}" '.self::$dataFileName;
|
|
||||||
$recCount = shell_exec($awk_string);
|
# dodamo pogoj za filter prepoznave uporabnika iz cms
|
||||||
if ($_GET['debug'] == 1) {
|
# vklopljeno more bit prepoznava userja iz cms
|
||||||
print_r('<br>'.$awk_string);
|
if (self::$doCMSUserFilter == true) {
|
||||||
}
|
$CMSUserCondition = self::createCMSUserFilter();
|
||||||
|
}
|
||||||
} else {
|
|
||||||
$awk_string = 'awk -F"'.STR_DLMT.'" \''.self::$_CURRENT_STATUS_FILTER.' {cnt++} END {print cnt}\' \''.self::$dataFileName.'\'';
|
|
||||||
$recCount = shell_exec($awk_string);
|
|
||||||
if ($_GET['debug'] == 1) {
|
|
||||||
print_r('<br>'.$awk_string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((int)$recCount > 0 ) {
|
|
||||||
self::$_RECORD_COUNT = (int)$recCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (($_condition_profile_AWK != "" && $_condition_profile_AWK != null )
|
||||||
if (self::$_VARS[VAR_REC_ON_PAGE] != 'all') {
|
|| ($_inspect_condition_awk != "" && $_inspect_condition_awk != null)
|
||||||
self::$_TOTAL_PAGES = bcdiv(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]);
|
|| ($_time_profile_awk != "" && $_time_profile_awk != null)
|
||||||
|
|| ($CMSUserCondition != "" && $CMSUserCondition != null)
|
||||||
if (bcmod(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]) > 0)
|
|| ($filter_testdata != null)
|
||||||
self::$_TOTAL_PAGES += 1;
|
|| ($filter_usability != null)) {
|
||||||
if (self::$_VARS[VAR_CUR_REC_PAGE] > self::$_TOTAL_PAGES ) {
|
self::$_CURRENT_STATUS_FILTER = '('.self::$_CURRENT_STATUS_FILTER;
|
||||||
self::$_VARS[VAR_CUR_REC_PAGE] = self::$_TOTAL_PAGES;
|
if ($_condition_profile_AWK != "" && $_condition_profile_AWK != null ) {
|
||||||
} elseif (self::$_VARS[VAR_CUR_REC_PAGE] < 1 ) {
|
self::$_CURRENT_STATUS_FILTER .= '&&'.$_condition_profile_AWK;
|
||||||
self::$_VARS[VAR_CUR_REC_PAGE] = 1;
|
}
|
||||||
}
|
if ($_inspect_condition_awk != "" && $_inspect_condition_awk != null ) {
|
||||||
|
self::$_CURRENT_STATUS_FILTER .= ' && '.$_inspect_condition_awk;
|
||||||
# nastavimo limit za datoteko
|
}
|
||||||
|
if ($_time_profile_awk != "" && $_time_profile_awk != null) {
|
||||||
$up = self::$_VARS[VAR_REC_ON_PAGE] * self::$_VARS[VAR_CUR_REC_PAGE];
|
self::$_CURRENT_STATUS_FILTER .= '&&'.$_time_profile_awk;
|
||||||
$low = $up - self::$_VARS[VAR_REC_ON_PAGE]+1;
|
}
|
||||||
|
if ($CMSUserCondition != "" && $CMSUserCondition != null) {
|
||||||
self::$_REC_LIMIT = ' NR=='.$low.',NR=='.$up.'';
|
self::$_CURRENT_STATUS_FILTER .= '&&'.$CMSUserCondition;
|
||||||
} else {
|
}
|
||||||
# nastavimo limit za datoteko
|
if ($filter_testdata != null ) {
|
||||||
self::$_REC_LIMIT = '';
|
self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_testdata.')';
|
||||||
}
|
}
|
||||||
}
|
if ($filter_usability != null ) {
|
||||||
if (self::$_VARS[VAR_DATA]) {
|
self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_usability.')';
|
||||||
$tmp_svp_pv = SurveyVariablesProfiles :: getProfileVariables(self::$_PROFILE_ID_VARIABLE );
|
}
|
||||||
|
self::$_CURRENT_STATUS_FILTER .= ')';
|
||||||
# če je $svp_pv = null potem prikazujemo vse variable
|
}
|
||||||
# oziroma če je sistemski dodamo tudi vse, ker drugače lahko filter skrije telefon in email
|
|
||||||
if (count($tmp_svp_pv) == 0 || self::$_VARS[VAR_SHOW_SYSTEM] == true ) {
|
# preštejemo vse zapise ki ustrezajo filtru po statusu
|
||||||
|
if (IS_WINDOWS) {
|
||||||
$_sv = self::$SDF->getSurveyVariables();
|
$awk_string = 'awk -F"'.STR_DLMT.'" "'.self::$_CURRENT_STATUS_FILTER.' {cnt++} END {print cnt}" '.self::$dataFileName;
|
||||||
if (count($_sv) > 0) {
|
$recCount = shell_exec($awk_string);
|
||||||
foreach ( $_sv as $vid => $variable) {
|
if ($_GET['debug'] == 1) {
|
||||||
$tmp_svp_pv[$vid] = $vid;
|
print_r('<br>'.$awk_string);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
} else {
|
||||||
}
|
$awk_string = 'awk -F"'.STR_DLMT.'" \''.self::$_CURRENT_STATUS_FILTER.' {cnt++} END {print cnt}\' \''.self::$dataFileName.'\'';
|
||||||
self::$lineoffset=1;
|
$recCount = shell_exec($awk_string);
|
||||||
# če prikazujemo sistemske ne prikazujemo recnumber
|
if ($_GET['debug'] == 1) {
|
||||||
if (!self::$_VARS[VAR_SHOW_SYSTEM] && self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL]) {
|
print_r('<br>'.$awk_string);
|
||||||
$svp_pv['recnum'] = 'recnum';
|
}
|
||||||
#$svp_pv['code'] = 'code';
|
}
|
||||||
self::$lineoffset++;
|
if ((int)$recCount > 0 ) {
|
||||||
# za code ni ofseta
|
self::$_RECORD_COUNT = (int)$recCount;
|
||||||
#self::$lineoffset++;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (self::$_VARS[VAR_DATA] && count($tmp_svp_pv) > 0) {
|
|
||||||
foreach ($tmp_svp_pv AS $_svp_pv) {
|
|
||||||
|
|
||||||
# če imamo sistemski email ali telefon, ime, priimek (v header je nastavljno "hide_system" = 1)
|
|
||||||
# potem v odvisnosti od nastavitve prikazujemo samo navadne podatke ali pa samo te sistemske, zaradizaščite podatkov
|
if (self::$_VARS[VAR_REC_ON_PAGE] != 'all') {
|
||||||
$_sistemski = false;
|
self::$_TOTAL_PAGES = bcdiv(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]);
|
||||||
if (!self::$_VARS[VAR_SHOW_SYSTEM] && self::$_HEADERS[$_svp_pv]['hide_system'] == '1') {
|
|
||||||
# prikazujemo samo nesistemske (nezaščitene)
|
if (bcmod(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]) > 0)
|
||||||
unset(self::$_HEADERS[$_svp_pv]);
|
self::$_TOTAL_PAGES += 1;
|
||||||
} else if (self::$_VARS[VAR_SHOW_SYSTEM] && self::$_HEADERS[$_svp_pv]['hide_system'] !== '1') {
|
if (self::$_VARS[VAR_CUR_REC_PAGE] > self::$_TOTAL_PAGES ) {
|
||||||
# prikazujemo samo sistemske (zaščitene) podatke
|
self::$_VARS[VAR_CUR_REC_PAGE] = self::$_TOTAL_PAGES;
|
||||||
unset(self::$_HEADERS[$_svp_pv]);
|
} elseif (self::$_VARS[VAR_CUR_REC_PAGE] < 1 ) {
|
||||||
} else {
|
self::$_VARS[VAR_CUR_REC_PAGE] = 1;
|
||||||
# če ne dodamo
|
}
|
||||||
$svp_pv[$_svp_pv] = $_svp_pv;
|
|
||||||
}
|
# nastavimo limit za datoteko
|
||||||
}
|
|
||||||
}
|
$up = self::$_VARS[VAR_REC_ON_PAGE] * self::$_VARS[VAR_CUR_REC_PAGE];
|
||||||
|
$low = $up - self::$_VARS[VAR_REC_ON_PAGE]+1;
|
||||||
|
|
||||||
|
self::$_REC_LIMIT = ' NR=='.$low.',NR=='.$up.'';
|
||||||
|
} else {
|
||||||
|
# nastavimo limit za datoteko
|
||||||
|
self::$_REC_LIMIT = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#status - če smo v meta ali imamo profil vse enote
|
if (self::$_VARS[VAR_DATA]) {
|
||||||
if ( (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
|
$tmp_svp_pv = SurveyVariablesProfiles :: getProfileVariables(self::$_PROFILE_ID_VARIABLE );
|
||||||
|| ( $ssp_pid = SurveyStatusProfiles::getCurentProfileId() == 1 )) {
|
|
||||||
$svp_pv['status'] = 'status';
|
# če je $svp_pv = null potem prikazujemo vse variable
|
||||||
self::$lineoffset++;
|
# oziroma če je sistemski dodamo tudi vse, ker drugače lahko filter skrije telefon in email
|
||||||
}
|
if (count($tmp_svp_pv) == 0 || self::$_VARS[VAR_SHOW_SYSTEM] == true ) {
|
||||||
|
|
||||||
#lurker
|
$_sv = self::$SDF->getSurveyVariables();
|
||||||
if ( (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
|
if (count($_sv) > 0) {
|
||||||
|| ( $ssp_pid = SurveyStatusProfiles::getCurentProfileId() == 1 )) {
|
foreach ( $_sv as $vid => $variable) {
|
||||||
// dodamo v array da se prikazujejo tudi ti stolpci
|
$tmp_svp_pv[$vid] = $vid;
|
||||||
$svp_pv['lurker'] = 'lurker';
|
}
|
||||||
self::$lineoffset++;
|
}
|
||||||
}
|
}
|
||||||
# ustreznost
|
}
|
||||||
if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
|
|
||||||
// dodamo v array da se prikazujejo tudi ti stolpci
|
|
||||||
$svp_pv['relevance'] = 'relevance';
|
|
||||||
self::$lineoffset++;
|
|
||||||
}
|
|
||||||
|
|
||||||
# email tion
|
|
||||||
#email prikazujemo skupaj z ustreznostjo
|
|
||||||
if ( self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
|
|
||||||
// dodamo v array da se prikazujejo tudi ti stolpci
|
|
||||||
$svp_pv['invitation'] = 'invitation';
|
|
||||||
self::$lineoffset++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset(self::$_HEADERS['testdata'])) {
|
self::$lineoffset=1;
|
||||||
self::$_HAS_TEST_DATA = true;
|
|
||||||
$svp_pv['testdata'] = 'testdata';
|
|
||||||
self::$lineoffset++;
|
|
||||||
}
|
|
||||||
# $svp_pv['unx_ins_date'] = 'unx_ins_date';
|
|
||||||
|
|
||||||
if (self::$_VARS[VAR_METAFULL] && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
|
# če prikazujemo sistemske ne prikazujemo recnumber
|
||||||
# dodamo tudi special meta
|
if (!self::$_VARS[VAR_SHOW_SYSTEM] && self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL]) {
|
||||||
$svp_pv['meta'] = 'meta';
|
$svp_pv['recnum'] = 'recnum';
|
||||||
}
|
self::$lineoffset++;
|
||||||
|
}
|
||||||
if (self::$showItime == true) {
|
|
||||||
$svp_pv['itime'] = 'itime';
|
|
||||||
self::$lineoffset++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ce imamo vklopljene sistemske ne smemo povezovat podatkov in zato urejamo po abecedi
|
|
||||||
if(self::$_VARS[VAR_SHOW_SYSTEM]){
|
|
||||||
|
|
||||||
$hasEmail = false;
|
|
||||||
|
|
||||||
// Poiscemo sekvenco sistemske spremenljivke
|
|
||||||
foreach (self::$_HEADERS AS $spr => $spremenljivka) {
|
|
||||||
if (isset($spremenljivka['sistem']) && $spremenljivka['sistem'] == 1 && $spremenljivka['variable'] == 'email') {
|
|
||||||
$sequence = $spremenljivka['sequences'];
|
|
||||||
$hasEmail = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($hasEmail){
|
|
||||||
# sortiramo
|
|
||||||
self::$do_sort = true;
|
|
||||||
|
|
||||||
# nastavimo po kateri sekvenci / stolpcu sortiramo
|
|
||||||
self::$sort_seq = $sequence;
|
|
||||||
|
|
||||||
self::$sort_type = 'sort_asc';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self::getQuestionCount();
|
|
||||||
if (self::$_VARS[VAR_SPR_LIMIT] > self::$_ALL_QUESTION_COUNT) {
|
|
||||||
self::$_VARS[VAR_SPR_LIMIT] = 'all';
|
|
||||||
}
|
|
||||||
|
|
||||||
$spr_cont = 0; // za paginacijo spremenljivk
|
|
||||||
|
|
||||||
if(self::$_VARS['spr_limit'] == 'all'){
|
|
||||||
$_spr_on_pages_start = 0;
|
|
||||||
$_spr_on_pages_stop = self::$_VARS['spr_page'];
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$_spr_on_pages_start = self::$_VARS['spr_page'] * self::$_VARS['spr_limit'] - self::$_VARS['spr_limit'];
|
|
||||||
$_spr_on_pages_stop = self::$_VARS['spr_page'] * self::$_VARS['spr_limit'];
|
|
||||||
}
|
|
||||||
|
|
||||||
# skreiramo filter variabel za podatke
|
if (self::$_VARS[VAR_META]) {
|
||||||
if (count(self::$_HEADERS) > 0) {
|
$svp_pv['code'] = 'code';
|
||||||
// zloopamo skozi spremenljivke in sestavimo filter po stolpcih
|
self::$lineoffset++;
|
||||||
$_tmp_filter = '';
|
}
|
||||||
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
|
|
||||||
if (isset($svp_pv[$spid])) {
|
if (self::$_VARS[VAR_DATA] && count($tmp_svp_pv) > 0) {
|
||||||
// paginacija spremenljivk
|
|
||||||
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
|
foreach ($tmp_svp_pv AS $_svp_pv) {
|
||||||
if (count($spremenljivka['grids']) > 0 ) {
|
|
||||||
foreach ($spremenljivka['grids'] AS $gid => $grid) {
|
|
||||||
if (count ($grid['variables']) > 0) {
|
|
||||||
foreach ($grid['variables'] AS $vid => $variable ){
|
|
||||||
$_tmp_filter .= $_prfx.$variable['sequence'];
|
|
||||||
$_prfx = ',';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // end: paginacija spremenljivk
|
|
||||||
$spr_cont++;
|
|
||||||
} else
|
|
||||||
# če prikazujemo samo sistemske
|
|
||||||
if ( self::$_VARS[VAR_SHOW_SYSTEM] && in_array($spremenljivka['variable'], array('email','ime','priimek','telefon','naziv','drugo','odnos'))) {
|
|
||||||
if (count($spremenljivka['grids']) > 0 ) {
|
|
||||||
foreach ($spremenljivka['grids'] AS $gid => $grid) {
|
|
||||||
if (count ($grid['variables']) > 0) {
|
|
||||||
foreach ($grid['variables'] AS $vid => $variable ){
|
|
||||||
$_tmp_filter .= $_prfx.$variable['sequence'];
|
|
||||||
$_prfx = ',';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$svp_pv[$spid] = $spid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# prilagodimo array profilov variabel
|
# če imamo sistemski email ali telefon, ime, priimek (v header je nastavljno "hide_system" = 1)
|
||||||
self::$_SVP_PV = $svp_pv;
|
# potem v odvisnosti od nastavitve prikazujemo samo navadne podatke ali pa samo te sistemske, zaradizaščite podatkov
|
||||||
if ($_tmp_filter != '')
|
$_sistemski = false;
|
||||||
{
|
if (!self::$_VARS[VAR_SHOW_SYSTEM] && self::$_HEADERS[$_svp_pv]['hide_system'] == '1') {
|
||||||
|
# prikazujemo samo nesistemske (nezaščitene)
|
||||||
|
unset(self::$_HEADERS[$_svp_pv]);
|
||||||
|
} else if (self::$_VARS[VAR_SHOW_SYSTEM] && self::$_HEADERS[$_svp_pv]['hide_system'] !== '1') {
|
||||||
|
# prikazujemo samo sistemske (zaščitene) podatke
|
||||||
|
unset(self::$_HEADERS[$_svp_pv]);
|
||||||
|
} else {
|
||||||
|
# če ne dodamo
|
||||||
|
$svp_pv[$_svp_pv] = $_svp_pv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#status - če smo v meta ali imamo profil vse enote
|
||||||
|
if ( (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
|
||||||
|
|| ( $ssp_pid = SurveyStatusProfiles::getCurentProfileId() == 1 )) {
|
||||||
|
$svp_pv['status'] = 'status';
|
||||||
|
self::$lineoffset++;
|
||||||
|
}
|
||||||
|
|
||||||
|
#lurker
|
||||||
|
if ( (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
|
||||||
|
|| ( $ssp_pid = SurveyStatusProfiles::getCurentProfileId() == 1 )) {
|
||||||
|
// dodamo v array da se prikazujejo tudi ti stolpci
|
||||||
|
$svp_pv['lurker'] = 'lurker';
|
||||||
|
self::$lineoffset++;
|
||||||
|
}
|
||||||
|
# ustreznost
|
||||||
|
if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
|
||||||
|
// dodamo v array da se prikazujejo tudi ti stolpci
|
||||||
|
$svp_pv['relevance'] = 'relevance';
|
||||||
|
self::$lineoffset++;
|
||||||
|
}
|
||||||
|
|
||||||
|
# email tion
|
||||||
|
#email prikazujemo skupaj z ustreznostjo
|
||||||
|
if ( self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
|
||||||
|
// dodamo v array da se prikazujejo tudi ti stolpci
|
||||||
|
$svp_pv['invitation'] = 'invitation';
|
||||||
|
self::$lineoffset++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset(self::$_HEADERS['testdata'])) {
|
||||||
|
self::$_HAS_TEST_DATA = true;
|
||||||
|
$svp_pv['testdata'] = 'testdata';
|
||||||
|
self::$lineoffset++;
|
||||||
|
}
|
||||||
|
# $svp_pv['unx_ins_date'] = 'unx_ins_date';
|
||||||
|
|
||||||
|
if (self::$_VARS[VAR_METAFULL] && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
|
||||||
|
# dodamo tudi special meta
|
||||||
|
$svp_pv['meta'] = 'meta';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (self::$showItime == true) {
|
||||||
|
$svp_pv['itime'] = 'itime';
|
||||||
|
self::$lineoffset++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ce imamo vklopljene sistemske ne smemo povezovat podatkov in zato urejamo po abecedi
|
||||||
|
if(self::$_VARS[VAR_SHOW_SYSTEM]){
|
||||||
|
|
||||||
|
$hasEmail = false;
|
||||||
|
|
||||||
|
// Poiscemo sekvenco sistemske spremenljivke
|
||||||
|
foreach (self::$_HEADERS AS $spr => $spremenljivka) {
|
||||||
|
if (isset($spremenljivka['sistem']) && $spremenljivka['sistem'] == 1 && $spremenljivka['variable'] == 'email') {
|
||||||
|
$sequence = $spremenljivka['sequences'];
|
||||||
|
$hasEmail = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($hasEmail){
|
||||||
|
# sortiramo
|
||||||
|
self::$do_sort = true;
|
||||||
|
|
||||||
|
# nastavimo po kateri sekvenci / stolpcu sortiramo
|
||||||
|
self::$sort_seq = $sequence;
|
||||||
|
|
||||||
|
self::$sort_type = 'sort_asc';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
self::getQuestionCount();
|
||||||
|
if (self::$_VARS[VAR_SPR_LIMIT] > self::$_ALL_QUESTION_COUNT) {
|
||||||
|
self::$_VARS[VAR_SPR_LIMIT] = 'all';
|
||||||
|
}
|
||||||
|
|
||||||
|
$spr_cont = 0; // za paginacijo spremenljivk
|
||||||
|
|
||||||
|
if(self::$_VARS['spr_limit'] == 'all'){
|
||||||
|
$_spr_on_pages_start = 0;
|
||||||
|
$_spr_on_pages_stop = self::$_VARS['spr_page'];
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$_spr_on_pages_start = self::$_VARS['spr_page'] * self::$_VARS['spr_limit'] - self::$_VARS['spr_limit'];
|
||||||
|
$_spr_on_pages_stop = self::$_VARS['spr_page'] * self::$_VARS['spr_limit'];
|
||||||
|
}
|
||||||
|
|
||||||
|
# skreiramo filter variabel za podatke
|
||||||
|
if (count(self::$_HEADERS) > 0) {
|
||||||
|
// zloopamo skozi spremenljivke in sestavimo filter po stolpcih
|
||||||
|
$_tmp_filter = '';
|
||||||
|
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
|
||||||
|
if (isset($svp_pv[$spid])) {
|
||||||
|
// paginacija spremenljivk
|
||||||
|
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
|
||||||
|
if (count($spremenljivka['grids']) > 0 ) {
|
||||||
|
foreach ($spremenljivka['grids'] AS $gid => $grid) {
|
||||||
|
if (count ($grid['variables']) > 0) {
|
||||||
|
foreach ($grid['variables'] AS $vid => $variable ){
|
||||||
|
$_tmp_filter .= $_prfx.$variable['sequence'];
|
||||||
|
$_prfx = ',';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // end: paginacija spremenljivk
|
||||||
|
$spr_cont++;
|
||||||
|
} else
|
||||||
|
# če prikazujemo samo sistemske
|
||||||
|
if ( self::$_VARS[VAR_SHOW_SYSTEM] && in_array($spremenljivka['variable'], array('email','ime','priimek','telefon','naziv','drugo','odnos'))) {
|
||||||
|
if (count($spremenljivka['grids']) > 0 ) {
|
||||||
|
foreach ($spremenljivka['grids'] AS $gid => $grid) {
|
||||||
|
if (count ($grid['variables']) > 0) {
|
||||||
|
foreach ($grid['variables'] AS $vid => $variable ){
|
||||||
|
$_tmp_filter .= $_prfx.$variable['sequence'];
|
||||||
|
$_prfx = ',';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$svp_pv[$spid] = $spid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# prilagodimo array profilov variabel
|
||||||
|
self::$_SVP_PV = $svp_pv;
|
||||||
|
if ($_tmp_filter != ''){
|
||||||
self::$_VARIABLE_FILTER = $_tmp_filter;
|
self::$_VARIABLE_FILTER = $_tmp_filter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Prikaže filtre za število podatkov....
|
/** Prikaže filtre za število podatkov....
|
||||||
|
Loading…
x
Reference in New Issue
Block a user