summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/surveyData
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
commit75160b12821f7f4299cce7f0b69c83c1502ae071 (patch)
tree27e25e4ccaef45f0c58b22831164050d1af1d4db /admin/survey/classes/surveyData
parentprvi-commit (diff)
download1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip
Diffstat (limited to '')
-rw-r--r--admin/survey/classes/surveyData/class.SurveyDataCollect.php490
-rw-r--r--admin/survey/classes/surveyData/class.SurveyDataDisplay.php2106
-rw-r--r--admin/survey/classes/surveyData/class.SurveyDataFile.php7
-rw-r--r--admin/survey/classes/surveyData/class.SurveySNDataFile.php20
4 files changed, 1466 insertions, 1157 deletions
diff --git a/admin/survey/classes/surveyData/class.SurveyDataCollect.php b/admin/survey/classes/surveyData/class.SurveyDataCollect.php
index 75cdd06..6014ca0 100644
--- a/admin/survey/classes/surveyData/class.SurveyDataCollect.php
+++ b/admin/survey/classes/surveyData/class.SurveyDataCollect.php
@@ -36,6 +36,8 @@ class SurveyDataCollect{
private $header_file_name = null; // Ime header datoteke
private $data_file_name = null; // Ime data datoteke
private $data_file_time = null; // datum zadnjega userja v data datoteki
+
+ private $new_line_seperator = null;
private $max_anketa_time = null; // datum zadnje spremembe v anketi
private $max_usr_time = null; // datum zadnje spremembe v tabelu userjev
@@ -189,11 +191,10 @@ class SurveyDataCollect{
$qry_survey = sisplet_query("SELECT *, UNIX_TIMESTAMP(edit_time) AS srv_edit_time FROM srv_anketa WHERE id='".$this->sid."'");
$this->survey = mysqli_fetch_assoc($qry_survey);
+ SurveyInfo::getInstance()->SurveyInit($this->sid);
+
// Aktivne tabele za podatke v bazi
- if ((int)$this->survey['db_table'] == 1)
- $this->db_table = '_active';
- else
- $this->db_table = '';
+ $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
// Zadnji cas editiranja ankete
$this->max_anketa_time = (int)$this->survey['srv_edit_time'];
@@ -315,7 +316,7 @@ class SurveyDataCollect{
$_tmpCnt = 0;
// v loopu dodamo podatke v data file
- if ($this->noErrors && count($this->_str_users) > 0) {
+ if ($this->noErrors && is_countable($this->_str_users) && count($this->_str_users) > 0) {
foreach ($this->_str_users AS $c => $string_user) {
@@ -388,7 +389,7 @@ class SurveyDataCollect{
fclose($file_handler_new);
// Pobrisemo staro datoteko
- unlink($file_handler_old);
+ unlink($this->data_file_name);
// Preimenujemo novo datoteko
rename($data_file_name_new, $this->data_file_name);
@@ -475,6 +476,22 @@ class SurveyDataCollect{
$_HEADER['uid']['sequences'] = $sequence;
$sequence++;
$_data_sequence++;
+
+ // status uporabnika
+ $_HEADER['status']= array ('tip'=>'m', 'variable'=>'status', 'naslov' =>$lang['srv_data_status'],
+ 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'status', 'naslov'=>$lang['srv_data_status'],'spss'=>'F3.0','sequence'=>$sequence))
+ ,'naslov'=>$lang['srv_data_status'],'cnt_vars' => 1)));
+ $_HEADER['status']['sequences'] = $sequence;
+ $sequence++;
+ $_data_sequence++;
+
+ // EMAIL VABILO - invitation
+ $_HEADER['invitation']= array ('tip'=>'m', 'variable'=>'invitation', 'naslov' =>$lang['srv_data_invitation'],
+ 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'invitation', 'naslov'=>$lang['srv_data_invitation'],'spss'=>'F3.0','sequence'=>$sequence))
+ ,'naslov'=>$lang['srv_data_invitation'],'cnt_vars' => 1)));
+ $_HEADER['invitation']['sequences'] = $sequence;
+ $sequence++;
+ $_data_sequence++;
// ustreznost uporabnika
$_HEADER['relevance']= array ('tip'=>'m', 'variable'=>'relevance', 'naslov' =>$lang['srv_data_relevance'],
@@ -483,22 +500,6 @@ class SurveyDataCollect{
$_HEADER['relevance']['sequences'] = $sequence;
$sequence++;
$_data_sequence++;
-
- // EMAIL VABILO - invitation
- $_HEADER['invitation']= array ('tip'=>'m', 'variable'=>'invitation', 'naslov' =>$lang['srv_data_invitation'],
- 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'invitation', 'naslov'=>$lang['srv_data_invitation'],'spss'=>'F3.0','sequence'=>$sequence))
- ,'naslov'=>$lang['srv_data_invitation'],'cnt_vars' => 1)));
- $_HEADER['invitation']['sequences'] = $sequence;
- $sequence++;
- $_data_sequence++;
-
- // status uporabnika
- $_HEADER['status']= array ('tip'=>'m', 'variable'=>'status', 'naslov' =>$lang['srv_data_status'],
- 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'status', 'naslov'=>$lang['srv_data_status'],'spss'=>'F3.0','sequence'=>$sequence))
- ,'naslov'=>$lang['srv_data_status'],'cnt_vars' => 1)));
- $_HEADER['status']['sequences'] = $sequence;
- $sequence++;
- $_data_sequence++;
// ali je uporabnik lurker
$_HEADER['lurker']= array ('tip'=>'m', 'variable'=>'lurker', 'naslov' =>$lang['srv_data_lurker'],
@@ -517,23 +518,23 @@ class SurveyDataCollect{
$_data_sequence++;
// Recnum
- $_HEADER['recnum'] = array('tip'=>'m', 'variable'=>'recnum', 'naslov' =>'Record number',
- 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'recnum','naslov'=>'Record number','spss'=>'F5.0','sortType'=>'number','sequence'=>$sequence)),
+ $_HEADER['recnum'] = array('tip'=>'m', 'variable'=>'recnum', 'naslov' =>$lang['srv_recnum'],
+ 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'recnum','naslov'=>$lang['srv_recnum'],'spss'=>'F5.0','sortType'=>'number','sequence'=>$sequence)),
'naslov'=>'recnum','cnt_vars' => 1)));
$_HEADER['recnum']['sequences'] = $sequence;
$sequence++;
$_data_sequence++;
-
+
// Dodamo geslo - code
if ($this->force_show_hiden_system == true) {
- $_HEADER['code'] = array('tip'=>'m', 'variable'=>'code', 'naslov' =>'Geslo',
- 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'code','naslov'=>'Geslo','spss'=>'A6','sequence'=>$sequence)),
- 'naslov'=>'Geslo','cnt_vars' => 1)));
+ $_HEADER['code'] = array('tip'=>'m', 'variable'=>'code', 'naslov' =>$lang['password'],
+ 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'code','naslov'=>$lang['password'],'spss'=>'A6','sequence'=>$sequence)),
+ 'naslov'=>$lang['password'],'cnt_vars' => 1)));
$_HEADER['code']['sequences'] = $sequence;
$sequence++;
$_data_sequence++;
}
-
+
// Ce vsebuje testne podatke dodamo tudi to polje
if ($this->has_test_data) {
$_HEADER['testdata']= array ('tip'=>'m', 'variable'=>'testdata', 'naslov' =>$lang['srv_data_test'],
@@ -563,8 +564,6 @@ class SurveyDataCollect{
$_array_vrednosti = $this->get_vrednosti(); // za vrednosti ankete
$_array_gridi = $this->get_gridi(); // za vrednosti ankete
-
- $cntHs = 0;
// Stejemo loope za numeric vprasanje
$num_loop_cnt = array();
@@ -574,22 +573,28 @@ class SurveyDataCollect{
foreach ($this->AllQuestionsOrder AS $_vprasanje_array) {
- $cntHs++;
+ // Ce vrpasanje ni nastavljeno preskocimo
+ if(!isset($this->AllQuestionsData[$_vprasanje_array['id']]))
+ continue;
# dodelimo vrednosti loopa
$rowVprasanje = $this->AllQuestionsData[$_vprasanje_array['id']];
- // nastavimo vrstni red ce loopamo po numericu
- $num_loop_cnt[$_vprasanje_array['id']]++;
+ // nastavimo vrstni red ce loopamo po numericu
+ if(!isset($num_loop_cnt[$_vprasanje_array['id']]))
+ $num_loop_cnt[$_vprasanje_array['id']] = 1;
+ else
+ $num_loop_cnt[$_vprasanje_array['id']]++;
# spremenljivki dodamo loop_id da je konsistentno z podatki
$rowVprasanje['spr_id'] = $rowVprasanje['spr_id'].'_'.$_vprasanje_array['loop_id'];
- $_vrednosti = $this->get_vrednosti($this->_array_loop_on_spr[$rowVprasanje['if_id']]);
- $_loop_vrednost = $this->_array_vre_on_loop[$rowVprasanje['if_id']][$_vprasanje_array['loop_id']];
+ $loop_vre = isset($this->_array_loop_on_spr[$rowVprasanje['if_id']]) ? $this->_array_loop_on_spr[$rowVprasanje['if_id']] : null;
+ $_vrednosti = $this->get_vrednosti($loop_vre);
+ $_loop_vrednost = isset($this->_array_vre_on_loop[$rowVprasanje['if_id']][$_vprasanje_array['loop_id']]) ? $this->_array_loop_on_spr[$rowVprasanje['if_id']] : null;
$spr_id = $rowVprasanje['spr_id'];
$vrednostLoopSufix = '';
-
+
# popravimo ime variable če smo v loopu
if(isset($this->_array_vre_on_loop[$rowVprasanje['if_id']][$_vprasanje_array['loop_id']])) {
@@ -599,23 +604,28 @@ class SurveyDataCollect{
}
else{
# id spremenljivke po kateri loopamo
- $_loop_on_spr_id = $this->_array_loop_on_spr[$rowVprasanje['if_id']];
+ $_loop_on_spr_id = isset($this->_array_loop_on_spr[$rowVprasanje['if_id']]) ? $this->_array_loop_on_spr[$rowVprasanje['if_id']] : null;
#variabla spremenljivke po kateri loopamo
$_loop_on_spr_variable = $this->AllQuestionsData[$_loop_on_spr_id]['variable'];
+
+ if(isset($_vrednosti[$_loop_vrednost])){
+
+ # id variable po kateri loopamo (v okviru $_loop_on_spr_id)
+ $_loop_on_variable_id = $_vrednosti[$_loop_vrednost];
+
+ # naslov variable po keteri loopamo (v okviru $_loop_on_spr_id)
+ $_vrednost_naslov = $_array_vrednosti[$_loop_on_spr_id][$_loop_on_variable_id['id']]['naslov'];
+ $rowVprasanje['variable'] = strip_tags($rowVprasanje['variable'])."_".$_vrednosti[$_loop_vrednost]['variable'];
+ $vrednostLoopSufix = "_".$_vrednosti[$_loop_vrednost]['variable'];
+
+ if ($_vrednost_naslov != '' && $_loop_on_spr_variable != '' && $rowVprasanje['naslov'] != '') {
+ # zamenjamo ime spremenljivke med #q1# (#q1# z naslovom trenutne variable)
+ $rowVprasanje['naslov'] = str_replace("#$_loop_on_spr_variable#", "$_vrednost_naslov", $rowVprasanje['naslov']);
+ }
+ }
- # id variable po kateri loopamo (v okviru $_loop_on_spr_id)
- $_loop_on_variable_id = $_vrednosti[$_loop_vrednost];
-
- # naslov variable po keteri loopamo (v okviru $_loop_on_spr_id)
- $_vrednost_naslov = $_array_vrednosti[$_loop_on_spr_id][$_loop_on_variable_id['id']]['naslov'];
- $rowVprasanje['variable'] = strip_tags($rowVprasanje['variable'])."_".$_vrednosti[$_loop_vrednost]['variable'];
- $vrednostLoopSufix = "_".$_vrednosti[$_loop_vrednost]['variable'];
-
- if ($_vrednost_naslov != '' && $_loop_on_spr_variable != '' && $rowVprasanje['naslov'] != '') {
- # zamenjamo ime spremenljivke med #q1# (#q1# z naslovom trenutne variable)
- $rowVprasanje['naslov'] = str_replace("#$_loop_on_spr_variable#", "$_vrednost_naslov", $rowVprasanje['naslov']);
- }
+
}
}
@@ -648,8 +658,8 @@ class SurveyDataCollect{
# TODO $spss_lngth mora biti enak za vse in sicer je enak največjemu možnemu številu znakov
# TODO zato je potrebno zdužit vse ($spss_lngth, $spss_lngth2, $spss_lngth3)
- $spss_lngth = $this->_array_SPSS[$spr_id]['text'];
- $spss_lngth2 = $this->_array_SPSS[$spr_id]['text2'];
+ $spss_lngth = isset($this->_array_SPSS[$spr_id]['text']) ? $this->_array_SPSS[$spr_id]['text'] : '';
+ $spss_lngth2 = isset($this->_array_SPSS[$spr_id]['text2']) ? $this->_array_SPSS[$spr_id]['text2'] : '';
$spss_lngth3 = isset($this->_array_SPSS[$spr_id]['vrednost']) && $this->_array_SPSS[$spr_id]['vrednost'] != '' ? $this->_array_SPSS[$spr_id]['vrednost'] : 0;
$_HEADER[$spr_data_id] = array('spr_id'=>$spr_id, 'tip'=>$tip, 'variable'=>$spr_variable, 'naslov'=>$spr_naslov, 'sistem'=>$spr_sistem, 'skala'=>$spr_skala, 'naslov_graf'=>$spr_naslov_graf, 'edit_graf'=>$spr_edit_graf, 'wide_graf'=>$spr_wide_graf);
@@ -718,9 +728,9 @@ class SurveyDataCollect{
$_seq_prefix = '_';
$sequence++;
$cnt++;
- $arrayVrednost = $_array_vrednosti[$spr_id];
+ $arrayVrednost = isset($_array_vrednosti[$spr_id]) ? $_array_vrednosti[$spr_id] : null;
- if (count($arrayVrednost)>0) {
+ if (is_countable($arrayVrednost) && count($arrayVrednost)>0) {
foreach ($arrayVrednost as $kid=> $vrednost) {
# dodamo še eno polje za tekstovne odgovore drugo
if ($vrednost['other'] == 1) {
@@ -730,13 +740,21 @@ class SurveyDataCollect{
$_seq_prefix = '_';
$sequence++;
$cnt++;
- $_GRIDS[0]['cnt_other'] += 1;
+
+ if(isset($_GRIDS[0]['cnt_other']))
+ $_GRIDS[0]['cnt_other'] += 1;
+ else
+ $_GRIDS[0]['cnt_other'] = 1;
} // end if
#dodamo opcije (za spss)
if ($vrednost['other'] == 0 || $vrednost['other'] == 1) {
$_HEADER[$spr_data_id]['options'][$vrednost['variable']] = ($vrednost['naslov'] != null) ? $vrednost['naslov'] : $vrednost['variable'];
$_HEADER[$spr_data_id]['options_graf'][$vrednost['variable']] = ($vrednost['naslov_graf'] != null) ? $vrednost['naslov_graf'] : $_HEADER[$spr_data_id]['options'][$vrednost['variable']];
}
+ //dodamo missing values
+ else if($vrednost['naslov'] != null){
+ $_HEADER[$spr_data_id]['missing_values'][$vrednost['other']] = $vrednost['naslov'];
+ }
} // end foreach
} // end if
@@ -755,7 +773,7 @@ class SurveyDataCollect{
case 2:
$arrayVrednost = $_array_vrednosti[$spr_id];
$cnt=0;
- if (count($arrayVrednost)>0) {
+ if (isset($arrayVrednost) && count($arrayVrednost)>0) {
foreach ($arrayVrednost as $vrednost) {
# dodamo header variable samo za ne -missing variable
@@ -773,9 +791,17 @@ class SurveyDataCollect{
$_seq_prefix = '_';
$sequence++;
$cnt++;
- $_GRIDS[0]['cnt_other'] += 1;
+
+ if(isset($_GRIDS[0]['cnt_other']))
+ $_GRIDS[0]['cnt_other'] += 1;
+ else
+ $_GRIDS[0]['cnt_other'] = 1;
} // end if
}
+ //dodamo missing values
+ else if($vrednost['naslov'] != null){
+ $_HEADER[$spr_data_id]['missing_values'][$vrednost['other']] = $vrednost['naslov'];
+ }
} // end foreach
} // end if
@@ -817,7 +843,9 @@ class SurveyDataCollect{
# Pri multigridu je logika obratna. variable predstavljajo podvprašanja, srv_grid pa odgovore
$cntGrid = 0;
$arrayVrednost = $_array_vrednosti[$spr_id];
- if (count($arrayVrednost)>0) {
+
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
+
# če imamo dvojni grid gremo 2_skozi
for ($i=1; $i<=$double+1;$i++) {
// for $double
@@ -839,7 +867,7 @@ class SurveyDataCollect{
# dodamo header samo za nemissing variable
if ($vrednost['other'] == 0 || $vrednost['other'] == 1) {
- $cnt = 0;
+ $cnt = 0;
$_GRIDS[$cntGrid]['variables'][$cnt] = array('vr_id'=>$vrednost['id'],
'naslov'=>$vrednost['naslov'],
'naslov2'=>$vrednost['naslov2'],
@@ -858,12 +886,13 @@ class SurveyDataCollect{
$_seq_prefix = '_';
$sequence++;
$cnt++;
- $_GRIDS[$cntGrid]['cnt_other'] += 1;
+ $_GRIDS[$cntGrid]['cnt_other'] = (isset($_GRIDS[$cntGrid]['cnt_other']) ? $_GRIDS[$cntGrid]['cnt_other'] += 1 : 1);
} // end if
$_GRIDS[$cntGrid]['cnt_vars'] = $cnt;
- $_GRIDS[$cntGrid]['naslov'] = $vrednost['variable'].$var_appendix;
+ $_GRIDS[$cntGrid]['naslov'] = $vrednost['variable'].$var_appendix.$vrednostLoopSufix;
$_GRIDS[$cntGrid]['part'] = $i;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$cntGrid++;
}
} // end foreach
@@ -873,13 +902,17 @@ class SurveyDataCollect{
#dodamo opcije (za spss)
$arrayGrids = $_array_gridi[$spr_id];
- if (count($arrayGrids) > 0) {
+ if (is_countable($arrayGrids) && count($arrayGrids) > 0) {
foreach ($arrayGrids AS $kid => $grid) {
if ($grid['other'] == 0 || $grid['other'] == 1) {
$_HEADER[$spr_data_id]['options'][$grid['variable']] = ($grid['naslov'] != null) ? $grid['naslov'] : $grid['variable'];
// Opcije za dodaten naslov grida pri grafu
$_HEADER[$spr_data_id]['options_graf'][$grid['variable']] = ($grid['naslov_graf'] != null) ? $grid['naslov_graf'] : $_HEADER[$spr_data_id]['options'][$grid['variable']];
}
+ //dodamo missing values
+ else if($grid['naslov'] != null){
+ $_HEADER[$spr_data_id]['missing_values'][$grid['other']] = $grid['naslov'];
+ }
}
}
@@ -898,7 +931,7 @@ class SurveyDataCollect{
# pri number lahko imamo dve variabli grida, če je size 2
$cnt_v = 0;
$arrayVrednost = $_array_vrednosti[$spr_id];
- if (count($arrayVrednost) > 0) {
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
$cnt=0;
foreach ($arrayVrednost as $kid=> $vrednost) {
if ($vrednost['other'] == 0) {
@@ -930,7 +963,8 @@ class SurveyDataCollect{
} // end if
$_GRIDS[0]['enota'] = $spr_variable;
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt_v;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt_v;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt_v;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
break;
@@ -950,7 +984,8 @@ class SurveyDataCollect{
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
$_GRIDS[0]['cnt_vars'] = $cnt;
$_GRIDS[0]['naslov'] = $spr_variable;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
break;
@@ -976,7 +1011,8 @@ class SurveyDataCollect{
$arrayGrids = $_array_gridi[$spr_id];
$arrayVrednost = $_array_vrednosti[$spr_id];
- if (count($arrayVrednost) > 0) {
+
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
foreach ($arrayVrednost as $kid=> $vrednost) {
// Za kombinirane tabele popravimo ime variable
@@ -990,9 +1026,9 @@ class SurveyDataCollect{
if (count($arrayGrids) > 0) {
foreach ($arrayGrids AS $kid => $grid) {
if ($grid['other'] == 0 || $grid['other'] == 1) {
- $_GRIDS[$grid_id]['variables'][$cnt] = array('vr_id'=>$vrednost['id'], 'gr_id'=>$grid['id'], 'naslov'=>$grid['naslov'], 'variable'=>$vrednost['variable'].'_'.$grid['variable'].$vrednostLoopSufix, 'other'=>false, 'text'=>false,'spss'=>$_spss,'sequence'=>$sequence,'naslov_graf'=>$grid['naslov_graf']);
+ $_GRIDS[$grid_id]['variables'][$cnt] = array('vr_id'=>$vrednost['id'], 'gr_id'=>$grid['id'], 'naslov'=>$grid['naslov'].($grid['part'] == '2' ? '_'.$grid['part'] : ''), 'variable'=>$vrednost['variable'].'_'.$grid['variable'].($grid['part'] == '2' ? '_'.$grid['part'] : '').$vrednostLoopSufix, 'other'=>false, 'text'=>false,'spss'=>$_spss,'sequence'=>$sequence,'naslov_graf'=>$grid['naslov_graf']);
- if((int)$is_datum === 1) {
+ if((int)$is_datum === 1) {
$_GRIDS[$grid_id]['variables'][$cnt]['sortType'] ='date';
}
$_sequences .= $_seq_prefix.$sequence;
@@ -1000,6 +1036,10 @@ class SurveyDataCollect{
$sequence++;
$cnt++;
}
+ //dodamo missing values
+ else if($grid['naslov'] != null){
+ $_HEADER[$spr_data_id]['missing_values'][$grid['other']] = $grid['naslov'];
+ }
} // end foreach
if ($vrednost['other'] == 1) {
$_GRIDS[$grid_id]['variables'][$cnt] = array('vr_id'=>$vrednost['id'],'naslov'=>$vrednost['naslov'], 'variable'=>$vrednost['variable'].$vrednostLoopSufix.STR_OTHER_TEXT, 'other'=>true,'text'=>true,'spss'=>'A'.$spss_lngth,'sequence'=>$sequence,'naslov_graf'=>$vrednost['naslov_graf']);
@@ -1016,7 +1056,12 @@ class SurveyDataCollect{
$_GRIDS[$grid_id]['naslov'] = $vrednost['naslov'];
$_GRIDS[$grid_id]['variable'] = $vrednost['variable'];
$_GRIDS[$grid_id]['naslov_graf'] = $vrednost['naslov_graf'];
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+
+ if(!isset($_HEADER[$spr_data_id]['cnt_all']))
+ $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else
+ $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+
$grid_id++;
} // end foreach
} // end if
@@ -1042,7 +1087,7 @@ class SurveyDataCollect{
$cnt=0;
$arrayVrednost = $_array_vrednosti[$spr_id];
- if (count($arrayVrednost) > 0) {
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
foreach ($arrayVrednost as $kid=> $vrednost) {
$_GRIDS[0]['variables'][$cnt] = array('vr_id'=>$vrednost['id'],'naslov'=>$vrednost['naslov'], 'variable'=>$vrednost['variable'].$vrednostLoopSufix, 'other'=>false, 'text'=>false,'spss'=>$_spss,'sequence'=>$sequence,'naslov_graf'=>$vrednost['naslov_graf']);
$_sequences .= $_seq_prefix.$sequence;
@@ -1057,7 +1102,8 @@ class SurveyDataCollect{
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
$_GRIDS[0][ 'cnt_vars'] = $cnt;
$_GRIDS[0]['naslov'] = $spr_variable;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
break;
@@ -1066,7 +1112,7 @@ class SurveyDataCollect{
case 21:
$cnt=0;
$arrayVrednost = $_array_vrednosti[$spr_id];
- if (count($arrayVrednost) > 0) {
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
foreach ($arrayVrednost as $kid=> $vrednost) {
if ($vrednost['other'] == 0) {
@@ -1085,7 +1131,8 @@ class SurveyDataCollect{
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
$_GRIDS[0]['cnt_vars'] = $cnt;
$_GRIDS[0]['naslov'] = $spr_variable;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
break;
@@ -1102,7 +1149,8 @@ class SurveyDataCollect{
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
$_GRIDS[0]['cnt_vars'] = $cnt;
$_GRIDS[0]['naslov'] = $spr_variable;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
break;
@@ -1119,7 +1167,8 @@ class SurveyDataCollect{
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
$_GRIDS[0]['cnt_vars'] = $cnt;
$_GRIDS[0]['naslov'] = $spr_variable;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
break;
@@ -1127,8 +1176,8 @@ class SurveyDataCollect{
# SN - IMENA
case 9:
$cnt=0;
- $arrayVrednost = $this->SNVariablesForSpr[$_vprasanje_array['id']];
- if (count($arrayVrednost) > 0) {
+ $arrayVrednost = isset($this->SNVariablesForSpr[$_vprasanje_array['id']]) ? $this->SNVariablesForSpr[$_vprasanje_array['id']] : array();
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
foreach ($arrayVrednost as $kid=> $vrednost) {
$_GRIDS[0]['variables'][$cnt] = array('vr_id'=>$vrednost,'naslov'=>($spr_variable.'_'.($cnt+1)), 'variable'=>($spr_variable.'_'.($cnt+1)), 'other'=>false, 'text'=>true,'spss'=>'A'.$spss_lngth,'sequence'=>$sequence);
$_sequences .= $_seq_prefix.$sequence;
@@ -1140,7 +1189,8 @@ class SurveyDataCollect{
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
$_GRIDS[0]['cnt_vars'] = $cnt;
$_GRIDS[0]['naslov'] = $spr_variable;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
break;
@@ -1152,7 +1202,7 @@ class SurveyDataCollect{
if($row['enota'] == 3){
$cnt=0;
$arrayVrednost = $_array_vrednosti[$spr_id];
- if (count($arrayVrednost) > 0) {
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
foreach ($arrayVrednost as $kid=> $vrednost) {
if ($vrednost['other'] == 0) {
@@ -1170,7 +1220,8 @@ class SurveyDataCollect{
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
$_GRIDS[0]['cnt_vars'] = $cnt;
$_GRIDS[0]['naslov'] = $spr_variable;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
}
else{
@@ -1223,8 +1274,8 @@ class SurveyDataCollect{
$cnt++;
}
//checkbox vrednosti za imena obmocij
- $arrayVrednost = $_array_vrednosti[$spr_id];
- if (count($arrayVrednost)>0) {
+ $arrayVrednost = isset($_array_vrednosti[$spr_id]) ? $_array_vrednosti[$spr_id] : null;
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
foreach ($arrayVrednost as $vrednost) {
# dodamo header variable samo za ne -missing variable
@@ -1262,14 +1313,14 @@ class SurveyDataCollect{
// s katero sekvenco se začnejo meta podatki
$_HEADER['_settings']['metaSequence'] = $sequence;
- $_HEADER['meta'] = array('tip'=>'sm', 'variable'=>'smeta', 'naslov' =>$lang['srv_displaydata_meta'],'cnt_all'=>2);
+ $_HEADER['meta'] = array('tip'=>'sm', 'variable'=>'smeta', 'naslov' =>$lang['srv_displaydata_meta2'],'cnt_all'=>2);
// Datum insert, datum edit, datume in čase za posamezno stran
$_g_cnt = 0;
$_tmp_seq = $sequence;
// Na zacetku prikazemo randomizacijo ce je prisotna pri kaksnem vprasanju ali bloku
- foreach ($this->_array_random as $random_parent) {
+ foreach ($this->_array_random as $parent_id => $random_parent) {
if($random_parent['type'] == 'spr'){
$_HEADER['meta']['grids'][$_g_cnt] = Array('naslov'=>'Random '.$random_parent['variable']);
@@ -1321,16 +1372,24 @@ class SurveyDataCollect{
$page = 1;
foreach ($this->_array_groups as $gid => $grupa) {
- $_HEADER['meta']['grids'][$_g_cnt] = Array('naslov'=>$lang['page'].' '.$page);
+ // Uvod
+ if($gid == '0'){
+ $_HEADER['meta']['grids'][$_g_cnt] = Array('naslov'=>$lang['intro']);
- # date on page
- $_HEADER['meta']['grids'][$_g_cnt]['variables'][0] = Array ('variable'=>'date_'.$page,'naslov'=>'datum_'.$page,'spss'=>'DATETIMEw','sortType'=>'date','sequence'=>$sequence);
- $sequence++;
+ # date on page
+ $_HEADER['meta']['grids'][$_g_cnt]['variables'][0] = Array ('variable'=>'date_0','naslov'=>'datum_0','spss'=>'DATETIMEw','sortType'=>'date','sequence'=>$sequence);
+ }
+ else{
+ $_HEADER['meta']['grids'][$_g_cnt] = Array('naslov'=>$lang['page'].' '.$page);
+ # date on page
+ $_HEADER['meta']['grids'][$_g_cnt]['variables'][0] = Array ('variable'=>'date_'.$page,'naslov'=>'datum_'.$page,'spss'=>'DATETIMEw','sortType'=>'date','sequence'=>$sequence);
+
+ $page++;
+ }
+
$_HEADER['meta']['grids'][$_g_cnt]['cnt_vars'] = 1;
-
- $page++;
- $_g_cnt++;
+ $sequence++; $_g_cnt++;
}
// IP
@@ -1403,7 +1462,7 @@ class SurveyDataCollect{
$_tmpCnt = $c * MAX_USER_PER_LOOP;
- $_dataLine = "";
+ $_dataLine = '';
// Dobimo vse jezike za katere obstaja jezikovna datoteka
include_once($site_path.'lang/jeziki.php');
@@ -1413,7 +1472,7 @@ class SurveyDataCollect{
$jeziki[$lang['id']] = $lang['language'];
if ($this->noErrors) {
-
+
while ($rowUser = mysqli_fetch_assoc($this->_qry_users[$c])) {
#sleep(1);
@@ -1422,9 +1481,9 @@ class SurveyDataCollect{
$uid = $rowUser['usr_id'];
# dodamo usr id k podatkom
$_dataLine .= $rowUser['usr_id'];
-
- # dodamo ustreznost k podatkom - relevance
- $_dataLine .= STR_DLMT. (($rowUser['status'] == 5 || $rowUser['status'] == 6) && $rowUser['lurker'] == 0 ? '1' : '0');
+
+ # dodamo status k podatkom
+ $_dataLine .= STR_DLMT.$rowUser['status'];
# dodamo email (invitation)k podatkom - če je bilo poslano z emailom ali je uporabnik ročno vnesel email
$_dataLine .= STR_DLMT. ((int)$rowUser['inv_res_id'] > 0 || (int)$rowUser['inv_res_id'] == -1
@@ -1436,9 +1495,9 @@ class SurveyDataCollect{
: '2')
# uporabnik ni bil dodan z email vabilom
: '0');
-
- # dodamo status k podatkom
- $_dataLine .= STR_DLMT.$rowUser['status'];
+
+ # dodamo ustreznost k podatkom - relevance
+ $_dataLine .= STR_DLMT. (($rowUser['status'] == 5 || $rowUser['status'] == 6) && $rowUser['lurker'] == 0 ? '1' : '0');
# dodamo lurkerje
$_dataLine .= STR_DLMT.$rowUser['lurker'];
@@ -1474,6 +1533,10 @@ class SurveyDataCollect{
if ($this->noErrors && count($this->AllQuestionsOrder) > 0) {
foreach ($this->AllQuestionsOrder AS $_vprasanje_array) {
+ // Ce vrpasanje ni nastavljeno preskocimo
+ if(!isset($this->AllQuestionsData[$_vprasanje_array['id']]))
+ continue;
+
$rowVprasanje = $this->AllQuestionsData[$_vprasanje_array['id']];
# spremenljivki dodamo loop_id da je konsistentno z podatki
@@ -1614,7 +1677,7 @@ class SurveyDataCollect{
$userAnswerLine .= STR_DLMT.$this->recode_answer($spr_id,$answer,$uid);
// poiščemo polja drugo
- if (count($spr_vrednosti) > 0){
+ if (isset($spr_vrednosti) && is_countable($spr_vrednosti) && count($spr_vrednosti) > 0){
foreach ($spr_vrednosti AS $vid => $vrednost) {
@@ -1732,7 +1795,7 @@ class SurveyDataCollect{
#ce smo meli checkboc obkljukan
if (isset($_tmp_answers[$vid])) {
- $answerOther = ($spr_data_text[$vid]['text'] == "" || $spr_data_text[$vid]['text'] == null) ? $VALUE_FOR_MISSING : $spr_data_text[$vid]['text'];
+ $answerOther = (!isset($spr_data_text[$vid]['text']) || $spr_data_text[$vid]['text'] == "" || $spr_data_text[$vid]['text'] == null) ? $VALUE_FOR_MISSING : $spr_data_text[$vid]['text'];
} else if ($missing_answers !== null) {
// Ce je bil 0 texta ni mogel vnesti in mora bit -2
if($VALUE_FOR_MISSING == -1)
@@ -2293,28 +2356,27 @@ class SurveyDataCollect{
case 9:
# zloopamo skozi podvprašanja in nastavimo izbrane odgovore
- $arrayVrednost = $this->SNVariablesForSpr[$_vprasanje_array['id']];
- if (!is_array($arrayVrednost)) {
- $arrayVrednost = array();
- }
- if(count($spr_vrednosti) > 0)
- foreach ($spr_vrednosti AS $vid => $vrednost) {
- if (in_array($vid,$arrayVrednost)) {
- $answer = null;
- if (isset($spr_data_text[$vid]['text'])) {
- # imamo normalno text vprašanje
- $answer = $spr_data_text[$vid]['text'];
-
- } else if (is_array($spr_data_vred) && count($spr_data_vred) > 0 ) {
- $answer = end($spr_data_vred);
- }
-
- if ($answer == "" || $answer == null) {
- $answer = $VALUE_FOR_MISSING;
- } // end if
- $userAnswerLine .= STR_DLMT.$this->recode_answer($spr_id,$answer,$uid);
-
- }
+ $arrayVrednost = isset($this->SNVariablesForSpr[$_vprasanje_array['id']]) ? $this->SNVariablesForSpr[$_vprasanje_array['id']] : array();
+
+ if(count($spr_vrednosti) > 0){
+ foreach ($spr_vrednosti AS $vid => $vrednost) {
+ if (in_array($vid,$arrayVrednost)) {
+ $answer = null;
+ if (isset($spr_data_text[$vid]['text'])) {
+ # imamo normalno text vprašanje
+ $answer = $spr_data_text[$vid]['text'];
+
+ } else if (is_array($spr_data_vred) && count($spr_data_vred) > 0 ) {
+ $answer = end($spr_data_vred);
+ }
+
+ if ($answer == "" || $answer == null) {
+ $answer = $VALUE_FOR_MISSING;
+ } // end if
+ $userAnswerLine .= STR_DLMT.$this->recode_answer($spr_id,$answer,$uid);
+
+ }
+ }
}
break;
@@ -2376,7 +2438,7 @@ class SurveyDataCollect{
# ce imamo odgovor
if (isset ($spr_data_map)) {
$missing_value_temp = (is_array($spr_data_vred) && count($spr_data_vred) == 1 ) ? end($spr_data_vred) : $VALUE_FOR_MISSING;
- $answerArr = (is_countable($spr_data_map['izpis']) && count($spr_data_map['izpis']) > 0) ? $spr_data_map['izpis'] : $missing_value_temp;
+ $answerArr = (isset($spr_data_map['izpis']) && is_countable($spr_data_map['izpis']) && count($spr_data_map['izpis']) > 0) ? $spr_data_map['izpis'] : $missing_value_temp;
}
else if (is_array($spr_data_map)) {
$key = key($spr_data_map);
@@ -2442,8 +2504,8 @@ class SurveyDataCollect{
$newParams = new enkaParameters($row['params']);
// ce imamo odgovor
- if (isset ($spr_data_heatmap)) {
- $answerArr = (is_countable($spr_data_heatmap['izpis']) && count($spr_data_heatmap['izpis']) > 0) ? $spr_data_heatmap['izpis'] : $VALUE_FOR_MISSING;
+ if (isset ($spr_data_heatmap['izpis'])) {
+ $answerArr = (is_countable($spr_data_heatmap['izpis']) && count($spr_data_heatmap['izpis']) > 0) ? $spr_data_heatmap['izpis'] : $VALUE_FOR_MISSING;
}
else if (is_array($spr_data_heatmap)) {
$key = key($spr_data_heatmap);
@@ -2489,37 +2551,38 @@ class SurveyDataCollect{
$numberOfPointsInside=array();
if (count($spr_vrednosti) > 0) {
- $i=0;
- foreach ($this->_array_data_heatmap_regions[(int)$spr_id] AS $regions){
- $answerReg = null;
- $numberOfPointsInside[$regions['region_name']] = 0; // Belezi stevilo tock znotraj trenutnega obmocja
-
- // Pretvori polje s tockami obmocja v ustrezno obliko
- $poly = $this->convertPolyString($regions['region_coords']);
-
- // preveri, ali je posamezna tocka znotraj trenutnega obmocja
- for ($z=0; $z<sizeof($pointx); $z++){
- $inside = $this->insidePoly($poly, $pointx[$z]["x"], $pointy[$z]["y"]);
- if ($inside == true){
- $numberOfPointsInside[$regions['region_name']]++;
- }
- }
-
- // Priprava odgovora za preglednico s podatki
- // Ce je missing
- if($answerKoo < 0){
- $answerReg = $answerKoo;
+ $i=0;
+ if(isset($this->_array_data_heatmap_regions[(int)$spr_id]))
+ foreach ($this->_array_data_heatmap_regions[(int)$spr_id] AS $regions){
+ $answerReg = null;
+ $numberOfPointsInside[$regions['region_name']] = 0; // Belezi stevilo tock znotraj trenutnega obmocja
+
+ // Pretvori polje s tockami obmocja v ustrezno obliko
+ $poly = $this->convertPolyString($regions['region_coords']);
+
+ // preveri, ali je posamezna tocka znotraj trenutnega obmocja
+ for ($z=0; $z<sizeof($pointx); $z++){
+ $inside = $this->insidePoly($poly, $pointx[$z]["x"], $pointy[$z]["y"]);
+ if ($inside == true){
+ $numberOfPointsInside[$regions['region_name']]++;
+ }
+ }
+
+ // Priprava odgovora za preglednico s podatki
+ // Ce je missing
+ if($answerKoo < 0){
+ $answerReg = $answerKoo;
+ }
+ else{
+ $answerReg = $numberOfPointsInside[$regions['region_name']];
+ }
+
+ $i++;
+
+ // dodamo odgovor s stevilom tock znotraj obmocja
+ $userAnswerLine .= STR_DLMT.$this->recode_answer($spr_id,$answerReg,$uid);
+
}
- else{
- $answerReg = $numberOfPointsInside[$regions['region_name']];
- }
-
- $i++;
-
- // dodamo odgovor s stevilom tock znotraj obmocja
- $userAnswerLine .= STR_DLMT.$this->recode_answer($spr_id,$answerReg,$uid);
-
- }
}
}
//za območja - konec
@@ -2577,7 +2640,7 @@ class SurveyDataCollect{
// Random vrstni redi
- foreach ($this->_array_random as $random_parent) {
+ foreach ($this->_array_random as $parent_id => $random_parent) {
$type = ($random_parent['type'] == 'spr') ? 'spr' : 'block';
$random_data = $this->get_array_data_random($uid, $random_parent['id'], $type);
@@ -2601,9 +2664,10 @@ class SurveyDataCollect{
# strani in časi
foreach ($this->_array_groups AS $gid => $grupa) {
- if ($this->_array_user_grupa[$uid][$gid] != '') {
+ if (isset($this->_array_user_grupa[$uid][$gid]) && $this->_array_user_grupa[$uid][$gid] != '') {
$_dataLine .= STR_DLMT.datetime($this->_array_user_grupa[$uid][$gid]);
- } else {
+ }
+ else {
$_dataLine .= STR_DLMT.'';
}
}
@@ -2643,8 +2707,8 @@ class SurveyDataCollect{
$this->noErrors = false;
}
- $_dataLine = null;
unset($_dataLine);
+ $_dataLine = '';
}
else {
# dodamo v log napako
@@ -2765,6 +2829,13 @@ class SurveyDataCollect{
$cnt = 0;
if ($this->_cnt_groups > 0) {
$this->_array_groups = array();
+
+ // Uvod - ce je prikazan v anketi
+ if($this->survey['show_intro'] == '1'){
+ $this->_array_groups['0'] = '0';
+ $str .= '0,';
+ }
+
$prefix ='';
while ($row = mysqli_fetch_assoc($qry_groups)) {
@@ -2880,7 +2951,7 @@ class SurveyDataCollect{
$rowVprasanja = array();
- if (!is_countable($sgmMap[$rowMainVprasanje['id']]) || count($sgmMap[$rowMainVprasanje['id']]) == 0) {
+ if (!isset($sgmMap[$rowMainVprasanje['id']]) || count($sgmMap[$rowMainVprasanje['id']]) == 0) {
$rowVprasanja[] = $rowMainVprasanje;
}
else {
@@ -2913,12 +2984,12 @@ class SurveyDataCollect{
$this->AllQuestionsData[$rowVprasanje['id']] = array(
'id' => $rowVprasanje['id'],
'spr_id' => $spr_id,
- 'sgm_parrent' => $rowVprasanje['sgm_parrent'],
+ 'sgm_parrent' => isset($rowVprasanje['sgm_parrent']) ? $rowVprasanje['sgm_parrent'] : '',
'tip' => $rowVprasanje['tip'],
'gru_id' => $rowVprasanje['gru_id'],
'variable' => strip_tags($rowVprasanje['variable']),
'naslov' => strip_tags($rowVprasanje['naslov']),
- 'label' => strip_tags($rowVprasanje['label']),
+ 'label' => (isset($rowVprasanje['label']) ? strip_tags($rowVprasanje['label']) : ''),
'size' => $rowVprasanje['size'],
'cela' => $rowVprasanje['cela'],
'grid_subtitle1' => $rowVprasanje['grid_subtitle1'],
@@ -3034,6 +3105,8 @@ class SurveyDataCollect{
$this->_array_loop_on_spr = array();
$this->_array_loop_parent = array();
+ $_cnt_loop = 0;
+
$qryLoop_spr_select = sisplet_query("SELECT l.if_id, l.spr_id
FROM srv_branching AS b, srv_loop AS l
WHERE b.ank_id = '".$this->sid."' AND b.element_if = l.if_id");
@@ -3084,6 +3157,22 @@ class SurveyDataCollect{
foreach ($spr_ids AS $spr_id) {
$this->_array_spr_in_loop[$spr_id] = $lkey;
$this->_array_loop_has_spr[$lkey][] = $spr_id;
+
+ // Pri kombinirani tabeli dodamo v array se podtabele
+ $row = Cache::srv_spremenljivka($spr_id);
+ if($row['tip'] == 24){
+
+ $sqlMT = sisplet_query("SELECT s.id
+ FROM srv_spremenljivka s, srv_grid_multiple mt
+ WHERE mt.ank_id='".$this->sid."' AND mt.parent='".$spr_id."' AND mt.spr_id=s.id
+ ORDER BY mt.vrstni_red ASC
+ ");
+ while ($rowMT = mysqli_fetch_array($sqlMT)) {
+ $this->_array_spr_in_loop[$rowMT['id']] = $lkey;
+ $this->_array_loop_has_spr[$lkey][] = $rowMT['id'];
+ }
+ }
+
}
}
}
@@ -3240,12 +3329,12 @@ class SurveyDataCollect{
}
$this->_array_random = array();
-
+ $i=0;
// Preberemo vsa VPRASANJA ki imajo vklopljeno randomizacijo
$_qry_random_spr = sisplet_query("SELECT s.id, s.variable FROM srv_spremenljivka s, srv_grupa g
WHERE g.ank_id='".$this->sid."' AND s.gru_id=g.id AND s.random='1'
- ORDER BY s.vrstni_red");
+ ORDER BY g.vrstni_red ASC, s.vrstni_red ASC");
if (!$_qry_random_spr) {
$this->trigerError('get_random', mysqli_error($GLOBALS['connect_db']));
}
@@ -3255,11 +3344,14 @@ class SurveyDataCollect{
// Napolnimo array z randomiziranimi vprasanji
if ($cnt_rows > 0) {
+
+
while ($row = mysqli_fetch_array($_qry_random_spr)) {
-
- $this->_array_random[$row['id']]['id'] = $row['id'];
+ $this->_array_random[$row['id']]['id'] = $row['id'];
$this->_array_random[$row['id']]['variable'] = $row['variable'];
$this->_array_random[$row['id']]['type'] = 'spr';
+
+ $i++;
}
}
@@ -3297,7 +3389,9 @@ class SurveyDataCollect{
// Blok ima randomizirana vprasanja
else{
$this->_array_random[$row['id']]['type'] = 'blok_spr';
- }
+ }
+
+ $i++;
}
}
}
@@ -3662,7 +3756,7 @@ class SurveyDataCollect{
if($text == '' || $text == null) $text = '-1';
// Addslashes je potreben za analize
- if($this->_array_data_map[(int)$usr_id][$spr_id.'_'.$loop_id]){
+ if(isset($this->_array_data_map[(int)$usr_id][$spr_id.'_'.$loop_id])){
$this->_array_data_map[(int)$usr_id][$spr_id.'_'.$loop_id]['izpis'][$i] = array(
'address'=>addslashes(strip_tags($address)),
'vrednost'=>addslashes(strip_tags($text)),
@@ -3670,11 +3764,15 @@ class SurveyDataCollect{
}
else{
$this->_array_data_map[(int)$usr_id][$spr_id.'_'.$loop_id] = array(
- 'izpis'=>array(array(
- 'address'=>addslashes(strip_tags($address)),
- 'vrednost'=>addslashes(strip_tags($text)),
- 'koordinate'=>$lat . ', ' . $lng)),
- 'spr_id' => $spr_id, 'usr_id' => $usr_id, 'loop_id' => $loop_id);
+ 'izpis'=>array(
+ array(
+ 'address'=>addslashes(strip_tags($address)),
+ 'vrednost'=>addslashes(strip_tags($text)),
+ 'koordinate'=>$lat . ', ' . $lng
+ )
+ ),
+ 'spr_id' => $spr_id, 'usr_id' => $usr_id, 'loop_id' => $loop_id
+ );
}
$i++;
@@ -3715,19 +3813,24 @@ class SurveyDataCollect{
if($text == '' || $text == null) $text = '-1';
// adslashes je potreben za analize
- if($this->_array_data_heatmap[(int)$usr_id][$spr_id.'_'.$loop_id]){
+ if(isset($this->_array_data_heatmap[(int)$usr_id][$spr_id.'_'.$loop_id])){
$this->_array_data_heatmap[(int)$usr_id][$spr_id.'_'.$loop_id]['izpis'][$i] = array(
'address'=>addslashes(strip_tags($address)),
'vrednost'=>addslashes(strip_tags($text)),
- 'koordinate'=> $lat . ', ' . $lng);
+ 'koordinate'=> $lat . ', ' . $lng
+ );
}
else{
$this->_array_data_heatmap[(int)$usr_id][$spr_id.'_'.$loop_id] = array(
- 'izpis'=>array(array(
- 'address'=>addslashes(strip_tags($address)),
- 'vrednost'=>addslashes(strip_tags($text)),
- 'koordinate'=>$lat . ', ' . $lng)),
- 'spr_id' => $spr_id, 'usr_id' => $usr_id, 'loop_id' => $loop_id);
+ 'izpis'=>array(
+ array(
+ 'address'=>addslashes(strip_tags($address)),
+ 'vrednost'=>addslashes(strip_tags($text)),
+ 'koordinate'=>$lat . ', ' . $lng
+ )
+ ),
+ 'spr_id' => $spr_id, 'usr_id' => $usr_id, 'loop_id' => $loop_id
+ );
}
$i++;
@@ -3860,7 +3963,7 @@ class SurveyDataCollect{
if (mysqli_num_rows($_qry_data_random) > 0) {
while($row2 = mysqli_fetch_array($_qry_data_random)){
-
+
// Zgradimo string z labelami vprasanj za prikaz v podatkih
$vrstni_red_string = '';
@@ -4054,7 +4157,7 @@ class SurveyDataCollect{
// Pripravimo missing vrednosti za anketo
private function setSurveyMissingValues() {
- $smv = new SurveyMissingValues($sid);
+ $smv = new SurveyMissingValues($this->sid);
$smv -> Init();
$_sys_missings = $smv->GetSurveyMissingValues();
@@ -4093,7 +4196,7 @@ class SurveyDataCollect{
return $result;
}
- if ($this->_user_spr_answer_count['last_seen'] == $this->_user_spr_answer_count['cnt']) {
+ if (isset($this->_user_spr_answer_count['last_seen']) && $this->_user_spr_answer_count['last_seen'] == $this->_user_spr_answer_count['cnt']) {
return $result;
}
@@ -4101,12 +4204,12 @@ class SurveyDataCollect{
return $result;
}
- foreach ($this->_user_spr_answer_count['spremenljivke'] AS $cnt) {
-
- if ($this->_user_spr_answer_count['last_seen'] > $result) {
- $result += $cnt;
- }
- }
+ if (isset($this->_user_spr_answer_count['last_seen']))
+ foreach ($this->_user_spr_answer_count['spremenljivke'] AS $cnt) {
+ if ($this->_user_spr_answer_count['last_seen'] > $result) {
+ $result += $cnt;
+ }
+ }
return $this->_user_spr_answer_count['cnt'] - $result;
}
@@ -4189,7 +4292,7 @@ class SurveyDataCollect{
// Pogledamo se ce je respondent videl vprasanje (tudi ce je -1, ker ga potem ne smemo spremenit v -3)
if ($answer == -1 || $answer === '-2d') {
- if (is_array($this->_array_user_grupa[$uid]) && array_key_exists($this->AllQuestionsData[$spr]['gru_id'], $this->_array_user_grupa[$uid])) {
+ if (isset($this->_array_user_grupa[$uid]) && is_array($this->_array_user_grupa[$uid]) && array_key_exists($this->AllQuestionsData[$spr]['gru_id'], $this->_array_user_grupa[$uid])) {
$this->_user_spr_answer_count['last_seen'] = $this->_user_spr_answer_count['cnt'] - 1;
}
}
@@ -4290,7 +4393,8 @@ class SurveyDataCollect{
$coordsWithComma = explode('<br>',$answerKoo);
$pointx = array();
$pointy = array();
-
+ $coords = array();
+
for($i = 1; $i<sizeof($coordsWithComma); $i++){
// Vecdimenzionalno polje
diff --git a/admin/survey/classes/surveyData/class.SurveyDataDisplay.php b/admin/survey/classes/surveyData/class.SurveyDataDisplay.php
index bc50f46..982aa68 100644
--- a/admin/survey/classes/surveyData/class.SurveyDataDisplay.php
+++ b/admin/survey/classes/surveyData/class.SurveyDataDisplay.php
@@ -30,6 +30,7 @@ define('VAR_SORT_SEQ', 'sort_seq');
define('VAR_SORT_TYPE', 'sort_type');
define('VAR_PDF_TYPE', 'type');
define('VAR_RELEVANCE', 'view_relevance');
+define('VAR_STATUS', 'view_status');
define('VAR_SHOW_DATE', 'view_date', false);
define('VAR_SHOW_NO', 'view_no', false);
define('VAR_EMAIL', 'email');
@@ -90,10 +91,14 @@ class SurveyDataDisplay{
'dataIcons_write'=>false); #ali prikazujemo ikone za urejanje
static private $displayEditIconsSettings = false; # ali prikazujemo okno s checkboxi za nastavitve tabele s podatki
+
+ static private $displayDataFullscreen = false; # ali prikazujemo podatke v fullscreen pogledu
static private $printPreview = false; # ali prikazujemo podatke kot print preview;
static private $canDisplayRelevance = true; # ali prikazujemo ustreznost - relevance;
+
+ static private $canDisplayStatus = true; # ali prikazujemo status;
static private $quickEdit_recnum = array(); # array z prejsnjim in naslednjim recnumom (za vpogled - puscici naprej,nazaj)
@@ -114,7 +119,9 @@ class SurveyDataDisplay{
VAR_PDF_TYPE => 0, # tip izpisa pdf (0 -> kratek, 1 -> dolg, 2 -> zelo kratek)
VAR_SORT_SEQ => '', # po kateri sekvenci sortiramo
VAR_SORT_TYPE => '', # način sortiranja (naraščajoče, padajoče)
- VAR_RELEVANCE => 1, # ali prikazujemo ustreznost
+ // VAR_RELEVANCE je po novem podrobnosti stausa (leva stran)
+ VAR_RELEVANCE => 0, # ali prikazujemo ustreznost
+ VAR_STATUS => 1, # ali prikazujemo status (in vabila)
VAR_EMAIL => 1, # ali prikazujemo email status
VAR_CIRCLES => 0, # ali prikazujemo kroge antonučija
VAR_SHOW_DATE => 0, # ali prikazujemo kroge antonučija
@@ -165,8 +172,7 @@ class SurveyDataDisplay{
self::$survey = SurveyInfo::getInstance()->getSurveyRow();
# aktivne tabele
- if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
- self::$db_table = '_active';
+ self::$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
# ali je anketa tipa SN - social network
self::$is_social_network = (SurveyInfo::getInstance()->checkSurveyModule('social_network')) ? true : false;
@@ -177,8 +183,7 @@ class SurveyDataDisplay{
}
# ali prikazujemo datum na začetku ankete (Če smo v identifikatorjih ne smemo zaradi povezovanja)
- if ( (self::$_VARS[VAR_SHOW_DATE] == true || (int)SurveyInfo :: getInstance()->getSurveyColumn('showItime') == 1) && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
- //if (self::$_VARS[VAR_SHOW_DATE] == true && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
+ if ( self::$_VARS[VAR_SHOW_DATE] == true && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
self::$showItime = true;
}
else {
@@ -186,8 +191,7 @@ class SurveyDataDisplay{
}
# ali prikazujemo zaporedno številko. (Če smo v identifikatorjih ne smemo zaradi povezovanja)
- if ( (self::$_VARS[VAR_SHOW_NO] == true || (int)SurveyInfo :: getInstance()->getSurveyColumn('showLineNumber') == 1) && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
- //if (self::$_VARS[VAR_SHOW_NO] == true) {
+ if ( self::$_VARS[VAR_SHOW_NO] == true && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
self::$showLineNumber = true;
}
else {
@@ -216,10 +220,13 @@ class SurveyDataDisplay{
if(isset($_SESSION['sid_'.self::$sid]['dataIcons_settings']))
self::$displayEditIconsSettings = ($_SESSION['sid_'.self::$sid]['dataIcons_settings']);
+
+ if(isset($_SESSION['sid_'.self::$sid]['data_fullscreen']))
+ self::$displayDataFullscreen = ($_SESSION['sid_'.self::$sid]['data_fullscreen']);
# ali filtriramo cms usejreve datotekoe
session_start();
- self::$doCMSUserFilter = $_SESSION['sid_'.$sid]['doCMSUserFilter'];
+ self::$doCMSUserFilter = isset($_SESSION['sid_'.$sid]['doCMSUserFilter']) ? $_SESSION['sid_'.$sid]['doCMSUserFilter'] : false;
session_commit();
@@ -230,7 +237,7 @@ class SurveyDataDisplay{
// Ce imamo urlhash gre za javno povezavo in nikoli ne prikazemo loading okna
$show_loading = (isset($_GET['urlhash'])) ? false : true;
- self::$SDF->prepareFiles($show_loading);
+ self::$SDF->prepareFiles();
self::$headFileName = self::$SDF->getHeaderFileName();
self::$dataFileName = self::$SDF->getDataFileName();
@@ -296,13 +303,13 @@ class SurveyDataDisplay{
$awk_cnt_str = 'awk -F"'.STR_DLMT.'" \''.EMAIL_FIELD.'~/1/'.' {cnt++} END {print cnt}\' \''.self::$dataFileName.'\'';
}
- $emailCount = shell_exec($awk_cnt_str);
-
+ //$emailCount = shell_exec($awk_cnt_str);
+
#self::$_VARS[VAR_EMAIL] = self::$_VARS[VAR_RELEVANCE] && ((int)self::$survey['email'] == 1 && (int)self::$survey['user_base'] == 1);
- if (((int)self::$survey['email'] == 0 && (int)self::$survey['user_base'] == 0) ) {
+ if (!SurveyInfo::getInstance()->checkSurveyModule('email') || !isset(self::$survey['user_base']) || (int)self::$survey['user_base'] == 0 ) {
self::$_VARS[VAR_EMAIL] = 0;
}
-
+
# nastavimo način sortiranja
self::setUpSort();
@@ -506,299 +513,314 @@ class SurveyDataDisplay{
static public function setUpFilter() {
# nastavimo filter po statusih
-
if (self::$headFileName != null && self::$headFileName != '' && file_exists(self::$headFileName)) {
- # kadar zbiramo sistemske, moramo obvezno zbirati tudi podatke, ne smemo pa full meta
- if (self::$_VARS[VAR_SHOW_SYSTEM]){
- self::$_VARS[VAR_DATA] = true;
- self::$_VARS[VAR_META] = true;
- self::$_VARS[VAR_METAFULL] = 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();
- }
+ # kadar zbiramo sistemske, moramo obvezno zbirati tudi podatke, ne smemo pa full meta
+ if (self::$_VARS[VAR_SHOW_SYSTEM]){
+ self::$_VARS[VAR_DATA] = true;
+ self::$_VARS[VAR_META] = true;
+ self::$_VARS[VAR_METAFULL] = false;
+ self::$_VARS[VAR_SHOW_DATE] = false;
+ self::$_VARS[VAR_RELEVANCE] = false;
+ self::$_VARS[VAR_STATUS] = false;
+ }
- if (($_condition_profile_AWK != "" && $_condition_profile_AWK != null )
- || ($_inspect_condition_awk != "" && $_inspect_condition_awk != null)
- || ($_time_profile_awk != "" && $_time_profile_awk != null)
- || ($CMSUserCondition != "" && $CMSUserCondition != null)
- || ($filter_testdata != null)
- || ($filter_usability != null)) {
- self::$_CURRENT_STATUS_FILTER = '('.self::$_CURRENT_STATUS_FILTER;
- if ($_condition_profile_AWK != "" && $_condition_profile_AWK != null ) {
- self::$_CURRENT_STATUS_FILTER .= '&&'.$_condition_profile_AWK;
- }
- if ($_inspect_condition_awk != "" && $_inspect_condition_awk != null ) {
- self::$_CURRENT_STATUS_FILTER .= ' && '.$_inspect_condition_awk;
- }
- if ($_time_profile_awk != "" && $_time_profile_awk != null) {
- self::$_CURRENT_STATUS_FILTER .= '&&'.$_time_profile_awk;
- }
- if ($CMSUserCondition != "" && $CMSUserCondition != null) {
- self::$_CURRENT_STATUS_FILTER .= '&&'.$CMSUserCondition;
- }
- if ($filter_testdata != null ) {
- self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_testdata.')';
- }
- if ($filter_usability != null ) {
- self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_usability.')';
- }
- self::$_CURRENT_STATUS_FILTER .= ')';
- }
-
- # preštejemo vse zapise ki ustrezajo filtru po statusu
- if (IS_WINDOWS) {
- $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);
- }
-
- } 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;
- }
+ # filtriranje po statusih
+ self::$_CURRENT_STATUS_FILTER = SurveyStatusProfiles :: getStatusAsAWKString();
+
+ if (self::$dataFileStatus >= 0) {
+ self::$_HEADERS = unserialize(file_get_contents(self::$headFileName));
+ $filter_testdata = null;
+
+ # 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
+ $filter_usability = null;
+ 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();
+ }
-
- if (self::$_VARS[VAR_REC_ON_PAGE] != 'all') {
- self::$_TOTAL_PAGES = bcdiv(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]);
-
- if (bcmod(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]) > 0)
- self::$_TOTAL_PAGES += 1;
- if (self::$_VARS[VAR_CUR_REC_PAGE] > self::$_TOTAL_PAGES ) {
- self::$_VARS[VAR_CUR_REC_PAGE] = self::$_TOTAL_PAGES;
- } elseif (self::$_VARS[VAR_CUR_REC_PAGE] < 1 ) {
- self::$_VARS[VAR_CUR_REC_PAGE] = 1;
- }
-
- # 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 = '';
- }
- }
- if (self::$_VARS[VAR_DATA]) {
- $tmp_svp_pv = SurveyVariablesProfiles :: getProfileVariables(self::$_PROFILE_ID_VARIABLE );
-
- # č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 ) {
-
- $_sv = self::$SDF->getSurveyVariables();
- if (count($_sv) > 0) {
- foreach ( $_sv as $vid => $variable) {
- $tmp_svp_pv[$vid] = $vid;
- }
- }
- }
- }
- self::$lineoffset=1;
- # če prikazujemo sistemske ne prikazujemo recnumber
- if (!self::$_VARS[VAR_SHOW_SYSTEM] && self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL]) {
- $svp_pv['recnum'] = 'recnum';
- #$svp_pv['code'] = 'code';
- self::$lineoffset++;
- # za code ni ofseta
- #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
- $_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;
- }
- }
- }
+ # dodamo pogoj za filter prepoznave uporabnika iz cms
+ # vklopljeno more bit prepoznava userja iz cms
+ $CMSUserCondition = null;
+ if (self::$doCMSUserFilter == true) {
+ $CMSUserCondition = self::createCMSUserFilter();
+ }
- #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($_condition_profile_AWK) && $_condition_profile_AWK != "" && $_condition_profile_AWK != null )
+ || (isset($_inspect_condition_awk) && $_inspect_condition_awk != "" && $_inspect_condition_awk != null)
+ || (isset($_time_profile_awk) && $_time_profile_awk != "" && $_time_profile_awk != null)
+ || (isset($CMSUserCondition) && $CMSUserCondition != "" && $CMSUserCondition != null)
+ || (isset($filter_testdata) && $filter_testdata != null)
+ || (isset($filter_usability) && $filter_usability != null)) {
+ self::$_CURRENT_STATUS_FILTER = '('.self::$_CURRENT_STATUS_FILTER;
+ if ($_condition_profile_AWK != "" && $_condition_profile_AWK != null ) {
+ self::$_CURRENT_STATUS_FILTER .= '&&'.$_condition_profile_AWK;
+ }
+ if ($_inspect_condition_awk != "" && $_inspect_condition_awk != null ) {
+ self::$_CURRENT_STATUS_FILTER .= ' && '.$_inspect_condition_awk;
+ }
+ if ($_time_profile_awk != "" && $_time_profile_awk != null) {
+ self::$_CURRENT_STATUS_FILTER .= '&&'.$_time_profile_awk;
+ }
+ if ($CMSUserCondition != "" && $CMSUserCondition != null) {
+ self::$_CURRENT_STATUS_FILTER .= '&&'.$CMSUserCondition;
+ }
+ if ($filter_testdata != null ) {
+ self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_testdata.')';
+ }
+ if ($filter_usability != null ) {
+ self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_usability.')';
+ }
+ self::$_CURRENT_STATUS_FILTER .= ')';
+ }
+
+ # preštejemo vse zapise ki ustrezajo filtru po statusu
+ if (IS_WINDOWS) {
+ $awk_string = 'awk -F"'.STR_DLMT.'" "'.self::$_CURRENT_STATUS_FILTER.' {cnt++} END {print cnt}" '.self::$dataFileName;
+ $recCount = shell_exec($awk_string);
+ if (isset($_GET['debug']) && $_GET['debug'] == 1) {
+ print_r('<br>'.$awk_string);
+ }
+
+ } else {
+ $awk_string = 'awk -F"'.STR_DLMT.'" \''.self::$_CURRENT_STATUS_FILTER.' {cnt++} END {print cnt}\' \''.self::$dataFileName.'\'';
+ $recCount = shell_exec($awk_string);
+ if (isset($_GET['debug']) && $_GET['debug'] == 1) {
+ print_r('<br>'.$awk_string);
+ }
+ }
+ if ((int)$recCount > 0 ) {
+ self::$_RECORD_COUNT = (int)$recCount;
+ }
- 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_REC_ON_PAGE] != 'all') {
+ self::$_TOTAL_PAGES = bcdiv(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]);
+
+ if (bcmod(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]) > 0)
+ self::$_TOTAL_PAGES += 1;
+ if (self::$_VARS[VAR_CUR_REC_PAGE] > self::$_TOTAL_PAGES ) {
+ self::$_VARS[VAR_CUR_REC_PAGE] = self::$_TOTAL_PAGES;
+ } elseif (self::$_VARS[VAR_CUR_REC_PAGE] < 1 ) {
+ self::$_VARS[VAR_CUR_REC_PAGE] = 1;
+ }
+
+ # 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 = '';
+ }
+ }
- 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'];
- }
+ $tmp_svp_pv = array();
+ $svp_pv = array();
+ if (self::$_VARS[VAR_DATA]) {
+ $tmp_svp_pv = SurveyVariablesProfiles :: getProfileVariables(self::$_PROFILE_ID_VARIABLE );
+
+ # č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 ) {
+
+ $_sv = self::$SDF->getSurveyVariables();
+ if (count($_sv) > 0) {
+ foreach ( $_sv as $vid => $variable) {
+ $tmp_svp_pv[$vid] = $vid;
+ }
+ }
+ }
+ }
- # 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 = ',';
- }
- }
- }
+ self::$lineoffset=1;
+
+ # če prikazujemo sistemske ne prikazujemo recnumber
+ if (!self::$_VARS[VAR_SHOW_SYSTEM] && self::$_VARS[VAR_RELEVANCE] /* self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL] */) {
+ $svp_pv['recnum'] = 'recnum';
+ 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
+ $_sistemski = false;
+ if (!self::$_VARS[VAR_SHOW_SYSTEM] && isset(self::$_HEADERS[$_svp_pv]['hide_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] && (!isset(self::$_HEADERS[$_svp_pv]['hide_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_STATUS] /* || ( $ssp_pid = SurveyStatusProfiles::getCurentProfileId() == 1 ) */ ) {
+ $svp_pv['status'] = 'status';
+ self::$lineoffset++;
+
+ # email tion
+ 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++;
}
- $svp_pv[$spid] = $spid;
- }
- }
- }
+ }
- # prilagodimo array profilov variabel
- self::$_SVP_PV = $svp_pv;
- if ($_tmp_filter != '')
- {
+ #geslo vabil
+ if ( self::$_VARS[VAR_EMAIL] && (self::$_VARS[VAR_SHOW_SYSTEM] == true || self::$survey['show_email'] == '1') ) {
+ // dodamo v array da se prikazujejo tudi ti stolpci
+ $svp_pv['code'] = 'code';
+ self::$lineoffset++;
+ }
+ #lurker
+ if ( self::$_VARS[VAR_RELEVANCE] && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
+ // 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++;
+ }
+
+ if (isset(self::$_HEADERS['testdata'])) {
+ self::$_HAS_TEST_DATA = true;
+
+ if(self::$_VARS[VAR_RELEVANCE]){
+ $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::$_VARS[VAR_RELEVANCE] && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
+ $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 = '';
+ $_prfx = '';
+ 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 (isset($grid['variables']) && count($grid['variables']) > 0) {
+ foreach ($grid['variables'] AS $vid => $variable ){
+ $_tmp_filter .= $_prfx.$variable['sequence'];
+ $_prfx = ',';
+ }
+ }
+ }
+ }
+ } // end: paginacija spremenljivk
+
+ if($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm')
+ $spr_cont++;
+ } else
+ # če prikazujemo samo sistemske
+ if ( isset($spremenljivka['variable']) && 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;
}
}
-
}
/** Prikaže filtre za število podatkov....
@@ -815,99 +837,7 @@ class SurveyDataDisplay{
}
# če imamo podatke
- if (self::$dataFileStatus != FILE_STATUS_SRV_DELETED) {
-
- echo '<div id="dataSettingsCheckboxes" '.(self::$displayEditIconsSettings ? '' : ' style="display:none;"').'>';
-
- echo '<div id="toggleDataCheckboxes2" onClick="toggleDataCheckboxes(\'data\');"><span class="faicon close icon-orange" style="padding-bottom:2px;"></span> '.$lang['srv_data_settings_checkboxes2'].'</div>';
-
- if(self::$dataFileStatus != FILE_STATUS_NO_DATA){
- echo '<div id="dataSetingsLinks" class="data noBorder">';
- self::displayLeftFilters();
- echo '</div>'; // konec diva za paginacijo
- }
-
- if (self :: $is_social_network == false || self::$_VARS[VAR_CIRCLES] == 0) {
-
- echo '<div class="clr" id="dataIconSetingsLinks" >'.$lang['srv_dataIcons_note'].'&nbsp;&nbsp;';
-
- if (self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
- echo '<input type="checkbox" id="dataIcons_quick_view" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_quick_view'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_quick_view">'.$lang['srv_dataIcons_quick_view'].'</label>';
- echo '&nbsp;&nbsp;';
- /*echo '<input type="checkbox" id="dataIcons_edit" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_edit'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_edit">'.$lang['srv_dataIcons_edit'].'</label>';
- if (self::$displayEditIcons['dataIcons_edit'] == true) {
- echo ' '.Help::display('srv_podatki_urejanje_inline');
- }
- echo '&nbsp;&nbsp;';
- echo '<input type="checkbox" id="dataIcons_write" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_write'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_write">'.$lang['srv_dataIcons_write'].'</label>';
- echo '&nbsp;&nbsp;';*/
- echo '<input type="checkbox" id="dataIcons_labels" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_labels'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_labels">'.$lang['srv_dataIcons_labels'].'</label>';
-
- if ( self::showMultiple() ) {
- echo '&nbsp;&nbsp;';
- echo '<input type="checkbox" id="dataIcons_multiple" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_multiple'] == true ? ' checked="checekd"' : '').' /><label for="dataIcons_multiple">'.$lang['srv_dataIcons_multiple'].'</label>';
- }
- } else {
- echo '<input type="checkbox" id="dataIcons_quick_view" disabled="disabled" /><label for="dataIcons_quick_view" class="gray">'.$lang['srv_dataIcons_quick_view'].'</label>';
- echo '&nbsp;&nbsp;';
- /*echo '<input type="checkbox" id="dataIcons_edit" disabled="disabled" /><label for="dataIcons_edit" class="gray">'.$lang['srv_dataIcons_edit'].'</label>';
- if (self::$displayEditIcons['dataIcons_edit'] == true) {
- echo ' '.Help::display('srv_podatki_urejanje_inline');
- }
- echo '&nbsp;&nbsp;';
- echo '<input type="checkbox" id="dataIcons_write" disabled="disabled" /><label for="dataIcons_write" class="gray">'.$lang['srv_dataIcons_write'].'</label>';
- echo '&nbsp;&nbsp;';*/
- echo '<input type="checkbox" id="dataIcons_labels" disabled="disabled" /><label for="dataIcons_labels" class="gray">'.$lang['srv_dataIcons_labels'].'</label>';
-
- if ( self::showMultiple() ) {
- echo '&nbsp;&nbsp;';
- echo '<input type="checkbox" id="dataIcons_multiple" disabled="disabled" /><label for="dataIcons_multiple" class="gray">'.$lang['srv_dataIcons_multiple'].'</label>';
- }
- }
-
- # preverimo koliko anket je dejansko uporbaniških
- # za potrebne statuse
- $statuses = SurveyStatusProfiles :: getStatusAsArrayString();
-
- $lurkers = false;
- if (is_array($statuses) && count($statuses) > 0) {
- # najprej preverimo ali filtriramo lurkereje
- if (isset($statuses['lurker'])) {
- $lurkers = true;
- unset($statuses['lurker']);
- }
-
- if (count($statuses) > 0) {
- $sstring = ' AND last_status IN (';
- foreach ($statuses AS $skey => $status) {
- if (is_numeric($skey)) {
- $sstring.=$prefix.$skey;
- } else if($skey == 'null') {
- $sstring.=$prefix.'-1';
- }
- $prefix = ',';
- }
- $sstring .=')';
-
- }
- }
-
- $q = sisplet_query("SELECT count(*) FROM srv_user WHERE ank_id = '".self::$sid."' AND user_id > 0 AND deleted='0' ".$sstring);
- list($cnt) = mysqli_fetch_row($q);
-
- if ($cnt > 0) {
- echo '<span class="spaceLeft">';
- self::displayOnlyCMS();
- echo '</span>';
- }
-
- echo '</div>';
- echo '<div class="clr"></div>';
- }
-
- echo '</div>';
-
-
+ if (self::$dataFileStatus != FILE_STATUS_SRV_DELETED) {
# ali imamo testne podatke
if (self::$_HAS_TEST_DATA) {
# izrišemo bar za testne podatke
@@ -936,7 +866,7 @@ class SurveyDataDisplay{
//$_tmp_limit = array(10,50,100,250,500,1000,2500,5000,10000);
$_tmp_limit = array(10,50,100,250,500);
- $_select_records = '<select id="rec_on_page'.$position.'" onchange="setDataView(\''.VAR_REC_ON_PAGE.'\',$(\'select#rec_on_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_rec_on_page'].'">';
+ $_select_records = '<select id="rec_on_page'.$position.'" class="dropdown" onchange="setDataView(\''.VAR_REC_ON_PAGE.'\',$(\'select#rec_on_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_rec_on_page'].'">';
foreach ($_tmp_limit AS $limit) {
if ($limit < self::$_RECORD_COUNT) {
$_select_records .= '<option '.(self::$_VARS[VAR_REC_ON_PAGE] == $limit ? ' selected="selected"' : '').' value="'.$limit.'">';
@@ -947,7 +877,7 @@ class SurveyDataDisplay{
// Opcija "vsi" - ni na voljo ce je vec kot 1000 responsov (drugace lahko vse zasteka)
if(self::$_RECORD_COUNT <= 1000){
$_select_records .= '<option '.(self::$_VARS[VAR_REC_ON_PAGE] == 'all' ? ' selected="selected"' : '').' value="all">';
- $_select_records .= $lang['srv_vsi'];
+ $_select_records .= $lang['all2'];
$_select_records .= '</option>';
}
@@ -960,7 +890,7 @@ class SurveyDataDisplay{
if (self::$_VARS[VAR_REC_ON_PAGE] != 'all' && self::$_TOTAL_PAGES > 1) {
echo '<label>';
- echo $lang['page'];
+ echo $lang['page'].':';
echo '</label>';
// puscica levo
@@ -968,7 +898,7 @@ class SurveyDataDisplay{
echo '<a title="'.$lang['previous_page'].'" href="#" onclick="setDataView(\''.VAR_CUR_REC_PAGE.'\',\''.(self::$_VARS[VAR_CUR_REC_PAGE]-1).'\');"><span class="faicon arrow2_l"></span></a>';
}
- $_records_page = '<select id="cur_rec_page'.$position.'" onchange="setDataView(\''.VAR_CUR_REC_PAGE.'\',$(\'select#cur_rec_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_rec_current_page'].'">';
+ $_records_page = '<select id="cur_rec_page'.$position.'" class="dropdown" onchange="setDataView(\''.VAR_CUR_REC_PAGE.'\',$(\'select#cur_rec_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_rec_current_page'].'">';
for ($i=1; $i<=self::$_TOTAL_PAGES; $i++) {
$_records_page .= '<option'.(self::$_VARS[VAR_CUR_REC_PAGE]==$i ? ' selected="selected"' : '' )
. ' value="'.$i.'" >';
@@ -999,7 +929,7 @@ class SurveyDataDisplay{
//$_spr_limit = array(5=>'5',10=>'10',20=>'20',30=>'30',50=>'50',100=>'100','all'=>$lang['hour_all2']);
$_spr_limit = array(5=>'5',10=>'10',20=>'20',30=>'30',50=>'50');
- $_spr_on_page = '<select id="spr_on_page'.$position.'" onchange="setDataView(\''.VAR_SPR_LIMIT.'\',$(\'select#spr_on_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_spr_on_page'].'">';
+ $_spr_on_page = '<select id="spr_on_page'.$position.'" class="dropdown" onchange="setDataView(\''.VAR_SPR_LIMIT.'\',$(\'select#spr_on_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_spr_on_page'].'">';
foreach ($_spr_limit AS $key => $label) {
if ($key < self::$_ALL_QUESTION_COUNT) {
$_spr_on_page .= '<option '.(self::$_VARS[VAR_SPR_LIMIT] == $key ? ' selected="selected"' : '').' value="'.$key.'">';
@@ -1010,7 +940,7 @@ class SurveyDataDisplay{
// Opcija "vsi" - ni na voljo ce je vec kot 50 vprasanj (drugace lahko vse zasteka)
if(self::$_ALL_QUESTION_COUNT <= 50){
$_spr_on_page .= '<option '.(self::$_VARS[VAR_SPR_LIMIT] == 'all' ? ' selected="selected"' : '').' value="all">';
- $_spr_on_page .= $lang['hour_all2'];
+ $_spr_on_page .= $lang['srv_block_random_all'];
$_spr_on_page .= '</option>';
}
@@ -1021,7 +951,7 @@ class SurveyDataDisplay{
# KATERA STRAN
// prestejemo stevilo vprasanj
- $questions = count(self::$_SVP_PV);
+ $questions = (self::$_SVP_PV !== null) ? count(self::$_SVP_PV) : 0;
if (self::$_VARS[VAR_SPR_LIMIT] != 'all') {
$spr_pages = bcdiv($questions, self::$_VARS[VAR_SPR_LIMIT]);
@@ -1031,9 +961,9 @@ class SurveyDataDisplay{
if ($spr_pages > 1) {
- $_spr_page = '<select id="cur_spr_page'.$position.'" onchange="setDataView(\''.VAR_SPR_PAGE.'\',$(\'select#cur_spr_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_spr_current_page'].'">';
+ $_spr_page = '<select id="cur_spr_page'.$position.'" class="dropdown" onchange="setDataView(\''.VAR_SPR_PAGE.'\',$(\'select#cur_spr_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_spr_current_page'].'">';
echo '<label>';
- echo $lang['page'];
+ echo $lang['page'].':';
echo '</label>';
// puscica levo
@@ -1064,82 +994,100 @@ class SurveyDataDisplay{
public static function displayLeftFilters() {
global $lang, $site_url;
-
- // število zapisov na stran
- echo '<ul class="">';
-
- echo '<li>'.$lang['srv_show'].':</li>';
-
+
// ustreznost
- if (self::$canDisplayRelevance) {
+ /* if (self::$canDisplayRelevance) {
- echo '<li>';
+ echo '<div class="setting_line">';
if (self::$_VARS[VAR_SHOW_SYSTEM] != true) {
- echo '<label for="var_relevance"><input type="checkbox" onchange="setDataView(\''. VAR_RELEVANCE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_RELEVANCE] ? ' checked="checked"' : '').' id="var_relevance" />'.$lang['srv_displaydata_relevance'].'</label>';
+ echo '<input type="checkbox" onchange="setDataView(\''. VAR_RELEVANCE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_RELEVANCE] ? ' checked="checked"' : '').' id="var_relevance" /><label for="var_relevance">'.$lang['srv_displaydata_relevance'].'</label>';
}
else {
- echo '<label for="var_relevance" class="gray"><input type="checkbox" disabled="disabled" />'.$lang['srv_displaydata_relevance'].'</label>';
+ echo '<input type="checkbox" disabled="disabled" /><label for="var_relevance" class="gray">'.$lang['srv_displaydata_relevance'].'</label>';
}
- echo '</li>';
- }
+ echo '</div>';
+ } */
+
+ // podrobnosti statusa (novo - po starem levi parapodatki + datum + ustreznost)
+ echo '<div class="setting_line">';
+ if (self::$_VARS[VAR_SHOW_SYSTEM] != true) {
+ echo '<input type="checkbox" onchange="setDataView(\''. VAR_STATUS.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_STATUS] ? ' checked="checked"' : '').' id="var_status" /><label for="var_status">'.$lang['srv_displaydata_status'].'</label>';
+ }
+ else {
+ echo '<input type="checkbox" disabled="disabled" /><label for="var_status" class="gray">'.$lang['srv_displaydata_status'].'</label>';
+ }
+ echo '</div>';
+
+ // podrobnosti statusa (novo - po starem levi parapodatki + datum + ustreznost)
+ echo '<div class="setting_line">';
+ if (self::$_VARS[VAR_SHOW_SYSTEM] != true) {
+ echo '<input type="checkbox" onchange="setDataView(\''. VAR_RELEVANCE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_RELEVANCE] ? ' checked="checked"' : '').' id="var_relevance" /><label for="var_relevance">'.$lang['srv_displaydata_status_details'].'</label>';
+ }
+ else {
+ echo '<input type="checkbox" disabled="disabled" /><label for="var_relevance" class="gray">'.$lang['srv_displaydata_status_details'].'</label>';
+ }
+ echo '</div>';
- // email prikazujemo skupaj z ustreznost
- if ((int)self::$survey['email'] == 1 && (int)self::$survey['user_base'] == 1) {
+ // email prikazujemo skupaj z status
+ /* if (SurveyInfo::getInstance()->checkSurveyModule('email') && isset(self::$survey['user_base']) && (int)self::$survey['user_base'] == 1) {
- echo '<li>';
+ echo '<div class="setting_line">';
if (self::$_VARS[VAR_SHOW_SYSTEM] != true ) {
- echo '<label for="var_email"><input type="checkbox" onchange="setDataView(\''. VAR_EMAIL.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_EMAIL] ? ' checked="checked"' : '').' id="var_email" />'.$lang['srv_displaydata_invitation'].'</label>';
+ echo '<input type="checkbox" onchange="setDataView(\''. VAR_EMAIL.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_EMAIL] ? ' checked="checked"' : '').' id="var_email" /><label for="var_email">'.$lang['srv_displaydata_invitation'].'</label>';
}
else {
- echo '<label for="var_email" class="gray"><input type="checkbox" disabled="disabled" id="var_email" />'.$lang['srv_displaydata_invitation'].'</label>';
+ echo '<input type="checkbox" disabled="disabled" id="var_email" /><label for="var_email" class="gray">'.$lang['srv_displaydata_invitation'].'</label>';
}
- echo '</li>';
- }
+ echo '</div>';
+ } */
// podatki
- echo '<li>';
- echo ' <input type="checkbox" onclick="setDataView(\''.VAR_DATA.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_DATA] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="data" /><label for="data" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_displaydata_data'].'</label>';
- echo '</li>';
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_DATA.'\',$(this).is(\':checked\'))" '.( (self::$_VARS[VAR_DATA] && !self::$_VARS[VAR_SHOW_SYSTEM]) ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="data" /><label for="data" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_displaydata_data'].'</label>';
+ echo '</div>';
+
+ // Labela
+ if(self::$_VARS[VAR_DATA]){
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" '.((self::$_VARS[VAR_DATA] && !self::$_VARS[VAR_SHOW_SYSTEM])?'':' disabled').' id="dataIcons_labels" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_labels'] == true ? ' checked="checekd"' : '').'/><label '.((self::$_VARS[VAR_DATA] && !self::$_VARS[VAR_SHOW_SYSTEM])?'':' class="gray"').' for="dataIcons_labels">'.$lang['srv_dataIcons_labels'].'</label>';
+ echo '</div>';
+ }
// Preverimo ce je vklopljen modul za volitve - potem nimamo identifikatorjev
if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
// Parapodatki
- echo '<li>';
- echo ' <input type="checkbox" onclick="setDataView(\''.VAR_METAFULL.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_METAFULL] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="fullmeta" /><label for="fullmeta" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_displaydata_meta'].'</label>';
- echo '</li>';
-
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_METAFULL.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_METAFULL] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="fullmeta" /><label for="fullmeta" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_displaydata_meta2'].'</label>';
+ echo '</div>';
+
// če imamo sistemske podatke katere moramo prikazovati ločeno - IDENTIFIKATORJI
if(!isset(self::$_HEADERS['_settings']['count_system_data_variables']) || (isset(self::$_HEADERS['_settings']['count_system_data_variables']) && (int)self::$_HEADERS['_settings']['count_system_data_variables'] > 0)) {
- echo '<li>';
- echo ' <label><input type="checkbox" onclick="setDataView(\''.VAR_SHOW_SYSTEM.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_SYSTEM] ? ' checked="checked"' : '').' id="showsystem" />'.$lang['srv_displaydata_system_data'].'</label>';
- echo '</li>';
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_SHOW_SYSTEM.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_SYSTEM] ? ' checked="checked"' : '').' id="showsystem" /><label for="showsystem">'.$lang['srv_displaydata_system_data'].'</label>';
+ echo '</div>';
}
// Po novem vedno prikazemo checkbox identifikatorji - samo je odkljukan in disablan
- else{
- echo '<li>';
- echo ' <label class="gray"><input type="checkbox" checked="checked" disabled="disabled" id="showsystem" />'.$lang['srv_displaydata_system_data'].'</label>';
- echo '</li>';
- }
+ /* else{
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" checked="checked" disabled="disabled" id="showsystem" /><label for="showsystem" class="gray">'.$lang['srv_displaydata_system_data'].'</label>';
+ echo '</div>';
+ } */
// datum
- echo '<li>';
- echo '<label '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'><input type="checkbox" onclick="setDataView(\''.VAR_SHOW_DATE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_DATE] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="showdate" />'.$lang['srv_data_date'].'</label>';
- echo '</li>';
+ /* echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_SHOW_DATE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_DATE] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="showdate" /><label for="showdate" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_data_date2'].'</label>';
+ echo '</div>'; */
}
// zaporedna številka
- echo '<li>';
- echo '<label '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'><input type="checkbox" onclick="setDataView(\''.VAR_SHOW_NO.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_NO] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="showno" />'.$lang['srv_recnum'].'</label>';
- echo '</li>';
-
- // pomoč - ?
- echo '<li>'.Help :: display('displaydata_checkboxes').'</li>';
- echo '</ul>';
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_SHOW_NO.'\',$(this).is(\':checked\'))" '.( (self::$_VARS[VAR_SHOW_NO] && !self::$_VARS[VAR_SHOW_SYSTEM]) ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="showno" /><label for="showno" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_recnum_long'].'</label>';
+ echo '</div>';
}
// Search po tabeli s podatki
@@ -1148,13 +1096,24 @@ class SurveyDataDisplay{
$search = isset($_SESSION['sid_'.self::$sid]['data_search_filter']) ? $_SESSION['sid_'.self::$sid]['data_search_filter'] : '';
- echo '<div id="data_search_filter">';
-
- echo '<label>'.$lang['srv_find'].':</label> <input id="data_search_value" type="text" onchange="data_search_filter(); return false;" value="'.$search.'">';
- if($search != ''){
- echo '<span class="bold red spaceLeft">'.$lang['srv_displayData_search'].' "'.$search.'"!</span>';
- }
+ echo '<div class="data_search_holder">';
+ echo '<div id="data_search_filter" class="setting_box '.($search != '' ? 'active':'').'">';
+
+ echo '<a '.($search != '' ? '':'onclick="showDataTableSearch();"').'><span class="faicon search pointer"></span></a> ';
+ echo '<input id="data_search_value" style="display:'.($search != '' ? "inline-block":"none").';" type="text" onchange="data_search_filter(); return false;" value="'.$search.'" placeholder="'.$lang['search'].'">';
+ echo '<input type="button" style="display: none;" value="' . $lang['s_search'] . '" />';
+
+ //X za pocisti search
+ if($search != '')
+ echo '<a onclick="clearDataTableSearch();"><span class="faicon xmark pointer"></span></a> ';
+
+ echo '</div>';
+
+ /* if($search != ''){
+ echo '<span class="search_filtered">'.$lang['srv_displayData_search'].' "'.$search.'"!</span>';
+ } */
+
echo '</div>';
}
@@ -1163,7 +1122,8 @@ class SurveyDataDisplay{
session_start();
- $search = (isset($_POST['value']) && $_POST['value'] != '') ? trim($_POST['value']) : '';
+ $search = (isset($_POST['value']) && $_POST['value'] != '') ? trim($_POST['value']) : '';
+
if($search != ''){
$_SESSION['sid_'.self::$sid]['data_search_filter'] = $search;
}
@@ -1181,17 +1141,17 @@ class SurveyDataDisplay{
}
- // Prikazemo editiranje na dnu (brisanje vecih hkrati...)
- public static function displayBottomEdit(){
+ // Prikazemo brisanje vecih hkrati
+ public static function displayMassDelete(){
global $lang;
+
if ((int)self::$_RECORD_COUNT > 0){
- echo '<div id="bottom_edit" class="floatLeft'.( self::$displayEditIcons['dataIcons_quick_view'] == true ? '' : ' shifted').'">';
+ echo '<div class="mass_delete">';
- echo '<span class="faicon arrow_up"></span> ';
- echo '<span id="switch_on"><a href="javascript:selectAll(1);">'.$lang['srv_select_all'].'</a></span>';
- echo '<span id="switch_off" style="display:none;"><a href="javascript:selectAll(0);">'.$lang['srv_deselect_all'].'</a></span>';
- echo '&nbsp;&nbsp;<a href="#" onClick="deleteMultipleData();"><span class="faicon delete_circle icon-orange" title="'.$lang['srv_delete_data_multirow'].'"/></span>&nbsp;'.$lang['srv_delete_selected'].'</a>';
- echo '<p>'.$lang['srv_delete_infotext'].' '.Help::display('srv_delete_infotext').'</p>';
+ echo '<span id="switch_on" class="faicon checkbox-empty" onClick="selectAll(1);" title="'.$lang['srv_select_all'].'"></span>';
+ echo '<span id="switch_off" class="faicon minus_square" onClick="selectAll(0);" title="'.$lang['srv_deselect_all'].'" style="display:none;"></span>';
+
+ echo '<button id="mass_delete_button" class="white-black small" onClick="deleteMultipleData();" style="display:none;"><span class="faicon delete" title="'.$lang['srv_delete_data_multirow'].'"/></span>'.$lang['srv_delete_selected'].'</button>';
echo '</div>';
}
@@ -1203,41 +1163,171 @@ class SurveyDataDisplay{
public static function displayVnosiHTML() {
global $lang;
global $site_path;
+ global $site_url;
global $global_user_id;
+
// na vrhu in na dnu izrisemo paginacijo
if(self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$_RECORD_COUNT > 0) {
- echo '<div id="vnosi_paginacija" class="top_paginacija">';
- self::displayPaginacija($position='_top');
- echo '</div>';
- // Izrisemo search
- if(!self::$_VARS[VAR_CODING])
- self::displayDataSearch();
-
+ // Zgornje nastavitve nad tabelo
+ echo '<div class="data_table_top_holder">';
+
+
+ // SN preklop - ego alter (ce je vklopljen modul)
+ if(self::$is_social_network){
+ echo '<div class="dataFullscreen">';
+
+ echo ' <a href="'.$site_url.'admin/survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVars(VAR_CIRCLES, '0').'"><button id="data_fullscreen_0" class="small white-blue '.((int)self::$_VARS[VAR_CIRCLES]==0 ? 'active' : '').'">'.$lang['srv_lnk_ego'].'</button></a>';
+ echo ' <a href="'.$site_url.'admin/survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVars(VAR_CIRCLES, '1').'"><button id="data_fullscreen_1" class="small white-blue '.((int)self::$_VARS[VAR_CIRCLES]==1 ? 'active' : '').'">'.$lang['srv_lnk_alter'].'</button></a>';
+
+ echo '</div>';
+ }
+
+
+ // Navaden pogled / fullscreen
+ echo '<div class="dataFullscreen">';
+
+ echo ' <button id="data_fullscreen_0" class="small white-blue '.(!self::$displayDataFullscreen ? 'active' : '').'" onClick="data_fullscreen(\'0\');">'.$lang['srv_displaydata_fullscreen_0'].'</button>';
+ echo ' <button id="data_fullscreen_1" class="small white-blue '.(self::$displayDataFullscreen ? 'active' : '').'" onClick="data_fullscreen(\'1\');">'.$lang['srv_displaydata_fullscreen_1'].'</button>';
+
+ echo '</div>';
+
// Checkboxa za urejanje in izpise podatkov ter razpiranje dodatnih nastavitev
- echo '<div class="dataSettingsBasic">';
+ echo '<div class="dataSettingsBasic">';
+ echo ' <button id="toggleDataCheckboxes" class="small white-blue '.(self::$displayEditIconsSettings ? 'active' : '').'" onClick="toggleDataCheckboxes(\'data\');"><span class="faicon plus"></span>'.$lang['srv_displaydata_columns'].'</button>';
+ echo '</div>';
- echo '<input type="checkbox" id="dataIcons_edit" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_edit'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_edit">'.$lang['srv_dataIcons_edit'].'</label>';
- if (self::$displayEditIcons['dataIcons_edit'] == true) {
- echo ' '.Help::display('srv_podatki_urejanje_inline');
+
+ // Search
+ if(!self::$_VARS[VAR_CODING])
+ self::displayDataSearch();
+
+ //icons and export checkbox
+ if (self :: $is_social_network == false || self::$_VARS[VAR_CIRCLES] == 0) {
+
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_edit" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_edit'] == true ? ' checked="checekd"' : '').'/>';
+ echo ' <label for="dataIcons_edit">'.$lang['srv_dataIcons_edit'].'</label>';
+ echo '</div>';
+
+ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
+ $userAccess = UserAccess::getInstance($global_user_id);
+ if(!$userAccess->checkUserAccess($what='data_export')) {
+
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_write" onclick="popupUserAccess(\'data_export\'); return false;" '.(self::$displayEditIcons['dataIcons_write'] == true ? ' checked="checked"' : '').'>';
+ echo ' <label for="dataIcons_write" '.(!$userAccess->checkUserAccess($what='data_export') ? 'class="user_access_locked"' : '').'>'.$lang['srv_dataIcons_write'].'</label>';
+ echo '</div>';
+ }
+ else {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_write" onchange="changeDataIcons(); return false;" '.(self::$displayEditIcons['dataIcons_write'] == true ? ' checked="checked"' : '').'>';
+ echo ' <label for="dataIcons_write">'.$lang['srv_dataIcons_write'].'</label>';
+ echo '</div>';
+ }
}
- echo '&nbsp;&nbsp;';
-
- // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
- $userAccess = UserAccess::getInstance($global_user_id);
- echo '<input type="checkbox" id="dataIcons_write" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_write'] == true ? ' checked="checked"' : '').' '.(!$userAccess->checkUserAccess($what='data_export') ? 'disabled="disabled"' : '').' /><label for="dataIcons_write" '.(!$userAccess->checkUserAccess($what='data_export') ? 'class="user_access_locked"' : '').'>'.$lang['srv_dataIcons_write'].'</label>';
- $arrow = (isset($_SESSION['sid_' . self::$sid]['dataIcons_settings'])) ? $_SESSION['sid_' . self::$sid]['dataIcons_settings'] : 0;
- echo '<div id="toggleDataCheckboxes" ' . $borderLeft . ' onClick="toggleDataCheckboxes(\'data\');"><span class="faicon ' . ($arrow == 1 ? ' dropup_blue' : 'dropdown_blue') . '"></span> ' . $lang['srv_extra_settings'] . '</div>';
+ // Paginacija
+ echo '<div id="vnosi_paginacija" class="top_paginacija">';
+ self::displayPaginacija($position='_top');
echo '</div>';
+
+
+ // Dodatne nastavitve, ki se razprejo
+ echo '<div id="dataSettingsCheckboxes" '.(self::$displayEditIconsSettings ? '' : ' style="display:none;"').'>';
+ echo ' <div class="dataSettingsCheckboxes_holder">';
+
+ if(self::$dataFileStatus != FILE_STATUS_NO_DATA){
+ echo '<div class="setting_line title">';
+ echo $lang['srv_dataTable_settings_show'];
+ echo '</div>';
+
+ self::displayLeftFilters();
+ }
+
+ if (self :: $is_social_network == false || self::$_VARS[VAR_CIRCLES] == 0) {
+
+ echo '<div class="setting_line title">';
+ echo $lang['srv_dataTable_settings_shortcuts'];
+ echo '</div>';
+
+ if (self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_quick_view" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_quick_view'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_quick_view">'.$lang['srv_dataIcons_quick_view'].'</label>';
+ echo '</div>';
+
+ if ( self::showMultiple() ) {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_multiple" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_multiple'] == true ? ' checked="checekd"' : '').' /><label for="dataIcons_multiple">'.$lang['srv_dataIcons_multiple'].'</label>';
+ echo '</div>';
+ }
+ }
+ else {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_quick_view" disabled="disabled" /><label for="dataIcons_quick_view" class="gray">'.$lang['srv_dataIcons_quick_view'].'</label>';
+ echo '</div>';
+
+ if ( self::showMultiple() ) {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_multiple" disabled="disabled" /><label for="dataIcons_multiple" class="gray">'.$lang['srv_dataIcons_multiple'].'</label>';
+ echo '</div>';
+ }
+ }
+
+ # preverimo koliko anket je dejansko uporbaniških
+ # za potrebne statuse
+ $statuses = SurveyStatusProfiles :: getStatusAsArrayString();
+
+ $lurkers = false;
+ if (is_array($statuses) && count($statuses) > 0) {
+ # najprej preverimo ali filtriramo lurkereje
+ if (isset($statuses['lurker'])) {
+ $lurkers = true;
+ unset($statuses['lurker']);
+ }
+
+ if (count($statuses) > 0) {
+ $prefix = '';
+ $sstring = ' AND last_status IN (';
+ foreach ($statuses AS $skey => $status) {
+ if (is_numeric($skey)) {
+ $sstring.=$prefix.$skey;
+ } else if($skey == 'null') {
+ $sstring.=$prefix.'-1';
+ }
+ $prefix = ',';
+ }
+ $sstring .=')';
+ }
+ }
+
+ $q = sisplet_query("SELECT count(*) FROM srv_user WHERE ank_id = '".self::$sid."' AND user_id > 0 AND deleted='0' ".$sstring);
+ list($cnt) = mysqli_fetch_row($q);
+
+ if ($cnt > 0) {
+ echo '<span class="spaceLeft">';
+ self::displayOnlyCMS();
+ echo '</span>';
+ }
+ }
+
+ // Gumb zapri dodatne nastavitve
+ echo '<div class="button_holder">';
+ echo ' <button class="small blue" onClick="toggleDataCheckboxes(\'data\');">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+
+ echo ' </div>';
+ echo '</div>';
+
+
+ echo '</div>';
}
- echo '<br class="clr" />';
-
+ // Vklopljeni filtri
echo '<div id="displayFilterNotes">';
# če ne uporabljamo privzetega časovnega profila izpišemo opozorilo
@@ -1265,12 +1355,7 @@ class SurveyDataDisplay{
echo '</div>';
-
-
-
-
- $folder = $site_path . EXPORT_FOLDER.'/';
-
+ // Div s tabelo
echo '<div id="div_vnosi_data">';
if ((self::$dataFileStatus == 1 || self::$dataFileStatus == 0) && self::$dataFileName !== null) {
@@ -1289,8 +1374,7 @@ class SurveyDataDisplay{
else {
# imamo SN omrežje
if (self::$_VARS[VAR_CIRCLES] == 0) {
- self::DisplaySnLinks();
- self::DisplayDataTable();
+ self::DisplayDataTable();
}
}
}
@@ -1300,35 +1384,37 @@ class SurveyDataDisplay{
}
}
else {
- echo '<br /><div style="margin: 0 0 40px 0;">Ni podatkov za prikaz. Preverite filtre (Podatki, Para podatki, Polni para podatki)</div>';
+ echo 'Ni podatkov za prikaz. Preverite filtre (Podatki, Para podatki, Polni para podatki)';
}
}
if (self :: $is_social_network ) {
if (self::$SSNDF != null && self::$_VARS[VAR_CIRCLES] == 1) {
- self::DisplaySnLinks();
self::$SSNDF->outputSNDataFile();
}
}
echo '</div>'; // id="div_vnosi_data">';
-
+
+ // Spodnje nastavitve pod tabelo
+ echo '<div class="data_table_bottom_holder">';
+
#izrišemo legendo statusov
self::displayStatusLegend();
self::displayMetaStatusLegend();
self::displayTestLegend();
-
// na vrhu in na dnu izrisemo paginacijo
- if(self::$dataFileStatus != FILE_STATUS_NO_DATA){
+ /*if(self::$dataFileStatus != FILE_STATUS_NO_DATA){
echo '<div id="vnosi_paginacija" class="bottom_paginacija">';
self::displayPaginacija($position='_bottom');
echo '</div>';
-
- echo '<div class="clr"></div>';
- }
+ }*/
+ echo '</div>';
+
+
// osvetlimo stolpec s spremenljivko
if (isset($_GET['highlight_spr'])) {
?><script>
@@ -1379,16 +1465,13 @@ class SurveyDataDisplay{
//self::$_SVP_PV = array_merge($_svp_pv, self::$_SVP_PV);
- #izpišemo tabelo
- echo '<div style="padding-top:0px; height:5px;" class="clr">&nbsp;</div>';
-
+ #izpišemo tabelo
echo '<div id="tableContainer" class="tableContainer">';
# div v katerem po potrebi prikazujemo gumbe za skrolanje levo in desno
echo '<div id="dataTableScroller">';
- echo '<span class="faicon arrow_large2_l icon-as_link pointer" onclick="dataTableScroll(\'left\');return false;"></span>';
- echo '&nbsp;&nbsp;&nbsp;&nbsp;';
- echo '<span class="faicon arrow_large2_r icon-as_link pointer" onclick="dataTableScroll(\'right\');return false;"></span>';
+ echo ' <div class="dataTable_arrow left" onclick="dataTableScroll(\'left\'); return false;"><span class="faicon arrow_large2_l"></span></div>';
+ echo ' <div class="dataTable_arrow right" onclick="dataTableScroll(\'right\'); return false;"><span class="faicon arrow_large2_r"></span></div>';
echo '</div>';
$display1kaIcon = self::$displayEditIcons['dataIcons_quick_view'] ;
@@ -1419,48 +1502,14 @@ class SurveyDataDisplay{
# ali smo v edit načinu ali monitoringu
$cssEdit = (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING]?' editData':'');
- echo '<table id="dataTable" class="scrollTable no_wrap_td'.$cssEdit.'" '.(self::$_VARS[VAR_EDIT]?' title="'.$lang['srv_edit_data_title'].'"':'').'>';
-
- // Nastavimo colgroup, da na njega vezemo vse sirine v tabeli, zaradi resizinga stolpcev
- echo '<colgroup>';
- # colspan za ikonce
- if ($stolpci > 0) {
- echo '<col class="data_edit"'.($stolpci > 1 ? (' span="'.$stolpci.'"') : '').'>';
- }
- $spr_cont = 0;
- foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- if (isset(self::$_SVP_PV[$spid]) && count($spremenljivka['grids']) > 0) {
- if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<col>';
- }
-
- // paginacija spremenljivk
- if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
- foreach ($spremenljivka['grids'] AS $gid => $grid) {
- if (count ($grid['variables']) > 0) {
- foreach ($grid['variables'] AS $vid => $variable ){
- echo '<col seq="'.$variable['sequence'].'"';
-
- if ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') {
- echo ' spr_id="'.substr($spid, 0, strpos($spid, '_')).'"';
- } else {
- echo ' spr_id="'.$spid.'"';
- }
-
- echo '>';
- }
- }
- }
- }
- $spr_cont++;
- }
-
- }
- echo '</colgroup>';
+
+ echo '<table id="dataTable" class="scrollTable no_wrap_td'.$cssEdit.'" '.(self::$_VARS[VAR_EDIT]?' title="'.$lang['srv_edit_data_title'].'"':'').'>';
+
echo '<thead class="fixedHeader">';
- echo '<tr>';
+
+ echo '<tr class="row1">';
# colspan za ikonce
if ($stolpci > 0) {
@@ -1468,29 +1517,120 @@ class SurveyDataDisplay{
}
# dodamo skrit stolpec uid
- echo '<th class="data_uid">&nbsp;</th>';
+ echo '<th class="data_uid"></th>';
+
+ // vedno na prvo mesto prikazi line number, ce je vklucen
+ if(self::$showLineNumber/* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th class="cell_info" title="'.$lang['srv_line_number'].'">';
+ echo ' <div class="headerCell">'. $lang['srv_line_number'] .'</div>';
+ echo '</th>';
+ }
$spr_cont = 0;
+ //stej info_cols
+ $info_cnt = 0;
+ //ce je info_cols true, jih samo stej in jih na koncu izrisi
+ $info_cols = false;
+
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- if (isset(self::$_SVP_PV[$spid])) {
- if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
- echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
+ $spremenljivka['tip'] = isset($spremenljivka['tip']) ? $spremenljivka['tip'] : '';
+ $spremenljivka['variable'] = isset($spremenljivka['variable']) ? $spremenljivka['variable'] : '';
+
+ if($spremenljivka['tip'] == 'm'){
+ $class = 'cell_info';
+ $info_cols = true;
+
+ if (isset(self::$_SVP_PV[$spid])){
+ //$spr_cont++;
+
+ if($spid != 'status' && $spid != 'invitation')
+ $info_cnt++;
}
+ }
+ elseif($spremenljivka['tip'] == 'sm'){
+ $class = 'cell_paradata';
+ $info_cols = false;
+ }
+ else{
+ $class = 'cell_data';
+ $info_cols = false;
+ }
+
+ $cnt_all = $spremenljivka['cnt_all'] ?? 1;
+
+ $var_code = ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') ? '('.$spremenljivka['variable'].') ' : '';
+
+ //v stolpcih, kjer je druga vrstica glave prazna, omogoci sortiranje v prvi
+ $sortable = (in_array($spremenljivka['tip'], array('1','3','7','8','21')) || $spid == 'status' || $spid == 'invitation') ? 'sortable' : '';
+
+ //za delovanje sortinga
+ $class_sorting = '';
+ if (self::$sort_seq != null && isset($spremenljivka['grids'][0]['variables'][0]['sequence']) && $spremenljivka['grids'][0]['variables'][0]['sequence'] == self::$sort_seq) {
+ $class_sorting = self::$sort_type !== null ? self::$sort_type : '' ;
+ }
+
+ if (isset(self::$_SVP_PV[$spid])) {
+
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
- echo '<th colspan="'.$spremenljivka['cnt_all'].'" title="'.$spremenljivka['naslov'].'">';
- echo '<div class="headerCell">'.$spremenljivka['naslov'].'</div>';
- echo '</th>';
+
+ // status in vabila so posebej na zacetku
+ if(isset(self::$_SVP_PV[$spid]) && ($spid == 'status' || $spid == 'invitation')){
+ echo '<th class="'.$class.' '.$sortable.' '.$class_sorting.'" title="'.$spremenljivka['naslov'].'"
+ seq="'.$spremenljivka["grids"][0]["variables"][0]["sequence"].'">';
+ echo ' <div class="headerCell">';
+ if ($spremenljivka['grids'][0]['variables'][0]['sequence'] == self::$sort_seq && self::$sort_seq != null) {
+ $img_src = self::$sort_type == 'sort_dsc' ? 'sort_descending' : 'sort_ascending' ;
+ echo '<span class="sort_holder"><span class="faicon '.$img_src.'" title=""></span></span>';
+ }
+ echo '<span>'.$spremenljivka['naslov'].'</span></div>';
+ echo '</th>';
+ }
+
+ //razpotegnjena prazna celica za vse info stolpce (ce trenutno ni vec info col, ampak prestelo pa jih je prej)
+ if($info_cols == false && $info_cnt > 0 && (self::$_VARS['spr_limit'] == 'all' || self::$_VARS['spr_page'] == 1)){
+ echo '<th class="cell_info" colspan="'.$info_cnt.'" title="'.$lang['srv_displaydata_status_details'].'">';
+ echo ' <div class="headerCell">'.$lang['srv_displaydata_status_details'].'</div>';
+ echo '</th>';
+
+ //reset stevec za info col
+ $info_cnt = 0;
+ }
+
+ //ce trenutno ni info col in jih tudi ne steje, potem normalno izrisi stolpec
+ if(($info_cols == false && $info_cnt == 0) || self::$_VARS['spr_page'] > 1){
+ echo '<th class="'.$class.' '.$sortable.' '.$class_sorting.'" colspan="'.$cnt_all.'" title="'.$var_code.''.$spremenljivka['naslov'].'"
+ seq="'.$spremenljivka["grids"][0]["variables"][0]["sequence"].'">';
+ echo ' <div class="headerCell">';
+ if ($spremenljivka['grids'][0]['variables'][0]['sequence'] == self::$sort_seq && self::$sort_seq != null && $sortable !== '') {
+ $img_src = self::$sort_type == 'sort_dsc' ? 'sort_descending' : 'sort_ascending' ;
+ echo '<span class="sort_holder"><span class="faicon '.$img_src.'" title=""></span></span>';
+ }
+ echo '<span style="font-weight:400">'.$var_code.'</span><span> '.$spremenljivka['naslov'].'</span></div>';
+ echo '</th>';
+ }
}
- $spr_cont++;
-
+
+ if($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm')
+ $spr_cont++;
}
}
- echo '</tr><tr>';
+ //ce od podrobnosti statusa naprej ni vec celic, zakljuzi celico
+ //razpotegnjena prazna celica za vse info stolpce (ce trenutno ni vec info col, ampak prestelo pa jih je prej)
+ //prikazi podrobnosti statusa samo na prvi strani
+ if($info_cnt > 0 && self::$_VARS[VAR_SPR_PAGE] == 1){
+ echo '<th class="cell_info" colspan="'.$info_cnt.'" title="'.$lang['srv_displaydata_status_details'].'">';
+ echo ' <div class="headerCell">'.$lang['srv_displaydata_status_details'].'</div>';
+ echo '</th>';
+ }
+
+ echo '</tr>';
+
+
+ /* po novem izkljucimo drugo vrstico v headerju
+ echo '<tr class="row2">';
# colspan za ikonce
if ($stolpci > 0) {
@@ -1502,10 +1642,18 @@ class SurveyDataDisplay{
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
+
+ if($spremenljivka['tip'] == 'm')
+ $class = 'cell_info';
+ elseif($spremenljivka['tip'] == 'sm')
+ $class = 'cell_paradata';
+ else
+ $class = 'cell_data';
+
if (isset(self::$_SVP_PV[$spid]) && (count($spremenljivka['grids']) > 0 )) {
if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
+ echo '<th class="'.$class.'" title="'.$lang['srv_line_number'].'" >';
echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
echo '</th>';
}
@@ -1515,70 +1663,130 @@ class SurveyDataDisplay{
foreach ($spremenljivka['grids'] AS $gid => $grid) {
if($spremenljivka['tip'] == 16 || $spremenljivka['tip'] == 19 || $spremenljivka['tip'] == 20){
- echo '<th colspan="'.$grid['cnt_vars'].'" title="'.$grid['variable'].'">';
- echo '<div class="headerCell">'.$grid['variable'].'</div>';
+ echo '<th class="'.$class.'" colspan="'.$grid['cnt_vars'].'" title="'.$grid['variable'].'">';
+ echo ' <div class="headerCell">'.$grid['variable'].'</div>';
echo '</th>';
}
else{
- echo '<th colspan="'.$grid['cnt_vars'].'" title="'.$grid['naslov'].'">';
- echo '<div class="headerCell">'.$grid['naslov'].'</div>';
+ echo '<th class="'.$class.'" colspan="'.$grid['cnt_vars'].'" title="'.$grid['naslov'].'">';
+ echo ' <div class="headerCell">'.$grid['naslov'].'</div>';
echo '</th>';
}
}
}
$spr_cont++;
}
-
}
- echo '</tr><tr>';
+ echo '</tr>'; */
+
+
+ echo '<tr class="row3">';
# colspan za ikonce
if ($stolpci > 0) {
- echo '<th class="data_edit"'.($stolpci > 1 ? (' colspan="'.$stolpci.'"') : '').'>&nbsp;</td>';
+
+ $show_mass_delete = (self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1) ? true : false;
+
+ echo '<th class="data_edit" '.($stolpci > 1 ? ('colspan="'.$stolpci.'"') : '').' '/* .($show_mass_delete ? 'style="min-width:190px"' : '') */.'>';
+
+ // Editiranje na dnu - brisanje vec userjev hkrati...
+ if($show_mass_delete){
+ self::displayMassDelete();
+ }
+
+ echo '</th>';
}
# dodamo skrit stolpec uid
echo '<th class="data_uid">&nbsp;</th>';
+ // vedno na prvo mesto prikazi line number, ce je vklucen
+ if(self::$showLineNumber/* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th class="cell_info" title="'.$lang['srv_line_number'].'" spr_id="lineNo">';
+ echo ' <div class="dataCell">'./* $lang['srv_line_number']. */'</div>';
+ echo '</th>';
+ }
+
$spr_cont = 0;
$system_columns = array();
+
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
+
+ $spremenljivka['tip'] = isset($spremenljivka['tip']) ? $spremenljivka['tip'] : '';
+
+ if($spremenljivka['tip'] == 'm')
+ $class = 'cell_info';
+ elseif($spremenljivka['tip'] == 'sm')
+ $class = 'cell_paradata';
+ else
+ $class = 'cell_data';
+
if (isset(self::$_SVP_PV[$spid]) && count($spremenljivka['grids']) > 0) {
- if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" spr_id="lineNo">';
- echo '<div class="dataCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
- }
-
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
foreach ($spremenljivka['grids'] AS $gid => $grid) {
- if (count ($grid['variables']) > 0) {
+ if (isset($grid['variables']) && count ($grid['variables']) > 0) {
foreach ($grid['variables'] AS $vid => $variable ){
- echo '<th title="'.$variable['naslov'].($variable['other'] ? '&nbsp;(text)' : '').'"'
+
+ //koda, ki se bo prikazala v oklepaju pred naslovom
+ $var_code = ($spremenljivka['tip'] == 16 || $spremenljivka['tip'] == 19 || $spremenljivka['tip'] == 20) ?
+ $grid['variable'] : $variable['variable'];
+
+ //text naslova po novem
+ $title_text = $variable['naslov'];
+ //za posebne tipe info in parapodatke prilagodi text naslova
+ if($spremenljivka['tip'] == 'm' || $spremenljivka['tip'] == 'sm'){
+ //status se prikaze v zgornjem header
+ if($var_code == 'status' || $var_code == 'invitation')
+ $title_text = '';
+ if($var_code == 'recnum')
+ $title_text = $variable['naslov'].' ('.$grid['naslov'].')';
+ //datum zacetek in konec
+ if($var_code == 't_insert' || $var_code == 't_edit')
+ $title_text = $grid['naslov'].' '.$variable['naslov'];
+ //datum glede na stran
+ if(substr($var_code, 0, 5) === "date_")
+ $title_text = $grid['naslov'].' ('.$variable['naslov'].')';
+ }
+
+ //za info in parapodatke ne prikazi kode
+ $var_code = ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') ? '('.$var_code.') ' : '';
+
+ //za delovanje sortinga
+ $class_sorting = '';
+ if ($variable['sequence'] == self::$sort_seq && self::$sort_seq != null) {
+ $class_sorting = self::$sort_type !== null ? self::$sort_type : '' ;
+ }
+
+ //v stolpcih, kjer je druga vrstica glave prazna, onemogoci sortiranje (sortira se v prvi glavi)
+ $sortable = (!in_array($spremenljivka['tip'], array(1,3,7,8,21)) && $spid != 'status' && $spid != 'invitation') ? 'sortable' : '';
+
+ echo '<th class="'.$class.' '.$sortable.' '.$class_sorting.'" title="'.$var_code.''.$title_text.(isset($variable['other']) && $variable['other'] == '1' ? '&nbsp;(text)' : '').'"'
.' seq="'.$variable['sequence'].'"';
-
+
if ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') {
echo ' spr_id="'.substr($spid, 0, strpos($spid, '_')).'"';
} else {
echo ' spr_id="'.$spid.'"';
}
- echo ($spremenljivka['inline_edit']?' inline_edit=1':'')
+ echo (isset($spremenljivka['inline_edit']) && $spremenljivka['inline_edit'] == '1' ? ' inline_edit=1' : '')
// .' inline_edit='.($spremenljivka['inline_edit']?$spremenljivka['inline_edit']:'0')
.($variable['sequence'] == self::$sort_seq && self::$sort_seq != null ? ' class="hover '.self::$sort_type.'"': '')
.'>';
+
+ // Zabelezimo sekvenco sistemskih identifikatorjev da jih pobarvamo
+ if(isset($spremenljivka['is_system']) && $spremenljivka['is_system'] == 1)
+ $system_columns[] = $spremenljivka['sequences'];
- if ($variable['sequence'] == self::$sort_seq && self::$sort_seq != null) {
+ echo '<div class="dataCell">';
+ if ($variable['sequence'] == self::$sort_seq && self::$sort_seq != null && $sortable !== '') {
$img_src = self::$sort_type == 'sort_dsc' ? 'sort_descending' : 'sort_ascending' ;
echo '<span class="sort_holder"><span class="faicon '.$img_src.'" title=""></span></span>';
}
+ echo '<span style="font-weight:400">'.(!in_array($spremenljivka['tip'], array(1,3,7,8,21)) ? $var_code : '').'</span>'.
+ (!in_array($spremenljivka['tip'], array(1,3,7,8,21)) ? $title_text : '');
- // Zabelezimo sekvenco sistemskih identifikatorjev da jih pobarvamo
- if($spremenljivka['is_system'] == 1)
- $system_columns[] = $spremenljivka['sequences'];
-
- echo '<div class="dataCell">'.$variable['naslov'];
- if ($variable['other'] == 1) {
+ if (isset($variable['other']) && $variable['other'] == 1) {
echo '&nbsp;(text)';
}
@@ -1594,11 +1802,15 @@ class SurveyDataDisplay{
}
}
}
- $spr_cont++;
+
+ if($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm')
+ $spr_cont++;
}
}
+
echo'</tr>';
+
echo '</thead>';
@@ -1619,20 +1831,20 @@ class SurveyDataDisplay{
//$sort_numeric = '-n ';
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- if (count($spremenljivka['grids']) > 0 ) {
+ if (isset($spremenljivka['grids']) && count($spremenljivka['grids']) > 0 ) {
foreach ($spremenljivka['grids'] AS $gid => $grid) {
if (count ($grid['variables']) > 0) {
foreach ($grid['variables'] AS $vid => $variable ){
if (self::$sort_seq == $variable['sequence']) {
// za datumska polja je potrebno malo potelovadit
- if ($variable['spss'] == 'DATETIMEw' || $variable['sortType'] == 'date') {
+ if (isset($variable['spss']) && $variable['spss'] == 'DATETIMEw' || isset($variable['sortType']) && $variable['sortType'] == 'date') {
#12.09.2011
$sortString = '-k '.self::$sort_seq.'.7,'.self::$sort_seq.'.10 -k'.self::$sort_seq.'.4,'.self::$sort_seq.'.5 -k'.self::$sort_seq.'.1,'.self::$sort_seq.'.2';
}
// za numericne spremenljivke in recnum uporabimo parameter -n da ne sortira po stringu
- if ($variable['sortType'] == 'number') {
+ if (isset($variable['sortType']) && $variable['sortType'] == 'number') {
$sort_numeric = '-n ';
}
}
@@ -1655,82 +1867,65 @@ class SurveyDataDisplay{
}
// polovimo vrstice z statusom 5,6 in jih damo v začasno datoteko
if (IS_WINDOWS) {
- #$cmdLn1 = 'awk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\x7C\"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }" '.self::$dataFileName.' > '.$tmp_files['filtred_status'];
- #$out1 = shell_exec($cmdLn1);
- # če smo predhodno sortirali
- if (self::$do_sort == true)
- {
+
+ if (self::$do_sort == true){
$_command .= ' | gawk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\x7C\"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }" ';
#$_command = 'awk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\x7C\"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }" '.self::$dataFileName;
}
- else
- {
+ else{
$_command = 'gawk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\x7C\"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }" '.self::$dataFileName;
}
+ }
+ else {
- } else {
- #$cmdLn1 = 'awk -F"'.STR_DLMT.'" \'BEGIN {OFS="\x7C"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }\' '.self::$dataFileName.' > '.$tmp_files['filtred_status'];
- #$out1 = shell_exec($cmdLn1);
# če smo predhodno sortirali
- if (self::$do_sort)
- {
+ if (self::$do_sort){
$_command .= ' | awk -F"'.STR_DLMT.'" \'BEGIN {OFS="\x7C"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }\' ';
}
- else
- {
+ else{
$_command = 'awk -F"'.STR_DLMT.'" \'BEGIN {OFS="\x7C"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }\' '.self::$dataFileName;
}
-
}
// pobrisemo vrstice ki ne vsebujejo iskalnega stringa (ce searchamo) in rdece boldamo rezultat
$search = isset($_SESSION['sid_'.self::$sid]['data_search_filter']) ? $_SESSION['sid_'.self::$sid]['data_search_filter'] : '';
if($search != ''){
if (IS_WINDOWS) {
- $_command .= ' | sed "/'.$search.'/!d"';
- $_command .= ' | sed "s*'.$search.'*<span class=\"highlighted\">'.$search.'</strong>*g"';
- } else {
- $_command .= ' | sed \'/'.$search.'/!d\'';
- $_command .= ' | sed \'s*'.$search.'*<span class=\"highlighted\">'.$search.'</strong>*g\'';
+ $_command .= ' | sed "/'.$search.'/I!d"';
+ $_command .= ' | sed "s*'.$search.'*<span class=\"highlighted\">&</span>*Ig"';
+
+ }
+ else {
+ $_command .= ' | sed \'/'.$search.'/I!d\'';
+ $_command .= ' | sed "s*'.$search.'*<span class=\"highlighted\">&</span>*Ig"';
+
}
}
-
+
// paginacija po stolpcih (spremenljivkah)
if (IS_WINDOWS) {
- #$cmdLn1_1 = 'cut -d "|" -f 1,'.self::$_VARIABLE_FILTER.' '.$tmp_files['filtred_status'].' > '.$tmp_files['filtred_spr_pagination'];
- #$out1 = shell_exec($cmdLn1_1);
$_command .= ' | cut -d "|" -f 1,'.self::$_VARIABLE_FILTER;
- } else {
- #$cmdLn1_1 = 'cut -d \'|\' -f 1,'.self::$_VARIABLE_FILTER.' '.$tmp_files['filtred_status'].' > '.$tmp_files['filtred_spr_pagination'];
- #$out1 = shell_exec($cmdLn1_1);
+ }
+ else {
$_command .= ' | cut -d \'|\' -f 1,'.self::$_VARIABLE_FILTER;
}
if (self::$_REC_LIMIT != '') {
- #paginating
+
+ #paginating
if (IS_WINDOWS) {
- #$cmdLn2 = 'awk '.self::$_REC_LIMIT.' '.$tmp_files['filtred_spr_pagination'].' > '.$tmp_files['filtred_pagination'];
- #$out2 = shell_exec($cmdLn2);
- $_command .= ' | awk '.self::$_REC_LIMIT;
- } else {
- #$cmdLn2 = 'awk '.self::$_REC_LIMIT.' '.$tmp_files['filtred_spr_pagination'].' > '.$tmp_files['filtred_pagination'];
- #$out2 = shell_exec($cmdLn2);
- $_command .= ' | awk '.self::$_REC_LIMIT;
- }
- #$file_sufix = 'filtred_pagination';
- } else {
- #$file_sufix = 'filtred_spr_pagination';
+ $_command .= ' | awk '.self::$_REC_LIMIT;
+ }
+ else {
+ $_command .= ' | awk '.self::$_REC_LIMIT;
+ }
}
// zamenjamo | z </td><td>
if (IS_WINDOWS) {
- #$cmdLn3 = 'sed "s*'.STR_DLMT.'*</td><td>*g" '.$tmp_files[$file_sufix].' > '.$tmp_files['filtred_sed'];
- #$out3 = shell_exec($cmdLn3);
$_command .= ' | sed "s*'.STR_DLMT.'*'.STR_LESS_THEN.'/td'.STR_GREATER_THEN.STR_LESS_THEN.'td'.STR_GREATER_THEN.'*g" >> '.$folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
-
- } else {
- #$cmdLn3 = 'sed \'s*'.STR_DLMT.'*</td><td>*g\' '.$tmp_files[$file_sufix].' > '.$tmp_files['filtred_sed'];
- #$out3 = shell_exec($cmdLn3);
+ }
+ else {
$_command .= ' | sed \'s*'.STR_DLMT.'*</td><td>*g\' >> '
.$folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
}
@@ -1742,12 +1937,14 @@ class SurveyDataDisplay{
fclose($file_handler);
$out_command = shell_exec($folder.'cmd_'.self::$sid.'_to_run.bat');
unlink($folder.'cmd_'.self::$sid.'_to_run.bat');
- } else {
+ }
+ else {
$out_command = shell_exec($_command);
}
+
echo '<tbody class="scrollContent'.(self::$_VARS[VAR_CODING]?' coding':'').'">';
- #$f = fopen ($tmp_files['filtred_sed'], 'r');
+
if (file_exists($folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT)) {
if(self::$_VARS[VAR_REC_ON_PAGE] == 'all'){
@@ -1763,22 +1960,26 @@ class SurveyDataDisplay{
$f = fopen ($folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT, 'r');
while ($line = fgets ($f)) {
- echo '<tr>';
+ echo '<tr class="row_data">';
+ if ($stolpci > 0 ) {
+ if (self::$displayEditIcons['dataIcons_edit'] == true) {
+ // checkbox za brisanje vecih vrstic hkrati
+ echo '<td class="data_edit delete_checkbox" title="'.$lang['srv_view_data_row_select'].'"><input type="checkbox" id="delete_data_row_'.$cntLines.'" class="delete_data_row" /><label for="delete_data_row_'.$cntLines.'"></label></td>';
+ }
+ }
if ((int)$display1kaIcon == 1) {
- echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon quick_view icon-as_link"></span></td>';
+ echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon monitor blue"></span></td>';
}
if ($stolpci > 0 ) {
if (self::$displayEditIcons['dataIcons_edit'] == true) {
- // checkbox za brisanje vecih vrstic hkrati
- echo '<td class="data_edit" title="'.$lang['srv_view_data_row_select'].'"><input type="checkbox" class="delete_data_row" /></td>';
- echo '<td class="data_edit"><span class="faicon delete_circle icon-orange_link" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
- echo '<td class="data_edit"><span class="faicon edit_square icon-as_link" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
- echo '<td class="data_edit"><span class="faicon edit smaller icon-as_link" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon edit_square" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon edit" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon delete" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
}
if (self::$displayEditIcons['dataIcons_write'] == true) {
- echo '<td class="data_edit"><span class="faicon pdf icon-as_link" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
- echo '<td class="data_edit"><span class="faicon rtf icon-as_link" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
+ echo '<td class="data_edit"><span class="faicon pdf" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
+ echo '<td class="data_edit"><span class="faicon rtf" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
// Evoli ikona (ce je vklopljen modul)
if(SurveyInfo::getInstance()->checkSurveyModule('evoli')) {
@@ -1818,14 +2019,18 @@ class SurveyDataDisplay{
echo '</tr>';
$cntLines++;
}
- } else {
+ }
+ else {
echo 'File does not exist (err.No.1)! :'.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
- #echo $folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
}
+
echo '</tbody>';
+
echo '</table>';
+
echo '</div>'; // end div tableContainer
+
/**
* kliki na ikonice za urejanje in izpis so definirane v script_analiza.js, analiza_init();
*/
@@ -1833,74 +2038,71 @@ class SurveyDataDisplay{
// JS za urejanje vnosov (click in hover) (funkciji sta definirani v postProcess.js)
?>
<script>
- $('#dataTableScroller').followTo($("#dataTable").position().top - $("#dataTableScroller").height()-25);
- dataTableResize(<?=self::$sid?>);
- $('#dataTable').bind('contextmenu', function (event) { data_preview_content(event); return false; } );
- <?php
- if (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING])
- {
- ?>
- $('#dataTable td').click( function (event) { edit_data(event); } );
- $('#dataTable td').hover( function (event) { edit_data_hover(event) }, function (event) { edit_data_hoverout(event) } );
- edit_data_inline_edit(); // manj utripne, ce takoj za tabelo poklicemo brez cakanja na dom ready
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- } elseif (self::$_VARS[VAR_CODING]) {
- ?>
- $('#dataTable tbody tr td').click( function (event) { coding_click( $(this), event ) } );
-
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- } else {
- ?>
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- }
-
- ?>
- $('#dataTable td.enkaIcon span.quick_view').click( function (event) { showSurveyAnswers(event); } );
- var sort_action_url = '<?php echo 'index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVarsNoSort();?>'
- <?php
- if (self::$_VARS[VAR_META]) {
- echo "postProcessAddLurkerTitles(".(self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance ? (4+(int)self::$_VARS[VAR_EMAIL]) : (3+(int)self::$_VARS[VAR_EMAIL])).");\n";
- }
-
- # pobarvamo celice in dodamo title za statuse
- echo "postProcessAddTitles();\n";
- echo "postProcessAddMetaTitles();\n";
-
- // Pobarvamo sistemske identifikatorje
- if(self::$_HEADERS['_settings']['force_show_hiden_system'] == '1')
- echo "postProcessAddSystem(".json_encode($system_columns).");\n";
-
- if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
- echo "postProcessAddRelevanceTitles();\n";
- }
- if (self::$_VARS[VAR_EMAIL]) {
- echo "postProcessAddEmailTitles(".(self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance ? 3 : 2).");\n";
- }
-
- ?>
+
+ <?php
+ if (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING]){
+ ?>
+ $('#dataTable td').click( function (event) { edit_data(event); } );
+ $('#dataTable td').hover( function (event) { edit_data_hover(event) }, function (event) { edit_data_hoverout(event) } );
+ edit_data_inline_edit(); // manj utripne, ce takoj za tabelo poklicemo brez cakanja na dom ready
+
+ <?php
+ } elseif (self::$_VARS[VAR_CODING]) {
+ ?>
+ $('#dataTable tbody tr td').click( function (event) { coding_click( $(this), event ) } );
+ <?php
+ }
+ ?>
+
+ $('#dataTable tr th.sortable').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
+ $('#dataTable tr th.sortable').on('click', function(event) { data_header_click(event); } );
+ $('#dataTable tr th.sortable div span').on('click', function(event) { event.stopPropagation(); $(this).closest('th').click() } );
+
+ $('#dataTable td.enkaIcon span.monitor').click( function (event) { showSurveyAnswers(event); } );
+ var sort_action_url = '<?php echo 'index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVarsNoSort();?>'
+ <?php
+
+ if (self::$_VARS[VAR_RELEVANCE]) {
+ $column = 1;
+ if(self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$showLineNumber) $column ++;
+ if(self::$canDisplayRelevance) $column ++;
+ echo "postProcessAddLurkerTitles(".$column.");\n";
+ }
+
+ # pobarvamo celice in dodamo title za statuse
+ echo "postProcessAddTitles();\n";
+ echo "postProcessAddMetaTitles();\n";
+
+ // Pobarvamo sistemske identifikatorje
+ if(self::$_HEADERS['_settings']['force_show_hiden_system'] == '1')
+ echo "postProcessAddSystem(".json_encode($system_columns).");\n";
+
+ if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
+ $column = 1;
+ if(self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$showLineNumber) $column ++;
+ echo "postProcessAddRelevanceTitles(".$column.");\n";
+ }
+ if (self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) {
+ echo "postProcessAddEmailTitles(".(self::$showLineNumber ? 3 : 2).");\n";
+ }
+
+ ?>
</script>
<?php
+
if ($f) {
fclose($f);
}
if (file_exists($folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT)) {
unlink($folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT);
}
- if ($_GET['debug'] == 1) {
+ if (isset($_GET['debug']) && $_GET['debug'] == 1) {
print_r("<pre>".$_command."</pre>");
}
-
- // Editiranje na dnu - brisanje vec userjev hkrati...
-
- if(self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1){
- self::displayBottomEdit();
- }
}
static public function DisplayDataMultipleTable() {
@@ -1936,8 +2138,7 @@ class SurveyDataDisplay{
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if ( isset(self::$_SVP_PV[$spid]) && is_numeric($spremenljivka['tip']) ) {
-
- //$spr_id = explode('_', $spid)[0]; // PHP 5.4
+
$spr_id = explode('_', $spid);
$spr_id = $spr_id[0];
@@ -1957,23 +2158,18 @@ class SurveyDataDisplay{
$sequences[$spr] = explode('_', $multiple[$spr]['sequences'] ); // vsi stolpci trenutne spremenljivke (4 - 12)
$subseq[$spr] = count($multiple[$spr]['grids']); // stevilo vrstic v vprasanju (4 - 4) (to je za vsa vprasanja enako)
$cols[$spr] = round(count($sequences[$spr])/$subseq[$spr], 0); // koliko stolpcev zasede enkratna ponovitev vprasanja (1 - 3)
-
- #echo "\n\r vars: ".count($sequences[$spr]).' '.$subseq[$spr].' '.$cols[$spr].' '.$dataoffset."\n\r";
-
}
-
$_svp_pv['uid'] = 'uid';
- //self::$_SVP_PV = array_merge($_svp_pv, self::$_SVP_PV);
+
+
#izpišemo tabelo
- echo '<br/>';
echo '<div id="tableContainer" class="tableContainer">';
# div v katerem po potrebi prikazujemo gumbe za skrolanje levo in desno
echo '<div id="dataTableScroller">';
- echo '<span class="pointer halfCircleLeft" onclick="dataTableScroll(\'left\');return false;">&lt;</span>';
- echo '&nbsp;';
- echo '<span class="pointer halfCircleRight" onclick="dataTableScroll(\'right\');return false;">&gt;</span>';
+ echo ' <div class="dataTable_arrow left" onclick="dataTableScroll(\'left\'); return false;"><span class="faicon arrow_large2_l"></span></div>';
+ echo ' <div class="dataTable_arrow right" onclick="dataTableScroll(\'right\'); return false;"><span class="faicon arrow_large2_r"></span></div>';
echo '</div>';
$display1kaIcon = self::$displayEditIcons['dataIcons_quick_view'] ;
@@ -2002,6 +2198,10 @@ class SurveyDataDisplay{
echo '<col class="data_edit"'.($stolpci > 1 ? (' span="'.$stolpci.'"') : '').'>';
}
+ if (self::$showLineNumber /* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<col>';
+ }
+
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if (isset(self::$_SVP_PV[$spid]) && count($spremenljivka['grids']) > 0) {
@@ -2013,11 +2213,7 @@ class SurveyDataDisplay{
$repeat = false;
else
$repeat = true;
-
- if (self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<col>';
- }
-
+
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
foreach ($spremenljivka['grids'] AS $gid => $grid) {
@@ -2054,6 +2250,12 @@ class SurveyDataDisplay{
# dodamo skrit stolpec uid
echo '<th class="data_uid">&nbsp;</th>';
+
+ if (self::$showLineNumber/* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th title="'.$lang['srv_line_number'].'" >';
+ echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
+ echo '</th>';
+ }
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
@@ -2069,11 +2271,6 @@ class SurveyDataDisplay{
$colspan = $spremenljivka['cnt_all'];
}
- if (self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
- echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
- }
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
echo '<th colspan="'.$colspan.'" title="'.$spremenljivka['naslov'].'">';
@@ -2095,6 +2292,12 @@ class SurveyDataDisplay{
# dodamo skrit stolpec uid
echo '<th class="data_uid">&nbsp;</th>';
+ if(self::$showLineNumber /* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th title="'.$lang['srv_line_number'].'" >';
+ echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
+ echo '</th>';
+ }
+
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if (isset(self::$_SVP_PV[$spid]) && (count($spremenljivka['grids']) > 0 )) {
@@ -2107,12 +2310,6 @@ class SurveyDataDisplay{
else
$repeat = true;
- if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
- echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
- }
-
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
@@ -2132,14 +2329,28 @@ class SurveyDataDisplay{
# colspan za ikonce
if ($stolpci > 0) {
- //for ($i=0; $i<$stolpci; $i++)
- // echo '<th class="data_edit">&nbsp;</th>';
- echo '<th class="data_edit"'.($stolpci > 1 ? (' colspan="'.$stolpci.'"') : '').'>&nbsp;</th>';
+
+ $show_mass_delete = (self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1) ? true : false;
+
+ echo '<th class="data_edit" '.($stolpci > 1 ? ('colspan="'.$stolpci.'"') : '').' '/* .($show_mass_delete ? 'style="min-width:190px"' : '') */.'>';
+
+ // Editiranje na dnu - brisanje vec userjev hkrati...
+ if($show_mass_delete){
+ self::displayMassDelete();
+ }
+
+ echo '</th>';
}
# dodamo skrit stolpec uid
echo '<th class="data_uid">&nbsp;</th>';
+ if (self::$showLineNumber /* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th title="'.$lang['srv_line_number'].'" >';
+ echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
+ echo '</th>';
+ }
+
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if (isset(self::$_SVP_PV[$spid]) && count($spremenljivka['grids']) > 0) {
@@ -2152,18 +2363,19 @@ class SurveyDataDisplay{
else
$repeat = true;
- if (self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
- echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
- }
-
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
foreach ($spremenljivka['grids'] AS $gid => $grid) {
if (count ($grid['variables']) > 0) {
foreach ($grid['variables'] AS $vid => $variable ){
- echo '<th title="'.$variable['naslov'].($variable['other'] ? '&nbsp;(text)' : '').'"'
+
+ //za delovanje sortinga
+ $class_sorting = '';
+ if ($variable['sequence'] == self::$sort_seq && self::$sort_seq != null) {
+ $class_sorting = self::$sort_type !== null ? self::$sort_type : '' ;
+ }
+
+ echo '<th class="'.$class_sorting.'" title="'.$variable['naslov'].($variable['other'] ? '&nbsp;(text)' : '').'"'
.' seq="'.$variable['sequence'].'"';
if ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') {
@@ -2435,21 +2647,24 @@ class SurveyDataDisplay{
echo '<tr>';
-
+ if ($stolpci > 0 ) {
+ if (self::$displayEditIcons['dataIcons_edit'] == true) {
+ // checkbox za brisanje vecih vrstic hkrati
+ echo '<td class="data_edit delete_checkbox" title="'.$lang['srv_view_data_row_select'].'"><input type="checkbox" id="delete_data_row_'.$cntLines.'" class="delete_data_row" /><label for="delete_data_row_'.$cntLines.'"></label></td>';
+ }
+ }
if ((int)$display1kaIcon == 1) {
- echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon quick_view icon-as_link"></span></td>';
+ echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon monitor"></span></td>';
}
if ($stolpci > 0 ) {
if (self::$displayEditIcons['dataIcons_edit'] == true) {
- // checkbox za brisanje vecih vrstic hkrati
- echo '<td class="data_edit" title="'.$lang['srv_view_data_row_select'].'"><input type="checkbox" class="delete_data_row" /></td>';
- echo '<td class="data_edit"><span class="faicon delete_circle icon-orange_link" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
- echo '<td class="data_edit"><span class="faicon edit_square icon-as_link" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
- echo '<td class="data_edit"><span class="faicon edit smaller icon-as_link" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon edit_square" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon edit" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon delete" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
}
if (self::$displayEditIcons['dataIcons_write'] == true) {
- echo '<td class="data_edit"><span class="faicon pdf icon-as_link" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
- echo '<td class="data_edit"><span class="faicon rtf icon-as_link" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
+ echo '<td class="data_edit"><span class="faicon pdf" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
+ echo '<td class="data_edit"><span class="faicon rtf" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
}
}
@@ -2481,51 +2696,62 @@ class SurveyDataDisplay{
// JS za urejanje vnosov (click in hover) (funkciji sta definirani v postProcess.js)
?>
- <script>
- $('#dataTableScroller').followTo($("#dataTable").position().top - $("#dataTableScroller").height()-25);
- dataTableResize(<?=self::$sid?>);
- $('#dataTable').bind('contextmenu', function (event) { data_preview_content(event); return false; } );
- <?php
- if (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING])
- {
- ?>
- $('#dataTable td').click( function (event) { edit_data(event); } );
- $('#dataTable td').hover( function (event) { edit_data_hover(event) }, function (event) { edit_data_hoverout(event) } );
- edit_data_inline_edit(); // manj utripne, ce takoj za tabelo poklicemo brez cakanja na dom ready
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- } elseif (self::$_VARS[VAR_CODING]) {
- ?>
- $('#dataTable tbody tr td').click( function (event) { coding_click( $(this), event ) } );
- <?php
- } else {
- ?>
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- }
-
- ?>
- $('#dataTable td.enkaIcon span.quick_view').click( function (event) { showSurveyAnswers(event); } );
- var sort_action_url = '<?php echo 'index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVarsNoSort();?>'
- <?php
- if (self::$_VARS[VAR_META]) {
- echo "postProcessAddLurkerTitles(".(self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance ? (4+(int)self::$_VARS[VAR_EMAIL]) : (3+(int)self::$_VARS[VAR_EMAIL])).");\n";
- }
-
- # pobarvamo celice in dodamo title za statuse
- echo "postProcessAddMetaTitles();\n";
-
- if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
- echo "postProcessAddRelevanceTitles();\n";
- }
- if (self::$_VARS[VAR_EMAIL]) {
- echo "postProcessAddEmailTitles(".(self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance ? 3 : 2).");\n";
- }
- ?>
+ <script>
+
+ <?php
+ if (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING]){
+ ?>
+ $('#dataTable td').click( function (event) { edit_data(event); } );
+ $('#dataTable td').hover( function (event) { edit_data_hover(event) }, function (event) { edit_data_hoverout(event) } );
+ edit_data_inline_edit(); // manj utripne, ce takoj za tabelo poklicemo brez cakanja na dom ready
+ $('#dataTable tr th.sortable').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
+ $('#dataTable tr th.sortable').on('click', function(event) { data_header_click(event); } );
+ $('#dataTable tr th.sortable div span').on('click', function(event) { event.stopPropagation(); $(this).closest('th').click() } );
+
+ <?php
+ } elseif (self::$_VARS[VAR_CODING]) {
+ ?>
+ $('#dataTable tbody tr td').click( function (event) { coding_click( $(this), event ) } );
+ <?php
+ } else {
+ ?>
+ $('#dataTable tr th.sortable').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
+ $('#dataTable tr th.sortable').on('click', function(event) { data_header_click(event); } );
+ $('#dataTable tr th.sortable div span').on('click', function(event) { event.stopPropagation(); $(this).closest('th').click() } );
+
+ <?php
+ }
+
+ ?>
+ $('#dataTable td.enkaIcon span.monitor').click( function (event) { showSurveyAnswers(event); } );
+ var sort_action_url = '<?php echo 'index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVarsNoSort();?>'
+ <?php
+ if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
+ $column = 2;
+ if(self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$showLineNumber) $column ++;
+ echo "postProcessAddLurkerTitles(".$column.");\n";
+ }
+
+ # pobarvamo celice in dodamo title za statuse
+ echo "postProcessAddMetaTitles();\n";
+
+ if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
+ $column = 1;
+ if(self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$showLineNumber) $column ++;
+ echo "postProcessAddRelevanceTitles(".$column.");\n";
+ }
+ if (self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) {
+ echo "postProcessAddEmailTitles(".(self::$showLineNumber ? 3 : 2).");\n";
+ }
+ ?>
</script>
- <?php
+ <?php
+
+
if ($f) {
fclose($f);
}
@@ -2535,11 +2761,6 @@ class SurveyDataDisplay{
if ($_GET['debug'] == 1) {
print_r("<pre>".$_command."</pre>");
}
-
- // Editiranje na dnu - brisanje vec userjev hkrati...
- if(self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1){
- self::displayBottomEdit();
- }
}
public static function url_to_link($text) {
@@ -2562,6 +2783,9 @@ class SurveyDataDisplay{
return false;
}
+ // Shranimo jezik vmesnika
+ $lang_old = $lang;
+
include_once('../../main/survey/app/global_function.php');
new \App\Controllers\SurveyController(true);
save('usr_id', self::$usr_id);
@@ -2571,7 +2795,7 @@ class SurveyDataDisplay{
} else {
$quick_view = true;
}
-
+
$rowa = SurveyInfo::getInstance()->getSurveyRow();
if ($quick_view) {
@@ -2592,22 +2816,11 @@ class SurveyDataDisplay{
echo "<script>function submitForm(){}</script>"."\n";
}
+
echo '<div id="edit_survey_data">';
- echo '<div class="inner quick_edit">';
- // title
- echo '<div class="quick_edit_title">';
-
- //echo $rowa['naslov'];
- if (self::$quickEdit_recnum[3]['hasPrev'] == true) {
- echo '<a href="#" onClick="location.href=\''.self::$quickEdit_recnum[0].'\'" title="'.$lang['srv_prev_resp'].'"><span class="faicon arrow2_l pointer"></span></a>';
- }
- echo 'Recnum '.self::$quickEdit_recnum[2];
- if (self::$quickEdit_recnum[3]['hasNext'] == true) {
- echo '<a href="#" onClick="location.href=\''.self::$quickEdit_recnum[1].'\'" title="'.$lang['srv_next_resp'].'"><span class="faicon arrow2_r pointer"></span></a>';
- }
-
- echo '</div>';
+
+ echo '<div class="quick_edit_inner">';
if ($quick_view == false) {
echo '<form name="vnos" id="vnos" method="post" action="../survey/index.php?anketa='.$_GET['anketa'].'&a=data&m=quick_edit&usr_id='.$_GET['usr_id'].'&quick_view=0&post=1" enctype="multipart/form-data">'."\n";
@@ -2693,6 +2906,7 @@ class SurveyDataDisplay{
# V VPOGLEDU NE FILTRIRAMO SPREMENLJIVK (v.v.: 27.11.2011)
#$tmp_svp_pv = SurveyVariablesProfiles :: getProfileVariables($_currentVariableProfile);
+ $tmp_svp_pv = array();
# č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
@@ -2726,33 +2940,38 @@ class SurveyDataDisplay{
while (get('grupa') != \App\Controllers\FindController::getInstance()->findNextGrupa() &&
(\App\Controllers\FindController::getInstance()->findNextGrupa() > 0 || (get('loop_id') != null && \App\Controllers\FindController::getInstance()->findNextLoopId() != null)));
}
- if ($quick_view == false) {
- //echo '<input type="submit" value="Shrani" /> ';<a href="#" onclick="document.forms['myFormName'].submit(); return false;">...</a>
- echo '<span class="floatRight spaceLeft" ><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="document.forms[\'vnos\'].submit(); return false;"><span>' . $lang['save'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" ><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="../survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'"><span>Nazaj na podatke</span></a></div></span>';
- #echo '</form>'."\n";
- }
- else{
+ if ($quick_view == false) {
echo '</form>'."\n";
}
- echo '</div>'; # inner
+ // restavriramo jezik vmesnika ce je slucajno drugacen od ankete
+ $lang = $lang_old;
- echo '<div id="quick_edit_title">';
+ echo '<div class="quick_edit_bottom_line">';
self::displayVnosIcons();
- echo '</div>';
-
- echo '<br /><br /><br /><br />';
-
+
+ if ($quick_view == false) {
+ echo '<div class="button_holder">';
+ echo ' <a href="../survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'"><button class="medium white-blue">'.$lang['srv_back_to_data'].'</button></a>';
+ echo ' <button class="medium blue" onclick="document.forms[\'vnos\'].submit(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+ }
+
echo '</div>';
+ echo '</div>'; # inner
+
+ // Div na desni z metapodatki
+ echo '<div class="quick_edit_meta_holder">';
+ echo ' <div id="quick_edit_meta">';
+ self::displayQuickEditMeta();
+ echo ' </div>';
+ echo '</div>';
- // Div na desni z metapodatki
- echo '<div id="quick_edit_meta">';
- self::displayQuickEditMeta();
echo '</div>';
+
// Preverimo ce gre za prvo urejanje - potem avtomatsko ustvarimo arhiv podatkov
if ($quick_view == false && isset($_GET['post']) && $_GET['post'] == '1') {
ob_flush();
@@ -2766,18 +2985,19 @@ class SurveyDataDisplay{
global $lang;
global $site_path;
- //echo '<h2>'.$lang['srv_data_title_quick_view'].'</h2>';
-
if (self::$dataFileStatus == FILE_STATUS_NO_DATA
|| self::$dataFileStatus == FILE_STATUS_NO_FILE
|| self::$dataFileStatus == FILE_STATUS_SRV_DELETED){
return false;
}
-
+
+ // Paginacija
self::displayQuickEditPagination();
- echo '<div id="div_analiza_filtri_right" class="floatRight vpogled">';
+
+ // Filtri - ?? todo ??
+ /*echo '<div id="div_analiza_filtri_right" class="floatRight vpogled">';
echo '<ul>';
# div za filtre statusov
SurveyStatusProfiles::DisplayLink(false);
@@ -2809,11 +3029,18 @@ class SurveyDataDisplay{
if ($doNewLine) {
echo '<br/>';
- }
+ }*/
+
- echo '<div id="quick_edit_title">';
+ // Zgrnja vrstica z ikonami in naslovom
+ echo '<div id="quick_edit_top_line">';
self::displayVnosIcons();
+
+ // title
+ echo '<div class="quick_edit_title">';
+ echo $lang['srv_recnum_long'].': '.self::$quickEdit_recnum[2];
+ echo '</div>';
echo '</div>';
}
@@ -2870,27 +3097,19 @@ class SurveyDataDisplay{
$current = count($uids)-1;
}
- echo '<div id="pagination" class="floatLeft">';
+ echo '<div class="pagination_holder">';
+ echo ' <div class="pagination">';
- # povezava -10
- /*if ($all > 10) {
- if ($current - 10 >= 0) {
- echo('<div><a href="'.$baseUrl.$uids[$current - 10].'">-10</a></div>');
- } else {
- # brez href povezave
- echo('<div class="disabledPage">-10</div>');
- }
- }*/
-
$controls=array('hasPrev'=>true,'hasNext'=>true);
# povezava na prejšnjo stran
- $prev_page = $uids[$current - 1] ? $uids[$current - 1] :$uids[$current];
+ $prev_page = ($current > 0 && $uids[$current - 1]) ? $uids[$current - 1] :$uids[$current];
if( ($current - 1) >= 0) {
- echo('<div><a href="'.$baseUrl.$prev_page.'"><span class="faicon pagination_left icon-blue"></span></a></div>');
- } else {
+ echo '<a href="'.$baseUrl.$prev_page.'"><div class="arrow left"><span class="faicon pagination_left"></span></div></a>';
+ }
+ else {
# brez href povezave
- echo('<div class="disabledPage"><span class="faicon pagination_left icon-blue_soft"></span></div>');
+ echo '<div class="arrow left disabledPage"><span class="faicon pagination_left"></span></div>';
$controls['hasPrev'] = false;
}
@@ -2907,38 +3126,32 @@ class SurveyDataDisplay{
}
if($a == $current) {
# brez href povezave
- echo('<div class="currentPage">'.($a+1).'</div>');
- } else {
- echo('<div><a href="'.$baseUrl.$uids[$a].'">'.($a+1).'</a></div>');
+ echo '<div class="page_number currentPage">'.($a+1).'</div>';
+ }
+ else {
+ echo '<a href="'.$baseUrl.$uids[$a].'"><div class="page_number">'.($a+1).'</div></a>';
}
- } else {
+ }
+ else {
$skipped = true;
}
}
# povezava na naslednjo stran
- $next_page = ($uids[$current + 1]) ? $uids[$current + 1] : $uids[$current];
+ $next_page = (isset($uids[$current + 1]) && $uids[$current + 1]) ? $uids[$current + 1] : $uids[$current];
if(($current + 1) < $all) {
- echo('<div><a href="'.$baseUrl.$next_page.'"><span class="faicon pagination_right icon-blue"></span></a></div>');
- } else {
+ echo '<a href="'.$baseUrl.$next_page.'"><div class="arrow right"><span class="faicon pagination_right"></span></div></a>';
+ }
+ else {
# brez href povezave
- echo('<div class="disabledPage"><span class="faicon pagination_right icon-blue_soft"></span></div>');
+ echo '<div class="arrow right disabledPage"><span class="faicon pagination_right"></span></div>';
$controls['hasNext'] = false;
}
- /*if ($all > 10) {
- if ($current + 10 < $all) {
- echo('<div><a href="'.$baseUrl.$uids[$current + 10].'">+10</a></div>');
- } else {
- # brez href povezave
- echo('<div class="disabledPage">+10</div>');
- }
- }*/
-
+ echo ' </div>';
echo '</div>';
// vrnemo link na prejsnega, link na naslednjega in recnum trenutnega
- //return array($baseUrl.$prev_page, $baseUrl.$next_page, $uid_rec[self::$usr_id], $controls);
self::$quickEdit_recnum = array($baseUrl.$prev_page, $baseUrl.$next_page, $uid_rec[self::$usr_id], $controls);
}
else {
@@ -3003,14 +3216,14 @@ class SurveyDataDisplay{
// jezik
// Dobimo vse jezike za katere obstaja jezikovna datoteka
include_once($site_path.'lang/jeziki.php');
- $jeziki = $lang_all_global['ime'];
+ $jeziki = isset($lang_all_global['ime']) ? $lang_all_global['ime'] : "";
$jeziki['0'] = $lang['language'];
echo '<tr><td class="left">'.$lang['lang'].':</td>';
- echo '<td class="right">'.$jeziki[$rowu['language']].'</td></tr>';
+ echo '<td class="right">'.isset($jeziki[$rowu['language']]) ? $jeziki[$rowu['language']] : "".'</td></tr>';
}
// status
- echo '<tr><td class="left">'.$lang['status'].':</td>';
+ echo '<tr><td class="left">'.$lang['status'].'</td>';
echo '<td class="right">'.($rowu['last_status'] ? $rowu['last_status'] : '&nbsp;').'</td></tr>';
// lurker
@@ -3042,21 +3255,19 @@ class SurveyDataDisplay{
echo '<td class="right">'.$text.'</td></tr>';
// preberemo popravljanje po straneh
- $sqlG = sisplet_query("SELECT ug.time_edit, g.naslov FROM srv_user_grupa".self::$db_table." ug, srv_grupa g WHERE g.ank_id = '".self::$sid."' AND ug.usr_id = '".self::$usr_id."' AND g.id = ug.gru_id ORDER BY g.vrstni_red ASC");
+ $sqlG = sisplet_query("SELECT ug.time_edit, g.naslov, g.vrstni_red FROM srv_user_grupa".self::$db_table." ug, srv_grupa g WHERE g.ank_id = '".self::$sid."' AND ug.usr_id = '".self::$usr_id."' AND g.id = ug.gru_id ORDER BY g.vrstni_red ASC");
while($rowG = mysqli_fetch_array($sqlG)){
$datetime = strtotime($rowG['time_edit']);
$text = date("d.m.Y, H:i:s", $datetime);
- echo '<tr><td class="left">'.$rowG['naslov'].':</td>';
+ echo '<tr><td class="left">'.$lang['srv_stran'].' '.$rowG['vrstni_red'].':</td>';
echo '<td class="right">'.$text.'</td></tr>';
}
- if ( $admin_type <= 1) {
-
+ if ( $admin_type <= 1) {
echo '<tr><td class="left">'.$lang['srv_sc_txt1'].':</td>';
- echo '<td class="right"><a href="#" onclick="sc_display(\''.self::$usr_id.'\'); return false;">'.$lang['srv_sc_txt2'].'</a></td></tr>';
-
+ echo '<td class="right"><a href="#" onclick="sc_display(\''.self::$usr_id.'\'); return false;">'.$lang['srv_sc_txt2'].'</a></td></tr>';
}
}
@@ -3172,7 +3383,7 @@ class SurveyDataDisplay{
echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=css" media="screen" rel="stylesheet" />';
echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=cssPrint" media="print" rel="stylesheet" />';
echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
+ echo '.container {margin-bottom:45px;} #dataTableScroller {display:none;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
echo '</style>';
echo '<!--[if lt IE 7]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie6hacks.css" type="text/css" />';
@@ -3205,7 +3416,7 @@ class SurveyDataDisplay{
echo '</script>';
echo '</head>';
- echo '<body style="margin:5px; padding:5px;" >';
+ echo '<body class="public_link data" style="margin:5px; padding:5px;" >';
echo '<h2>'.$lang['srv_publc_data_title_for'].self::$survey['naslov'].'</h2>';
echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $anketa . '" />';
@@ -3228,9 +3439,6 @@ class SurveyDataDisplay{
'a'=>'list_xls',
'anketa'=>$anketa)));
echo '<div class="printHide" style="margin-top:6px; margin-bottom:60px;">';
- echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';
if (isset($properties['profile_id_status']))
{
@@ -3272,19 +3480,7 @@ class SurveyDataDisplay{
</script><?php
echo '</div>';
-
- echo '<div id="navigationBottom" class="printHide">';
-
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="window.print();return false;"><span><img src="'.$site_url.'admin/survey/icons/icons/printer.png" vartical-align="middle" /> '.$lang['hour_print2'].'</span></a></div></span>';
- echo '<span class="spaceRight floatRight printHide" style="margin-top:6px;">';
- echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';
- echo '</span>';
-
- echo '<br class="clr" />';
- echo '</div>';
-
+
echo '</body>';
echo '</html>';
}
@@ -3306,20 +3502,26 @@ class SurveyDataDisplay{
$lang_admin = $row['value'];
}
+ $sqlVersion = sisplet_query("SELECT value FROM misc WHERE what = 'version'");
+ $rowVersion = mysqli_fetch_assoc($sqlVersion);
+
#izpišemo HTML
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
- echo '<head>';
- echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
+
+
+ echo '<head>';
+
+ echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
echo '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />';
- echo '<script type="text/javascript" src="'.$site_url.'admin/survey/script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
+
+ echo '<script type="text/javascript" src="'.$site_url.'admin/survey/script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
echo '<script type="text/javascript" src="'.$site_url.'admin/survey/minify/g=jsnew"></script>';
- echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=css" media="screen" rel="stylesheet" />';
- echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=cssPrint" media="print" rel="stylesheet" />';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
- echo '<!--[if lt IE 7]>';
+
+ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=css?v='.$rowVersion['value'].'" media="screen" rel="stylesheet" />';
+ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=cssPrint?v='.$rowVersion['value'].'" media="print" rel="stylesheet" />';
+
+ echo '<!--[if lt IE 7]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie6hacks.css" type="text/css" />';
echo '<![endif]-->';
echo '<!--[if IE 7]>';
@@ -3328,9 +3530,7 @@ class SurveyDataDisplay{
echo '<!--[if IE 8]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie8hacks.css" type="text/css" />';
echo '<![endif]-->';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
+
echo '<script>';
echo 'function chkstate(){';
echo ' if(document.readyState=="complete"){';
@@ -3348,12 +3548,17 @@ class SurveyDataDisplay{
echo ' window.close();';
echo '}';
echo '</script>';
+
echo '</head>';
- echo '<body style="margin:5px; padding:5px;" onBlur="window.close();">';
- echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $_REQUEST['anketa'] . '" />';
- #echo '<div id="div_analiza_single_var" class="container">';
+
+ echo '<body class="quick_list_data" onBlur="window.close();">';
+
+ echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $_REQUEST['anketa'] . '" />';
+
+
echo '<div id="analiza_data">';
+
//Izvoz v PDF / RTF / XLS
$_url1 = $site_url.'admin/survey/izvoz.php?dc='.base64_encode(
serialize(
@@ -3370,14 +3575,18 @@ class SurveyDataDisplay{
array( 'b'=>'export',
'a'=>'list_xls',
'anketa'=>$anketa)));
- echo '<div class=" printHide" style="margin-top:6px;">';
- echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a>&nbsp;&nbsp;';
+
+
+ echo '<div class="printHide">';
+
+ /*echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a>&nbsp;&nbsp;';
echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';
+ echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';*/
- echo '<br class="clr"/>';
echo $lang['srv_data_print_preview'];
+
echo '</div>';
+
self::$printPreview = true;
self::$_VARS[VAR_DATA] = 1;
@@ -3385,6 +3594,7 @@ class SurveyDataDisplay{
self::$_VARS[VAR_META] = 0;
self::$_VARS[VAR_EMAIL] = 0;
self::$_VARS[VAR_RELEVANCE] = 0;
+ self::$_VARS[VAR_STATUS] = 0;
self::$_VARS[VAR_EDIT] = 0;
self::$_VARS[VAR_PRINT] = 0;
self::$_VARS[VAR_MONITORING] = 0;
@@ -3392,27 +3602,23 @@ class SurveyDataDisplay{
unset(self::$_SVP_PV['invitation']);
}
-
- # ponastavimo nastavitve- filter
+
+ # ponastavimo nastavitve- filter
self::setUpFilter();
self::DisplayDataTable();
+
echo '</div>';
- echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="close_win(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="window.print();return false;"><span class="faicon print_small icon-grey_dark_link"></span> '.$lang['hour_print2'].'</a></div></span>';
-
- echo '<span class="spaceRight floatRight printHide" style="margin-top:6px;">';
- echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="medium white-blue" onclick="window.print(); return false;">'.$lang['hour_print2'].'</button>';
+ echo ' <button class="medium blue" onclick="close_win(); return false;">'.$lang['srv_zapri'].'</button>';
echo '</span>';
-
- echo '<br class="clr" />';
+
echo '</div>';
echo '</body>';
+
echo '</html>';
}
@@ -3423,33 +3629,35 @@ class SurveyDataDisplay{
$userAccess = UserAccess::getInstance($global_user_id);
// gumbi na levi (delete, edit, izvozi...)
- echo '<div id="left_options">';
+ echo '<div class="quick_edit_icons">';
- echo '<span class="faicon delete_circle large icon-orange_link" title="'.$lang['srv_delete_data_row'].'" onClick="quickEditAction(\'delete\', \''.self::$usr_id.'\');"></span>';
- echo '<span class="faicon edit_square large icon-grey_dark_link" title="'.$lang['srv_edit_data_row'].'" onClick="quickEditAction(\'edit\', \''.self::$usr_id.'\');"></span>';
- echo '<span class="faicon print_small large icon-grey_dark_link" title="'.$lang['PRN_Izpis'].'" onClick="printAnaliza(\'Vpogled\'); return false;"></span>';
+ echo '<span class="faicon edit_square" title="'.$lang['srv_edit_data_row'].'" onClick="quickEditAction(\'edit\', \''.self::$usr_id.'\');"></span>';
- // Ce imamo izvoze v paketu
- if($userAccess->checkUserAccess($what='data_export')){
- echo '<span class="faicon pdf large icon-grey_dark_link" title="'.$lang['PDF_Izpis'].'" onClick="quickEditAction(\'pdf\', \''.self::$usr_id.'\');"></span>';
- echo '<span class="faicon rtf large icon-grey_dark_link" title="'.$lang['RTF_Izpis'].'" onClick="quickEditAction(\'rtf\', \''.self::$usr_id.'\');"></span>';
- }
- else{
- echo '<span class="faicon pdf large icon-grey_dark_link user_access_locked" title="'.$lang['PDF_Izpis'].'" onClick="popupUserAccess(\'data_export\');"></span>';
- echo '<span class="faicon rtf large icon-grey_dark_link user_access_locked" title="'.$lang['RTF_Izpis'].'" onClick="popupUserAccess(\'data_export\');"></span>';
- }
-
- echo '<span class="faicon copy large icon-grey_dark_link" title="'.$lang['srv_copy_data'].'" onClick="quickEditAction(\'copy\', \''.self::$usr_id.'\');"></span>';
-
- // omogocimo/onemogocimo popravljanje vnosa
+ // omogocimo/onemogocimo popravljanje vnosa
if(isset($_GET['quick_view']) && $_GET['quick_view'] == 0){
- echo '<span class="faicon edit large icon-grey_dark_link_reverse" title="'.$lang['srv_quick_view_off'].'" onClick="quickEditAction(\'quick_view\', \''.self::$usr_id.'\');"></span>';
+ echo '<span class="faicon edit" title="'.$lang['srv_quick_view_off'].'" onClick="quickEditAction(\'quick_view\', \''.self::$usr_id.'\');"></span>';
echo '<input type="hidden" id="quick_view" value="0">';
}
else{
- echo '<span class="faicon edit large icon-grey_dark_link" title="'.$lang['srv_quick_view_on'].'" onClick="quickEditAction(\'quick_view\', \''.self::$usr_id.'\');"></span>';
+ echo '<span class="faicon edit gray" title="'.$lang['srv_quick_view_on'].'" onClick="quickEditAction(\'quick_view\', \''.self::$usr_id.'\');"></span>';
echo '<input type="hidden" id="quick_view" value="1">';
}
+
+ echo '<span class="faicon copy" title="'.$lang['srv_copy_data'].'" onClick="quickEditAction(\'copy\', \''.self::$usr_id.'\');"></span>';
+ echo '<span class="faicon delete" title="'.$lang['srv_delete_data_row'].'" onClick="quickEditAction(\'delete\', \''.self::$usr_id.'\');"></span>';
+
+ // Ce imamo izvoze v paketu
+ if($userAccess->checkUserAccess($what='data_export')){
+ echo '<span class="faicon pdf" title="'.$lang['PDF_Izpis'].'" onClick="quickEditAction(\'pdf\', \''.self::$usr_id.'\');"></span>';
+ echo '<span class="faicon rtf" title="'.$lang['RTF_Izpis'].'" onClick="quickEditAction(\'rtf\', \''.self::$usr_id.'\');"></span>';
+ }
+ else{
+ echo '<span class="faicon pdf user_access_locked" title="'.$lang['PDF_Izpis'].'" onClick="popupUserAccess(\'data_export\');"></span>';
+ echo '<span class="faicon rtf user_access_locked" title="'.$lang['RTF_Izpis'].'" onClick="popupUserAccess(\'data_export\');"></span>';
+ }
+
+ echo '<span class="faicon print" title="'.$lang['PRN_Izpis'].'" onClick="printAnaliza(\'Vpogled\'); return false;"></span>';
+
echo '</div>';
}
@@ -3457,7 +3665,7 @@ class SurveyDataDisplay{
if (self::$dataFileStatus >= 0) {
#status - če smo v meta ali imamo profil vse enote
- if ( (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
+ if (true|| (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
|| ( SurveyStatusProfiles::getCurentProfileId() == 1 )) {
SurveyAnalysisHelper::getInstance()->displayStatusLegend();
}
@@ -3467,7 +3675,7 @@ class SurveyDataDisplay{
if (self::$dataFileStatus >= 0) {
#testni vnosi - samo ce imamo testne
- if (self::$_HAS_TEST_DATA) {
+ if (self::$_HAS_TEST_DATA && self::$_VARS[VAR_RELEVANCE]) {
SurveyAnalysisHelper::getInstance()->displayTestLegend();
}
}
@@ -3478,25 +3686,7 @@ class SurveyDataDisplay{
SurveyAnalysisHelper::getInstance()->displayMissingLegend();
}
}
-
- static function DisplaySnLinks() {
- global $lang, $site_url;
-
- echo '<div id="data_sn_buttons">';
- // Gumb za preklop na EGO
- echo '<span>';
- echo '<a href="'.$site_url.'admin/survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVars(VAR_CIRCLES, '0').'"'.((int)self::$_VARS[VAR_CIRCLES]==0?' class="red"':'').'>'.$lang['srv_lnk_ego'].'</a>';
- echo '</span>';
-
- // Gumb za preklop na ALTER
- echo '<span>';
- echo '<a href="'.$site_url.'admin/survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVars(VAR_CIRCLES, '1').'"'.((int)self::$_VARS[VAR_CIRCLES]==1?' class="red"':'').'>'.$lang['srv_lnk_alter'].'</a>';
- echo '</span>';
-
- echo '</div>';
- }
-
static function setSnDisplayFullTableCheckbox() {
session_start();
@@ -3510,14 +3700,18 @@ class SurveyDataDisplay{
$offset = 0;
- // Ce nismo na prvi strani spremenljivk je offset drugacen in prikazemo stevilko na zacetku
+ // OLD - Ce nismo na prvi strani spremenljivk je offset drugacen in prikazemo stevilko na zacetku
+
if(self::$_VARS[VAR_SPR_PAGE] > 1){
$offset = strpos($line, '</td><td>');
}
elseif (self::$lineoffset > 0 ) {
- for ($i = 0; $i < self::$lineoffset; $i++) {
+ /* for ($i = 0; $i < self::$lineoffset; $i++) {
$offset = strpos($line,'</td><td>',$offset+1);
- }
+ } */
+
+ // NEW - vedno prikazemo st vrstice na prvem mestu (na prvi strani na drugem, zaradi uid)
+ $offset = strpos($line,'</td><td>',$offset+1);
}
return $offset;
diff --git a/admin/survey/classes/surveyData/class.SurveyDataFile.php b/admin/survey/classes/surveyData/class.SurveyDataFile.php
index 29482d7..6cb591a 100644
--- a/admin/survey/classes/surveyData/class.SurveyDataFile.php
+++ b/admin/survey/classes/surveyData/class.SurveyDataFile.php
@@ -134,9 +134,9 @@ class SurveyDataFile {
foreach ($this->HEADER AS $_vkey => $variable) {
# dodamo samo tiste variable, ki imajo numerični tip (navadne spremenljvke)
- if (is_numeric($variable['tip'] )
+ if ( (isset($variable['tip']) && is_numeric($variable['tip']))
# ne dodamo sistemskih email, telefon, ime, priimek, naziv
- && !( (int)$variable['hide_system'] == 1
+ && !( (isset($variable['hide_system']) && (int)$variable['hide_system'] == 1)
&& in_array($variable['variable'],unserialize (SYSTEM_VARIABLES)) )# unserialize (SYSTEM_VARIABLES) -> definition.php = array('email','telefon','ime','priimek','naziv','drugo')
) {
# če filter ni setiran dodamo vse variable
@@ -319,7 +319,8 @@ class SurveyDataFile {
// Preverimo ce prej nismo imeli testnih podatkov
$settings = $this->getHeaderVariable('_settings');
- if($settings['hasTestData'] != 1 && $this->has_test_data > 0){
+
+ if((!isset($settings['hasTestData']) || $settings['hasTestData'] != 1) && $this->has_test_data > 0){
return true;
}
diff --git a/admin/survey/classes/surveyData/class.SurveySNDataFile.php b/admin/survey/classes/surveyData/class.SurveySNDataFile.php
index aba152b..57796b9 100644
--- a/admin/survey/classes/surveyData/class.SurveySNDataFile.php
+++ b/admin/survey/classes/surveyData/class.SurveySNDataFile.php
@@ -17,9 +17,11 @@
* zato je na začetek dodana funkcija ki prešteje loope
*/
+
#KONSTANTE
-define(EXPORT_FOLDER, "admin/survey/SurveyData");
-DEFINE (STR_DLMT, "|");
+if(!defined(EXPORT_FOLDER)) define(EXPORT_FOLDER, "admin/survey/SurveyData");
+if(!defined(STR_DLMT)) define(STR_DLMT, "|");
+
class SurveySNDataFile {
@@ -56,7 +58,8 @@ class SurveySNDataFile {
session_start();
- $this->snCreateFullTable = $_SESSION['sid_'.$sid]['snCreateFullTable'];
+ $this->snCreateFullTable = isset($_SESSION['sid_'.$sid]['snCreateFullTable']) ? $_SESSION['sid_'.$sid]['snCreateFullTable'] : $this->snCreateFullTable;
+
if ( $this->dataFileStatus == FILE_STATUS_NO_DATA
|| $this->dataFileStatus == FILE_STATUS_SRV_DELETED) {
Common::noDataAlert();
@@ -338,8 +341,10 @@ class SurveySNDataFile {
function displayFullTableCheckbox() {
global $lang;
+
session_start();
- echo '<label><input id="snCreateFullTable" name="snCreateFullTable" onclick="setSnDisplayFullTableCheckbox();" type="checkbox"'.($this->snCreateFullTable==true?' checked="checked"':'').'>Prikaži razširjeno tabelo</label>';
+
+ echo '<input id="snCreateFullTable" name="snCreateFullTable" onclick="setSnDisplayFullTableCheckbox();" type="checkbox"'.($this->snCreateFullTable==true?' checked="checked"':'').'><label for="snCreateFullTable">Prikaži razširjeno tabelo</label>';
}
@@ -387,7 +392,7 @@ class SurveySNDataFile {
$SN_HEADER = unserialize(file_get_contents($_SN_head_file_name));
echo '<div id="tableContainer" class="tableContainer">';
- echo '<h3>'.$lang['srv_loop_for_variable'].' <b>['. $this->sn_loop_data[$lpid]['variable']. '] - '. $this->sn_loop_data[$lpid]['naslov']. '</b> ('.$lang['srv_loop_antonucci_circle'].' '.$this->sn_loop_data[$lpid]['antonucci'].')</h3>';
+ echo '<h3 class="sn_title">'.$lang['srv_loop_for_variable'].' <span class="semi-bold">['. $this->sn_loop_data[$lpid]['variable']. '] - '. $this->sn_loop_data[$lpid]['naslov']. '</span> ('.$lang['srv_loop_antonucci_circle'].' '.$this->sn_loop_data[$lpid]['antonucci'].')</h3>';
// TABELA
@@ -603,6 +608,11 @@ class SurveySNDataFile {
$add_data = true;
}
break;
+ case 'status':
+ if ($this->_VARS[VAR_STATUS] && $this->canDisplayStatus) {
+ $add_data = true;
+ }
+ break;
case 'invitation':
if ($this->_VARS[VAR_EMAIL]) {
$add_data = true;