summaryrefslogtreecommitdiffstats
path: root/admin/survey/export/latexclasses/Vprasanja/DatumLatex.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/export/latexclasses/Vprasanja/DatumLatex.php')
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/DatumLatex.php27
1 files changed, 18 insertions, 9 deletions
diff --git a/admin/survey/export/latexclasses/Vprasanja/DatumLatex.php b/admin/survey/export/latexclasses/Vprasanja/DatumLatex.php
index 7110873..006863f 100644
--- a/admin/survey/export/latexclasses/Vprasanja/DatumLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/DatumLatex.php
@@ -36,6 +36,7 @@ class DatumLatex extends LatexSurveyElement
public function export($spremenljivke=null, $export_format='', $questionText='', $fillablePdf=null, $texNewLine='', $usr_id=null, $db_table=null, $export_subtype='', $preveriSpremenljivko=null, $loop_id=null){
+ //$time_start = microtime(true);
// Ce je spremenljivka v loopu
$this->loop_id = $loop_id;
@@ -65,19 +66,25 @@ class DatumLatex extends LatexSurveyElement
//$sqlUserAnswer = sisplet_query("SELECT text FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."' AND vre_id='".$rowVrednost['id']."' AND loop_id $loop_id");
//$sqlUserAnswerString = "SELECT text FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."' AND vre_id='".$rowVrednost['id']."' ";
$sqlUserAnswerString = "SELECT text FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."' ";
- //echo $sqlUserAnswerString;
+ //$sqlUserAnswerString = "SELECT text FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."' AND loop_id = $loop_id";
+ if($loop_id){
+ $sqlUserAnswerString = $sqlUserAnswerString." AND loop_id = '$loop_id'";
+ }
+
+ //echo $sqlUserAnswerString."</br>";
+
$sqlUserAnswer = sisplet_query($sqlUserAnswerString);
$userAnswer = mysqli_fetch_assoc($sqlUserAnswer);
//echo "userAnswer: ".$userAnswer['text']."</br>";
//ureditev polja s podatki trenutnega uporabnika - konec ##############################################
//ureditev besedila odgovora respondenta v doloceno barvo
- $besedilo = '\\textcolor{crta}{';
- $besedilo .= $userAnswer['text'];
+ $besedilo = '\\textcolor{crta}{';
+ $besedilo .= isset($userAnswer['text'])?$userAnswer['text']:null;
$besedilo .= '}';
//ureditev besedila odgovora respondenta v doloceno barvo - konec
- if($userAnswer['text']==''){ //ce ni izpisa odgovorov respondentov, priprava izpis s tabelo
+ if(isset($userAnswer['text'])?$userAnswer['text']:null==''){ //ce ni izpisa odgovorov respondentov, priprava izpis s tabelo
$answerTextBox = $this->LatexTextBox($export_format, $textboxHeight, $textboxWidth, $besedilo, $textboxAllignment, $noBorders);
//parametri tabele
@@ -91,12 +98,12 @@ class DatumLatex extends LatexSurveyElement
//IZRIS
#ZACETEK TABELE
//zacetek tabele
- $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'tabularx', 'tabular', 1, 1);
+ $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'xltabular', 'tabular', 1, 1);
$tex .= $answerTextBox; //izris znotraj tabele
//zakljucek tabele
- $tex .= $this->EndLatexTable($export_format, 'tabularx', 'tabular');
+ $tex .= $this->EndLatexTable($export_format, 'xltabular', 'tabular');
#KONEC TABELE
$tex .= $this->texBigSkip;
}else{ //ce je izpis odgovorov respondentov
@@ -114,11 +121,11 @@ class DatumLatex extends LatexSurveyElement
$array_others[$rowVrednost['id']] = array(
'naslov'=>$rowVrednost['naslov'],
'vrstni_red'=>$rowVrednost['vrstni_red'],
- 'value'=>$text[$rowVrednost['vrstni_red']],
+ //'value'=>$text[$rowVrednost['vrstni_red']],
);
}
}
- $symbol = $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, 0); //poberi simbol checkbox za other in missing moznosti odgovora
+ $symbol = $this->getAnswerSymbol($export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, 0); //poberi simbol checkbox za other in missing moznosti odgovora
//priprava missing-ov - konec
// Izris polj drugo - ne vem...
@@ -133,7 +140,9 @@ class DatumLatex extends LatexSurveyElement
}
//IZRIS - KONEC
-
+ /* $time_end = microtime(true);
+ $execution_time = ($time_end - $time_start);
+ echo '<b>Total Execution Time datum:</b> '.$execution_time.' sec'; */
return $tex;
}
}