summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.SurveyUsableResp.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/survey/classes/class.SurveyUsableResp.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/admin/survey/classes/class.SurveyUsableResp.php b/admin/survey/classes/class.SurveyUsableResp.php
index 48e5cea..a494727 100644
--- a/admin/survey/classes/class.SurveyUsableResp.php
+++ b/admin/survey/classes/class.SurveyUsableResp.php
@@ -51,9 +51,8 @@ class SurveyUsableResp{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
- if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
- $this->db_table = '_active';
- }
+ $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
+
$this->_CURRENT_STATUS_FILTER = STATUS_FIELD.' ~ /6|5/';
Common::deletePreviewData($this->anketa);
@@ -431,10 +430,12 @@ class SurveyUsableResp{
$this->_CURRENT_STATUS_FILTER = SurveyStatusProfiles :: getStatusAsAWKString();
# filtriranje po časih
- $_time_profile_awk = SurveyTimeProfiles :: getFilterForAWK($this->_HEADERS['unx_ins_date']['grids']['0']['variables']['0']['sequence']);
-
+ if(isset($this->_HEADERS['unx_ins_date']['grids']['0']['variables']['0']['sequence']))
+ $_time_profile_awk = SurveyTimeProfiles :: getFilterForAWK($this->_HEADERS['unx_ins_date']['grids']['0']['variables']['0']['sequence']);
+ else
+ $_time_profile_awk = '';
+
# dodamo še ife
-
SurveyConditionProfiles :: setHeader($this->_HEADERS);
$_condition_profile_AWK = SurveyConditionProfiles:: getAwkConditionString();
@@ -589,13 +590,15 @@ class SurveyUsableResp{
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;
+ $this->cols_with_value[(int)$key] = isset($this->cols_with_value[(int)$key]) ? $this->cols_with_value[(int)$key] += $cnt : 1;
+ elseif($key != 'recnum' && isset($this->cols_with_value['valid']))
+ $this->cols_with_value['valid'] = isset($this->cols_with_value['valid']) ? $this->cols_with_value['valid'] += $cnt : 1;
+
}
+
}
return $frequency;
@@ -686,6 +689,10 @@ class SurveyUsableResp{
$usablePercent = $UCL * 100;
+ $usability['unusable'] = 0;
+ $usability['partusable'] = 0;
+ $usability['usable'] = 0;
+ $usability['all'] = 0;
if($usablePercent < (int)$this->bottom_usable_limit){
$css_usable = 'unusable';
$status = 0;