summaryrefslogtreecommitdiffstats
path: root/admin/survey/export/latexclasses/Analize/AnalizaTTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/export/latexclasses/Analize/AnalizaTTest.php')
-rw-r--r--admin/survey/export/latexclasses/Analize/AnalizaTTest.php141
1 files changed, 44 insertions, 97 deletions
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaTTest.php b/admin/survey/export/latexclasses/Analize/AnalizaTTest.php
index a0f832b..8e1bb58 100644
--- a/admin/survey/export/latexclasses/Analize/AnalizaTTest.php
+++ b/admin/survey/export/latexclasses/Analize/AnalizaTTest.php
@@ -2,41 +2,41 @@
global $site_path;
- include_once('../../function.php');
- include_once('../survey/definition.php');
+/* include_once('../../function.php');
+ include_once('../survey/definition.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
-
- define("M_ANALIZA_DESCRIPTOR", "descriptor");
- define("M_ANALIZA_FREQUENCY", "frequency");
-
- define("FNT_FREESERIF", "freeserif");
- define("FNT_FREESANS", "freesans");
- define("FNT_HELVETICA", "helvetica");
-
- define("FNT_MAIN_TEXT", FNT_FREESANS);
- define("FNT_QUESTION_TEXT", FNT_FREESANS);
- define("FNT_HEADER_TEXT", FNT_FREESANS);
-
- define("FNT_MAIN_SIZE", 10);
- define("FNT_QUESTION_SIZE", 9);
- define("FNT_HEADER_SIZE", 10);
-
- define("RADIO_BTN_SIZE", 3);
- define("CHCK_BTN_SIZE", 3);
- define("LINE_BREAK", 6);
-
- define ('PDF_MARGIN_HEADER', 8);
- define ('PDF_MARGIN_FOOTER', 12);
- define ('PDF_MARGIN_TOP', 18);
- define ('PDF_MARGIN_BOTTOM', 18);
- define ('PDF_MARGIN_LEFT', 15);
- define ('PDF_MARGIN_RIGHT', 15);
+ 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
+
+ if(!defined("M_ANALIZA_DESCRIPTOR"))define("M_ANALIZA_DESCRIPTOR", "descriptor");
+ if(!defined("M_ANALIZA_FREQUENCY"))define("M_ANALIZA_FREQUENCY", "frequency");
+
+ if(!defined("FNT_FREESERIF"))define("FNT_FREESERIF", "freeserif");
+ if(!defined("FNT_FREESANS"))define("FNT_FREESANS", "freesans");
+ if(!defined("FNT_HELVETICA"))define("FNT_HELVETICA", "helvetica");
+
+ if(!defined("FNT_MAIN_TEXT"))define("FNT_MAIN_TEXT", FNT_FREESANS);
+ if(!defined("FNT_QUESTION_TEXT"))define("FNT_QUESTION_TEXT", FNT_FREESANS);
+ if(!defined("FNT_HEADER_TEXT"))define("FNT_HEADER_TEXT", FNT_FREESANS);
+
+ if(!defined("FNT_MAIN_SIZE"))define("FNT_MAIN_SIZE", 10);
+ if(!defined("FNT_QUESTION_SIZE"))define("FNT_QUESTION_SIZE", 9);
+ if(!defined("FNT_HEADER_SIZE"))define("FNT_HEADER_SIZE", 10);
+
+ if(!defined("RADIO_BTN_SIZE"))define("RADIO_BTN_SIZE", 3);
+ if(!defined("CHCK_BTN_SIZE"))define("CHCK_BTN_SIZE", 3);
+ if(!defined("LINE_BREAK"))define("LINE_BREAK", 6);
+
+ if(!defined("PDF_MARGIN_HEADER"))define ('PDF_MARGIN_HEADER', 8);
+ if(!defined("PDF_MARGIN_FOOTER"))define ('PDF_MARGIN_FOOTER', 12);
+ if(!defined("PDF_MARGIN_TOP"))define ('PDF_MARGIN_TOP', 18);
+ if(!defined("PDF_MARGIN_BOTTOM"))define ('PDF_MARGIN_BOTTOM', 18);
+ if(!defined("PDF_MARGIN_LEFT"))define ('PDF_MARGIN_LEFT', 15);
+ if(!defined("PDF_MARGIN_RIGHT"))define ('PDF_MARGIN_RIGHT', 15);
/** Class za generacijo izvoza v Latex
@@ -76,8 +76,6 @@ class AnalizaTTest extends LatexAnalysisElement{
{
$this->anketa['id'] = $anketa;
$this->anketa['podstran'] = $podstran;
- // create new PDF document
- //$this->pdf = new enka_TCPDF('L', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
}
else
{
@@ -106,12 +104,7 @@ class AnalizaTTest extends LatexAnalysisElement{
{
return $this->pi['canCreate'];
}
- function getFile($fileName=null)
- {
- //Close and output PDF document
- ob_end_clean();
- $this->pdf->Output($fileName, 'I');
- }
+
function init()
@@ -125,35 +118,7 @@ class AnalizaTTest extends LatexAnalysisElement{
$language_meta['a_meta_language'] = 'sl';
$language_meta['w_page'] = $lang['page'];
- //set some language-dependent strings
- $this->pdf->setLanguageArray($language_meta);
-
- //set margins
- $this->pdf->setPrintHeaderFirstPage(true);
- $this->pdf->setPrintFooterFirstPage(true);
- $this->pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
- $this->pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
- $this->pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
-
- // set header and footer fonts
- $this->pdf->setHeaderFont(Array(FNT_HEADER_TEXT, "I", FNT_HEADER_SIZE));
- $this->pdf->setFooterFont(Array(FNT_HEADER_TEXT, 'I', FNT_HEADER_SIZE));
-
-
- // set document information
- $this->pdf->SetAuthor('An Order Form');
- $this->pdf->SetTitle('An Order');
- $this->pdf->SetSubject('An Order');
-
- // set default header data
- $this->pdf->SetHeaderData(null, null, "www.1ka.si", $this->encodeText(SurveyInfo::getInstance()->getSurveyAkronim()));
- //set auto page breaks
- $this->pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
-
- $this->pdf->SetFont(FNT_MAIN_TEXT, '', FNT_MAIN_SIZE);
- //set image scale factor
- $this->pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
return true;
}
@@ -210,7 +175,7 @@ class AnalizaTTest 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;
@@ -239,8 +204,8 @@ class AnalizaTTest extends LatexAnalysisElement{
$poravnava = "c";
- $tabela .= " & \multicolumn{".$steviloOstalihStolpcev."}{".$poravnava."|}{".$this->returnBold($this->encodeText($sprLabel1))."} ".$this->texNewLine;
- //$tabela .= ' & \multicolumn{'.$steviloOstalihStolpcev.'}{>{\hsize=\dimexpr '.($steviloOstalihStolpcev).'\hsize + '.($steviloOstalihStolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.$this->returnBold($this->encodeText($sprLabel1)).'} '.$this->texNewLine;
+ $tabela .= " & \multicolumn{".$steviloOstalihStolpcev."}{".$poravnava."|}{".$this->returnBold(LatexDocument::encodeText($sprLabel1))."} ".$this->texNewLine;
+ //$tabela .= ' & \multicolumn{'.$steviloOstalihStolpcev.'}{>{\hsize=\dimexpr '.($steviloOstalihStolpcev).'\hsize + '.($steviloOstalihStolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.$this->returnBold(LatexDocument::encodeText($sprLabel1)).'} '.$this->texNewLine;
// prva vrstica - konec
// druga vrstica
@@ -248,7 +213,7 @@ class AnalizaTTest extends LatexAnalysisElement{
$tabela .= "\\cline{2-".$steviloStolpcevParameterTabular."} "; //horizontalna vrstica od 2 do zadnje celice
}
$druga = array();
- $druga[] = $this->returnBold($this->encodeText($sprLabel2));
+ $druga[] = $this->returnBold(LatexDocument::encodeText($sprLabel2));
$druga[] = 'n';
$druga[] = 'x';
$druga[] = 's$^2$';
@@ -269,7 +234,7 @@ class AnalizaTTest extends LatexAnalysisElement{
//tretja vrstica
$tretja = array();
- $tretja[] = $this->encodeText($label1); //1. stolpec
+ $tretja[] = LatexDocument::encodeText($label1); //1. stolpec
$tretja[] = $this->formatNumber($ttest[1]['n'], 0);
$tretja[] = $this->formatNumber($ttest[1]['x'], 3);
$tretja[] = $this->formatNumber($ttest[1]['s2'], 3);
@@ -285,9 +250,9 @@ class AnalizaTTest extends LatexAnalysisElement{
//cetrta vrstica
$cetrta = array();
if($export_format != 'xls'){
- $cetrta[] = '\cline{1-'.$zadnjiStolpecDvojnihVrstic.'} '.$this->encodeText($label2); //1. stolpec, //crta samo do dolocenega stolpca
+ $cetrta[] = '\cline{1-'.$zadnjiStolpecDvojnihVrstic.'} '.LatexDocument::encodeText($label2); //1. stolpec, //crta samo do dolocenega stolpca
}else{
- $cetrta[] = $this->encodeText($label2); //1. stolpec, //crta samo do dolocenega stolpca
+ $cetrta[] = LatexDocument::encodeText($label2); //1. stolpec, //crta samo do dolocenega stolpca
}
$cetrta[] = $this->formatNumber($ttest[2]['n'], 0);
$cetrta[] = $this->formatNumber($ttest[2]['x'], 3);
@@ -304,7 +269,7 @@ class AnalizaTTest extends LatexAnalysisElement{
// vrstici s podatki - 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
}
@@ -341,9 +306,9 @@ class AnalizaTTest extends LatexAnalysisElement{
if($creport==false){
// Naslov posameznega grafa
$title = $lang['srv_chart_ttest_title'].':'.$this->texNewLine;
- $title .= $this->encodeText($this->ttestVars[0]);
- $title .= $this->encodeText('/');
- $title .= $this->encodeText($this->ttestVars[1]);
+ $title .= LatexDocument::encodeText($this->ttestVars[0]);
+ $title .= LatexDocument::encodeText('/');
+ $title .= LatexDocument::encodeText($this->ttestVars[1]);
$boldedTitle = $this->returnBold($title).$this->texNewLine; //vrni boldan naslov in skoci v novo vrstico
}else{
$boldedTitle = '';
@@ -375,11 +340,6 @@ class AnalizaTTest extends LatexAnalysisElement{
return $text;
}
- function drawLine()
- {
- $cy = $this->pdf->getY();
- $this->pdf->Line(15, $cy , 195, $cy , $this->currentStyle);
- }
function setUserId($usrId=null) {$this->anketa['uid'] = $usrId;}
function getUserId() {return ($this->anketa['uid'])?$this->anketa['uid']:false;}
@@ -394,20 +354,7 @@ class AnalizaTTest extends LatexAnalysisElement{
return $result;
}
-
- function getCellHeight($string='', $width=null){
-
- $this->pdf->startTransaction();
- // get the number of lines calling you method
- $linecount = $this->pdf->MultiCell($width, 0, $string, 0, 'L', 0, 0, '', '', true, 0, false, true, 0);
- // restore previous object
- $this->pdf = $this->pdf->rollbackTransaction();
-
- $height = ($linecount <= 1) ? 4.7 : $linecount * ($this->pdf->getFontSize() * $this->pdf->getCellHeightRatio()) + 2;
- return $height;
- }
-
}
?> \ No newline at end of file