summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.SurveyVariableView.php
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/class.SurveyVariableView.php
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 'admin/survey/classes/class.SurveyVariableView.php')
-rw-r--r--admin/survey/classes/class.SurveyVariableView.php28
1 files changed, 11 insertions, 17 deletions
diff --git a/admin/survey/classes/class.SurveyVariableView.php b/admin/survey/classes/class.SurveyVariableView.php
index 4dc1557..c2d04b7 100644
--- a/admin/survey/classes/class.SurveyVariableView.php
+++ b/admin/survey/classes/class.SurveyVariableView.php
@@ -33,6 +33,8 @@ class VariableView {
#inicializiramo class za datoteke
self::$SDF = SurveyDataFile::get_instance();
self::$SDF->init($sid);
+
+ self::$SDF->prepareFiles();
self::$headFileName = self::$SDF->getHeaderFileName();
self::$dataFileName = self::$SDF->getDataFileName();
@@ -44,23 +46,18 @@ class VariableView {
public static function displayVariables() {
global $lang;
- echo '<table class="variableView">';
+ echo '<table class="variableView">';
- echo '<thead><tr>';
- echo '<th>'.$lang['srv_variableView_h_'].'</th>';
+ echo '<tr>';
+ echo '<th>'.$lang['srv_variableView_h_name'].'</th>';
echo '<th>'.$lang['srv_variableView_h_type'].'</th>';
- echo '<th>'.$lang['srv_variableView_h_width'].'</th>';
- echo '<th>'.$lang['srv_variableView_h_decimals'].'</th>';
- echo '<th>'.$lang['srv_variableView_h_label'].'</th>';
echo '<th>'.$lang['srv_variableView_h_measure'].'</th>';
- echo '</tr></thead>';
-
- echo '<tbody>';
+ echo '<th>'.$lang['srv_variableView_h_label'].'</th>';
+ echo '</tr>';
foreach (self::$_HEADERS AS $skey => $spremenljivka) {
-
- if (is_numeric($spremenljivka['tip']) && $spremenljivka['tip'] != '' && $spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') {
-
+ if (isset($spremenljivka['tip']) && is_numeric($spremenljivka['tip']) && $spremenljivka['tip'] != '' && $spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') {
+
$spss = $spremenljivka['grids'][0]['variables'][0]['spss'];
$spss_type = substr($spss,0,1);
$spss_length = explode('.',substr($spss,1));
@@ -70,16 +67,13 @@ class VariableView {
echo '<tr>';
echo '<td>'.$spremenljivka['variable'].'</td>';
- echo '<td>'.$legenda['izrazanje'].'</td>';
- echo '<td>'.(int)$spss_length['0'].'</td>';
- echo '<td>'.(int)$spss_length['1'].'</td>';
- echo '<td>'.$spremenljivka['naslov'].'</td>';
+ echo '<td class="nowrap">'.$legenda['izrazanje'].'</td>';
echo '<td>'.$legenda['skala'].'</td>';
+ echo '<td>'.((strlen($spremenljivka['naslov']) > 100) ? substr($spremenljivka['naslov'], 0, 97).'...' : $spremenljivka['naslov']).'</td>';
echo '</tr>';
}
}
- echo '</tbody>';
echo '</table>';
}
} \ No newline at end of file