0){ $this->anketa = $anketa; SurveyAnalysisHelper::getInstance()->Init($this->anketa); # polovimo vrsto tabel (aktivne / neaktivne) SurveyInfo :: getInstance()->SurveyInit($this->anketa); if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) { $this->db_table = '_active'; } $this->_CURRENT_STATUS_FILTER = STATUS_FIELD.' ~ /6|5/'; Common::deletePreviewData($this->anketa); // Poskrbimo za datoteko s podatki $SDF = SurveyDataFile::get_instance(); $SDF->init($this->anketa); if($generateDataFile) $SDF->prepareFiles(); $this->headFileName = $SDF->getHeaderFileName(); $this->dataFileName = $SDF->getDataFileName(); $this->dataFileStatus = $SDF->getStatus(); if ($this->dataFileStatus == FILE_STATUS_NO_DATA || $this->dataFileStatus == FILE_STATUS_SRV_DELETED) { Common::noDataAlert(); exit(); } # Inicializiramo in polovimo nastavitve missing profila SurveyStatusProfiles::Init($this->anketa); SurveyUserSetting::getInstance()->Init($this->anketa, $global_user_id); SurveyConditionProfiles :: Init($this->anketa, $global_user_id); SurveyTimeProfiles :: Init($this->anketa, $global_user_id); SurveyVariablesProfiles :: Init($this->anketa, $global_user_id); SurveyDataSettingProfiles :: Init($this->anketa); // preberemo nastavitve iz baze (prej v sessionu) SurveyUserSession::Init($this->anketa); $this->sessionData = SurveyUserSession::getData(); if(isset($_SESSION['sid_'.$this->anketa]['usabilityIcons_settings'])) $this->displayEditIconsSettings = ($_SESSION['sid_'.$this->anketa]['usabilityIcons_settings']); if ($this->headFileName !== null && $this->headFileName != ''){ $this->_HEADERS = unserialize(file_get_contents($this->headFileName)); } # nastavimo vse filtre $this->setUpFilter(); # nastavimo filtre uporabnika $this->setUserFilters(); # nastavimo sortiranje if(isset($_GET['sortField'])) $this->sortField = $_GET['sortField']; if(isset($_GET['sortType'])) $this->sortType = $_GET['sortType']; } else { echo 'Invalid Survey ID!'; exit(); } } public function getMissings(){ return $this->_missings; } public function getUnsets(){ return $this->_unsets; } public function getColsWithValue(){ return $this->cols_with_value; } public function showCalculations(){ return $this->show_calculations; } public function showDetails(){ return $this->show_details; } public function showWithZero(){ return $this->show_with_zero; } function displayTable(){ global $lang; # ali imamo testne podatke if ($this->_HAS_TEST_DATA){ # izrišemo bar za testne podatke $SSH = new SurveyStaticHtml($this->anketa); $SSH -> displayTestDataBar(true); } // Izracunamo vse podatke $usability = $this->calculateData(); //podatki po respondentih $userData = $usability['data']; $vars = $this->calculateDataVars($userData[1]['usr_id']); //podatki po spremenljivkah if($_GET['m'] == A_REMINDER_TRACKING_RECNUM){ //ce je prikaz po respondentih $this->sortField = 'recnum'; } else if($_GET['m'] == A_REMINDER_TRACKING_VAR){ //ce je prikaz po spremenljivkah $this->sortField = 'vars'; } // Sortiramo podatke foreach ($userData as $key => $row) { $mid[$key] = $row[$this->sortField]; } if($this->sortType == 0) array_multisort($mid, SORT_ASC, $userData); else array_multisort($mid, SORT_DESC, $userData); # ali odstranimo stolpce kateri imajo same 0 if ($this->show_with_zero == false) { # odstranimo missinge brez vrednosti foreach ($this->_missings AS $_key => $_missing) { if (!isset($this->cols_with_value[$_key]) || $this->cols_with_value[$_key] == false) { unset($this->_missings[$_key]); } } # odstranimo neveljavne brez vrednosti foreach ($this->_unsets AS $_key => $_unset) { if (!isset($this->cols_with_value[$_key]) || $this->cols_with_value[$_key] == false) { unset($this->_unsets[$_key]); } } } if($_GET['m'] == A_REMINDER_TRACKING_RECNUM){ //ce je prikaz po respondentih echo '

'.$lang['srv_reminder_tracking_title_recnum'].'

'; $naslovStolpecMoznaOpozorila = $lang['srv_reminder_tracking_possible_errors_resp']; } else if($_GET['m'] == A_REMINDER_TRACKING_VAR){ //ce je prikaz po spremenljivkah echo '

'.$lang['srv_reminder_tracking_title_vars'].'

'; $naslovStolpecMoznaOpozorila = $lang['srv_reminder_tracking_possible_errors_var']; } echo '
show_details==true && $this->show_calculations==true ? '' : ' style="width:100%"').'>'; // Header row echo ''; if($this->sortType == 1){ $sortType = 0; $arrow = ' '; } else{ $sortType = 1; $arrow = ' '; } if($_GET['m'] == A_REMINDER_TRACKING_RECNUM){ //ce je prikaz po respondentih echo ''; //$qualityRowSpan = count($userData) + 2; $qualityRowSpan = count($userData) + 3; $numOf = count($userData); } else if($_GET['m'] == A_REMINDER_TRACKING_VAR){ //ce je prikaz po spremenljivkah //echo ''; echo ''; //$qualityRowSpan = count($vars) + 2; $qualityRowSpan = count($vars) + 3; $numOf = count($vars); } //echo ''; //Obvezna vprasanja echo ''; //echo ''; //Vnos stevil echo ''; //echo ''; //Vsota stevil echo ''; //echo ''; //Validacije echo ''; echo ''; //naslov stolpca "Število možnih opozoril" echo ''; //naslov stolpca "Vsota sprozenih opozoril" echo ''; //naslov stolpca "Stevilo sprozenih opozoril" //$qualityRowSpan = count($userData) + 2; echo ''; echo ''; // Header row - konec //Second title row echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; //Second title row - konec if($_GET['m'] == A_REMINDER_TRACKING_RECNUM) { //ce je prikaz po respondentih $sprozenaOpozorilaAll = 0; $sumObveznihVprasanjHard = 0; $sumObveznihVprasanjSoft = 0; $sumNumAlertHard = 0; $sumNumAlertSoft = 0; $sumSumAlertHard = 0; $sumSumAlertSoft = 0; $sumValidationHard = 0; $sumValidationSoft = 0; // Izpis podatkov vsakega respondenta foreach($userData as $key => $user){ // Prva vrstica z vrednostmi echo ''; echo ''; $sprozenaOpozorila = 0; $steviloVsehMoznihOpozoril= 0; // Alerti obveznih vprasanj Hard $this->izrisPodatka($user['rowHardAlert']); //$sprozenaOpozorila = $sprozenaOpozorila + $user['rowHardAlert']; if($user['rowHardAlert'] != 0){$sprozenaOpozorila++;} // Alerti obveznih vprasanj Soft $this->izrisPodatka($user['rowSoftAlert']); //$sprozenaOpozorila = $sprozenaOpozorila + $user['rowSoftAlert']; if($user['rowSoftAlert'] != 0){$sprozenaOpozorila++;} // Num Alerti Hard $this->izrisPodatka($user['rowNumHard']); //$sprozenaOpozorila = $sprozenaOpozorila + $user['rowNumHard']; if($user['rowNumHard'] != 0){$sprozenaOpozorila++;} // Num Alerti Soft $this->izrisPodatka($user['rowNumSoft']); //$sprozenaOpozorila = $sprozenaOpozorila + $user['rowNumSoft']; if($user['rowNumSoft'] != 0){$sprozenaOpozorila++;} // Sum Alerti Hard $this->izrisPodatka($user['rowSumHard']); //$sprozenaOpozorila = $user['rowSumHard']; if($user['rowSumHard'] != 0){$sprozenaOpozorila++;} // Sum Alerti Soft $this->izrisPodatka($user['rowSumSoft']); //$sprozenaOpozorila = $sprozenaOpozorila + $user['rowSumSoft']; if($user['rowSumSoft'] != 0){$sprozenaOpozorila++;} // Alerti Hard Validation $this->izrisPodatka($user['rowHardValidation']); //$sprozenaOpozorila = $sprozenaOpozorila + $user['rowHardValidation']; if($user['rowHardValidation'] != 0){$sprozenaOpozorila++;} // Alerti Soft Validation $this->izrisPodatka($user['rowSoftValidation']); //$sprozenaOpozorila = $sprozenaOpozorila + $user['rowSoftValidation']; if($user['rowSoftValidation'] != 0){$sprozenaOpozorila++;} //Izracun vsote sprozenih opozoril - po stolpcih //Alerti obveznih vprasanj $sumObveznihVprasanjHard = $sumObveznihVprasanjHard + $user['rowHardAlert']; $sumObveznihVprasanjSoft = $sumObveznihVprasanjSoft + $user['rowSoftAlert']; //Num Alerti $sumNumAlertHard = $sumNumAlertHard + $user['rowNumHard']; $sumNumAlertSoft = $sumNumAlertSoft + $user['rowNumSoft']; //Sum Alerti $sumSumAlertHard = $sumSumAlertHard + $user['rowSumHard']; $sumSumAlertSoft = $sumSumAlertSoft + $user['rowSumSoft']; //Alerti validation $sumValidationHard = $sumValidationHard + $user['rowHardValidation']; $sumValidationSoft = $sumValidationSoft + $user['rowSoftValidation']; //Izracun vsote sprozenih opozoril - po stolpcih - konec //Izracun stevila vseh moznih opozoril, ki ga potrebujemo za izracun kakovosti $steviloVsehMoznihOpozorilSumHard = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilSumHard'); $steviloVsehMoznihOpozorilSumSoft = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilSumSoft'); $steviloVsehMoznihOpozorilNumHard = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilNumHard'); $steviloVsehMoznihOpozorilNumSoft = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilNumSoft'); $steviloVsehMoznihOpozorilHard = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilHard'); $steviloVsehMoznihOpozorilSoft = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilSoft'); $steviloVsehMoznihOpozorilValHard = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilValHard'); $steviloVsehMoznihOpozorilValSoft = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilValSoft'); //$steviloVsehMoznihOpozoril = $steviloVsehMoznihOpozorilSumHard + $steviloVsehMoznihOpozorilSumSoft + $steviloVsehMoznihOpozorilNumHard + $steviloVsehMoznihOpozorilNumSoft + $steviloVsehMoznihOpozorilHard + $steviloVsehMoznihOpozorilSoft + $steviloVsehMoznihOpozorilValHard + $steviloVsehMoznihOpozorilValSoft; if($steviloVsehMoznihOpozorilSumHard != 0){$steviloVsehMoznihOpozoril++;} if($steviloVsehMoznihOpozorilSumSoft != 0){$steviloVsehMoznihOpozoril++;} if($steviloVsehMoznihOpozorilNumHard != 0){$steviloVsehMoznihOpozoril++;} if($steviloVsehMoznihOpozorilNumSoft != 0){$steviloVsehMoznihOpozoril++;} if($steviloVsehMoznihOpozorilHard != 0){$steviloVsehMoznihOpozoril++;} if($steviloVsehMoznihOpozorilSoft != 0){$steviloVsehMoznihOpozoril++;} if($steviloVsehMoznihOpozorilValHard != 0){$steviloVsehMoznihOpozoril++;} if($steviloVsehMoznihOpozorilValSoft != 0){$steviloVsehMoznihOpozoril++;} //Izracun stevila vseh moznih opozoril, ki ga potrebujemo za izracun kakovosti - konec //Stevilo moznih opozoril $steviloMoznihOpozorilPoResp = $steviloVsehMoznihOpozorilSumHard + $steviloVsehMoznihOpozorilSumSoft + $steviloVsehMoznihOpozorilNumHard + $steviloVsehMoznihOpozorilNumSoft + $steviloVsehMoznihOpozorilHard + $steviloVsehMoznihOpozorilSoft + $steviloVsehMoznihOpozorilValHard + $steviloVsehMoznihOpozorilValSoft; $this->izrisPodatka($steviloMoznihOpozorilPoResp, 1); //Stevilo moznih opozoril - konec //Izracun vsote sprozenih opozoril - po vrsticah $vsotaSprozenihOpozoril = $user['rowHardAlert'] + $user['rowSoftAlert'] + $user['rowNumHard'] + $user['rowNumSoft'] + $user['rowSumHard'] + $user['rowSumSoft'] + $user['rowHardValidation'] + $user['rowSoftValidation'] ; //Izracun vsote sprozenih opozoril - po vrsticah - konec echo '';*/ echo ''; $sprozenaOpozorilaAll = $sprozenaOpozorilaAll + $sprozenaOpozorila; } } else if($_GET['m'] == A_REMINDER_TRACKING_VAR) { //ce je prikaz po spremenljivkah $sprozenaOpozorilaAll = 0; $sumObveznihVprasanjHard = 0; $sumObveznihVprasanjSoft = 0; $sumNumAlertHard = 0; $sumNumAlertSoft = 0; $sumSumAlertHard = 0; $sumSumAlertSoft = 0; $sumValidationHard = 0; $sumValidationSoft = 0; $varsData = array(); // Izpis podatkov za vsako spremenljivko foreach($vars as $key => $var){ // Prva vrstica z vrednostmi echo ''; //echo ''; echo ''; //echo ''; $sprozenaOpozorila = 0; $steviloVsehMoznihOpozoril= 0; //Alerti obveznih vprasanj Hard $this->izrisPodatka($var['rowHardAlert']); if($var['rowHardAlert'] != 0){$sprozenaOpozorila++;} // Alerti obveznih vprasanj Soft $this->izrisPodatka($var['rowSoftAlert']); if($var['rowSoftAlert'] != 0){$sprozenaOpozorila++;} // Num Alerti Hard $this->izrisPodatka($var['rowNumHard']); if($var['rowNumHard'] != 0){$sprozenaOpozorila++;} // Num Alerti Soft $this->izrisPodatka($var['rowNumSoft']); if($var['rowNumSoft'] != 0){$sprozenaOpozorila++;} // Sum Alerti Hard $this->izrisPodatka($var['rowSumHard']); if($var['rowSumHard'] != 0){$sprozenaOpozorila++;} // Sum Alerti Soft $this->izrisPodatka($var['rowSumSoft']); if($var['rowSumSoft'] != 0){$sprozenaOpozorila++;} // Alerti Hard Validation $this->izrisPodatka($var['rowHardValidation']); if($var['rowHardValidation'] != 0){$sprozenaOpozorila++;} // Alerti Soft Validation $this->izrisPodatka($var['rowSoftValidation']); if($var['rowSoftValidation'] != 0){$sprozenaOpozorila++;} //echo ''; //Izracun vsote sprozenih opozoril - po stolpcih //Alerti obveznih vprasanj $sumObveznihVprasanjHard = $sumObveznihVprasanjHard + $var['rowHardAlert']; $sumObveznihVprasanjSoft = $sumObveznihVprasanjSoft + $var['rowSoftAlert']; //Num Alerti $sumNumAlertHard = $sumNumAlertHard + $var['rowNumHard']; $sumNumAlertSoft = $sumNumAlertSoft + $var['rowNumSoft']; //Sum Alerti $sumSumAlertHard = $sumSumAlertHard + $var['rowSumHard']; $sumSumAlertSoft = $sumSumAlertSoft + $var['rowSumSoft']; //Alerti validation $sumValidationHard = $sumValidationHard + $var['rowHardValidation']; $sumValidationSoft = $sumValidationSoft + $var['rowSoftValidation']; //Izracun vsote sprozenih opozoril - po stolpcih - konec //Izracun stevila vseh moznih opozoril, ki ga potrebujemo za izracun kakovosti $steviloVsehMoznihOpozorilSumHard = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilSumHard'); $steviloVsehMoznihOpozorilSumSoft = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilSumSoft'); $steviloVsehMoznihOpozorilNumHard = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilNumHard'); $steviloVsehMoznihOpozorilNumSoft = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilNumSoft'); $steviloVsehMoznihOpozorilHard = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilHard'); $steviloVsehMoznihOpozorilSoft = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilSoft'); $steviloVsehMoznihOpozorilValHard = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilValHard'); $steviloVsehMoznihOpozorilValSoft = $this->steviloMoznihOpozoril($vars, 'steviloVsehMoznihOpozorilValSoft'); if($steviloVsehMoznihOpozorilSumHard != 0){$steviloVsehMoznihOpozoril++; } if($steviloVsehMoznihOpozorilSumSoft != 0){$steviloVsehMoznihOpozoril++; } if($steviloVsehMoznihOpozorilNumHard != 0){$steviloVsehMoznihOpozoril++; } if($steviloVsehMoznihOpozorilNumSoft != 0){$steviloVsehMoznihOpozoril++; } if($steviloVsehMoznihOpozorilHard != 0){$steviloVsehMoznihOpozoril++; } if($steviloVsehMoznihOpozorilSoft != 0){$steviloVsehMoznihOpozoril++; } if($steviloVsehMoznihOpozorilValHard != 0){$steviloVsehMoznihOpozoril++; } if($steviloVsehMoznihOpozorilValSoft != 0){$steviloVsehMoznihOpozoril++; } //Izracun stevila vseh moznih opozoril, ki ga potrebujemo za izracun kakovosti - konec //Izracun stevila moznih opozoril po var //echo ''; $steviloMoznihOpozorilPoVar = $var['steviloVsehMoznihOpozorilSumHard'] + $var['steviloVsehMoznihOpozorilSumSoft'] + $var['steviloVsehMoznihOpozorilNumHard'] + $var['steviloVsehMoznihOpozorilNumSoft'] + $var['steviloVsehMoznihOpozorilHard'] + $var['steviloVsehMoznihOpozorilSoft'] + $var['steviloVsehMoznihOpozorilValHard'] + $var['steviloVsehMoznihOpozorilValSoft']; $this->izrisPodatka($steviloMoznihOpozorilPoVar, 1); //Izracun stevila moznih opozoril po var - konec //Izracun vsote sprozenih opozoril - po vrsticah $vsotaSprozenihOpozoril = $var['rowHardAlert'] + $var['rowSoftAlert'] + $var['rowNumHard'] + $var['rowNumSoft'] + $var['rowSumHard'] + $var['rowSumSoft'] + $var['rowHardValidation'] + $var['rowSoftValidation'] ; //Izracun vsote sprozenih opozoril - po vrsticah - konec echo ''; $sprozenaOpozorilaAll = $sprozenaOpozorilaAll + $sprozenaOpozorila; } } //predzadnja vrstica preglednice, ki prikazuje sprozenih opozoril po stolpcih echo ''; //echo ''; //stevilo moznih opozoril po stolpih echo ''; //echo ''; //1. stolpec - Vsota obveznih vprasanj Hard echo ''; //1. stolpec - Vsota obveznih vprasanj Hard - konec //2. stolpec - Vsota obveznih vprasanj Soft echo ''; //2. stolpec - Vsota obveznih vprasanj Soft - konec //3. stolpec - Vsota Num opozorila Hard echo ''; //3. stolpec - Vsota Num opozorila Hard - konec //4. stolpec - Vsota Num opozorila Soft echo ''; //4. stolpec - Vsota Num opozorila Soft - konec //5. stolpec - Vsota Sum opozorila Hard echo ''; //5. stolpec - Vsota Sum opozorila Hard - konec //6. stolpec - Vsota Sum opozorila Soft echo ''; //6. stolpec - Vsota Sum opozorila Soft - konec //7. stolpec - Vsota Validacije Hard echo ''; //7. stolpec - Vsota Validacije Hard - konec //8. stolpec - Vsota Validacije Soft echo ''; //8. stolpec - Vsota Validacije Soft - konec /* //9. stolpec - Vsota vseh moznih opozoril echo ''; //9. stolpec - Vsota vseh moznih opozoril - konec */ //9. stolpec - Stevilo moznih opozoril po vrsticah //echo ''; echo ''; //9. stolpec - Stevilo moznih opozoril po vrsticah - konec */ //10. stolpec - Stevilo moznih opozoril po vrsticah //echo ''; echo ''; //10. stolpec - Stevilo moznih opozoril po vrsticah - konec */ //11. stolpec - Prikaz stevila vseh sprozenih opozoril in vseh moznih opozoril echo ''; //11. stolpec - Prikaz stevila vseh sprozenih opozoril in vseh moznih opozoril - konec echo ''; //predzadnja vrstica preglednice, ki prikazuje sprozenih opozoril po stolpcih - konec //zadnja vrstica preglednice, ki prikazuje stevilo vseh moznih opozoril echo ''; //echo ''; //stevilo moznih opozoril po stolpih echo ''; //echo ''; //1. stolpec - Opozorila obveznih vprasanj Hard echo ''; //1. stolpec - Opozorila obveznih vprasanj Hard - konec //2. stolpec - Opozorila obveznih vprasanj Soft echo ''; //2. stolpec - Opozorila obveznih vprasanj Soft - konec //3. stolpec - Num opozorila Hard echo ''; //3. stolpec - Num opozorila Hard - konec //4. stolpec - Num opozorila Soft echo ''; //4. stolpec - Num opozorila Soft - konec //5. stolpec - Sum opozorila Hard echo ''; //5. stolpec - Sum opozorila Hard - konec //6. stolpec - Sum opozorila Soft echo ''; //6. stolpec - Sum opozorila Soft - konec //7. stolpec - Validacije Hard echo ''; //7. stolpec - Validacije Hard - konec //8. stolpec - Validacije Soft echo ''; //8. stolpec - Validacije Soft - konec /* //9. stolpec - Vsota vseh moznih opozoril echo ''; //9. stolpec - Vsota vseh moznih opozoril - konec */ //9. stolpec - Stevilo moznih opozoril po vrsticah //echo ''; echo ''; //9. stolpec - Stevilo moznih opozoril po vrsticah - konec */ //10. stolpec - Vsota sprozenih echo ''; //10. stolpec - Vsota sprozenih - konec //11. stolpec - Prikaz stevila vseh sprozenih opozoril in vseh moznih opozoril echo ''; //11. stolpec - Prikaz stevila vseh sprozenih opozoril in vseh moznih opozoril - konec //Izracun in prikazovanje kakovosti //$kakovost = $this->izracunKakovosti(count($userData), $sprozenaOpozorilaAll, $steviloVsehMoznihOpozoril); $kakovost = $this->izracunKakovosti($numOf, $sprozenaOpozorilaAll, $steviloVsehMoznihOpozoril); $kakovost = SurveyAnalysis::formatNumber($kakovost, 3,''); echo ''; //Izracun in prikazovanje kakovosti - konec echo ''; //zadnja vrstica preglednice, ki prikazuje stevilo vseh moznih opozoril - konec echo '
Recnum'./*$lang['recnum'].*/($this->sortField=='recnum' ? $arrow : '').'Spremenljivka'./*$lang['recnum'].*/($this->sortField=='vars' ? $arrow : '').'VprašanjeOpozorila obveznih vprašanj'.$lang['srv_reminder_tracking_question'].'Num opozorila'.$lang['srv_reminder_tracking_num'].'Sum opozorila'.$lang['srv_reminder_tracking_sum'].'Validacije'.$lang['srv_reminder_tracking_validation'].''.$naslovStolpecMoznaOpozorila.''.$lang['srv_reminder_tracking_sum_of_errors'].''.$lang['srv_reminder_tracking_activated_errors'].''.$lang['srv_reminder_tracking_quality'].' '.Help::display('srv_reminder_tracking_quality').'
'.$lang['srv_reminder_tracking_hard'].''.$lang['srv_reminder_tracking_soft'].''.$lang['srv_reminder_tracking_hard'].''.$lang['srv_reminder_tracking_soft'].''.$lang['srv_reminder_tracking_hard'].''.$lang['srv_reminder_tracking_soft'].''.$lang['srv_reminder_tracking_hard'].''.$lang['srv_reminder_tracking_soft'].'
'.$user['recnum'].''.$vsotaSprozenihOpozoril; //Vsota sprozenih opozoril echo ''.$sprozenaOpozorila; //Stevilo sprozenih opozoril /* //Izracun in prikazovanje kakovosti $kakovost = $this->izracunKakovosti(count($userData), $sprozenaOpozorila, $steviloVsehMoznihOpozoril); $kakovost = SurveyAnalysis::formatNumber($kakovost, 3,''); echo ''.$kakovost; //Izracun in prikazovanje kakovosti - konec echo '
'.$var['spr_id'].''.$var['variable'].''.$var['variable'].' '.count($vars).''.$sprozenaOpozorila; //echo '
'.$vsotaSprozenihOpozoril; //Vsota sprozenih opozoril echo ''.$sprozenaOpozorila; //Stevilo sprozenih opozoril echo '
Možnih opozoril za celotno anketo'.$lang['srv_reminder_tracking_sum_of_errors'].' '.$this->anketa.' '.$sumObveznihVprasanjHard.' '.$sumObveznihVprasanjSoft.' '.$sumNumAlertHard.' '.$sumNumAlertSoft.' '.$sumSumAlertHard.' '.$sumSumAlertSoft.' '.$sumValidationHard.' '.$sumValidationSoft.' '.$steviloVsehMoznihOpozoril.' '.$steviloMoznihOpozorilPoVrsticah.' '.$steviloMoznihOpozorilPoVrsticah.'
Možnih opozoril za celotno anketo'.$lang['srv_reminder_tracking_possible_errors'].' '.$this->anketa.' '.$steviloVsehMoznihOpozorilHard.' '.$steviloVsehMoznihOpozorilSoft.' '.$steviloVsehMoznihOpozorilNumHard.' '.$steviloVsehMoznihOpozorilNumSoft.' '.$steviloVsehMoznihOpozorilSumHard.' '.$steviloVsehMoznihOpozorilSumSoft.' '.$steviloVsehMoznihOpozorilValHard.' '.$steviloVsehMoznihOpozorilValSoft.' '.$steviloVsehMoznihOpozoril.' '.$steviloMoznihOpozorilPoVrsticah.' '.$sprozenaOpozorilaAll.'/'.$steviloVsehMoznihOpozoril.''.$kakovost; echo '
'; echo '
'; } //metoda, ki skrbi za izbiro sloga podatka v preglednici private function izrisPodatka($podatek, $stolpec1=0){ if ($podatek != 0){ //ce je podatek razlicen od 0 if($stolpec1){ $redBg = ''; }else{ $redBg = ' redCell'; } //$slog = 'data sum bold'; //naj bo slog bold //$slog = 'data sum bold red'; //naj bo slog bold in stevilke rdece barve $slog = 'data bold'.$redBg; //naj bo slog bold in ozadje celice rdece barve, ce niso celice zadnjega stolpca }else{ $slog = 'data'; } echo ''.$podatek.''; } function displayUsableSettings(){ global $lang; // Div z nastavitvami ki se razpre echo '
displayEditIconsSettings ? '' : ' style="display:none;"').'>'; echo '
'.$lang['srv_data_settings_checkboxes2'].'
'; echo '
'; echo $lang['srv_usableResp_limit'].': '; echo ''.$lang['srv_usableResp_bottom_limit'].': %'; echo ''.$lang['srv_usableResp_top_limit'].': %'; echo '
'; echo '
'; echo $lang['srv_usableResp_show'].': '; // Prikaz neničelnih stolpcev echo ''; // Prikaz podrobnosti echo ''; // Prikaz podrobnih izracunov echo ''; echo '
'; echo '
'; echo '
'; } /** Funkcija ki nastavi vse filtre * */ private function setUpFilter(){ /*if ($this->dataFileStatus == FILE_STATUS_NO_DATA || $this->dataFileStatus == FILE_STATUS_NO_FILE || $this->dataFileStatus == FILE_STATUS_SRV_DELETED) { return false; }*/ # poiščemo kater profil uporablja uporabnik $_currentMissingProfile = SurveyUserSetting :: getInstance()->getSettings('default_missing_profile'); $this->currentMissingProfile = (isset($_currentMissingProfile) ? $_currentMissingProfile : 1); # filtriranje po statusih $this->_CURRENT_STATUS_FILTER = SurveyStatusProfiles :: getStatusAsAWKString(); # filtriranje po časih $_time_profile_awk = SurveyTimeProfiles :: getFilterForAWK($this->_HEADERS['unx_ins_date']['grids']['0']['variables']['0']['sequence']); # dodamo še ife SurveyConditionProfiles :: setHeader($this->_HEADERS); $_condition_profile_AWK = SurveyConditionProfiles:: getAwkConditionString(); if (($_condition_profile_AWK != "" && $_condition_profile_AWK != null ) || ($_time_profile_awk != "" && $_time_profile_awk != null)) { $this->_CURRENT_STATUS_FILTER = '('.$this->_CURRENT_STATUS_FILTER; if ($_condition_profile_AWK != "" && $_condition_profile_AWK != null ) { $this->_CURRENT_STATUS_FILTER .= ' && '.$_condition_profile_AWK; } if ($_time_profile_awk != "" && $_time_profile_awk != null) { $this->_CURRENT_STATUS_FILTER .= ' && '.$_time_profile_awk; } $this->_CURRENT_STATUS_FILTER .= ')'; } $status_filter = $this->_CURRENT_STATUS_FILTER; if ($this->dataFileStatus == FILE_STATUS_OK || $this->dataFileStatus == FILE_STATUS_OLD) { if (isset($this->_HEADERS['testdata'])) { $this->_HAS_TEST_DATA = true; } } $smv = new SurveyMissingValues($this->anketa); $smv -> Init(); $smv_array = $smv->GetSurveyMissingValues($this->anketa); if (!empty($smv_array[1])){ foreach ($smv_array[1] AS $_survey_missings) { $this->_missings[$_survey_missings['value']] = $_survey_missings['text']; } } if (!empty($smv_array[2])){ foreach ($smv_array[2] AS $_survey_unsets) { $this->_unsets[$_survey_unsets['value']] = $_survey_unsets['text']; } } } private function setUserFilters(){ # Nastavimo filtre variabel $dvp = SurveyUserSetting :: getInstance()->getSettings('default_variable_profile'); $_currentVariableProfile = SurveyVariablesProfiles :: checkDefaultProfile($dvp); if ($dvp != $_currentVariableProfile) { SurveyUserSetting :: getInstance()->saveSettings('default_variable_profile', $_currentVariableProfile); } $this->_PROFILE_ID_VARIABLE = $_currentVariableProfile; # ali prikazujemo tudi stolpce z 0 vrednostmi if (isset($this->sessionData['usable_resp']['show_with_zero'])) { $this->show_with_zero = $this->sessionData['usable_resp']['show_with_zero']; } # ali prikazujemo tudi stolpce z 0 vrednostmi if (isset($this->sessionData['usable_resp']['show_details'])) { $this->show_details = $this->sessionData['usable_resp']['show_details']; } # ali prikazujemo tudi stolpce z izracuni if (isset($this->sessionData['usable_resp']['show_calculations'])) { $this->show_calculations = $this->sessionData['usable_resp']['show_calculations']; } # ali prikazujemo vrstice "Drugo" $this->show_with_other = true; if (isset($this->sessionData['usable_resp']['show_with_other'])) { $this->show_with_other = $this->sessionData['usable_resp']['show_with_other']; } # ali prikazujemo vrstice tipa "besedilo" $this->show_with_text = true; if (isset($this->sessionData['usable_resp']['show_with_text'])) { $this->show_with_text = $this->sessionData['usable_resp']['show_with_text']; } # Spodnja in zgornja meja za usable if (isset($this->sessionData['usable_resp']['bottom_usable_limit'])) { $this->bottom_usable_limit = $this->sessionData['usable_resp']['bottom_usable_limit']; } # ali prikazujemo tudi stolpce z 0 vrednostmi if (isset($this->sessionData['usable_resp']['top_usable_limit'])) { $this->top_usable_limit = $this->sessionData['usable_resp']['top_usable_limit']; } } // Zgeneriramo datoteko in izracunamo frekvence (stevilo 1, -1, -2...) za vsako enoto private function collectData(){ global $site_path; # polovimo frekvence statusov odgovorov za posameznega respondenta (stevilo -1, -2...) $folder = $site_path . EXPORT_FOLDER.'/'; #array za imeni tmp fajlov, ki jih nato izbrišemo $tmp_file = $folder.'tmp_export_'.$this->anketa.'_reminder_tracking_recnum.php'; # pobrišemo sfiltrirane podatke, ker jih več ne rabimo if (file_exists($tmp_file)) { unlink($tmp_file); } $status_filter = $this->_CURRENT_STATUS_FILTER; # s katero sekvenco se začnejo podatki, da ne delamo po nepotrebnem za ostala polja $start_sequence = $this->_HEADERS['_settings']['dataSequence']; # s katero sekvenco se končajo podatki da ne delamo po nepotrebnem za ostala polja $end_sequence = $this->_HEADERS['_settings']['metaSequence']-1; # sekvenca recnuma $recnum_sequence = $this->_HEADERS['recnum']['sequences']; # naredimo datoteko z frekvencami # za windows sisteme in za linux sisteme if (IS_WINDOWS ) { # združimo v eno vrstico da bo strežnik bol srečen $command = 'awk -F"|" "{{OFS=\"\x7C\"} {ORS=\"\n\"} {FS=\"\x7C\"} {SUBSEP=\"\x7C\"}} {{for (n in arr) {delete arr[n]}}} {delete arr} '.$status_filter.' {for (i='.$start_sequence.';i<='.$end_sequence.';i++) { arr[$i]++}} '.$status_filter.' {{for (n in arr) { print NR,$'.$recnum_sequence.',$1,n,arr[n]}}}" '.$this->dataFileName; $command .= ' | sed "s*\x27*`*g" '; $command .= ' | awk -F"|" "BEGIN {{OFS=\"\"} {ORS=\"\n\"}} { print \"$frequency[\",$1,\"]\",\"[\x27\",$4,\"\x27]\",\"=\",$5,\";\"} { print \"$frequency[\",$1,\"]\",\"[usr_id]\",\"=\",$3,\";\"} { print \"$frequency[\",$1,\"]\",\"[recnum]\",\"=\",$2,\";\"}" >> '.$tmp_file; } else { # združimo v eno vrstico da bo strežnik bol srečen $command = 'awk -F"|" \' {{OFS="|"} {ORS="\n"} {FS="|"} {SUBSEP="|"}} {{for (n in arr) {delete arr[n]}}} {delete arr} '.$status_filter.' {for (i='.$start_sequence.';i<='.$end_sequence.';i++) { arr[$i]++}} '.$status_filter.' {{for (n in arr) { print NR,$'.$recnum_sequence.',$1,n,arr[n]}}}\' '.$this->dataFileName; $command .= ' | sed \'s*\x27*`*g\' '; $command .= ' | awk -F"|" \'BEGIN {{OFS=""} {ORS="\n"}} { print "$frequency[",$1,"]","[\x27",$4,"\x27]","=\x27",$5,"\x27;"} { print "$frequency[",$1,"]","[usr_id]","=\x27",$3,"\x27;"} { print "$frequency[",$1,"]","[recnum]","=\x27",$2,"\x27;"}\' >> '.$tmp_file; } $file_handler = fopen($tmp_file,"w"); fwrite($file_handler,"'); fclose($file_handler); include($tmp_file); # pobrišemo sfiltrirane podatke, ker jih več ne rabimo if (file_exists($tmp_file)) { unlink($tmp_file); } // Loop cez podatke da vidimo kateri stolpci so prazni foreach ($frequency AS $seq => $freqData) { if (empty($freqData)) { continue; } foreach ($freqData AS $key => $cnt){ if (is_numeric($key) && (isset($this->_missings[(int)$key]) || isset($this->_unsets[(int)$key]))) $this->cols_with_value[(int)$key] += $cnt; elseif($key != 'recnum') $this->cols_with_value['valid'] += $cnt; } } return $frequency; } // Gremo cez enote in izracunamo uporabne vrednosti (uporabnost, breakoff...) public function calculateData(){ // Preko datoteke preberemo frekvence za posamezne userje (1, -1, -2...) $data = $this->collectData(); $ank_id = $this->anketa; $css = ''; $usability = array(); // Loop cez vse responente $counter = 1; foreach($data as $key1 => $frequencies){ // Prestejemo vse in veljavne $all = 0; $valid = 0; $usable = 0; // valid + nonsubstantive $nonsubstantive = 0; // -97,-98... $nonresponse = 0; // -1 $preskok = 0; // -2 $breakoff = 0; // -3 $naknadno = 0; // -4 $status = 0; // 0->unusable, 1->part. usable, 2->usable foreach($frequencies as $key => $cnt){ if(!array_key_exists($key, $this->_missings) && !array_key_exists($key, $this->_unsets) && $key!==''){ $valid += $cnt; $usable += $cnt; } if(array_key_exists($key, $this->_unsets)){ $nonsubstantive += $cnt; $usable += $cnt; } if($key == -1) $nonresponse += $cnt; if($key == -3) $breakoff+= $cnt; if($key == -2) $preskok+= $cnt; if($key == -4) $naknadno+= $cnt; $all += $cnt; } // odstejemo polje recnum $all -= $frequencies['recnum']; $valid -= $frequencies['recnum']; $usable -= $frequencies['recnum']; // odstejemo polje usr_id $all -= $frequencies['usr_id']; $valid -= $frequencies['usr_id']; $usable -= $frequencies['usr_id']; /* echo ' '; */ //*************************** Pobiranje in stetje alertov po respondentih ***************************************************** $user = $frequencies['usr_id']; //poberi stevilo hard in soft alertov za vsoto $sqlSumHard = sisplet_query("SELECT COUNT(d.usr_id) AS NumberOfSumHard FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE d.usr_id = '$user' AND d.ank_id='$ank_id' AND (a.type LIKE '%hard%' AND a.trigger_type = 'sum')"); $sqlSumSoft = sisplet_query("SELECT COUNT(d.usr_id) AS NumberOfSumSoft FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE d.usr_id = '$user' AND d.ank_id='$ank_id' AND (a.type LIKE '%soft%' AND a.trigger_type = 'sum')"); //poberi stevilo hard in soft alertov za stevilo $sqlNumHard = sisplet_query("SELECT COUNT(d.usr_id) AS NumberOfNumHard FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE d.usr_id = '$user' AND d.ank_id='$ank_id' AND (a.type LIKE '%hard%' AND a.trigger_type = 'num')"); $sqlNumSoft = sisplet_query("SELECT COUNT(d.usr_id) AS NumberOfNumSoft FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE d.usr_id = '$user' AND d.ank_id='$ank_id' AND (a.type LIKE '%soft%' AND a.trigger_type = 'num')"); //poberi stevilo hard in soft alertov $sqlHardAlert = sisplet_query("SELECT COUNT(d.usr_id) AS NumberOfHardAlert FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE d.usr_id = '$user' AND d.ank_id='$ank_id' AND trigger_type = 'har'"); $sqlSoftAlert = sisplet_query("SELECT COUNT(d.usr_id) AS NumberOfSoftAlert FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE d.usr_id = '$user' AND d.ank_id='$ank_id' AND trigger_type = 'sof'"); //poberi stevilo hard in soft validacij $sqlHardValidation = sisplet_query("SELECT COUNT(d.usr_id) AS NumberOfHardValidation FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE d.usr_id = '$user' AND d.ank_id='$ank_id' AND (a.type LIKE '%hard%' AND a.trigger_type = 'val')"); $sqlSoftValidation = sisplet_query("SELECT COUNT(d.usr_id) AS NumberOfSoftValidation FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE d.usr_id = '$user' AND d.ank_id='$ank_id' AND (a.type LIKE '%soft%' AND a.trigger_type = 'val')"); $rowSumHard = mysqli_fetch_assoc($sqlSumHard); $rowSumSoft = mysqli_fetch_assoc($sqlSumSoft); $rowNumHard = mysqli_fetch_assoc($sqlNumHard); $rowNumSoft = mysqli_fetch_assoc($sqlNumSoft); $rowHardAlert = mysqli_fetch_assoc($sqlHardAlert); $rowSoftAlert = mysqli_fetch_assoc($sqlSoftAlert); $rowHardValidation = mysqli_fetch_assoc($sqlHardValidation); $rowSoftValidation = mysqli_fetch_assoc($sqlSoftValidation); //************************************************************************************************************* po respondentih - konec //$validPercent = ($all > 0) ? ($valid / $all * 100) : 0; //$nonsubstantivePercent = ($valid + $nonsubstantive > 0) ? ($nonsubstantive / ($valid + $nonsubstantive) * 100) : 0; //$nonresponsePercent = ($valid + $nonsubstantive + $nonresponse > 0) ? ($nonresponse / ($valid + $nonsubstantive + $nonresponse) * 100) : 0; $validPercent = ($valid + $nonsubstantive + $nonresponse > 0) ? ($valid / ($valid + $nonsubstantive + $nonresponse) * 100) : 0; $nonsubstantivePercent = ($valid + $nonsubstantive + $nonresponse > 0) ? ($nonsubstantive / ($valid + $nonsubstantive + $nonresponse) * 100) : 0; $nonresponsePercent = ($valid + $nonsubstantive + $nonresponse > 0) ? ($nonresponse / ($valid + $nonsubstantive + $nonresponse) * 100) : 0; //$breakoffPercent = ($valid + $nonsubstantive + $nonresponse + $breakoff > 0) ? ($breakoff / ($valid + $nonsubstantive + $nonresponse + $breakoff) * 100) : 0; $breakoffPercent = $breakoff / $all * 100; //$usablePercent = ($valid + $nonsubstantive + $nonresponse + $breakoff > 0) ? ($usable / ($valid + $nonsubstantive + $nonresponse + $breakoff) * 100) : 0; // Posebni izracuni $UNL = (($valid + $nonsubstantive + $nonresponse) > 0) ? $nonresponse / ($valid + $nonsubstantive + $nonresponse) : 0; // Delez neodgovorov $UBL = ($all > 0) ? $breakoff / $all : 0; // Delez prekinitev $UML = $UBL + (1 - $UBL) * $UNL; $UCL = 1 - $UML; // Uporabnost $UIL = (($valid + $nonsubstantive + $nonresponse + $preskok) > 0) ? $preskok /($valid + $nonsubstantive + $nonresponse + $preskok) : 0; // Delez preskokov $UAQ = ($all > 0) ? $naknadno / $all : 0; // Delez naknadnih // Ce nimamo veljavnih in nevsebinskih je UCL vedno 0 $UCL = ($valid + $nonsubstantive == 0) ? 0 : $UCL; $usablePercent = $UCL * 100; if($usablePercent < (int)$this->bottom_usable_limit){ $css_usable = 'unusable'; $status = 0; $usability['unusable']++; } elseif($usablePercent >= (int)$this->bottom_usable_limit && $usablePercent < (int)$this->top_usable_limit){ $css_usable = 'partusable'; $status = 1; $usability['partusable']++; } else{ $css_usable = 'usable'; $status = 2; $usability['usable']++; } $usability['all']++; // Nastavimo izracunane podatke za respondenta $usability['data'][$counter]['recnum'] = $frequencies['recnum']; $usability['data'][$counter]['usr_id'] = $frequencies['usr_id']; $usability['data'][$counter]['css'] = $css; $usability['data'][$counter]['status'] = $status; $usability['data'][$counter]['all'] = $all; $usability['data'][$counter]['valid'] = $valid; $usability['data'][$counter]['nonsubstantive'] = $nonsubstantive; $usability['data'][$counter]['nonresponse'] = $nonresponse; $usability['data'][$counter]['breakoff'] = $breakoff; $usability['data'][$counter]['usable'] = $usable; $usability['data'][$counter]['validPercent'] = $validPercent; $usability['data'][$counter]['usablePercent'] = $usablePercent; $usability['data'][$counter]['nonsubstantivePercent'] = $nonsubstantivePercent; $usability['data'][$counter]['nonresponsePercent'] = $nonresponsePercent; $usability['data'][$counter]['breakoffPercent'] = $breakoffPercent; $usability['data'][$counter]['UNL'] = $UNL; $usability['data'][$counter]['UML'] = $UML; $usability['data'][$counter]['UCL'] = $UCL; $usability['data'][$counter]['UIL'] = $UIL; $usability['data'][$counter]['UAQ'] = $UAQ; //************ Za alerte ************ $usability['data'][$counter]['rowSumHard'] = $rowSumHard['NumberOfSumHard']; $usability['data'][$counter]['rowSumSoft'] = $rowSumSoft['NumberOfSumSoft']; $usability['data'][$counter]['rowNumHard'] = $rowNumHard['NumberOfNumHard']; $usability['data'][$counter]['rowNumSoft'] = $rowNumSoft['NumberOfNumSoft']; $usability['data'][$counter]['rowHardAlert'] = $rowHardAlert['NumberOfHardAlert']; $usability['data'][$counter]['rowSoftAlert'] = $rowSoftAlert['NumberOfSoftAlert']; $usability['data'][$counter]['rowHardValidation'] = $rowHardValidation['NumberOfHardValidation']; $usability['data'][$counter]['rowSoftValidation'] = $rowSoftValidation['NumberOfSoftValidation']; //*********************************** // ali odstranimo vse stolpce s podrobnimi vrednostmi (-1, -2...) foreach ($this->_missings AS $value => $text){ $usability['data'][$counter][$value] = (isset($frequencies[$value]) ? $frequencies[$value] : '0'); } foreach ($this->_unsets AS $value => $text){ $usability['data'][$counter][$value] = (isset($frequencies[$value]) ? $frequencies[$value] : '0'); } $css = ($css == 'colored') ? '' : 'colored'; $counter++; } return $usability; } private function calculateDataVars($usr_id){ global $site_path; $usability_vars = array(); //*************************** Pobiranje in stetje alertov po spremenljivkah ***************************************************** $defaultProfile = SurveyStatusProfiles::getDefaultProfile(); //ce je 1, imamo "Vse enota", ce je 2, imamo "Ustrezne" enote $ank_id = $this->anketa; $counter = 0; if($defaultProfile == 2){ //ce imamo "Ustrezne", najdi ne respondente $sql_lurkers_hard_alert = sisplet_query("SELECT id FROM srv_user WHERE ank_id = '$ank_id' and lurker = 1");//poberi podatki o lurker oz. ne respondentov while($row_lurkers_hard_alert = mysqli_fetch_array($sql_lurkers_hard_alert)){ /* echo' '; */ $lurkers = $lurkers.' and usr_id !='.$row_lurkers_hard_alert['id']; } /* echo' '; */ } $sql_spr_id = sisplet_query("SELECT element_spr FROM srv_branching WHERE ank_id = ".$ank_id); //poberi id spremenljivk while($row_spr_id = mysqli_fetch_array($sql_spr_id)){ $spr_id = $row_spr_id['element_spr']; if($spr_id){ //ce $spr_id ni nula $sql_spr_variable = sisplet_query("SELECT variable FROM srv_spremenljivka WHERE id=$spr_id");//poberi id spremenljivk $row_spr_variable = mysqli_fetch_assoc($sql_spr_variable); $usability_vars[$counter]['variable'] = $row_spr_variable['variable']; //Hard alerts************************** $query_variable_hard_alert = "SELECT COUNT(a.trigger_id) AS NumOfHardAlerts FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE a.trigger_id = '$spr_id' AND d.ank_id='$ank_id' AND a.trigger_type='har' "; if($defaultProfile == 2){ //ce imamo "Ustrezne" $query_variable_hard_alert = $query_variable_hard_alert.''.$lurkers; } $sql_variable_hard_alert = sisplet_query($query_variable_hard_alert); $row_variable_hard_alert = mysqli_fetch_assoc($sql_variable_hard_alert); $usability_vars[$counter]['rowHardAlert'] = $row_variable_hard_alert['NumOfHardAlerts']; $query_steviloVsehMoznihOpozorilHard = "SELECT COUNT(id) AS steviloVsehMoznihOpozorilHard FROM `srv_spremenljivka` WHERE id = '$spr_id' AND reminder = 2"; $sql_steviloVsehMoznihOpozorilHard = sisplet_query($query_steviloVsehMoznihOpozorilHard); $row_steviloVsehMoznihOpozorilHard = mysqli_fetch_assoc($sql_steviloVsehMoznihOpozorilHard); $usability_vars[$counter]['steviloVsehMoznihOpozorilHard'] = $row_steviloVsehMoznihOpozorilHard['steviloVsehMoznihOpozorilHard']; //Hard alerts - konec************************** //Soft alerts************************** $query_variable_soft_alert = "SELECT COUNT(a.trigger_id) AS NumOfSoftAlerts FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE a.trigger_id = '$spr_id' AND d.ank_id='$ank_id' AND a.trigger_type='sof' "; if($defaultProfile == 2){ //ce imamo "Ustrezne" $query_variable_soft_alert = $query_variable_soft_alert.''.$lurkers; } $sql_variable_soft_alert = sisplet_query($query_variable_soft_alert); $row_variable_soft_alert = mysqli_fetch_assoc($sql_variable_soft_alert); $usability_vars[$counter]['rowSoftAlert'] = $row_variable_soft_alert['NumOfSoftAlerts']; $query_steviloVsehMoznihOpozorilSoft = "SELECT COUNT(id) AS steviloVsehMoznihOpozorilSoft FROM `srv_spremenljivka` WHERE id = '$spr_id' AND reminder = 1"; $sql_steviloVsehMoznihOpozorilSoft = sisplet_query($query_steviloVsehMoznihOpozorilSoft); $row_steviloVsehMoznihOpozorilSoft = mysqli_fetch_assoc($sql_steviloVsehMoznihOpozorilSoft); $usability_vars[$counter]['steviloVsehMoznihOpozorilSoft'] = $row_steviloVsehMoznihOpozorilSoft['steviloVsehMoznihOpozorilSoft']; //Soft alerts - konec************************** //Num Hard alerts************************** $query_variable_num_hard_alert = "SELECT COUNT(a.trigger_id) AS NumOfNumHardAlerts FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE a.trigger_id = '$spr_id' AND d.ank_id='$ank_id' AND (a.type LIKE '%hard%' AND a.trigger_type = 'num') "; if($defaultProfile == 2){ //ce imamo "Ustrezne" $query_variable_num_hard_alert = $query_variable_num_hard_alert.''.$lurkers; } $sql_variable_num_hard_alert = sisplet_query($query_variable_num_hard_alert); $row_variable_num_hard_alert = mysqli_fetch_assoc($sql_variable_num_hard_alert); $usability_vars[$counter]['rowNumHard'] = $row_variable_num_hard_alert['NumOfNumHardAlerts']; $query_steviloVsehMoznihOpozorilNumHard = "SELECT COUNT(id) AS steviloVsehMoznihOpozorilNumHard FROM `srv_spremenljivka` WHERE id = '$spr_id' AND vsota_reminder = 2 AND tip = 7"; $sql_steviloVsehMoznihOpozorilNumHard = sisplet_query($query_steviloVsehMoznihOpozorilNumHard); $row_steviloVsehMoznihOpozorilNumHard = mysqli_fetch_assoc($sql_steviloVsehMoznihOpozorilNumHard); $usability_vars[$counter]['steviloVsehMoznihOpozorilNumHard'] = $row_steviloVsehMoznihOpozorilNumHard['steviloVsehMoznihOpozorilNumHard']; //Num Hard alerts - konec************************** //Num Soft alerts************************** $query_variable_num_soft_alert = "SELECT COUNT(a.trigger_id) AS NumOfNumSoftAlerts FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE a.trigger_id = '$spr_id' AND d.ank_id='$ank_id' AND (a.type LIKE '%soft%' AND a.trigger_type = 'num') "; if($defaultProfile == 2){ //ce imamo "Ustrezne" $query_variable_num_soft_alert = $query_variable_num_soft_alert.''.$lurkers; } $sql_variable_num_soft_alert = sisplet_query($query_variable_num_soft_alert); $row_variable_num_soft_alert = mysqli_fetch_assoc($sql_variable_num_soft_alert); $usability_vars[$counter]['rowNumSoft'] = $row_variable_num_soft_alert['NumOfNumSoftAlerts']; $query_steviloVsehMoznihOpozorilNumSoft = "SELECT COUNT(id) AS steviloVsehMoznihOpozorilNumSoft FROM `srv_spremenljivka` WHERE id = '$spr_id' AND vsota_reminder = 1 AND tip = 7"; $sql_steviloVsehMoznihOpozorilNumSoft = sisplet_query($query_steviloVsehMoznihOpozorilNumSoft); $row_steviloVsehMoznihOpozorilNumSoft = mysqli_fetch_assoc($sql_steviloVsehMoznihOpozorilNumSoft); $usability_vars[$counter]['steviloVsehMoznihOpozorilNumSoft'] = $row_steviloVsehMoznihOpozorilNumSoft['steviloVsehMoznihOpozorilNumSoft']; //Num Soft alerts - konec************************** //Sum Hard alerts************************** $query_variable_sum_hard_alert = "SELECT COUNT(a.trigger_id) AS NumOfSumHardAlerts FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE a.trigger_id = '$spr_id' AND d.ank_id='$ank_id' AND (a.type LIKE '%hard%' AND a.trigger_type = 'sum') "; if($defaultProfile == 2){ //ce imamo "Ustrezne" $query_variable_sum_hard_alert = $query_variable_sum_hard_alert.''.$lurkers; } $sql_variable_sum_hard_alert = sisplet_query($query_variable_sum_hard_alert); $row_variable_sum_hard_alert = mysqli_fetch_assoc($sql_variable_sum_hard_alert); $usability_vars[$counter]['rowSumHard'] = $row_variable_sum_hard_alert['NumOfSumHardAlerts']; $query_steviloVsehMoznihOpozorilSumHard = "SELECT COUNT(id) AS steviloVsehMoznihOpozorilSumHard FROM `srv_spremenljivka` WHERE id = '$spr_id' AND vsota_reminder = 2 AND tip = 18"; $sql_steviloVsehMoznihOpozorilSumHard = sisplet_query($query_steviloVsehMoznihOpozorilSumHard); $row_steviloVsehMoznihOpozorilSumHard = mysqli_fetch_assoc($sql_steviloVsehMoznihOpozorilSumHard); $usability_vars[$counter]['steviloVsehMoznihOpozorilSumHard'] = $row_steviloVsehMoznihOpozorilSumHard['steviloVsehMoznihOpozorilSumHard']; //Sum Hard alerts - konec************************** //Sum Soft alerts************************** $query_variable_sum_soft_alert = "SELECT COUNT(a.trigger_id) AS NumOfSumSoftAlerts FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE a.trigger_id = '$spr_id' AND d.ank_id='$ank_id' AND (a.type LIKE '%soft%' AND a.trigger_type = 'sum') "; if($defaultProfile == 2){ //ce imamo "Ustrezne" $query_variable_sum_soft_alert = $query_variable_sum_soft_alert.''.$lurkers; } $sql_variable_sum_soft_alert = sisplet_query($query_variable_sum_soft_alert); $row_variable_sum_soft_alert = mysqli_fetch_assoc($sql_variable_sum_soft_alert); $usability_vars[$counter]['rowSumSoft'] = $row_variable_sum_soft_alert['NumOfSumSoftAlerts']; $query_steviloVsehMoznihOpozorilSumSoft = "SELECT COUNT(id) AS steviloVsehMoznihOpozorilSumSoft FROM `srv_spremenljivka` WHERE id = '$spr_id' AND vsota_reminder = 1 AND tip = 18"; $sql_steviloVsehMoznihOpozorilSumSoft = sisplet_query($query_steviloVsehMoznihOpozorilSumSoft); $row_steviloVsehMoznihOpozorilSumSoft = mysqli_fetch_assoc($sql_steviloVsehMoznihOpozorilSumSoft); $usability_vars[$counter]['steviloVsehMoznihOpozorilSumSoft'] = $row_steviloVsehMoznihOpozorilSumSoft['steviloVsehMoznihOpozorilSumSoft']; //Sum Soft alerts - konec************************** //Val Hard alerts************************** $query_variable_val_hard_alert = "SELECT COUNT(a.trigger_id) AS NumOfValHardAlerts FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE a.trigger_id = '$spr_id' AND d.ank_id='$ank_id' AND (a.type LIKE '%hard%' AND a.trigger_type = 'val') "; if($defaultProfile == 2){ //ce imamo "Ustrezne" $query_variable_val_hard_alert = $query_variable_val_hard_alert.''.$lurkers; } $sql_variable_val_hard_alert = sisplet_query($query_variable_val_hard_alert); $row_variable_val_hard_alert = mysqli_fetch_assoc($sql_variable_val_hard_alert); $usability_vars[$counter]['rowHardValidation'] = $row_variable_val_hard_alert['NumOfValHardAlerts']; $query_steviloVsehMoznihOpozorilValHard = "SELECT COUNT(reminder) AS steviloVsehMoznihOpozorilValHard FROM `srv_validation` WHERE spr_id = '$spr_id' AND reminder = '2'"; $sql_steviloVsehMoznihOpozorilValHard = sisplet_query($query_steviloVsehMoznihOpozorilValHard); $row_steviloVsehMoznihOpozorilValHard = mysqli_fetch_assoc($sql_steviloVsehMoznihOpozorilValHard); $usability_vars[$counter]['steviloVsehMoznihOpozorilValHard'] = $row_steviloVsehMoznihOpozorilValHard['steviloVsehMoznihOpozorilValHard']; //Val Hard alerts - konec************************** //Val Soft alerts************************** $query_variable_val_soft_alert = "SELECT COUNT(a.trigger_id) AS NumOfValSoftAlerts FROM srv_advanced_paradata_alert a INNER JOIN srv_advanced_paradata_page d ON a.page_id=d.id WHERE a.trigger_id = '$spr_id' AND d.ank_id='$ank_id' AND (a.type LIKE '%soft%' AND a.trigger_type = 'val') "; if($defaultProfile == 2){ //ce imamo "Ustrezne" $query_variable_val_soft_alert = $query_variable_val_soft_alert.''.$lurkers; } $sql_variable_val_soft_alert = sisplet_query($query_variable_val_soft_alert); $row_variable_val_soft_alert = mysqli_fetch_assoc($sql_variable_val_soft_alert); $usability_vars[$counter]['rowSoftValidation'] = $row_variable_val_soft_alert['NumOfValSoftAlerts']; $query_steviloVsehMoznihOpozorilValSoft = "SELECT COUNT(reminder) AS steviloVsehMoznihOpozorilValSoft FROM `srv_validation` WHERE spr_id = '$spr_id' AND reminder = '1'"; $sql_steviloVsehMoznihOpozorilValSoft = sisplet_query($query_steviloVsehMoznihOpozorilValSoft); $row_steviloVsehMoznihOpozorilValSoft = mysqli_fetch_assoc($sql_steviloVsehMoznihOpozorilValSoft); $usability_vars[$counter]['steviloVsehMoznihOpozorilValSoft'] = $row_steviloVsehMoznihOpozorilValSoft['steviloVsehMoznihOpozorilValSoft']; //Val Soft alerts - konec************************** /* //Hard alerts $query_variable_hard_alert = "SELECT COUNT(spr_id_variable) AS NumOfHardAlerts FROM `srv_parapodatki` WHERE spr_id_variable = '$spr_id' AND what = 'hard alert' "; if($defaultProfile == 2){ //ce imamo "Ustrezne" $query_variable_hard_alert = $query_variable_hard_alert.''.$lurkers; } $sql_variable_hard_alert = sisplet_query($query_variable_hard_alert); $row_variable_hard_alert = mysqli_fetch_assoc($sql_variable_hard_alert); $usability_vars[$counter]['rowHardAlert'] = $row_variable_hard_alert['NumOfHardAlerts']; //Hard alerts - konec */ //za ureditev stevila vseh moznih opozoril //$query_steviloVsehmoznihOpozoril = "SELECT COUNT(spr_id_variable) AS NumOfHardAlerts FROM `srv_parapodatki` WHERE spr_id_variable = '$spr_id' AND what = 'hard alert' "; //za ureditev stevila vseh moznih opozoril - konec /* echo' '; */ $counter = $counter + 1; } } //************************************************************************************************************* po spremenljivkah - konec //******belezenje stevila moznih oziroma narejenih opozoril iz strani urejevalca ankete //******belezenje stevila moznih oziroma narejenih opozoril iz strani urejevalca ankete - konec return $usability_vars; } // Ali imamo zgenerirano datoteko ali ne public function hasDataFile(){ if ($this->dataFileStatus == FILE_STATUS_NO_DATA || $this->dataFileStatus == FILE_STATUS_NO_FILE || $this->dataFileStatus == FILE_STATUS_SRV_DELETED) return false; else return true; } public function setStatusFilter($status=''){ $this->_CURRENT_STATUS_FILTER = $status; } function ajax(){ $action = $_GET['a']; switch ($action){ case 'changeSetting' : $this->ajax_change_settings(); break; } } private function ajax_change_settings(){ $value = $_POST['value']; $what = $_POST['what']; if($value == 'true') $value = true; elseif($value == 'false') $value = false; $this->sessionData['reminder_tracking'][$what] = $value; // Shranimo spremenjene nastavitve v bazo SurveyUserSession::saveData($this->sessionData); } private function steviloMoznihOpozoril($vars, $what){ $steviloMoznihOpozoril = 0; foreach($vars as $key => $var){ $steviloMoznihOpozoril = $steviloMoznihOpozoril + $var[$what]; } return $steviloMoznihOpozoril; } //skrbi za racunanje kakovosti private function izracunKakovosti($steviloRespondentov, $sprozenaOpozorila, $steviloVsehMoznihOpozoril){ $kakovost = 1 - ($sprozenaOpozorila/$steviloVsehMoznihOpozoril)/$steviloRespondentov; return $kakovost; } }