summaryrefslogtreecommitdiffstats
path: root/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.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/export/latexclasses/Analize/AnalizaMultiCrosstab.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/export/latexclasses/Analize/AnalizaMultiCrosstab.php')
-rw-r--r--admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php362
1 files changed, 78 insertions, 284 deletions
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php b/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php
index 02f6eb9..ce2126a 100644
--- a/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php
+++ b/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.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");
@@ -84,12 +84,8 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
global $global_user_id;
// preverimo ali imamo stevilko ankete
- //if ( is_numeric($anketa) ){
if ( is_numeric($anketa['id']) ){
- //$this->anketa['id'] = $anketa;
$this->anketa = $anketa;
- // create new PDF document
- //$this->pdf = new enka_TCPDF('L', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
}
else{
$this->pi['msg'] = "Anketa ni izbrana!";
@@ -142,14 +138,8 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$this->multiCrosstabClass->getSelectedVars();
// Izpisemo naslov tabele
- //echo "naslov tabele: ".$this->encodeText($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['title'])."</br>";
- $tabela .= '\textbf{'.$this->encodeText($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['title']).'}'.$this->texBigSkip.$this->texNewLine;
- //echo $tabela."</br>";
-/* $this->pdf->setFont('','B','10');
- $this->pdf->MultiCell(150, 5, $this->encodeText($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['title']), 0, 'L', 0, 1, 0 ,0, true);
- $this->pdf->ln(5);
- $this->pdf->setFont('','','6'); */
-
+ $tabela .= '\textbf{'.LatexDocument::encodeText($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['title']).'}'.$this->texBigSkip.$this->texNewLine;
+
// TABELA
@@ -198,17 +188,16 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
foreach($this->multiCrosstabClass->selectedVars['ver'] as $var){
$cntVerVars++;
}
- //echo "cntVerVars: ".$cntVerVars."</br>";
+ $tretjaVrsticaVert = array();
+ $cetrtaVrsticaVert = array();
if($this->multiCrosstabClass->colSpan == 0){
- //$this->cellWidth = $dataWidth/2;
- //$this->pdf->MultiCell($metaWidth, 0, '', 'B', 'L', 0, 1, 0 ,0, true);
+
$steviloPodstolpcev = 1;
$steviloPodstolpcevV1[] = $steviloPodstolpcev;
}
// Imamo 2 nivoja
elseif($this->multiCrosstabClass->colLevel2){
- //echo "vertikalno izbrane sprem. 1. vrstica, ko imamo 2 nivoja</br>";
$this->cellWidth = $dataWidth / $this->multiCrosstabClass->colSpan;
@@ -223,7 +212,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
foreach($this->multiCrosstabClass->variablesList[$parentVar['spr']]['options'] as $option){
foreach($parentVar['sub'] as $var){
foreach($this->multiCrosstabClass->variablesList[$var['spr']]['options'] as $suboption){
- //$this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->snippet($suboption, 25), 1, 'C', 0, 0, 0 ,0, true, $stretch=0, $ishtml=false, $autopadding=false, $maxh=0);
if($export_format != 'xls'){
$cetrtaVrsticaVertText = $this->snippet($suboption, 25);
$cetrtaVrsticaVertTmpText = $this->snippet($suboption, 25);
@@ -241,25 +229,19 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
}
else{
- //$this->pdf->MultiCell($this->cellWidth*count($this->multiCrosstabClass->variablesList[$parentVar['spr']]['options']), $lineHeight, '', 0, 'C', 0, 0, 0 ,0, true);
-
foreach($this->multiCrosstabClass->variablesList[$parentVar['spr']]['options'] as $option){
- //$this->pdf->MultiCell($this->cellWidth, $lineHeight*2, $this->snippet($option, 25), 1, 'C', 0, 0, 0 ,0, true);
-
- /* $cetrtaVrsticaVert[] = $this->snippet($option, 25);
- $cetrtaVrsticaVertTmp[] = $this->snippet($suboption, 25); */
if($export_format != 'xls'){
$cetrtaVrsticaVertText = $this->snippet($option, 25);
- $cetrtaVrsticaVertTmpText = $this->snippet($suboption, 25);
+ //$cetrtaVrsticaVertTmpText = $this->snippet($suboption, 25);
}else{
$cetrtaVrsticaVertText = $option;
- $cetrtaVrsticaVertTmpText = $suboption;
+ //$cetrtaVrsticaVertTmpText = $suboption;
}
$cetrtaVrsticaVert[] = $cetrtaVrsticaVertText;
- $cetrtaVrsticaVertTmp[] = $cetrtaVrsticaVertTmpText;
+ //$cetrtaVrsticaVertTmp[] = $cetrtaVrsticaVertTmpText;
$indeksMultiRow[] = 0;
}
- $steviloPodstolpcev = count($cetrtaVrsticaVertTmp);
+ //$steviloPodstolpcev = count($cetrtaVrsticaVertTmp);
$steviloPodstolpcevV3[] = count($this->multiCrosstabClass->variablesList[$parentVar['spr']]['options']);
}
if($steviloPodstolpcev!=0){
@@ -271,7 +253,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Izrisemo VERTIKALNO izbrane spremenljivkec - 1. vrstica
- //$this->pdf->MultiCell($metaWidth, $lineHeight, '', 0, 'L', 0, 0, 0 ,0, true);
if(count($this->multiCrosstabClass->selectedVars['ver'])){
$prvaVrsticaVert = array();
@@ -283,43 +264,36 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$rowspan = 1;
$width = $this->cellWidth * count($this->multiCrosstabClass->variablesList[$var['sub'][0]['spr']]['options']) * count($this->multiCrosstabClass->variablesList[$var['spr']]['options']);
if($export_format != 'xls'){
- $naslov = $this->encodeText($this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25));
+ $naslov = LatexDocument::encodeText($this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25));
}else{
- $naslov = $this->encodeText($this->multiCrosstabClass->variablesList[$var['spr']]['naslov']);
+ $naslov = LatexDocument::encodeText($this->multiCrosstabClass->variablesList[$var['spr']]['naslov']);
}
}
else{
$rowspan = 2;
$width = $this->cellWidth * count($this->multiCrosstabClass->variablesList[$var['spr']]['options']);
if($export_format != 'xls'){
- $naslov = '\multirow{2}{*}{ '.$this->encodeText($this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25)).' }';
+ $naslov = '\multirow{2}{*}{ '.LatexDocument::encodeText($this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25)).' }';
}else{
- $naslov = $this->encodeText($this->multiCrosstabClass->variablesList[$var['spr']]['naslov']);
+ $naslov = LatexDocument::encodeText($this->multiCrosstabClass->variablesList[$var['spr']]['naslov']);
}
}
- //$this->pdf->MultiCell($width, $lineHeight*$rowspan, $this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25), 1, 'C', 0, 0, 0 ,0, true);
-
- //$naslov = $this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25);
- //$naslov = $this->encodeText($this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25));
$prvaVrsticaVert[] = $naslov;
//echo "naslov: ".$naslov."</br>";
}
}
- //$this->pdf->MultiCell(1, $lineHeight, '', 0, 'L', 0, 1, 0 ,0, true);
+
// Izris vrstic za 2. nivo - 3. in 4. vrstica
- //$this->pdf->MultiCell($metaWidth, $lineHeight, '', 0, 'L', 0, 0, 0 ,0, true);
+
if(count($this->multiCrosstabClass->selectedVars['ver'])){
- $tretjaVrsticaVert = array();
foreach($this->multiCrosstabClass->selectedVars['ver'] as $parentVar){
// ce imamo childe na 2. nivoju
if(count($parentVar['sub']) > 0){
- //$tretjaVrsticaVert = array();
foreach($this->multiCrosstabClass->variablesList[$parentVar['spr']]['options'] as $option){
$width = $this->cellWidth * count($this->multiCrosstabClass->variablesList[$parentVar['sub'][0]['spr']]['options']);
foreach($parentVar['sub'] as $var){
- //$this->pdf->MultiCell($width, $lineHeight, $this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25), 1, 'C', 0, 0, 0 ,0, true);
if($export_format != 'xls'){
$tretjaVrsticaVert[] = $this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25);
}else{
@@ -331,9 +305,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
}
else{
- //$this->pdf->MultiCell($this->cellWidth*count($this->multiCrosstabClass->variablesList[$parentVar['spr']]['options']), $lineHeight, '', 0, 'C', 0, 0, 0 ,0, true);
- //$tretjaVrsticaVert[] = '';
$tretjaVrsticaVert[] = '\multirow{2}{*}{}';
@@ -343,7 +315,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
// Izrisemo VARIABLE za spremenljivko - 2. vrstica
- //$this->pdf->MultiCell($metaWidth, $lineHeight, '', 0, 'L', 0, 0, 0 ,0, true);
if(count($this->multiCrosstabClass->selectedVars['ver'])){
$drugaVrsticaVert = array();
@@ -378,16 +349,13 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
}
}
- //$this->pdf->MultiCell(1, $lineHeight, '', 0, 'L', 0, 1, 0 ,0, true);
}
// Imamo samo 1 nivo
else{
// Izrisemo VERTIKALNO izbrane spremenljivkec - 1. vrstica
- //echo "Samo 1 nivo </br>";
// Izracunamo sirine celic
$this->cellWidth = $dataWidth / $this->multiCrosstabClass->fullColSpan;
- //$this->pdf->MultiCell($metaWidth, $lineHeight, '', 0, 'C', 0, 0, 0 ,0, true);
if(count($this->multiCrosstabClass->selectedVars['ver'])){
$prvaVrsticaVert = array();
@@ -403,22 +371,12 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
}
- //$prvaVrsticaVert[] = $this->snippet($naslov, 35);
-
- //$sprWidth = count($this->multiCrosstabClass->variablesList[$var['spr']]['options']) * $this->cellWidth;
- //if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['sums'] == 1 && !$this->multiCrosstabClass->rowLevel2)
- //$sprWidth += $this->cellWidth;
- //$this->pdf->MultiCell($sprWidth, $lineHeight, $this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 35), 1, 'C', 0, 0, 0 ,0, true);
-
+ //$prvaVrsticaVert[] = $this->snippet($naslov, 35);
}
-
- //$this->pdf->MultiCell(1, $lineHeight, '', 0, 'C', 0, 1, 0 ,0, true);
- //$tabela .= $this->tableRow($prvaVrsticaVert);
- //echo $tabela;
+
}
// Nimamo nobene vertikalne spremenljivke in 2 horizontalni
elseif($this->multiCrosstabClass->rowLevel2){
- //$this->pdf->MultiCell($dataWidth, $lineHeight, '', 0, 'C', 0, 0, 0 ,0, true);
echo "Nimamo nobene vertikalne spremenljivke in 2 horizontalni </br>";
}
@@ -429,22 +387,12 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Iracunamo visino najvisje celice
$cellHeight = $lineHeight;
-/* foreach($this->multiCrosstabClass->selectedVars['ver'] as $var){
-
- foreach($this->multiCrosstabClass->variablesList[$var['spr']]['options'] as $option){
- $height = $this->getCellHeight($this->snippet($option, 25), $this->cellWidth);
- $cellHeight = ($height > $cellHeight) ? $height : $cellHeight;
- }
- } */
-
- //$this->pdf->MultiCell($metaWidth, $cellHeight, '', 'B', 'C', 0, 0, 0 ,0, true);
-
foreach($this->multiCrosstabClass->selectedVars['ver'] as $var){
$steviloPodstolpcev = 0;
// Loop cez variable spremenljivke
foreach($this->multiCrosstabClass->variablesList[$var['spr']]['options'] as $option){
- //$this->pdf->MultiCell($this->cellWidth, $cellHeight, $this->snippet($option, 25), 1, 'C', 0, 0, 0 ,0, true);
+
if($export_format != 'xls'){
$drugaVrsticaVert[] = $this->snippet($option, 25);
}else{
@@ -456,16 +404,10 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Suma (ce jo imamo vklopljeno)
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['sums'] == 1 && !$this->multiCrosstabClass->rowLevel2){
- //$this->pdf->MultiCell($this->cellWidth, $cellHeight, $lang['srv_analiza_crosstab_skupaj'], 1, 'C', 0, 0, 0 ,0, true);
$drugaVrsticaVert[] = $lang['srv_analiza_crosstab_skupaj'];
$steviloPodstolpcev++;
}
-
-/* if($colspan<4){
- $steviloPodstolpcevV2[] = $steviloPodstolpcev;
- }elseif($steviloPodstolpcev!=0&&$colspan==4){
- $steviloPodstolpcevV2[] = $steviloPodstolpcev;
- } */
+
if($steviloPodstolpcev!=0){
$steviloPodstolpcevV1[] = $steviloPodstolpcev;
}
@@ -473,7 +415,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
//$steviloPodstolpcevV2[] = $steviloPodstolpcev;
}
//$tabela .= $this->tableRow($drugaVrsticaVert);
- //$this->pdf->MultiCell(1, $cellHeight, '', 0, 'C', 0, 1, 0 ,0, true);
}
}
@@ -501,7 +442,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
/*Priprava parametrov za tabelo in ostala polja za nadaljnji izpis - konec*/
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -512,8 +453,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$tabela .= "\\cline{".($colspan+1)."-".$steviloStolpcevParameterTabular."}"; //prekinjena horizontalna vrstica na vrhu tabele
}
- $tabela .= $this->MultiColCellLatex($colspan, '', 1); //prazne celice v prvi vrstici
- //$tabela .= $this->tableRow($prvaVrsticaVert, 1, 0, 0, $steviloPodstolpcevV1); //izpis prve vrstice tabele
+ $tabela .= $this->MultiColCellLatex($colspan, '', 1, $export_format); //prazne celice v prvi vrstici
$tabela .= $this->tableRow($prvaVrsticaVert, 1, 0, 0, '', $export_format, $steviloPodstolpcevV1); //izpis prve vrstice tabele
//prekinjena horizontalna vrstica po prvi vrstici
@@ -523,9 +463,8 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
//prekinjena horizontalna vrstica po prvi vrstici - konec
if(count($drugaVrsticaVert)){
- $tabela .= $this->MultiColCellLatex($colspan, '', 1); //prazne celice v drugi vrstici
+ $tabela .= $this->MultiColCellLatex($colspan, '', 1, $export_format); //prazne celice v drugi vrstici
if(count($steviloPodstolpcevV2)){
- //$tabela .= $this->tableRow($drugaVrsticaVert, 1, 0, 0, $steviloPodstolpcevV2);
$tabela .= $this->tableRow($drugaVrsticaVert, 1, 0, 0, '', $export_format, $steviloPodstolpcevV2);
}else{
$tabela .= $this->tableRow($drugaVrsticaVert, 1);
@@ -538,10 +477,9 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
//prekinjena horizontalna vrstica po drugi vrstici - konec
}
- if(count($tretjaVrsticaVert)){
- $tabela .= $this->MultiColCellLatex($colspan, '', 1); //prazne celice v drugi vrstici
+ if(is_countable($tretjaVrsticaVert) && count($tretjaVrsticaVert)){
+ $tabela .= $this->MultiColCellLatex($colspan, '', 1, $export_format); //prazne celice v drugi vrstici
if(count($steviloPodstolpcevV3)){
- //$tabela .= $this->tableRow($tretjaVrsticaVert, 1, 0, 0, $steviloPodstolpcevV3);
$tabela .= $this->tableRow($tretjaVrsticaVert, 1, 0, 0, '', $export_format, $steviloPodstolpcevV3);
}else{
$tabela .= $this->tableRow($tretjaVrsticaVert, 1);
@@ -552,7 +490,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
if(count($cetrtaVrsticaVert)){
- $tabela .= $this->MultiColCellLatex($colspan, '', 1); //prazne celice v drugi vrstici
+ $tabela .= $this->MultiColCellLatex($colspan, '', 1, $export_format); //prazne celice v drugi vrstici
$tabela .= $this->tableRow($cetrtaVrsticaVert, 1);
}
@@ -572,7 +510,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$order0 = 0;
foreach($this->multiCrosstabClass->variablesList[$parentVar['spr']]['options'] as $option){
- //echo "option hor 2. nivoja: ".$option."</br>";
$cnt2 = 0;
// ce imamo childe na 2. nivoju
@@ -605,17 +542,14 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
if($cnt == 0){
if($export_format != 'xls'){
- $tabela .= $this->encodeText($this->snippet($this->multiCrosstabClass->variablesList[$parentVar['spr']]['naslov'], 25))." & ";
+ $tabela .= LatexDocument::encodeText($this->snippet($this->multiCrosstabClass->variablesList[$parentVar['spr']]['naslov'], 25))." & ";
}else{
- $tabela .= $this->encodeText($this->multiCrosstabClass->variablesList[$parentVar['spr']]['naslov'])." & ";
+ $tabela .= LatexDocument::encodeText($this->multiCrosstabClass->variablesList[$parentVar['spr']]['naslov'])." & ";
}
- //$this->pdf->MultiCell($width, $this->cellHeight, $this->snippet($this->multiCrosstabClass->variablesList[$parentVar['spr']]['naslov'], 25), 'LR', 'C', 0, 0, 0 ,0, true);
- //echo "naslov : ".$this->snippet($this->multiCrosstabClass->variablesList[$parentVar['spr']]['naslov'], 25)."</br>";
+
}
else{
$tabela .= " & ";
- //$this->pdf->MultiCell($width, $this->cellHeight, '', 'LR'.$border1, 'C', 0, 0, 0 ,0, true);
- //echo "naslov : </br>";
}
@@ -623,54 +557,42 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
//if($cnt2 == floor(count($this->multiCrosstabClass->variablesList[$var['spr']]['options'])/2)){
if($cnt2 == 0){
if($export_format != 'xls'){
- $tabela .= $this->encodeText($this->snippet($option, 25))." & ";
+ $tabela .= LatexDocument::encodeText($this->snippet($option, 25))." & ";
}else{
- $tabela .= $this->encodeText($option)." & ";
+ $tabela .= LatexDocument::encodeText($option)." & ";
}
- //echo "variabla : ".$this->snippet($option, 25)."</br>";
- //$this->pdf->MultiCell($width, $this->cellHeight, $this->snippet($option, 25), 'LR', 'C', 0, 0, 0 ,0, true);
}
else{
$tabela .= " & ";
- //echo "variabla : </br>";
- //$this->pdf->MultiCell($width, $this->cellHeight, '', 'LR'.$border2, 'C', 0, 0, 0 ,0, true);
}
//if($cnt3 == floor(count($this->multiCrosstabClass->variablesList[$var['spr']]['options'])/2)){
if($cnt3 == 0){
if($export_format != 'xls'){
- $tabela .= $this->encodeText($this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25))." & ";
+ $tabela .= LatexDocument::encodeText($this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25))." & ";
}else{
- $tabela .= $this->encodeText($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'])." & ";
+ $tabela .= LatexDocument::encodeText($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'])." & ";
}
- //echo "variabla cnt3: ".$this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25)."</br>";
- //$this->pdf->MultiCell($width, $this->cellHeight, $this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25), 'LR', 'C', 0, 0, 0 ,0, true);
}
else{
- $tabela .= " & ";
- //echo "variabla cnt3: </br>";
- //$this->pdf->MultiCell($width, $this->cellHeight, '', 'LR'.$border2, 'C', 0, 0, 0 ,0, true);
+ $tabela .= " & ";
}
// Variabla 2
if($export_format != 'xls'){
- $tabela .= $this->encodeText($this->snippet($suboption, 25))." & ";
+ $tabela .= LatexDocument::encodeText($this->snippet($suboption, 25))." & ";
}else{
- $tabela .= $this->encodeText($suboption)." & ";
+ $tabela .= LatexDocument::encodeText($suboption)." & ";
}
- //$this->pdf->MultiCell($width, $this->cellHeight, $this->snippet($suboption, 25), 1, 'C', 0, 0, 0 ,0, true);
- //echo "option variabla 2: ".$this->snippet($suboption, 25)."</br>";
// Celice s podatki
$vrsticaPodatki = $this->displayDataCells($parentVar, $order0, $var, $cnt3);
- //print_r($vrsticaPodatki);
+
################# izpis celic s podatki
$tabela .= $this->displayDataCellLatex($vrsticaPodatki, $this->tableSettingsNumerus, $this->tableSettingsAvgVar, $this->tableSettingsDelezVar, $colspan, $steviloStolpcevParameterTabular, $export_format);
################# izpis celic s podatki - konec
// Celice s podatki - konec
- //$this->pdf->MultiCell(1, $this->cellHeight, '', 0, 'C', 0, 1, 0 ,0, true);
-
$cnt++;
$cnt2++;
$cnt3++;
@@ -753,11 +675,9 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}else{
$naslovVarHor = '';
}
- //echo "naslovVarHor: ".$naslovVarHor."</br>";
$tabela .= $naslovVarHor." & ";
// Variabla
- //$this->pdf->MultiCell($width, $this->cellHeight, $this->snippet($option, 25), '1', 'C', 0, 0, 0 ,0, true);
//echo "variabla: ".$this->snippet($option, 25)."</br>";
if($export_format != 'xls'){
$tabela .= $this->snippet($option, 25)." & ";
@@ -766,8 +686,8 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
// Celice s podatki
- //echo "celica s podatki: ".$var."</br>";
// Ce nimamo nobenega krizanja izpisemo prazne
+ $spr2=isset($spr2)?$spr2:'';
if($spr2 == '' && $this->multiCrosstabClass->colSpan == 0){
//$tabela .= " & ";
$tabela .= $this->texNewLine;
@@ -778,7 +698,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$tabela .= $this->displayDataCellLatex($vrsticaPodatki, $this->tableSettingsNumerus, $this->tableSettingsAvgVar, $this->tableSettingsDelezVar, $colspan, $steviloStolpcevParameterTabular, $export_format);
################# izpis celic s podatki - konec
}
- //$this->pdf->MultiCell(1, $this->cellHeight, '', 0, 'C', 0, 1, 0 ,0, true);
if($export_format != 'xls'){
$tabela .= "\\cline{".($colspan)."-".$steviloStolpcevParameterTabular."}"; //prekinjena horizontalna vrstica
@@ -788,11 +707,8 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
// Vrstica za sumo (ce jo imamo vklopljeno)
if($suma){
-
- //$this->pdf->MultiCell($width, $this->cellHeight, '', 'BLR', 'C', 0, 0, 0 ,0, true);
- //$this->pdf->MultiCell($width, $this->cellHeight, $lang['srv_analiza_crosstab_skupaj'], '1', 'C', 0, 0, 0 ,0, true);
- $tabela .= " & ".$this->encodeText($lang['srv_analiza_crosstab_skupaj'])." & ";
- //$tabela .= $this->encodeText($lang['srv_analiza_crosstab_skupaj'])." & ";
+
+ $tabela .= " & ".LatexDocument::encodeText($lang['srv_analiza_crosstab_skupaj'])." & ";
$vrsticaPodatkiSumNum = array();
$vrsticaPodatkiSumPer = array();
@@ -876,7 +792,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
if($this->tableSettingsDelezVar!= ''){
$color = 'red';
- //$tabela .= $this->tableRow($vrsticaPodatkiSumDelez,1);
$tabela .= $this->tableRow($vrsticaPodatkiSumDelez,1,0,0,$color, $export_format);
}
}
@@ -898,7 +813,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
//zaljucek latex tabele z obrobo za drugo tabelo
- $tabela .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tabela .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za drugo tabelo - konec
//echo "tabela: ".$tabela;
return $tabela;
@@ -1434,27 +1349,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
function displaySumsCell($spr1=null, $spr2=null, $val=null, $orientation=null){
$celicaSums = array();
- //echo "Orientacija skupaj: ".$orientation."</br>";
-/* $startX = $this->pdf->getX();
- $startY = $this->pdf->getY(); */
-
- // Nastavimo visino posamezne vrstice
-/* $cellSpan = 0;
- if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1)
- $cellSpan++;
- if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1)
- $cellSpan++;
- if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['avgVar'] != '')
- $cellSpan++;
- if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['delezVar'] != '')
- $cellSpan++;
- $cellSpan = ($cellSpan > 0) ? $cellSpan : 1;
- $lineHeight = $this->cellHeight / $cellSpan; */
-
- // Nastavimo barvo texta
-/* $this->pdf->SetTextColor(160, 0, 0);
- $this->pdf->setFont('','B','6'); */
-
$crosstabs = $this->multiCrosstabClass->crosstabData[$spr1['spr'].'-'.$spr2['spr']];
// Celica s skupno sumo
@@ -1463,16 +1357,11 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Numerus
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1){
$celicaSums['numerus'] = $crosstabs['sumaSkupna'];
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $crosstabs['sumaSkupna'], 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
}
// Procenti
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1){
- //$celicaSums['percent'] = $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['percent'] = $this->encodeText($this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+ $celicaSums['percent'] = LatexDocument::encodeText($this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
}
// Povprecje
@@ -1490,13 +1379,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$avg = $tempAvg / $crosstabs['sumaSkupna'];
}
$celicaSums['avg'] = $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'));
-/* $this->pdf->SetFillColor(220, 220, 255);
- $this->pdf->SetTextColor(0, 0, 230);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE')), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
}
// Delez
@@ -1511,15 +1393,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
}
}
- //$celicaSums['delez'] = $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['delez'] = $this->encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-/* $this->pdf->SetFillColor(255, 220, 220);
- $this->pdf->SetTextColor(230, 0, 0);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+ $celicaSums['delez'] = LatexDocument::encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
}
}
// Suma na koncu vrstice
@@ -1530,16 +1404,13 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Numerus
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1){
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $crosstabs['sumaVrstica'][$val], 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
$celicaSums['numerus'] = $crosstabs['sumaVrstica'][$val];
}
// Procenti
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1){
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
- //$celicaSums['percent'] = $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['percent'] = $this->encodeText($this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+
+ $celicaSums['percent'] = LatexDocument::encodeText($this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
}
}
else{
@@ -1547,15 +1418,11 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Numerus
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1){
$celicaSums['numerus'] = '0';
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, '0', 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
}
// Procenti
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1){
- //$celicaSums['percent'] = $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['percent'] = $this->encodeText($this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
+ $celicaSums['percent'] = LatexDocument::encodeText($this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
}
}
@@ -1574,13 +1441,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$celicaSums['avg'] = $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'));
-/* $this->pdf->SetFillColor(220, 220, 255);
- $this->pdf->SetTextColor(0, 0, 230);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE')), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
}
// Delez
@@ -1593,17 +1453,9 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$delez += $tempDelez;
}
}
+
+ $celicaSums['delez'] = LatexDocument::encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- //$celicaSums['delez'] = $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['delez'] = $this->encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-
-/* $this->pdf->SetFillColor(255, 220, 220);
- $this->pdf->SetTextColor(230, 0, 0);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
}
}
// Suma za stolpce
@@ -1614,15 +1466,13 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Numerus
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1){
$celicaSums['numerus'] = $crosstabs['sumaStolpec'][$val];
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $crosstabs['sumaStolpec'][$val], 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
}
// Procenti
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1){
- //$celicaSums['percent'] = $this->formatNumber($this->multiCrosstabClass->getCrossTabPercentage($crosstabs['sumaSkupna'], $crosstabs['sumaStolpec'][$val]), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['percent'] = $this->encodeText($this->formatNumber($this->multiCrosstabClass->getCrossTabPercentage($crosstabs['sumaSkupna'], $crosstabs['sumaStolpec'][$val]), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($this->multiCrosstabClass->getCrossTabPercentage($crosstabs['sumaSkupna'], $crosstabs['sumaStolpec'][$val]), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
+ $celicaSums['percent'] = LatexDocument::encodeText($this->formatNumber($this->multiCrosstabClass->getCrossTabPercentage($crosstabs['sumaSkupna'], $crosstabs['sumaStolpec'][$val]), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+
}
}
else{
@@ -1630,16 +1480,13 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Numerus
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1){
$celicaSums['numerus'] = '0';
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, '0', 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
}
// Procenti
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1){
- //$celicaSums['percent'] = $this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['percent'] = $this->encodeText($this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
+ $celicaSums['percent'] = LatexDocument::encodeText($this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+
}
}
@@ -1658,13 +1505,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
$celicaSums['avg'] = $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'));
-/* $this->pdf->SetFillColor(220, 220, 255);
- $this->pdf->SetTextColor(0, 0, 230);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE')), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
}
// Delez
@@ -1677,33 +1517,21 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$delez += $tempDelez[$val];
}
}
- //$celicaSums['delez'] = $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['delez'] = $this->encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-/* $this->pdf->SetFillColor(255, 220, 220);
- $this->pdf->SetTextColor(230, 0, 0);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
+ $celicaSums['delez'] = LatexDocument::encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+
}
}
-
-/* $this->pdf->SetTextColor(0, 0, 0);
- $this->pdf->setFont('','','6');
- $this->pdf->setXY($startX + $this->cellWidth, $startY); */
+
return $celicaSums;
}
// Izpis celice z vrednostmi
- //function displayDataCell($crosstab, $percent, $avg, $delez){
function displayDataCell($crosstab=null, $percent=null, $avg=null, $delez=null, $cnt=null){
- //$podatekCelice = '';
$podatekCelice = array();
- //$startX = $this->pdf->getX();
- //$startY = $this->pdf->getY();
+
$lineHeight = ($this->cellSpan > 1) ? 5 : 6;
@@ -1711,68 +1539,41 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Numerus
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1){
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $crosstab, 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
- //$podatekCelice = $crosstab;
$podatekCelice['numerus'][$cnt] = $crosstab;
- //echo "Crosstab ce crosstab > 0: ".$crosstab."</br>";
}
// Procenti
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1){
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
- //$podatekCelice = $this->formatNumber($percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- //$podatekCelice['percent'][$cnt] = $this->formatNumber($percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $podatekCelice['percent'][$cnt] = $this->encodeText($this->formatNumber($percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- //echo "Procenti ce crosstab > 0: ".$podatekCelice."</br>";
+
+ $podatekCelice['percent'][$cnt] = LatexDocument::encodeText($this->formatNumber($percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
}
}
else{
// Numerus
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1){
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, '0', 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
$podatekCelice['numerus'][$cnt] = '0';
}
// Procenti
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1){
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
- //$podatekCelice = $this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- //$podatekCelice['percent'][$cnt] = $this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $podatekCelice['percent'][$cnt] = $this->encodeText($this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+
+ $podatekCelice['percent'][$cnt] = LatexDocument::encodeText($this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
}
}
// Povprecje
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['avgVar'] > 0){
- //$podatekCelice = $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'));
- //echo "Povprecje: ".$podatekCelice."</br>";
+
$podatekCelice['avg'][$cnt] = $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'));
-/* $this->pdf->SetFillColor(220, 220, 255);
- $this->pdf->SetTextColor(0, 0, 230);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE')), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
}
// Delez
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['delezVar'] > 0){
- //$podatekCelice = $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- //echo "Delez: ".$podatekCelice."</br>";
- $podatekCelice['delez'][$cnt] = $this->encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-/* $this->pdf->SetFillColor(255, 220, 220);
- $this->pdf->SetTextColor(230, 0, 0);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
+ $podatekCelice['delez'][$cnt] = LatexDocument::encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+
}
- //$this->pdf->setXY($startX + $this->cellWidth, $startY);
return $podatekCelice;
}
@@ -1858,13 +1659,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
return $result;
}
-/* function encodeText($text){
- // popravimo sumnike ce je potrebno
- $text = html_entity_decode($text, ENT_NOQUOTES, 'UTF-8');
- $text = str_replace(array("&scaron;","&#353;","&#269;"),array("š","š","č"),$text);
-
- return strip_tags($text);
- } */
/*Skrajsa tekst in doda '...' na koncu*/
function snippet($text='', $length=64, $tail="..."){