diff options
Diffstat (limited to 'admin/survey/export/latexclasses/Analize/AnalizaMean.php')
-rw-r--r-- | admin/survey/export/latexclasses/Analize/AnalizaMean.php | 76 |
1 files changed, 25 insertions, 51 deletions
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaMean.php b/admin/survey/export/latexclasses/Analize/AnalizaMean.php index e2bceba..138afcc 100644 --- a/admin/survey/export/latexclasses/Analize/AnalizaMean.php +++ b/admin/survey/export/latexclasses/Analize/AnalizaMean.php @@ -7,14 +7,14 @@ /* include_once('../exportclases/class.pdfIzvozAnalizaFunctions.php');
require_once('../exportclases/class.enka.pdf.php'); */
- define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
- define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
+ if (!defined('ALLOW_HIDE_ZERRO_REGULAR')) define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
+ if (!defined('ALLOW_HIDE_ZERRO_MISSING')) define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
- define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
- define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
+ if (!defined('NUM_DIGIT_AVERAGE')) define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
+ if (!defined('NUM_DIGIT_DEVIATION')) define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
- define("M_ANALIZA_DESCRIPTOR", "descriptor");
- define("M_ANALIZA_FREQUENCY", "frequency");
+ if (!defined('M_ANALIZA_DESCRIPTOR')) define("M_ANALIZA_DESCRIPTOR", "descriptor");
+ if (!defined('M_ANALIZA_FREQUENCY')) define("M_ANALIZA_FREQUENCY", "frequency");
define("FNT_FREESERIF", "freeserif");
define("FNT_FREESANS", "freesans");
@@ -125,11 +125,6 @@ class AnalizaMean extends LatexAnalysisElement{ $singleWidth = round( 180 / $cols / 2 );
// visina prve vrstice
-/* $firstHeight = 0;
- for ($i = 0; $i < $cols; $i++) {
- $label1 = $this->meansClass->getSpremenljivkaTitle($_means[$i]['v1']);
- $firstHeight = ($firstHeight > $this->getCellHeight($this->encodeText($label1), $singleWidth*2)) ? $firstHeight : $this->getCellHeight($this->encodeText($label1), $singleWidth*2);
- } */
//Priprava parametrov za tabelo
$steviloStolpcevParameterTabular = 3;
@@ -152,7 +147,7 @@ class AnalizaMean extends LatexAnalysisElement{ //Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -167,11 +162,10 @@ class AnalizaMean extends LatexAnalysisElement{ //prva vrstica tabele
$label2 = $this->meansClass->getSpremenljivkaTitle($_means[0]['v2']);
- //$this->pdf->MultiCell(80, $firstHeight, $this->encodeText($label2), 'TLR', 'C', 0, 0, 0 ,0, true);
$prva = '';
for ($i = 0; $i < $cols; $i++) {
$label1 = $this->meansClass->getSpremenljivkaTitle($_means[$i]['v1']);
- //$this->pdf->MultiCell($singleWidth*2, $firstHeight, $this->encodeText($label1), 1, 'C', 0, 0, 0 ,0, true);
+ //$this->pdf->MultiCell($singleWidth*2, $firstHeight, LatexDocument::encodeText($label1), 1, 'C', 0, 0, 0 ,0, true);
$prva .= $label1.' ';
}
@@ -188,28 +182,18 @@ class AnalizaMean extends LatexAnalysisElement{ $steviloArrayrulewidth = ($steviloPodStolpcev1-1);
if($export_format=='pdf'){
- $tabela .= $this->encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{>{\hsize=\dimexpr".$steviloPodStolpcev1."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}".$poravnava."|}{".$this->encodeText($prva)."} ".$this->texNewLine;
+ $tabela .= LatexDocument::encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{>{\hsize=\dimexpr".$steviloPodStolpcev1."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}".$poravnava."|}{".LatexDocument::encodeText($prva)."} ".$this->texNewLine;
}elseif($export_format=='rtf'){
- $tabela .= $this->encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{".$poravnava."|}{".$this->encodeText($prva)."} ".$this->texNewLine;
+ $tabela .= LatexDocument::encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{".$poravnava."|}{".LatexDocument::encodeText($prva)."} ".$this->texNewLine;
}
############
-
- //$tabela .= $this->encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{>{\hsize=\dimexpr".$steviloPodStolpcev1."\hsize+".$steviloPodStolpcev1."\\tabcolsep+\arrayrulewidth\\relax}".$poravnava."|}{".$this->encodeText($prva)."} ".$this->texNewLine;
- //$tabela .= $this->encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($prva)."} ".$this->texNewLine;
- //$tabela .= $this->encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{".$poravnava."|}{".$this->encodeText($prva)."} ".$this->texNewLine;
- //$tabela .= $this->encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{C|}{".$this->encodeText($prva)."} ".$this->texNewLine;
- //$tabela .= $this->encodeText($label2).' & \multicolumn{'.$steviloPodStolpcev1.'}{>{\hsize=\dimexpr '.($steviloPodStolpcev1).'\hsize + '.($steviloPodStolpcev1).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($prva).'} '.$this->texNewLine;
-
+
//prva vrstica tabele - konec
//druga vrstica tabele
- //$this->pdf->MultiCell(80, 7, $this->encodeText(''), 'BLR', 'C', 0, 0, 0 ,0, true);
- //echo "stolpci: ".$cols."</br>";
- //echo "vrstice: ".$rows."</br>";
$druga = array();
$steviloPodStolpcev = $steviloPodStolpcev1 + 1;
- //$tabela .= "\\cline{2-".$steviloPodStolpcev."} & "; //horizontalna vrstica od 2 do zadnje celice
if($export_format != 'xls'){
$tabela .= "\\cline{2-".$steviloPodStolpcev."} "; //horizontalna vrstica od 2 do zadnje celice
}
@@ -219,12 +203,9 @@ class AnalizaMean extends LatexAnalysisElement{ $brezHline = $this->getBrezHline($export_format);
for ($i = 0; $i < $cols; $i++) {
- $druga[] = $this->encodeText($lang['srv_means_label']);
- $druga[] = $this->encodeText($lang['srv_means_label4']);
- //$this->pdf->MultiCell($singleWidth, 7, $this->encodeText($lang['srv_means_label']), 1, 'C', 0, 0, 0 ,0, true);
- //$this->pdf->MultiCell($singleWidth, 7, $this->encodeText($lang['srv_means_label4']), 1, 'C', 0, 0, 0 ,0, true);
+ $druga[] = LatexDocument::encodeText($lang['srv_means_label']);
+ $druga[] = LatexDocument::encodeText($lang['srv_means_label4']);
}
- //$this->pdf->MultiCell(1, 7, $this->encodeText(''), 0, 'C', 0, 1, 0 ,0, true);
$tabela .= $this->tableRow($druga, $brezHline)." ";
//druga vrstica tabele - konec
@@ -236,24 +217,19 @@ class AnalizaMean extends LatexAnalysisElement{ $variabla = $crossVariabla2['naslov'];
# če ni tekstovni odgovor dodamo key
if ($crossVariabla2['type'] !== 't' ) {
- if ($crossVariabla2['vr_id'] == null) {
+ if ((isset($crossVariabla2['vr_id'])?$crossVariabla2['vr_id']:null) == null) {
$variabla .= ' ( '.$ckey2.' )';
} else {
$variabla .= ' ( '.$crossVariabla2['vr_id'].' )';
}
}
- //$this->pdf->MultiCell(80, 7, $this->encodeText($variabla), 1, 'C', 0, 0, 0 ,0, true);
- $dataVrstica[] = $this->encodeText($variabla);
+ $dataVrstica[] = LatexDocument::encodeText($variabla);
# celice z vsebino
- for ($i = 0; $i < $cols; $i++) {
- //$dataVrstica[] = $this->encodeText($this->meansClass->formatNumber($_means[$i]['result'][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL')));
- $dataVrstica[] = $this->encodeText(self::formatNumber($_means[$i]['result'][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL')));
- $dataVrstica[] = $this->encodeText((int)$_means[$i]['sumaVrstica'][$ckey2]);
- //$this->pdf->MultiCell($singleWidth, 7, $this->encodeText($this->meansClass->formatNumber($_means[$i]['result'][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'))), 1, 'C', 0, 0, 0 ,0, true);
- //$this->pdf->MultiCell($singleWidth, 7, $this->encodeText((int)$_means[$i]['sumaVrstica'][$ckey2]), 1, 'C', 0, 0, 0 ,0, true);
+ for ($i = 0; $i < $cols; $i++) {
+ $dataVrstica[] = LatexDocument::encodeText(self::formatNumber(isset($_means[$i]['result'][$ckey2])?$_means[$i]['result'][$ckey2]:0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL')));
+ $dataVrstica[] = LatexDocument::encodeText((int)isset($_means[$i]['sumaVrstica'][$ckey2])?$_means[$i]['sumaVrstica'][$ckey2]:0);
}
- //$this->pdf->MultiCell(1, 7, $this->encodeText(''), 0, 'C', 0, 1, 0 ,0, true);
$tabela .= $this->tableRow($dataVrstica, $brezHline)." ";
}
}
@@ -261,21 +237,19 @@ class AnalizaMean extends LatexAnalysisElement{ //SKUPAJ
$skupajVrstica = array();
- //$this->pdf->MultiCell(80, 7, $this->encodeText($lang['srv_means_label3']), 1, 'C', 0, 0, 0 ,0, true);
- $skupajVrstica[] = $this->encodeText($lang['srv_means_label3']);
+ $skupajVrstica[] = LatexDocument::encodeText($lang['srv_means_label3']);
for ($i = 0; $i < $cols; $i++) {
- //$skupajVrstica[] = $this->encodeText($this->meansClass->formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL')));
- $skupajVrstica[] = $this->encodeText(self::formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL')));
- //$this->pdf->MultiCell($singleWidth, 7, $this->encodeText($this->meansClass->formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'))), 1, 'C', 0, 0, 0 ,0, true);
- $skupajVrstica[] = $this->encodeText((int)$_means[$i]['sumaSkupna']);
- //$this->pdf->MultiCell($singleWidth, 7, $this->encodeText((int)$_means[$i]['sumaSkupna']), 1, 'C', 0, 0, 0 ,0, true);
+ //$skupajVrstica[] = LatexDocument::encodeText($this->meansClass->formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL')));
+ $skupajVrstica[] = LatexDocument::encodeText(self::formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL')));
+ //$this->pdf->MultiCell($singleWidth, 7, LatexDocument::encodeText($this->meansClass->formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'))), 1, 'C', 0, 0, 0 ,0, true);
+ $skupajVrstica[] = LatexDocument::encodeText((int)$_means[$i]['sumaSkupna']);
+ //$this->pdf->MultiCell($singleWidth, 7, LatexDocument::encodeText((int)$_means[$i]['sumaSkupna']), 1, 'C', 0, 0, 0 ,0, true);
}
- //$this->pdf->MultiCell(1, 7, $this->encodeText(''), 0, 'C', 0, 1, 0 ,0, true);
$tabela .= $this->tableRow($skupajVrstica, $brezHline)." ";
//SKUPAJ - konec
//zaljucek latex tabele z obrobo za prvo tabelo
- $tabela .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tabela .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za prvo tabelo - konec
return $tabela;
}
|