diff options
Diffstat (limited to 'admin/survey/classes/surveyAnalysis/class.SurveyMultiCrosstabs.php')
-rw-r--r-- | admin/survey/classes/surveyAnalysis/class.SurveyMultiCrosstabs.php | 363 |
1 files changed, 202 insertions, 161 deletions
diff --git a/admin/survey/classes/surveyAnalysis/class.SurveyMultiCrosstabs.php b/admin/survey/classes/surveyAnalysis/class.SurveyMultiCrosstabs.php index 67664da..98c2f59 100644 --- a/admin/survey/classes/surveyAnalysis/class.SurveyMultiCrosstabs.php +++ b/admin/survey/classes/surveyAnalysis/class.SurveyMultiCrosstabs.php @@ -1,8 +1,8 @@ <?php
-define("AUTO_HIDE_ZERRO_VALUE", 20); # nad koliko kategorij skrivamo ničelne vrednosti
-define("EXPORT_FOLDER", "admin/survey/SurveyData");
-define("R_FOLDER", "admin/survey/R");
+if(!defined("AUTO_HIDE_ZERRO_VALUE")) define("AUTO_HIDE_ZERRO_VALUE", 20); # nad koliko kategorij skrivamo ničelne vrednosti
+if(!defined("EXPORT_FOLDER")) define("EXPORT_FOLDER", "admin/survey/SurveyData");
+if(!defined("R_FOLDER")) define("R_FOLDER", "admin/survey/R");
class SurveyMultiCrosstabs {
@@ -74,9 +74,12 @@ class SurveyMultiCrosstabs { # polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->ank_id);
- if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
- $this->db_table = '_active';
- }
+ $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
+
+ // Pri glasovanju tega ne pustimo
+ if(SurveyInfo::getInstance()->getSurveyColumn("survey_type") == 0){
+ die();
+ }
$this->_CURRENT_STATUS_FILTER = STATUS_FIELD.' ~ /6|5/';
@@ -216,7 +219,7 @@ class SurveyMultiCrosstabs { if($spr['canChoose'] && in_array($spr['tip'], array(1,3,6))){
echo '<li class="draggable mc_draggable" id="'.$spr['spr_id'].'-'.$spr['sequence'].'">';
- echo '<span class="strong">'.$spr['variable'].'</span> - '.$this->snippet($spr['naslov'], 25);
+ echo ' <span class="strong"><span class="faicon grip"></span>'.$spr['variable'].'</span> - '.$this->snippet($spr['naslov'], 25);
echo '</li>';
}
}
@@ -227,7 +230,7 @@ class SurveyMultiCrosstabs { $this->displayMCTablesPopups();
// Izris diva za nastavitve tabele
- echo '<div id="mc_table_settings" class="mc_table_settings">';
+ echo '<div id="mc_table_settings" class="mc_table_settings divPopUp PopUpNarrow">';
$this->displayTableSettings();
echo '</div>';
@@ -252,9 +255,19 @@ class SurveyMultiCrosstabs { // Napolnimo variable ki so ze izbrane
$this->getSelectedVars();
+ // Zvezdica za creport - ce smo v custom reportu tega ne izpisemo
+ /*if($_GET['m'] != 'analysis_creport'){
+
+ echo '<div class="mc_table_top_settings">';
+
+ // Zvezdica za vkljucitev v porocilo
+ SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=10, $sub_type=0, $spr1=$this->table_id);
+
+ echo '</div>';
+ }*/
+
echo '<table id="'.$this->table_id.'" cellspacing="0" cellpadding="0" class="mc_table">';
-
// Imamo 2 nivoja
if($this->colLevel2){
@@ -264,8 +277,10 @@ class SurveyMultiCrosstabs { elseif(!$this->rowLevel2)
$colspan = ' colspan="2"';
else
- $colspan = ' colspan="4"';
+ $colspan = ' colspan="4"';
+
echo '<tr><td class="borderless" '.$colspan.'></td>';
+
if(count($this->selectedVars['ver'])){
foreach($this->selectedVars['ver'] as $var){
@@ -276,23 +291,27 @@ class SurveyMultiCrosstabs { echo $this->snippet($this->variablesList[$var['spr']]['naslov'], 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
}
// Izrisemo se zadnjo prazno navpicno celico vrstico
echo '<td id="undefined" class="spr vertical droppable empty" rowspan="4">'.$lang['srv_multicrosstabs_add'].'</td>';
- echo '</tr>';
+ echo '</tr>';
+
+
// Izrisemo VARIABLE za spremenljivko - 2. vrstica
if($this->rowSpan == 0)
$colspan = ' colspan="1"';
elseif(!$this->rowLevel2)
$colspan = ' colspan="2"';
else
- $colspan = ' colspan="4"';
+ $colspan = ' colspan="4"';
+
echo '<tr><td class="borderless" '.$colspan.'></td>';
+
if(count($this->selectedVars['ver'])){
foreach($this->selectedVars['ver'] as $var){
@@ -311,16 +330,18 @@ class SurveyMultiCrosstabs { }
}
echo '</tr>';
+
// Izris vrstic za 2. nivo - 3. in 4. vrstica
-
if($this->rowSpan == 0)
$colspan = ' colspan="1"';
elseif(!$this->rowLevel2)
$colspan = ' colspan="2"';
else
- $colspan = ' colspan="4"';
+ $colspan = ' colspan="4"';
+
echo '<tr><td class="borderless" '.$colspan.'></td>';
+
if(count($this->selectedVars['ver'])){
foreach($this->selectedVars['ver'] as $parentVar){
@@ -335,7 +356,7 @@ class SurveyMultiCrosstabs { echo $this->snippet($this->variablesList[$var['spr']]['naslov'], 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
@@ -352,15 +373,19 @@ class SurveyMultiCrosstabs { }
}
}
+
echo '</tr>';
+
if($this->rowSpan == 0)
$colspan = ' colspan="1"';
elseif(!$this->rowLevel2)
$colspan = ' colspan="2"';
else
- $colspan = ' colspan="4"';
+ $colspan = ' colspan="4"';
+
echo '<tr><td class="borderless" '.$colspan.'></td>';
+
if(count($this->selectedVars['ver'])){
foreach($this->selectedVars['ver'] as $parentVar){
@@ -375,7 +400,7 @@ class SurveyMultiCrosstabs { echo $this->snippet($suboption, 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
@@ -384,10 +409,12 @@ class SurveyMultiCrosstabs { }
}
}
+
echo '</tr>';
}
// Imamo samo 1 nivo
else{
+
// Izrisemo VERTIKALNO izbrane spremenljivkec - 1. vrstica
if($this->rowSpan == 0)
$colspan = ' colspan="1"';
@@ -395,8 +422,10 @@ class SurveyMultiCrosstabs { $colspan = ' colspan="2"';
else
$colspan = ' colspan="4"';
+
echo '<tr><td class="borderless" '.$colspan.'></td>';
- if(count($this->selectedVars['ver'])){
+
+ if(isset($this->selectedVars['ver'])&&count($this->selectedVars['ver'])){
foreach($this->selectedVars['ver'] as $var){
$colspan = ' colspan="'.($this->table_settings[$this->table_id]['sums'] == 1 && !$this->rowLevel2 ? $var['span']+1 : $var['span']).'"';
@@ -405,7 +434,7 @@ class SurveyMultiCrosstabs { echo $this->snippet($this->variablesList[$var['spr']]['naslov'], 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
@@ -416,18 +445,22 @@ class SurveyMultiCrosstabs { }
// Izrisemo se zadnjo prazno navpicno celico vrstico
- echo '<td id="undefined" class="spr vertical droppable empty" rowspan="2">'.$lang['srv_multicrosstabs_add'].'</td>';
+ echo '<td id="undefined" class="spr vertical droppable empty" rowspan="2">'.$lang['srv_multicrosstabs_add'].'</td>';
+
echo '</tr>';
+
// Izrisemo VARIABLE za spremenljivko - 2. vrstica
if($this->rowSpan == 0)
$colspan = ' colspan="1"';
elseif(!$this->rowLevel2)
$colspan = ' colspan="2"';
else
- $colspan = ' colspan="4"';
+ $colspan = ' colspan="4"';
+
echo '<tr><td class="borderless" '.$colspan.'></td>';
- if(count($this->selectedVars['ver'])){
+
+ if(isset($this->selectedVars['ver'])&&count($this->selectedVars['ver'])){
foreach($this->selectedVars['ver'] as $var){
// Loop cez variable spremenljivke
@@ -449,13 +482,14 @@ class SurveyMultiCrosstabs { }
}
}
+
echo '</tr>';
}
// Izrisemo HORIZONTALNO izbrane variable
- if(count($this->selectedVars['hor'])){
+ if(isset($this->selectedVars['hor'])&&count($this->selectedVars['hor'])){
// Imamo 2 nivoja vrstic
if($this->rowLevel2){
@@ -486,7 +520,7 @@ class SurveyMultiCrosstabs { echo $this->snippet($this->variablesList[$parentVar['spr']]['naslov'], 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
@@ -507,7 +541,7 @@ class SurveyMultiCrosstabs { echo $this->snippet($this->variablesList[$var['spr']]['naslov'], 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
@@ -535,7 +569,7 @@ class SurveyMultiCrosstabs { echo '<tr>';
- echo '<td class="var sums">'.$lang['srv_analiza_crosstab_skupaj'].'</td>';
+ echo '<td class="var sums horizontal">'.$lang['srv_analiza_crosstab_skupaj'].'</td>';
$crosstabs = $this->crosstabData[$parentVar['spr'].'-'.$var['spr']];
@@ -561,7 +595,7 @@ class SurveyMultiCrosstabs { echo $this->snippet($this->variablesList[$parentVar['spr']]['naslov'], 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
@@ -599,7 +633,7 @@ class SurveyMultiCrosstabs { echo $this->snippet($this->variablesList[$var['spr']]['naslov'], 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
@@ -622,7 +656,7 @@ class SurveyMultiCrosstabs { // Vrstica za sumo (ce jo imamo vklopljeno)
if($this->table_settings[$this->table_id]['sums'] == 1 && count($this->selectedVars['ver']) > 0 && !$this->colLevel2){
echo '<tr>';
- echo '<td class="var sums">'.$lang['srv_analiza_crosstab_skupaj'].'</td>';
+ echo '<td class="var sums horizontal">'.$lang['srv_analiza_crosstab_skupaj'].'</td>';
// Loop cez vse stolpce
foreach($this->selectedVars['ver'] as $spr2){
@@ -683,37 +717,26 @@ class SurveyMultiCrosstabs { echo '</tr>';
-
echo '</table>';
-
- echo '<div class="mc_table_bottom_settings">';
-
// Izrisemo legendo
+ echo '<div class="mc_table_bottom_settings">';
$this->displayLegend();
-
-
- // Ce smo v custom reportu tega ne izpisemo
- if($_GET['m'] != 'analysis_creport'){
-
- // Zvezdica za vkljucitev v porocilo
- SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=10, $sub_type=0, $spr1=$this->table_id);
-
-
- echo '<script type="text/javascript">';
-
- // Nastavimo droppable (drugace po ajaxu ne dela)
- echo '$(function(){createDroppable();});';
-
- // Nastavimo gumb za brisanje spremenljivke
- echo '$(".mc_table tr td.spr").mouseover(function(){$(this).find(".delete_var").show();});';
- echo '$(".mc_table tr td.spr").mouseout(function(){$(this).find(".delete_var").hide();});';
-
- echo '</script>';
- }
-
echo '</div>';
+
+
+ // JS
+ echo '<script type="text/javascript">';
+
+ // Nastavimo droppable (drugace po ajaxu ne dela)
+ echo '$(function(){createDroppable();});';
+
+ // Nastavimo gumb za brisanje spremenljivke
+ echo '$(".mc_table tr td.spr").mouseover(function(){$(this).find(".delete_var").show();});';
+ echo '$(".mc_table tr td.spr").mouseout(function(){$(this).find(".delete_var").hide();});';
+
+ echo '</script>';
}
// Izpis celic v vrstici s podatki
@@ -1108,7 +1131,7 @@ class SurveyMultiCrosstabs { // Numerus
if($this->table_settings[$this->table_id]['numerus'] == 1){
echo '<tr><td class="bold white">';
- echo $crosstabs['sumaSkupna'];
+ echo ($crosstabs['sumaSkupna'] != '') ? $crosstabs['sumaSkupna'] : '0';
echo '</td></tr>';
}
@@ -1390,91 +1413,84 @@ class SurveyMultiCrosstabs { echo '<input type="hidden" name="table_id" value="'.$this->table_id.'" />';
- echo '<fieldset>';
- echo '<legend>'.$lang['srv_multicrosstabs_settings_val'].'</legend>';
-
+ echo '<h3>'.$lang['srv_multicrosstabs_settings_val'].'</h3>';
+
+ echo '<div class="setting_holder">';
+
// Prikaz numerusa
- echo '<span class="clr"><input type="checkbox" id="numerus_'.$this->table_id.'" name="numerus" '.($this->table_settings[$this->table_id]['numerus'] == 1 ? ' checked="checked"':'').' value="1" /><label for="numerus_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_numerus'].'</label></span>';
-
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="numerus_'.$this->table_id.'" name="numerus" '.($this->table_settings[$this->table_id]['numerus'] == 1 ? ' checked="checked"':'').' value="1" /><label for="numerus_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_numerus'].'</label>';
+ echo '</div>';
// Prikaz procentov
- echo '<span class="clr"><input type="checkbox" id="percent_'.$this->table_id.'" name="percent" '.($this->table_settings[$this->table_id]['percent'] == 1 ? ' checked="checked"':'').' value="1" /><label for="percent_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_percent'].'</label></span>';
-
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="percent_'.$this->table_id.'" name="percent" '.($this->table_settings[$this->table_id]['percent'] == 1 ? ' checked="checked"':'').' value="1" /><label for="percent_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_percent'].'</label>';
+ echo '</div>';
// Prikaz vsot
- echo '<span class="clr"><input type="checkbox" id="sums_'.$this->table_id.'" name="sums" '.($this->table_settings[$this->table_id]['sums'] == 1 ? ' checked="checked"':'').' value="1" /><label for="sums_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_sum'].'</label></span>';
-
- // Navedbe / enote
- /*if($this->isCheckbox){
- echo '<span class="clr" style="line-height: 20px;">';
- echo '<label for="navVsEno0_'.$this->table_id.'"><input type="radio" id="navVsEno0_'.$this->table_id.'" name="navVsEno" '.($this->table_settings[$this->table_id]['navVsEno'] == 0 ? ' checked="checked"':'').' value="0" />'.$lang['srv_analiza_crosstab_navedbe'].'</label>';
- echo ' <label for="navVsEno1_'.$this->table_id.'"><input type="radio" id="navVsEno1_'.$this->table_id.'" name="navVsEno" '.($this->table_settings[$this->table_id]['navVsEno'] == 1 ? ' checked="checked"':'').' value="1" />'.$lang['srv_analiza_crosstab_enote'].'</label>';
- echo '</span>';
- }*/
-
- echo '</fieldset>';
-
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="sums_'.$this->table_id.'" name="sums" '.($this->table_settings[$this->table_id]['sums'] == 1 ? ' checked="checked"':'').' value="1" /><label for="sums_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_sum'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
- echo '<fieldset>';
- echo '<legend>'.$lang['srv_multicrosstabs_settings_avg'].'</legend>';
+ echo '<h3>'.$lang['srv_multicrosstabs_settings_avg'].'</h3>';
// Variabla za racunanje povprecja - numeric in ordinal (radio, dropdown, mg)
$checked = $this->table_settings[$this->table_id]['avgVar'] == '' ? false : true;
- echo '<span class="clr"><input type="checkbox" id="avgSetting_'.$this->table_id.'" name="avgSetting" '.($checked ? ' checked="checked"':'').' onClick="toggleMCSetting(\'avgVar\');" /><label for="avgSetting_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_avg'].'</label>';
- echo '<span id="avgVar" class="spaceLeft" '.($checked ? '' : ' style="display: none;"').'><select id="avgVar_'.$this->table_id.'" name="avgVar">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="avgSetting_'.$this->table_id.'" name="avgSetting" '.($checked ? ' checked="checked"':'').' onClick="toggleMCSetting(\'avgVar\');" /><label for="avgSetting_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_avg'].'</label>';
+ echo '</div>';
+ echo '<div id="avgVar" class="setting_item" '.($checked ? '' : ' style="display: none;"').'>';
+ echo '<select class="dropdown medium" id="avgVar_'.$this->table_id.'" name="avgVar">';
echo '<option value="">'.$lang['srv_select_spr'].'...</option>';
foreach($this->variablesList AS $spr){
- if( $spr['canChoose'] && ($spr['tip'] == 7 || (in_array($spr['tip'], array(1,3,6)) && $spr['skala'] == 0)) ){
+ if( $spr['canChoose'] && ($spr['tip'] == 7 || (in_array($spr['tip'], array(1,3,6)) && (!isset($spr['skala'])||$spr['skala'] == 0))) ){
echo '<option value="'.$spr['spr_id'].'-'.$spr['sequence'].'" '.($this->table_settings[$this->table_id]['avgVar'] == $spr['spr_id'].'-'.$spr['sequence'] ? ' selected="selected"' : '').'>('.$spr['variable'].') '.$this->snippet($spr['naslov'], 25).'</option>';
}
}
- echo '</select></span>';
- echo '</span>';
-
- echo '</fieldset>';
+ echo '</select>';
+ echo '</div>';
+
+ echo '</div>';
- echo '<fieldset>';
- echo '<legend>'.$lang['srv_multicrosstabs_settings_del'].'</legend>';
+ echo '<h3>'.$lang['srv_multicrosstabs_settings_del'].'</h3>';
// Variabla za racunanje deleza - ordinal in nominal (radio, dropdown, mg, po novem tudi checkbox, multicheckbox)
$checked = $this->table_settings[$this->table_id]['delezVar'] == '' ? false : true;
- echo '<span class="clr"><input type="checkbox" id="delezSetting_'.$this->table_id.'" name="delezSetting" '.($checked ? ' checked="checked"':'').' onClick="toggleMCSetting(\'delezVar\');" /><label for="delezSetting_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_delez'].'</label>';
-
- echo '<span id="delezVar" class="spaceLeft" '.($checked ? '' : ' style="display: none;"').'><select id="delezVar_'.$this->table_id.'" name="delezVar" onChange="setDelez(this.value);">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="delezSetting_'.$this->table_id.'" name="delezSetting" '.($checked ? ' checked="checked"':'').' onClick="toggleMCSetting(\'delezVar\');" /><label for="delezSetting_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_delez'].'</label>';
+ echo '</div>';
+ echo '<div id="delezVar" class="setting_item" '.($checked ? '' : ' style="display: none;"').'>';
+ echo '<select class="dropdown medium" id="delezVar_'.$this->table_id.'" name="delezVar" onChange="setDelez(this.value);">';
echo '<option value="">'.$lang['srv_select_spr'].'...</option>';
foreach($this->variablesList AS $spr){
if($spr['canChoose'] && in_array($spr['tip'], array(1,3,6,2,16))){
echo '<option value="'.$spr['spr_id'].'-'.$spr['sequence'].'" '.($this->table_settings[$this->table_id]['delezVar'] == $spr['spr_id'].'-'.$spr['sequence'] ? ' selected="selected"' : '').'>('.$spr['variable'].') '.$this->snippet($spr['naslov'], 25).'</option>';
}
}
- echo '</select></span>';
- echo '</span>';
+ echo '</select>';
+ echo '</div>';
+
+ echo '</div>';
echo '<div id="delez" '.($checked ? '' : ' style="display: none;"').'>';
$this->displayDelez($this->table_settings[$this->table_id]['delezVar']);
echo '</div>';
- echo '</fieldset>';
-
echo '</form>';
-
// Gumbi na dnu
- echo '<div id="mcSettingsButtons">';
-
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_gray" onclick="closeMCSettings(\''.$this->table_id.'\');">';
- echo '<span>'.$lang['srv_zapri'].'</span>';
- echo '</a>';
- echo '</span>';
-
- echo '<span class="buttonwrapper spaceRight spaceLeft floatLeft">';
- echo '<a class="ovalbutton ovalbutton_orange" onclick="saveMCSettings(\''.$this->table_id.'\');">';
- echo '<span>'.$lang['srv_potrdi'].'</span>';
- echo '</a>';
- echo '</span>';
-
- echo '</div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="closeMCSettings(\''.$this->table_id.'\');">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="saveMCSettings(\''.$this->table_id.'\');">'.$lang['srv_potrdi'].'</button>';
+ echo '</div>';
}
// Prikazemo opcije variable (checkboxe) za delez
@@ -1492,9 +1508,13 @@ class SurveyMultiCrosstabs { else
$val = 0;
- echo '<span class="clr">';
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
echo '<input type="checkbox" id="delez_'.$cnt.'" name="delez_'.$cnt.'" value="1" '.($val == 1 ? ' checked="checked"' : '').' /><label for="delez_'.$cnt.'"> '.$option.'</label>';
- echo '</span>';
+ echo '</div>';
+
+ echo '</div>';
$cnt++;
}
@@ -1530,10 +1550,12 @@ class SurveyMultiCrosstabs { $href_xls = makeEncodedIzvozUrlString('izvoz.php?b=export&m=multicrosstabs_izpis_xls&anketa='.$this->ank_id);
echo '<script>';
+
# nastavimopravilne linke
echo '$("#secondNavigation_links a#multicrosstabDoPdf").attr("href", "'.$href_pdf.'");';
echo '$("#secondNavigation_links a#multicrosstabDoRtf").attr("href", "'.$href_rtf.'");';
echo '$("#secondNavigation_links a#multicrosstabDoXls").attr("href", "'.$href_xls.'");';
+
# prikažemo linke
echo '$("#hover_export_icon a").removeClass("hidden");';
echo '$("#secondNavigation_links a").removeClass("hidden");';
@@ -1583,11 +1605,11 @@ class SurveyMultiCrosstabs { $this->variablesList = array();
# zloopamo skozi header in dodamo variable (potrebujemo posamezne sekvence)
foreach ($this->_HEADERS AS $skey => $spremenljivka) {
- if ((int)$spremenljivka['hide_system'] == 1 && in_array($spremenljivka['variable'],array('email','ime','priimek','telefon','naziv','drugo'))) {
+ if (isset($spremenljivka['hide_system'])&&(int)$spremenljivka['hide_system'] == 1 && in_array($spremenljivka['variable'],array('email','ime','priimek','telefon','naziv','drugo'))) {
continue;
}
- $tip = $spremenljivka['tip'];
+ $tip = isset($spremenljivka['tip'])?$spremenljivka['tip']:null;
if (is_numeric($tip)
# tekstovnih tipov ne dodajamo
@@ -1731,7 +1753,7 @@ class SurveyMultiCrosstabs { foreach($spremenljivka['grids'] AS $gid => $grid) {
$sub = 0;
- if ($grid['variable'] != '') {
+ if (isset($grid['variable'])&&$grid['variable'] != '') {
$sub++;
$this->variablesList[$skey] = array(
'tip'=>$tip,
@@ -1830,7 +1852,7 @@ class SurveyMultiCrosstabs { else{
$this->selectedVars['ver'][$row['vrstni_red']] = $row;
-
+ $fullColSpan = 0;
$sql2 = sisplet_query("SELECT * FROM srv_mc_element WHERE table_id='$this->table_id' AND parent='$row[vrstni_red]' AND position='1'");
// Ce ni 2.nivoja
if(mysqli_num_rows($sql2) == 0){
@@ -1889,7 +1911,7 @@ class SurveyMultiCrosstabs { foreach($variables as $key => $variable){
$spr[$key] = $this->_HEADERS[$variables[$key]['spr']];
- $grid[$key] = $spr[$key]['grids'][$variables[$key]['grd']];
+ $grid[$key] = isset($spr[$key]['grids'][$variables[$key]['grd']])?$spr[$key]['grids'][$variables[$key]['grd']]:null;
$sekvenca = $variables[$key]['seq'];
$spr_checkbox = false;
@@ -1910,7 +1932,7 @@ class SurveyMultiCrosstabs { $sekvence[$key] = explode('_',$spr[$key]['sequences']);
}
}
- if ($spr1['tip'] == 16) {
+ if ($spr[$key]['tip'] == 16) {
foreach ($grid[$key]['variables'] AS $_variables) {
@@ -1946,7 +1968,7 @@ class SurveyMultiCrosstabs { }
}
-
+ $crosstabVars = '';
// Nastavimo string s katerim filtriramo datoteko za prave stolpce
foreach($sekvence as $sekvenca){
if(count($sekvenca) > 1){
@@ -1968,6 +1990,7 @@ class SurveyMultiCrosstabs { $avgVar = 1;
}
+ $delez=array();
// Ce imamo racunanje deleza
if($this->table_settings[$this->table_id]['delezVar'] != ''){
@@ -2046,9 +2069,9 @@ class SurveyMultiCrosstabs { $status_filter = $this->_CURRENT_STATUS_FILTER;
# dodamo status filter za vse sekvence checkbox-a da so == 1
- if ($additional_status_filter != null) {
+ /* if ($additional_status_filter != null) {
$status_filter .= $additional_status_filter;
- }
+ } */
# odstranimo vse zapise, kjer katerakoli od variabel vsebuje missing
$_allMissing_answers = SurveyMissingValues::GetMissingValuesForSurvey(array(1,2,3));
@@ -2144,7 +2167,8 @@ class SurveyMultiCrosstabs { $sql = sisplet_query("SELECT * FROM srv_mc_table WHERE id='$this->table_id' AND ank_id='$this->ank_id' AND usr_id='$global_user_id'");
$current_table = mysqli_fetch_array($sql);
- echo '<h2>'.$lang['srv_multicrosstabs_tables'].'</h2>';
+ echo '<h2>'.$lang['srv_multicrosstabs_tables'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onclick="close_mc_tables(); return false;">✕</a></div>';
echo '<div id="mc_tables_left">';
@@ -2158,68 +2182,85 @@ class SurveyMultiCrosstabs { }
echo '</span>';
+
+ /*/ Cas kreiranja tabele
+ echo '<div id="table_create_time">';
+ $time_created = strtotime($current_table['time_created']);
+ echo $lang['srv_multicrosstabs_tables_time'].': <span class="bold">'.date("d.m.Y H:i", $time_created).'</span>';
+ echo '</div>';*/
- // Na dnu imamo gumba brisi in preimenuj
- echo '<div style="float:left;">';
- echo '<a href="#" onclick="mc_table_action(\'show_rename\'); return false;">'.$lang['srv_multicrosstabs_tables_rename'].'</a><br/>'."\n";
- echo '<a href="#" onclick="mc_table_action(\'show_delete\'); return false;">'.$lang['srv_multicrosstabs_tables_delete'].'</a>'."\n";
- echo '</div>';
+ // Na dnu imamo linka brisi in preimenuj
+ echo '<p class="blue pointer bottom8 top16" onClick="mc_table_action(\'show_rename\'); return false;">'.$lang['srv_multicrosstabs_tables_rename'].'</p>';
+ echo '<p class="blue pointer" onclick="mc_table_action(\'show_delete\'); return false;">'.$lang['srv_multicrosstabs_tables_delete'].'</p>';
- // Cas kreirranja tabele
- echo '<div style="float:right; text-align:right;">';
- $time_created = strtotime($current_table['time_created']);
- echo $lang['srv_multicrosstabs_tables_time'].': <span class="bold">'.date("d.m.Y H:i", $time_created).'</span><br />';
- echo '</div>';
-
echo '</div>';
// cover Div
- echo '<div id="dsp_cover_div"></div>'."\n";
+ echo '<div id="dsp_cover_div"></div>';
- echo '<span class="clr"></span>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-black" onclick="close_mc_tables(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium white-blue" onClick="mc_table_action(\'show_new\'); return false;">'.$lang['srv_multicrosstabs_tables_add'].'</button>';
+ echo '<button class="medium blue" onClick="use_mc_table(); return false;">'.$lang['srv_multicrosstabs_tables_use'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
- echo '<div style="position:absolute; bottom:15px; right:15px;">';
-
- //echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="save_creport_profile(); return false;"><span>'.$lang['save'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="use_mc_table(); return false;"><span>'.$lang['srv_multicrosstabs_tables_use'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_multicrosstabs_tables_add'].'"><div class="buttonwrapper"><a class="ovalbutton" href="#" onclick="mc_table_action(\'show_new\'); return false;"><span>'.$lang['srv_multicrosstabs_tables_add'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton" href="#" onclick="close_mc_tables(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
-
- echo '</div>';
}
function displayMCTablesPopups(){
global $lang;
// div za kreacijo novega
- echo '<div id="newMCTable">';
+ echo '<div id="newMCTable" class="divPopUp PopUpNarrow">';
echo '<h2>'.$lang['srv_new_table'].'</h2>';
-
- echo '<div style="float:left; width:400px; text-align:right;">'.$lang['srv_multicrosstabs_tables_name'].': '."\n";
- echo '<input id="newMCTableName" name="newMCTableName" type="text" value="" size="50" /></div>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="mc_table_action(\'new\'); return false;"><span>'.$lang['save'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="mc_table_action(\'cancel_new\'); return false;"><span>'.$lang['srv_zapri'].'</span></a></span></span>'."\n";
- echo '<div class="floatRight clr" style="padding: 15px 5px 15px 0;"><a href="#" onClick="mc_table_action(\'goto_archive\');">'.$lang['srv_analiza_arhiv'].'</a></div>';
- echo '</div>'."\n";
+
+ echo '<div class="setting_holder">';
+ echo '<label>'.$lang['srv_multicrosstabs_tables_name'].':</label>';
+ echo '<input id="newMCTableName" class="text large" name="newMCTableName" type="text" value="" />';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-black" onclick="mc_table_action(\'goto_archive\');">'.$lang['srv_analiza_arhiv'].'</button>';
+ echo '<button class="medium white-blue" onClick="mc_table_action(\'cancel_new\'); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onClick="mc_table_action(\'new\'); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za preimenovanje
- echo '<div id="renameMCTable">'.$lang['srv_multicrosstabs_tables_name'].': '."\n";
- echo '<input id="renameMCTableName" name="renameMCTableName" type="text" size="45" />'."\n";
- echo '<input id="renameMCTableId" type="hidden" value="' . $this->table_id . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="mc_table_action(\'rename\'); return false;"><span>'.$lang['srv_multicrosstabs_tables_rename_short'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="mc_table_action(\'cancel_rename\'); return false;"><span>'.$lang['srv_zapri'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="renameMCTable" class="divPopUp PopUpNarrow">';
+
+ echo '<div class="setting_holder">';
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_multicrosstabs_tables_name'].':</label>';
+ echo '<input id="renameMCTableName" name="renameMCTableName" class="text large" type="text" value="' . $this->table_id . '" />';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="mc_table_action(\'cancel_rename\'); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="mc_table_action(\'rename\');">'.$lang['srv_multicrosstabs_tables_rename_short'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za brisanje
- echo '<div id="deleteMCTable">'.$lang['srv_multicrosstabs_tables_delete_confirm'].': <span id="deleteMCTableName" style="font-weight:bold;"></span>?'."\n";
- echo '<input id="deleteMCTableId" type="hidden" value="' . $this->table_id . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="mc_table_action(\'delete\'); return false;"><span>'.$lang['srv_multicrosstabs_tables_delete_short'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="mc_table_action(\'cancel_delete\'); return false;"><span>'.$lang['srv_zapri'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="deleteMCTable" class="divPopUp PopUpNarrow">';
+
+ echo $lang['srv_multicrosstabs_tables_delete_confirm'].': <span id="deleteMCTableName" class="semi-bold"></span>?';
+ echo '<input id="deleteMCTableId" type="hidden" value="' . $this->table_id . '" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="mc_table_action(\'cancel_delete\'); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="mc_table_action(\'delete\');">'.$lang['srv_multicrosstabs_tables_delete_short'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
}
// Vrnemo vse tabele uporabnika
|