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 (file_exists($this->headFileName) && $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 displayUsableRespTable(){ global $lang; // Prikaz nastavitev $this->displayUsableSettings(); # 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(); $userData = $usability['data']; // 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]); } } } echo '
Recnum'./*$lang['recnum'].*/($this->sortField=='recnum' ? $arrow : '').' | '; echo ''.$lang['srv_usableResp_qcount'].' | '; echo ''.$lang['srv_usableResp_exposed'].' | '; echo ''.$lang['srv_usableResp_breakoff'].($this->sortField=='breakoff' ? $arrow : '').' | '; echo ''.$lang['srv_usableResp_usability'].' | '; // ali odstranimo vse stolpce s podrobnimi vrednostmi (-1, -2...) if ($this->show_details == true) { foreach ($this->_missings AS $value => $text){ $cnt_miss++; echo "{$value} (".$lang['srv_usableResp_'.$text].") | ";
}
foreach ($this->_unsets AS $value => $text){
$cnt_undefined++;
echo "{$value} (".$lang['srv_usableResp_'.$text].") | ";
}
}
// ali prikazemo podrobne izracune
if ($this->show_calculations == true) {
echo 'UNL | '; echo 'UML | '; echo 'UCL | '; echo 'UIL | '; echo 'UAQ | '; } echo '||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
'.$lang['srv_anl_valid'].($this->sortField=='valid' ? $arrow : '').' | '; echo ''.$lang['srv_usableResp_nonsubstantive'].($this->sortField=='nonsubstantive' ? $arrow : '').' | '; echo ''.$lang['srv_usableResp_nonresponse'].($this->sortField=='nonresponse' ? $arrow : '').' | '; echo ''.$lang['srv_anl_suma1'].' | '; echo '%'.($this->sortField=='usable' ? $arrow : '').' | '; echo 'Status'.($this->sortField=='status' ? $arrow : '').' | '; echo '||||||||||
'.$user['recnum'].' | '; // Vsi echo ''.$user['all'].' | '; // Ustrezni echo ''.$user['valid'].' | '; // Non-substantive echo ''.$user['nonsubstantive'].' | '; // Non-response echo ''.$user['nonresponse'].' | '; // Skupaj echo ''.($user['valid']+$user['nonsubstantive']+$user['nonresponse']+$user['breakoff']).' | '; // Breakoffs echo ''.$user['breakoff'].' | '; // Uporabni echo ''.$user['usable'].' | '; echo ''.$user['status'].' | '; // ali odstranimo vse stolpce s podrobnimi vrednostmi (-1, -2...) if ($this->show_details == true) { foreach ($this->_missings AS $value => $text){ echo ''.$user[$value].' | '; } foreach ($this->_unsets AS $value => $text){ echo ''.$user[$value].' | '; } } // ali prikazemo podrobne izracune if ($this->show_calculations == true) { echo ''.common::formatNumber($user['UNL']*100, 0, null, '%').' | '; echo ''.common::formatNumber($user['UML']*100, 0, null, '%').' | '; echo ''.common::formatNumber($user['UCL']*100, 0, null, '%').' | '; echo ''.common::formatNumber($user['UIL']*100, 0, null, '%').' | '; echo ''.common::formatNumber($user['UAQ']*100, 0, null, '%').' | '; } echo '
'.common::formatNumber($user['validPercent'], 0, null, '%').' | '; // Non-substantive echo ''.common::formatNumber($user['nonsubstantivePercent'], 0, null, '%').' | '; // Non-response echo ''.common::formatNumber($user['nonresponsePercent'], 0, null, '%').' | '; // Skupaj //echo ''.common::formatNumber(($user['validPercent']+$user['nonsubstantivePercent']+$user['nonresponsePercent']+$user['breakoffPercent']), 0, null, '%').' | '; echo ''.common::formatNumber(100, 0, null, '%').' | '; // Breakoffs echo ''.common::formatNumber($user['breakoffPercent'], 0, null, '%').' | '; // Uporabni echo ''.common::formatNumber($user['usablePercent'], 0, null, '%').' | '; // ali odstranimo vse stolpce s podrobnimi vrednostmi (-1, -2...) if ($this->show_details == true) { foreach ($this->_missings AS $value => $text){ $val = $user[$value]; $val = ($all > 0) ? ($val / $all * 100) : 0; echo ''.common::formatNumber($val, 0, null, '%').' | '; } foreach ($this->_unsets AS $value => $text){ $val = $user[$value]; $val = ($all > 0) ? ($val / $all * 100) : 0; echo ''.common::formatNumber($val, 0, null, '%').' | '; } } echo '