Redesign - analize - crosstab

This commit is contained in:
pero1203 2022-02-02 09:44:45 +01:00
parent ec366dd89f
commit 430cbdd6a4
5 changed files with 112 additions and 60 deletions

View File

@ -430,6 +430,9 @@ class SurveyCrosstabs {
echo '<div class="title">'.$lang['srv_crosstab_label1'].'</div>';
echo '<div id="crossLeftDropdowns">';
foreach($this->variabla1 AS $_key => $variabla1) {
echo '<div id="v1_'.$_key.'" class="variabla_line">';
@ -463,6 +466,9 @@ class SurveyCrosstabs {
echo '</div>';
}
echo '</div>';
if ((int)$this->variabla1['0']['seq'] > 0) {
echo '<button class="blue small" id="crosstab_add_new" onclick="add_new_variable(\'1\');">'.$lang['srv_multicrosstabs_add'].'</button>';
}
@ -490,6 +496,8 @@ class SurveyCrosstabs {
# za vsako novo spremenljivko 2 nardimo svoj select
if (count($this->variabla2) > 0) {
echo '<div id="crossRightDropdowns">';
foreach($this->variabla2 AS $_key => $variabla2) {
echo '<div id="v2_'.$_key.'" class="variabla_line">';
@ -530,7 +538,10 @@ class SurveyCrosstabs {
echo '</div>';
}
echo '</div>';
if ((int)$this->variabla1['0']['seq'] > 0) {
echo '<button class="blue small" id="crosstab_add_new" onclick="add_new_variable(\'2\');">'.$lang['srv_multicrosstabs_add'].'</button>';
}
@ -864,13 +875,26 @@ class SurveyCrosstabs {
# izrišemo tabelo
echo '<div class="table_holder">';
# hi2
// Zgornja vrstca
echo '<div class="top_line">';
// hi2
echo '<div class="hi2">';
if ($this->displayHi2 == true) {
echo '<div class="hi2">';
echo '&#x3A7;<sup>2</sup> = ';
echo $this->formatNumber($crosstabs['hi2'], 3, '');
echo '</div>';
echo $this->formatNumber($crosstabs['hi2'], 3, '');
}
echo '</div>';
// Zvezdica za vkljucitev v porocilo
$spr2 = $v_first['seq'].'-'.$v_first['spr'].'-'.$v_first['grd'];
$spr1 = $v_second['seq'].'-'.$v_second['spr'].'-'.$v_second['grd'];
SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=5, $sub_type=0, $spr1, $spr2);
echo '</div>';
# najprej izrišemo naslovne vrstice
#Zadnja kolona: Če imamo vodoravno checkboxe in gledamo enote, potem kolono s summo malo razmaknemo
@ -881,6 +905,7 @@ class SurveyCrosstabs {
$addVerticalSpace = 0;
}
echo '<div class="table_crosstab_div">';
echo '<table class="table_crosstab" sq1="'.$v_first['seq'].'" sp1="'.$v_first['spr'].'" gd1="'.$v_first['grd'].'" sq2="'.$v_second['seq'].'" sp2="'.$v_second['spr'].'" gd2="'.$v_second['grd'].'">';
echo '<tr class="row1">';
@ -965,7 +990,7 @@ class SurveyCrosstabs {
echo '<td class="cell_noPadding '.($this->enableInspect && ((int)$crosstabs_value[$ckey1][$ckey2] > 0) ? ' ct_inspect' : '').'" k1="'.$ckey1.'" k2="'.$ckey2.'" n1="'.$crossVariabla1['naslov'].'" n2="'.$crossVariabla2['naslov'].'" v1="'.$crossVariabla1['vr_id'].'" v2="'.$crossVariabla2['vr_id'].'">';
# prikazujemo eno ali več od: frekvenc, odstotkov, residualov
echo '<table class="ct_in_tbl">';
echo '<table class="cell_table">';
if ($this->crossChk0) {
# izpišemo frekvence crostabov
@ -991,7 +1016,7 @@ class SurveyCrosstabs {
echo '<tr>';
echo '<td class="cell_noPadding '.$css_bt.'">';
echo '<table class="anl_tbl_crosstab fullWidth fullHeight">';
echo '<table class="cell_table">';
echo '<tr>';
$col=0;
@ -1046,7 +1071,7 @@ class SurveyCrosstabs {
echo '<tr>';
echo '<td class="cell_noPadding '.$css_bt.'">';
echo '<table class="anl_tbl_crosstab fullWidth fullHeight" style="padding:0px; margin:0px;">';
echo '<table class="cell_table">';
echo '<tr>';
$col=0;
@ -1095,7 +1120,7 @@ class SurveyCrosstabs {
// vedno rišemo zadnji stolpec.
echo '<td class="cell_noPadding">';
echo '<table class="anl_tbl_crosstab fullWidth fullHeight" style="padding:0px; margin:0px;">';
echo '<table class="cell_table">';
if ($this->crossChk0) {
echo '<tr>';
echo '<td class="cell_value ctbCll crostabSuma" colspan="' . ( $this->crossChk1 + $this->crossChk2 + $this->crossChk3 ).'">';
@ -1151,32 +1176,21 @@ class SurveyCrosstabs {
}
}
#Zadnja vrstica. Če imamo navpično checkboxe in gledamo enote, potem vrstico z summo malo razmaknemo
$cssBT = 'anl_bt';
if ( $crosstabs['isCheckbox']['spr2'] == true && $this->crossNavVsEno == true) {
echo '<tr>';
echo '<td class="'.$cssBT.'">&nbsp;</th>';
echo '<td class="'.$cssBT.'">&nbsp;</th>';
echo '<td class="'.$cssBT.'" colspan="'.count($crosstabs['options1']).'">&nbsp;</th>';
echo '<td class="'.$cssBT.'">&nbsp;</th>';
echo '</tr>';
$cssBT = '';
}
$cntY++;
echo '<tr>';
$css_backY = ' rsdl_bck_variable1';
echo '<td class="anl_bb anl_bt anl_bl anl_ac red anl_ita anl_bck_text_0'.$css_backY.' ctbCll">' . $lang['srv_analiza_crosstab_skupaj'] . '</td>';
// skupni sestevki po stolpcih
// skupni sestevki po stolpcih
if (count($crosstabs['options1']) > 0)
foreach ($crosstabs['options1'] as $ckey1 => $crossVariabla1) {
echo '<td class="cell_noPadding">';
{
# prikazujemo eno od treh možnosti
echo '<table class="anl_tbl_crosstab fullWidth fullHeight" style="padding:0px; margin:0px;">';
echo '<table class="cell_table">';
if ($this->crossChk0) {
echo '<tr>';
echo '<td class="cell_value ctbCll crostabSuma" colspan="'.($this->crossChk1 + $this->crossChk2 + $this->crossChk3).'">';
@ -1218,7 +1232,7 @@ class SurveyCrosstabs {
# zadnja celica z skupno sumo
echo '<td class="cell_noPadding">';
{
echo '<table class="anl_tbl_crosstab fullWidth fullHeight" style="padding:0px; margin:0px;">';
echo '<table class="cell_table">';
if ($this->crossChk0) {
echo '<tr>';
echo '<td class="cell_value ctbCll crostabSuma" colspan="'.($this->crossChk1 + $this->crossChk2 + $this->crossChk3).'">';
@ -1284,18 +1298,14 @@ class SurveyCrosstabs {
# če smo v break dodamo še povprečja
echo '<td>&nbsp;</td>';
}
echo '</tr>';
}
echo '</table>';
echo '</div>';
// Zvezdica za vkljucitev v porocilo
$spr2 = $v_first['seq'].'-'.$v_first['spr'].'-'.$v_first['grd'];
$spr1 = $v_second['seq'].'-'.$v_second['spr'].'-'.$v_second['grd'];
SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=5, $sub_type=0, $spr1, $spr2);
// Izrisemo legendo
$this->displayCrosstabCheckboxes();

View File

@ -14,12 +14,6 @@ function add_new_variable(which) {
var spr = new Array();
var grid = new Array();
if (which == '2' ) {
//$('#crossRightHolder #crosstab_add_new').hide();
} else {
//$('#crossLeftHolder #crosstab_add_new').hide();
}
$('select[name=crosstab_variable_'+which+']').each(function(index,el) {
sequence.push($(el).val());
});
@ -32,19 +26,17 @@ function add_new_variable(which) {
$.post("ajax.php?t=crosstab&a=add_new_variable", {anketa:srv_meta_anketa_id, which:which, sequence:sequence, spr:spr, grid:grid, crossNavVsEno:crossNavVsEno}, function(response) {
if (which == '2' ) {
$(response).appendTo('#crossRightHolder');
$(response).appendTo('#crossRightDropdowns');
} else {
$(response).appendTo('#crossLeftHolder');
$(response).appendTo('#crossLeftDropdowns');
}
});
}
function crs_remove_variable(what) {
$(what).parent().remove();
if ( $(what).parent().find('select').val() > 0 ) {
change_crosstab();
}
$(what).parent().parent().remove();
change_crosstab();
}
function change_crosstab (action) {

View File

@ -15810,10 +15810,21 @@ iframe#ifmcontentstoprint {
#div_analiza_data.crosstabs #crosstab_tables .table_holder:last-child {
border-bottom: 0;
}
#div_analiza_data.crosstabs #crosstab_tables .table_holder .hi2 {
#div_analiza_data.crosstabs #crosstab_tables .table_holder .top_line {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
#div_analiza_data.crosstabs #crosstab_tables .table_holder .top_line .hi2 {
font-weight: 600;
}
#div_analiza_data.crosstabs #crosstab_tables .table_holder .top_line .custom_report_include a {
text-decoration: none;
}
#div_analiza_data.crosstabs #crosstab_tables .table_holder .table_crosstab_div {
overflow-x: auto;
}
#div_analiza_data.crosstabs #crosstab_tables .table_holder table.table_crosstab td.cell_var {
width: 260px;
text-align: left;
@ -15825,12 +15836,19 @@ iframe#ifmcontentstoprint {
#div_analiza_data.crosstabs #crosstab_tables .table_holder table.table_crosstab td.cell_value {
text-align: center;
padding: 4px 8px;
border: 0;
}
#div_analiza_data.crosstabs #crosstab_tables .table_holder .custom_report_include {
margin-top: 16px;
#div_analiza_data.crosstabs #crosstab_tables .table_holder table.table_crosstab table.cell_table > tbody > tr {
border-bottom: 1px #E5E5E5 dashed;
}
#div_analiza_data.crosstabs #crosstab_tables .table_holder .custom_report_include a {
text-decoration: none;
#div_analiza_data.crosstabs #crosstab_tables .table_holder table.table_crosstab table.cell_table > tbody > tr:last-child {
border-bottom: 0;
}
#div_analiza_data.crosstabs #crosstab_tables .table_holder table.table_crosstab table.cell_table > tbody > tr table.cell_table tr td {
border-right: 1px #FFC700 solid;
}
#div_analiza_data.crosstabs #crosstab_tables .table_holder table.table_crosstab table.cell_table > tbody > tr table.cell_table tr td:last-child {
border-right: 0;
}
#div_analiza_data.crosstabs #crosstab_tables .table_holder #crosstab_legend {
display: flex;

View File

@ -21,8 +21,10 @@ $light-gray2: #F2F2F2;
$light-gray: #F8F8F8;
$yellow: #FFC700;
$red: #FF0000;
$light-red: #FFEFEF;
$green: #00C437;
$light-green: #a8eea8;
$light-green2: #E3F6DE;

View File

@ -84,11 +84,28 @@
border-bottom: 0;
}
.hi2{
.top_line{
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
font-weight: 600;
.hi2{
font-weight: 600;
}
.custom_report_include{
a{
text-decoration: none;
}
}
}
.table_crosstab_div{
overflow-x: auto;
}
table.table_crosstab{
td.cell_var{
@ -106,16 +123,29 @@
td.cell_value{
text-align: center;
padding: 4px 8px;
}
}
.custom_report_include{
margin-top: 16px;
a{
text-decoration: none;
border: 0;
}
}
table.cell_table{
> tbody > tr{
border-bottom: 1px $gray dashed;
&:last-child{
border-bottom: 0;
}
table.cell_table tr td{
border-right: 1px $yellow solid;
&:last-child{
border-right: 0;
}
}
}
}
}
#crosstab_legend{
display: flex;