diff options
Diffstat (limited to 'main/survey/app/Controllers/Vprasanja/DynamicController.php')
-rw-r--r-- | main/survey/app/Controllers/Vprasanja/DynamicController.php | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/main/survey/app/Controllers/Vprasanja/DynamicController.php b/main/survey/app/Controllers/Vprasanja/DynamicController.php index 57e0127..92acc2d 100644 --- a/main/survey/app/Controllers/Vprasanja/DynamicController.php +++ b/main/survey/app/Controllers/Vprasanja/DynamicController.php @@ -183,18 +183,21 @@ class DynamicController extends Controller echo '<thead>';
+
//vrstica z nadnaslovi
echo '<tr '.$display_trak_num_of_titles.' class="display_trak_num_of_titles_respondent_'.$row['id'].'">';
echo ' <td></td>';
echo ' <td></td>';
- //for($j = 1; $j <= $trak_num_of_titles; $j++){
+
for ($j = 1; $j <= $row['grids']; $j++) {
- //echo '<td>'.$j.'</td>';
+
if($j == 1){
$nadnaslov_floating = 'left';
- }else if($j == $row['grids']){
+ }
+ else if($j == $row['grids']){
$nadnaslov_floating = 'right';
- }else{
+ }
+ else{
$nadnaslov_floating = 'none';
}
echo '<td class="trak_inline_nadnaslov" grd="gr_'.$j.'"><div id="trak_nadnaslov_'.$j.'_'.$spremenljivka.'" name="trak_nadnaslov_'.$j.'" class="trak_inline_nadnaslov" style="float:'.$nadnaslov_floating.'; display:inline" '.(strpos($trak_nadnaslov[$j], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $trak_nadnaslov[$j] . '</div></td>';
@@ -203,6 +206,7 @@ class DynamicController extends Controller echo '</tr>';
//vrstica z nadnaslovi - konec
+
echo ' <tr>' . "\n";
echo ' <td></td>' . "\n";
echo ' <td></td>' . "\n";
@@ -220,15 +224,20 @@ class DynamicController extends Controller // Datapiping
$srv_grid['naslov'] = Helper::dataPiping($srv_grid['naslov']);
-
- if($diferencial_trak != 1){ //ce ni traku
+ //ce ni traku
+ if($diferencial_trak != 1){
# izpišemo labelo grida
echo ' <td class="' . ($srv_grid['other'] == 0 ? 'category' : 'missing') . '">' . $srv_grid['naslov'] . '</td>' . "\n";
- }elseif($diferencial_trak == 1){ //ce je trak
+ }
+ //ce je trak
+ elseif($diferencial_trak == 1){
+
# izpišemo ustrezno labelo grida
if($srv_grid['other'] == 0){ //ce je labela za kategorijo odgovora, naj bo prazno
echo ' <td class="' . ($srv_grid['other'] == 0 ? 'category' : 'missing') . ' ' . $cssAlign . '"></td>' . "\n";
- }else { //drugace, ce je labela za missing, izpisi labelo
+ }
+ //drugace, ce je labela za missing, izpisi labelo
+ else {
echo ' <td class="' . ($srv_grid['other'] == 0 ? 'category' : 'missing') . ' ' . $cssAlign . '">' . $srv_grid['naslov'] . '</td>' . "\n";
}
}
@@ -263,15 +272,26 @@ class DynamicController extends Controller // Stevilo vseh vrednosti
echo '<input type="hidden" id="dynamic_multigrid_' . $spremenljivka . '" value="' . $countVar . '" />';
+
// Indikator da v js vemo ali smo ravnokar naloudali stran ali pa smo samo premaknili vrstico (potrebno zaradi prikazovanja glede na ife v dolocenih primerih)
echo '<input type="hidden" id="dynamic_multigrid_' . $spremenljivka . '_load" value="1" />';
while ($row1 = mysqli_fetch_array($sql1)) {
+
# po potrebi prevedemo naslov
$naslov = Language::getInstance()->srv_language_vrednost($row1['id']);
if ($naslov != '') {
$row1['naslov'] = $naslov;
}
+
+ # po potrebi prevedemo naslov2 za diferencial
+ if ($row['enota'] == 1) {
+ $naslov2 = Language::getInstance()->srv_language_vrednost($row1['id'], true);
+ if ($naslov2 != '') {
+ $row1['naslov2'] = $naslov2;
+ }
+ }
+
# preverimo izbrano vrednost
$grid_id = $srv_data_grid[$row1['id']]['grd_id'];
@@ -545,11 +565,22 @@ class DynamicController extends Controller echo '<input type="hidden" id="dynamic_multigrid_' . $spremenljivka . '_load" value="1" />';
while ($row1 = mysqli_fetch_array($sql1)) {
+
# po potrebi prevedemo naslov
$naslov = Language::getInstance()->srv_language_vrednost($row1['id']);
if ($naslov != '') {
$row1['naslov'] = $naslov;
}
+
+ # po potrebi prevedemo naslov2 za diferencial
+ if ($row['enota'] == 1) {
+ $naslov2 = Language::getInstance()->srv_language_vrednost($row1['id'], true);
+ if ($naslov2 != '') {
+ $row1['naslov2'] = $naslov2;
+ }
+ }
+
+
# preverimo izbrano vrednost
$grid_id = $srv_data_grid[$row1['id']]['grd_id'];
|