summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.SurveyCustomReport.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/classes/class.SurveyCustomReport.php')
-rw-r--r--admin/survey/classes/class.SurveyCustomReport.php671
1 files changed, 364 insertions, 307 deletions
diff --git a/admin/survey/classes/class.SurveyCustomReport.php b/admin/survey/classes/class.SurveyCustomReport.php
index c0d9acf..94bcda2 100644
--- a/admin/survey/classes/class.SurveyCustomReport.php
+++ b/admin/survey/classes/class.SurveyCustomReport.php
@@ -19,6 +19,11 @@ class SurveyCustomReport {
public $creportProfile = 0; // trenutno izbrani profil porocila
public $creportAuthor = 0; // trenutno izbrani avtor porocila ki se ga ureja
+ public $db_table = null;
+ public $headFileName = null;
+ public $dataFileName = null;
+ public $dataFileStatus = null;
+
public $expanded = 0; // skrcen(0) ali razsirjen(1) nacin
function __construct($anketa) {
@@ -29,9 +34,8 @@ class SurveyCustomReport {
// 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();
// Inicializiramo in polovimo nastavitve missing profila
SurveyStatusProfiles::Init($this->ank_id);
@@ -89,55 +93,90 @@ class SurveyCustomReport {
ob_start();
}
- if ($this->isArchive == false && $this->publicCReport == false) {
+ if ($this->isArchive == false && $this->publicCReport == false) {
echo '<input type="hidden" value="'.$this->expanded.'" id="creport_expanded" />';
$this->displayProfilePopups();
// Prva vrstica - seznam poročil
- echo '<div>';
- echo '<span class="pointer blue bold" style="font-size:14px;" onClick="showCReportProfiles();">'.$lang['srv_custom_report_list'].'</span>';
- echo ' <span id="creport_profile_setting_plus" class="pointer faicon add icon-as_link spaceLeft" title="'.$lang['srv_custom_report_create'].'" style="padding-bottom:1px;"></span>';
- echo '</div>';
-
- // Naslov
- echo '<h2 style="display:inline-block; color:#333;">';
-
- // Profil
- if($this->creportProfile == 0){
-
- $what = 'creport_default_profile_name';
- $sql = sisplet_query("SELECT value FROM srv_user_setting_for_survey WHERE sid='$this->ank_id' AND uid='$this->creportAuthor' AND what='$what'");
-
- if(mysqli_num_rows($sql) == 0){
- $name = $lang['srv_custom_report_default'];
- }
- else{
- $row = mysqli_fetch_array($sql);
- $name = $row['value'];
- }
- }
- else{
- $profile = $this->getProfile($this->creportProfile);
- $name = $profile['name'];
- }
- echo '<span style="font-weight: normal;">';
- echo $lang['srv_custom_report_profile'].': <span class="bold pointer blue" onClick="showCReportProfiles();">"'.$name.'"</span>';
- echo '</span>';
+ echo '<div id="custom_report_top">';
+
+
+ // Seznam porocil
+ echo ' <div class="custom_report_list">';
+
+ // Seznam avtorjevih porocil
+
+ // Prvo default porocilo
+ $sql = sisplet_query("SELECT value FROM srv_user_setting_for_survey WHERE sid='$this->ank_id' AND uid='$global_user_id' AND what='creport_default_profile_name'");
+ if(mysqli_num_rows($sql) == 0){
+ echo '<div class="list_item '.($this->creportProfile == 0 && $this->creportAuthor == $global_user_id ? 'active' : '').'" onClick="change_creport_profile(\'0\', \''.$global_user_id.'\');">';
+ echo $lang['srv_custom_report_default'];
+ echo '</div>';
+ }
+ else{
+ $row = mysqli_fetch_array($sql);
+
+ echo '<div class="list_item '.($this->creportProfile == 0 && $this->creportAuthor == $global_user_id ? 'active' : '').'" onClick="change_creport_profile(\'0\', \''.$global_user_id.'\');">';
+ echo $row['value'];
+ echo '</div>';
+ }
+
+ // Loop po ostalih lastnih porocilih
+ $sqlReports = sisplet_query("SELECT * FROM srv_custom_report_profiles WHERE ank_id='$this->ank_id' AND usr_id='$global_user_id'");
+ while($rowReports = mysqli_fetch_array($sqlReports)){
+ echo '<div class="list_item '.($this->creportProfile == $rowReports['id'] && $this->creportAuthor == $global_user_id ? 'active' : '').'" onClick="change_creport_profile(\''.$rowReports['id'].'\', \''.$global_user_id.'\');">';
+ echo $rowReports['name'];
+ echo '</div>';
+ }
+
+ // Loop po deljenih porocilih
+ $sqlSharedReports = sisplet_query("SELECT s.*, u.email FROM srv_custom_report_share s, users u WHERE ank_id='$this->ank_id' AND share_usr_id='$global_user_id' AND u.id=s.author_usr_id");
+ while($rowSharedReports = mysqli_fetch_array($sqlSharedReports)){
+
+ // Ce gre za osnovno porocilo ki ga ne more pobrisati
+ if($rowSharedReports['profile_id'] == 0){
+
+ // Dobimo ime osnovnega porocila
+ $what = 'creport_default_profile_name';
+ $sqlN = sisplet_query("SELECT value FROM srv_user_setting_for_survey WHERE sid='$this->ank_id' AND uid='".$rowSharedReports['author_usr_id']."' AND what='$what'");
+ if(mysqli_num_rows($sqlN) == '0'){
+ $default_name = $lang['srv_custom_report_default'];
+ }
+ else{
+ $rowN = mysqli_fetch_array($sqlN);
+ $default_name = ($rowN['value'] == '') ? $lang['srv_custom_report_default'] : $rowN['value'];
+ }
+
+ echo '<div class="list_item '.($this->creportProfile == 0 && $this->creportAuthor == $rowSharedReports['author_usr_id'] ? 'active' : '').'" onClick="change_creport_profile(\'0\', \''.$rowSharedReports['author_usr_id'].'\');" id="creport_profile_0_'.$rowSharedReports['author_usr_id'].'" author="'.$rowSharedReports['author_usr_id'].'" value="0">';
+ echo $default_name . ' ('.$rowSharedReports['email'].')';
+ echo '</div>';
+ }
+ // Ce gre za dodatno porocilo ga imamo normalno v bazi
+ else{
+ $sql = sisplet_query("SELECT * FROM srv_custom_report_profiles WHERE ank_id='$this->ank_id' AND usr_id='".$rowSharedReports['author_usr_id']."'");
+ while($row = mysqli_fetch_array($sql)){
+ echo '<div class="list_item '.($this->creportProfile == $row['id'] && $this->creportAuthor == $rowSharedReports['author_usr_id'] ? 'active' : '').'" onClick="change_creport_profile(\''.$row['id'].'\', \''.$rowSharedReports['author_usr_id'].'\');">';
+ echo $row['name'] . ' ('.$rowSharedReports['email'].')';
+ echo '</div>';
+ }
+ }
+ }
+
+ echo '</div>';
- echo '</h2>';
// Edit in add porocilo
- echo '<div style="display:inline-block; line-height:10px;">';
- echo ' <span id="creport_profile_setting_edit" class="faicon edit icon-as_link spaceLeft" style="margin-bottom:1px;" title="'.$lang['srv_custom_report_edit'].'"></span>';
+ echo ' <span id="creport_profile_setting_edit" class="faicon edit" title="'.$lang['srv_custom_report_edit'].'"></span>';
+ echo ' <span id="creport_profile_setting_plus" class="faicon add" title="'.$lang['srv_custom_report_create'].'"></span>';
// Osnova porocila (prazna, vsi grafi, vse frekvence...) - prikazemo samo ce je porocilo prazno
if($this->checkEmpty($this->ank_id)){
- echo '<span style="font-size:14px; font-weight: normal; margin-left: 20px;">';
- echo $lang['srv_custom_report_base'].': ';
+ echo '<span class="custom_report_base">';
+ echo $lang['srv_custom_report_base'].':';
- echo '<select name="custom_report_base" id="custom_report_base" onChange="addCustomReportAllElementsAlert(this.value);">';
+ echo '<select name="custom_report_base" id="custom_report_base" class="dropdown medium" onChange="addCustomReportAllElementsAlert(this.value);">';
echo ' <option value="0">'.$lang['srv_custom_report_base_0'].'</option>';
echo ' <option value="1">'.$lang['srv_sumarnik'].'</option>';
echo ' <option value="2">'.$lang['srv_frequency'].'</option>';
@@ -146,37 +185,27 @@ class SurveyCustomReport {
echo '</select>';
echo '</span>';
}
- echo '</div>';
-
- // Stevilo vseh porocil
- $sqlC = sisplet_query("SELECT id FROM srv_custom_report_profiles WHERE ank_id='$this->ank_id' AND usr_id='$global_user_id'");
- $report_count = mysqli_num_rows($sqlC);
- if($report_count > 0)
- echo '<div style="margin:-12px 0 20px 0; color:#555555; font-size:10px;">'.$lang['srv_custom_report_count'].': '.($report_count + 1).'</div>';
-
-
- // Preklop na skrcen/razsirjen pogled in predogled
- if ($this->isArchive == false && $this->publicCReport == false) {
-
- echo '<div id="custom_report_view">';
-
- if($this->expanded == 0)
- echo '<a href="index.php?anketa='.$this->ank_id.'&a=analysis&m=analysis_creport&expanded=1"><span class="faicon compress"></span> '.$lang['srv_custom_report_expanded_0'].'</a>';
- else
- echo '<a href="index.php?anketa='.$this->ank_id.'&a=analysis&m=analysis_creport&expanded=0"><span class="faicon expand"></span> '.$lang['srv_custom_report_expanded_1'].'</a>';
-
- // Preview
- echo ' &nbsp;<a title="'.$lang['srv_custom_report_preview'].'" onClick="showCReportPreview(); return false;" href="#"><span class="faicon preview pointer"></span> '.$lang['srv_custom_report_preview_short'].'</a>';
-
- echo '</div>';
- }
+
+ echo '</div>';
+
- }
-
- echo '<div id="custom_report_elements">';
+ // Preklop na skrcen/razsirjen pogled in predogled
+ echo '<div id="custom_report_view">';
+
+ if($this->expanded == 0)
+ echo '<a href="index.php?anketa='.$this->ank_id.'&a=analysis&m=analysis_creport&expanded=1" class="noline"><span class="faicon compress"></span> '.$lang['srv_custom_report_expanded_0'].'</a>';
+ else
+ echo '<a href="index.php?anketa='.$this->ank_id.'&a=analysis&m=analysis_creport&expanded=0" class="noline"><span class="faicon expand"></span> '.$lang['srv_custom_report_expanded_1'].'</a>';
+
+ // Preview
+ echo '<a title="'.$lang['srv_custom_report_preview'].'" class="noline" onClick="showCReportPreview(); return false;" href="#"><span class="faicon monitor"></span> '.$lang['srv_custom_report_preview_short'].'</a>';
+
+ echo '</div>';
+ }
-
+ echo '<div id="custom_report_elements" class="div_analiza_holder">';
+
// ce arhiviramo imamo razsirjene elemente
$this->expanded = ($this->isArchive == false && $this->publicCReport == false) ? $this->expanded : 1;
@@ -191,52 +220,63 @@ class SurveyCustomReport {
echo '<ul id="custom_report_sortable">';
- if ($this->isArchive == false && $this->publicCReport == false) {
- echo '<div class="report_element_separator '.($this->expanded == 1 ? 'expanded' : '').'">';
+
+ if ($this->isArchive == false && $this->publicCReport == false) {
+ echo '<li class="report_element_separator '.($this->expanded == 1 ? 'expanded' : '').'">';
echo '<div class="add_element">';
$this->addNewElement(-1);
echo '</div>';
- echo '</div>';
+ echo '</li>';
}
-
+
+
// Loop po vseh dodanih elementih porocila
while($row = mysqli_fetch_array($sql)){
- echo '<li id="sortable_report_element_'.$row['id'].'">';
+ // V arhivih nimamo pagebreakov
+ if( $row['type'] == '-1' && ($this->isArchive != false || $this->publicCReport != false) ){
+ continue;
+ }
+
+
+ echo '<li id="sortable_report_element_'.$row['id'].'" class="'.($row['type'] == '-1' ? 'report_element_break' : 'report_element_standard').'">';
+
// Pagebreak
- if($row['type'] == '-1'){
- if ($this->isArchive == false && $this->publicCReport == false){
- $this->displayBreak($row);
- }
+ if($row['type'] == '-1'){
+ echo '<div class="report_element">';
+ $this->displayBreak($row);
+ echo '</div>';
}
+ // Navaden element
else{
echo '<div class="report_element '.($this->expanded == 1 && $this->isArchive == false && $this->publicCReport == false ? ' active':'').'" id="report_element_'.$row['id'].'">';
$this->displayReportElement($row['id'], $this->expanded);
echo '</div>';
}
+ // Separator za elementom
if ($this->isArchive == false && $this->publicCReport == false) {
- echo '<div class="report_element_separator '.($this->expanded == 1 ? 'expanded' : '').'" id="report_element_separator_'.$row['id'].'">';
- if($row['vrstni_red'] < $counter){
- echo '<div class="add_element">';
- $this->addNewElement($row['id']);
- echo '</div>';
- }
- echo '</div>';
+ echo '<div id="report_element_separator_'.$row['id'].'" class="report_element_separator '.($row['vrstni_red'] == $counter ? 'last_separator' : '').'" >';
+ echo '<div class="add_element">';
+ $this->addNewElement($row['id']);
+ echo '</div>';
+ echo '</div>';
}
-
- echo '</li>';
+
+ echo '</li>';
}
+
echo '</ul>';
}
- else
- echo '<br /><br />';
+ else{
+ echo '<div class="first_element_text">'.$lang['srv_custom_report_begin'].'</div>';
+ }
+
if ($this->isArchive == false && $this->publicCReport == false) {
// Dodajanje novega porocila
- echo '<br />';
- echo '<div class="add_element">';
+ echo '<div class="add_element bottom">';
$this->addNewElement();
echo '</div>';
}
@@ -319,7 +359,7 @@ class SurveyCustomReport {
echo '<div class="report_element_settings" '.($expanded == 0 ? ' style="display:none;"' : '').'>';
// Tip izpisa (sums, freq, opisne...)
- echo '<select name="report_element_type_'.$reportElement['id'].'" id="report_element_type_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'type\', this.value)">';
+ echo '<select name="report_element_type_'.$reportElement['id'].'" id="report_element_type_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'type\', this.value)">';
// Ce ni izbrana
if ( $reportElement['type'] == null || $reportElement['type'] == 0 ) {
@@ -329,11 +369,14 @@ class SurveyCustomReport {
echo '<option value="2" '.($reportElement['type'] == 2 ? 'selected="selected"' : '').'>'.$lang['srv_frequency'].'</option>';
echo '<option value="3" '.($reportElement['type'] == 3 ? 'selected="selected"' : '').'>'.$lang['srv_descriptor_short'].'</option>';
echo '<option value="4" '.($reportElement['type'] == 4 ? 'selected="selected"' : '').'>'.$lang['srv_chart'].'</option>';
- echo '<option value="5" '.($reportElement['type'] == 5 ? 'selected="selected"' : '').'>'.$lang['srv_crosstabs'].'</option>';
- echo '<option value="10" '.($reportElement['type'] == 10 ? 'selected="selected"' : '').'>'.$lang['srv_multicrosstab'].'</option>';
- echo '<option value="6" '.($reportElement['type'] == 6 ? 'selected="selected"' : '').'>'.$lang['srv_means_label'].'</option>';
- echo '<option value="7" '.($reportElement['type'] == 7 ? 'selected="selected"' : '').'>'.$lang['srv_ttest'].'</option>';
- echo '<option value="9" '.($reportElement['type'] == 9 ? 'selected="selected"' : '').'>'.$lang['srv_break'].'</option>';
+
+ if(SurveyInfo::getInstance()->getSurveyColumn("survey_type") != 0){
+ echo '<option value="5" '.($reportElement['type'] == 5 ? 'selected="selected"' : '').'>'.$lang['srv_crosstabs'].'</option>';
+ //echo '<option value="10" '.($reportElement['type'] == 10 ? 'selected="selected"' : '').'>'.$lang['srv_multicrosstab'].'</option>';
+ echo '<option value="6" '.($reportElement['type'] == 6 ? 'selected="selected"' : '').'>'.$lang['srv_means_label'].'</option>';
+ echo '<option value="7" '.($reportElement['type'] == 7 ? 'selected="selected"' : '').'>'.$lang['srv_ttest'].'</option>';
+ echo '<option value="9" '.($reportElement['type'] == 9 ? 'selected="selected"' : '').'>'.$lang['srv_break'].'</option>';
+ }
echo '</select>';
@@ -342,7 +385,7 @@ class SurveyCustomReport {
if($reportElement['type'] > 0 && $reportElement['type'] < 5){
// Izbira spremneljivke
- echo ' <select style="margin-left:20px;" name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
+ echo ' <select name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
// Ce ni izbrana
if ( $reportElement['spr1'] == null || $reportElement['spr1'] == '' ) {
@@ -351,7 +394,7 @@ class SurveyCustomReport {
# preberemo header
foreach (SurveyAnalysis::$_HEADERS AS $spid => $spremenljivka) {
# preverjamo ali je meta
- if (($spremenljivka['tip'] != 'm'
+ if ((isset($spremenljivka['tip'])&&$spremenljivka['tip'] != 'm'
&& in_array($spremenljivka['tip'], SurveyAnalysis::$_FILTRED_TYPES ))
/*&& in_array($spremenljivka['tip'],array(1,2,3,6,7,8,16,17,18,20) )*/) {
@@ -363,7 +406,7 @@ class SurveyCustomReport {
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'];
+ $only_valid += (isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])?(int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']:0);
}
}
}
@@ -389,7 +432,7 @@ class SurveyCustomReport {
$crossData2 = explode("-", $reportElement['spr2']);
// Izbira spremneljivke 1
- echo ' <select style="margin-left:20px;" name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
+ echo ' <select name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr1'] == null || $reportElement['spr1'] == 0 ) {
@@ -398,11 +441,11 @@ class SurveyCustomReport {
foreach ($variables as $variable) {
$text = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-undefined';
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-undefined';
echo '<option value="'.$value.'" '
. (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($crossData1[0] == $variable['sequence'] && $crossData1[0] != null) ? ' selected="selected" ' : '')
+ . ( (isset($variable['sequence']) && $crossData1[0] == $variable['sequence'] && $crossData1[0] != null) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $text . '</option>';
@@ -412,7 +455,7 @@ class SurveyCustomReport {
// Izbira spremneljivke 2
- echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
+ echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr2'] == null || $reportElement['spr2'] == 0 ) {
@@ -420,12 +463,12 @@ class SurveyCustomReport {
}
foreach ($variables as $variable) {
$text = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
-
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-'.$variable['grd_id'];
+
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-'.(isset($variable['grd_id'])?$variable['grd_id']:'');
echo '<option value="'.$value.'" '
. (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($crossData2[0] == $variable['sequence'] && $crossData2[0] != null) ? ' selected="selected" ' : '')
+ . ( (isset($variable['sequence']) && $crossData2[0] == $variable['sequence'] && $crossData2[0] != null) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $text . '</option>';
@@ -434,8 +477,11 @@ class SurveyCustomReport {
echo '</select>';
// Izbira podtipa (tabela / graf)
- echo ' <input style="margin-left:20px;" type="radio" value="0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />Tabela ';
- echo '<input type="radio" value="1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />Graf';
+ echo ' <input style="margin-left:16px;" type="radio" value="0" id="report_element_sub_type_'.$reportElement['id'].'_0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_0">'.$lang['srv_table'].'</label>';
+
+ echo ' <input type="radio" value="1" id="report_element_sub_type_'.$reportElement['id'].'_1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_1">'.$lang['srv_chart'].'</label>';
}
// Nastavitve za MULTICROSSTABE
@@ -448,7 +494,7 @@ class SurveyCustomReport {
}
else{
// Izbira ze ustvarjene tabele
- echo ' <select style="margin-left:20px;" name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
+ echo ' <select name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr1'] == null || $reportElement['spr1'] == 0 ) {
@@ -473,7 +519,7 @@ class SurveyCustomReport {
$meanData2 = explode("-", $reportElement['spr2']);
// Izbira spremneljivke 1
- echo ' <select style="margin-left:20px;" name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
+ echo ' <select name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr1'] == null || $reportElement['spr1'] == 0 ) {
@@ -482,11 +528,12 @@ class SurveyCustomReport {
foreach ($variables1 as $variable) {
$text = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-undefined';
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-undefined';
+
echo '<option value="'.$value.'" '
- . (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($meanData1[0] == $variable['sequence'] && $meanData1[0] != null) ? ' selected="selected" ' : '')
+ . (( isset($variable['canChoose'])&&(int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
+ . ( (isset($variable['sequence'])&&$meanData1[0] == $variable['sequence'] && $meanData1[0] != null) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $text . '</option>';
@@ -496,7 +543,7 @@ class SurveyCustomReport {
// Izbira spremneljivke 2
- echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
+ echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr2'] == null || $reportElement['spr2'] == 0 ) {
@@ -505,11 +552,12 @@ class SurveyCustomReport {
foreach ($variables2 as $variable) {
$text = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-undefined';
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-undefined';
+
echo '<option value="'.$value.'" '
- . (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($meanData2[0] == $variable['sequence'] && $meanData2[0] != null) ? ' selected="selected" ' : '')
+ . (( isset($variable['canChoose'])&&(int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
+ . ( (isset($variable['sequence'])&&$meanData2[0] == $variable['sequence'] && $meanData2[0] != null) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $text . '</option>';
@@ -519,8 +567,11 @@ class SurveyCustomReport {
// Izbira podtipa (tabela / graf)
- echo ' <input style="margin-left:20px;" type="radio" value="0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />Tabela ';
- echo '<input type="radio" value="1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />Graf';
+ echo ' <input style="margin-left:16px;" type="radio" value="0" id="report_element_sub_type_'.$reportElement['id'].'_0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_0">'.$lang['srv_table'].'</label>';
+
+ echo ' <input type="radio" value="1" id="report_element_sub_type_'.$reportElement['id'].'_1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_1">'.$lang['srv_chart'].'</label>';
}
// Nastavitve za TTEST
@@ -535,7 +586,7 @@ class SurveyCustomReport {
$ttestData2 = explode("-", $reportElement['spr2']);
// Izbira spremneljivke 1
- echo ' <select style="margin-left:20px;" name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
+ echo ' <select name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr1'] == null || $reportElement['spr1'] == 0 ) {
@@ -544,11 +595,11 @@ class SurveyCustomReport {
foreach ($variables as $variable) {
$text = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-undefined';
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-undefined';
echo '<option value="'.$value.'" '
- . (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($ttestData1[0] == $variable['sequence'] && $ttestData1[0] != null) ? ' selected="selected" ' : '')
+ . (( isset($variable['canChoose'])&&(int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
+ . ( (isset($variable['sequence'])&&$ttestData1[0] == $variable['sequence'] && $ttestData1[0] != null) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $text . '</option>';
@@ -558,7 +609,7 @@ class SurveyCustomReport {
// Izbira spremneljivke 2
- echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
+ echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr2'] == null || $reportElement['spr2'] == 0 ) {
@@ -567,11 +618,11 @@ class SurveyCustomReport {
foreach ($numerus as $variable) {
$text = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-undefined';
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-undefined';
echo '<option value="'.$value.'" '
- . (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($ttestData2[0] == $variable['sequence'] && $ttestData2[0] != null) ? ' selected="selected" ' : '')
+ . (( isset($variable['canChoose'])&&(int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
+ . ( (isset($variable['sequence'])&&$ttestData2[0] == $variable['sequence'] && $ttestData2[0] != null) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $text . '</option>';
@@ -581,8 +632,11 @@ class SurveyCustomReport {
// Izbira podtipa (tabela / graf)
- echo ' <input style="margin-left:20px;" type="radio" value="0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />Tabela ';
- echo '<input type="radio" value="1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />Graf';
+ echo ' <input style="margin-left:16px;" type="radio" value="0" id="report_element_sub_type_'.$reportElement['id'].'_0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_0">'.$lang['srv_table'].'</label>';
+
+ echo ' <input type="radio" value="1" id="report_element_sub_type_'.$reportElement['id'].'_1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_1">'.$lang['srv_chart'].'</label>';
// Izbira dveh podvariabel za prvo variablo
@@ -601,7 +655,7 @@ class SurveyCustomReport {
// Izbira spremneljivke 1
$variables = $this->classInstance->getVariableList(2);
- echo ' <select style="margin-left:20px;" name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
+ echo ' <select name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr1'] == null || $reportElement['spr1'] == 0){
@@ -610,11 +664,11 @@ class SurveyCustomReport {
if (count($variables)) {
foreach ($variables as $variable) {
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-undefined';
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-undefined';
echo '<option value="'.$value.'"'
- . ((int)$variable['canChoose'] == 1 ? '' : ' disabled="disabled" ')
- . ($breakData1[0] == $variable['sequence'] && $breakData1[0] != null ? ' selected="selected"':''). '> ';
+ . (isset($variable['canChoose'])&&(int)$variable['canChoose'] == 1 ? '' : ' disabled="disabled" ')
+ . (isset($variable['sequence']) && $breakData1[0] == $variable['sequence'] && $breakData1[0] != null ? ' selected="selected"':''). '> ';
$text = ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' )) . $variable['variableNaslov'];
$text = (strlen($text) > 60) ? substr($text, 0, 57).'...' : $text;
@@ -630,7 +684,7 @@ class SurveyCustomReport {
// Izbira spremneljivke 2
$variables = $this->getBreakDependentVariableList();
- echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
+ echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr2'] == null || $reportElement['spr2'] == 0 ) {
@@ -639,14 +693,14 @@ class SurveyCustomReport {
foreach ($variables as $variable) {
// Ce ni ista kot prva izbrana
- if($variable['spr_id'] != $breakData1[1]){
+ if(isset($variable['spr_id'])&&$variable['spr_id'] != $breakData1[1]){
$text = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-'.$variable['grd_id'];
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-'.(isset($variable['grd_id'])?$variable['grd_id']:'');
echo '<option value="'.$value.'" '
- . (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($breakData2[0] == $variable['sequence'] && $breakData2[0] != null) ? ' selected="selected" ' : '')
+ . (( isset($variable['canChoose'])&&(int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
+ . ( (isset($variable['sequence'])&&$breakData2[0] == $variable['sequence'] && $breakData2[0] != null) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $text . '</option>';
@@ -656,8 +710,11 @@ class SurveyCustomReport {
echo '</select>';
// Izbira podtipa (tabela / graf)
- echo ' <input style="margin-left:20px;" type="radio" value="0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />'.$lang['srv_table'];
- echo ' <input type="radio" value="1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />'.$lang['srv_chart'];
+ echo ' <input style="margin-left:16px;" type="radio" value="0" id="report_element_sub_type_'.$reportElement['id'].'_0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_0">'.$lang['srv_table'].'</label>';
+
+ echo ' <input type="radio" value="1" id="report_element_sub_type_'.$reportElement['id'].'_1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_1">'.$lang['srv_chart'].'</label>';
}
echo '</div>';
@@ -669,14 +726,13 @@ class SurveyCustomReport {
global $site_path;
global $lang;
- echo '<div class="creport_bottom_settings">';
-
- echo '<a href="#" onclick="doArchiveCReport();" title="'.$lang['srv_analiza_arhiviraj_ttl'].'"><span class="faicon arhiv black very_large"></span></a>';
- echo '<a href="#" onclick="createArchiveCReportBeforeEmail();" title="'.$lang['srv_analiza_arhiviraj_email_ttl'] . '"><span class="faicon arhiv_mail black very_large"></span></a>';
+ echo '<div class="analysis_bottom_settings printHide">';
- echo '<a href="#" onClick="printAnaliza(\'CReport\'); return false;" title="'.$lang['hour_print2'].'"><span class="faicon print icon-grey_dark_link"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=creport_pdf&anketa=' . $this->ank_id) . '" target="_blank" title="'.$lang['PDF_Izpis'].'"><span class="faicon pdf black very_large"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=creport_rtf&anketa=' . $this->ank_id) . '" target="_blank" title="'.$lang['RTF_Izpis'].'"><span class="faicon rtf black very_large"></span></a>';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=creport_rtf&anketa=' . $this->ank_id) . '" target="_blank" title="'.$lang['RTF_Izpis'].'"><span class="faicon rtf"></span></a>';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=creport_pdf&anketa=' . $this->ank_id) . '" target="_blank" title="'.$lang['PDF_Izpis'].'"><span class="faicon pdf"></span></a>';
+
+ echo '<a href="#" onclick="doArchiveCReport();" title="'.$lang['srv_analiza_arhiviraj_ttl'].'"><span class="faicon arhiv"></span></a>';
+ echo '<a href="#" onclick="createArchiveCReportBeforeEmail();" title="'.$lang['srv_analiza_arhiviraj_email_ttl'] . '"><span class="faicon arhiv_mail"></span></a>';
echo '</div>';
}
@@ -685,12 +741,12 @@ class SurveyCustomReport {
function displayTTestSubVar($reportElement){
global $lang;
- echo '<div id="ttestVariablesSpan" style="margin: 10px 0 10px 80px;">';
+ echo '<div id="ttestVariablesSpan" style="margin: 0 0 0 32px;">';
$ttestData1 = explode("-", $reportElement['spr1']);
$spr = $ttestData1[1];
- $check1 = $ttestData1[3];
- $check2 = $ttestData1[4];
+ $check1 = isset($ttestData1[3])?$ttestData1[3]:null;
+ $check2 = isset($ttestData1[4])?$ttestData1[4]:null;
# poiscemo pripadajoce variable
@@ -707,7 +763,8 @@ class SurveyCustomReport {
$checked = ($check1 == $spr.'_'.$sekvenca.'_'.$value || $check2 == $spr.'_'.$sekvenca.'_'.$value) ? true : false;
$disabled = ($check1 != null && $check2 != null && !$checked) ? ' disabled="disabled"' : '';
- echo '<label '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />('.$value.') - '.$option.'</label><br/>';
+ echo '<input id="subTtest_'.$reportElement['id'].'_'.$value.'" name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />';
+ echo '<label for="subTtest_'.$reportElement['id'].'_'.$value.'" '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'>('.$value.') - '.$option.'</label><br/>';
}
break;
@@ -718,7 +775,8 @@ class SurveyCustomReport {
$checked = ($check1 == $spr.'_'.$variable['sequence'].'_'.$option || $check2 == $spr.'_'.$variable['sequence'].'_'.$option) ? true : false;
$disabled = ($check1 != null && $check2 != null && !$checked) ? ' disabled="disabled"' : '';
- echo '<label '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />('.$variable['variable'].') - '.$variable['naslov'].'</label><br/>';
+ echo '<input id="subTtest_'.$reportElement['id'].'_'.$variable['variable'].'" name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />';
+ echo '<label for="subTtest_'.$reportElement['id'].'_'.$variable['variable'].'" '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'>('.$variable['variable'].') - '.$variable['naslov'].'</label><br/>';
}
break;
@@ -730,20 +788,22 @@ class SurveyCustomReport {
$checked = ($check1 == $spr.'_'.$sekvenca.'_'.$value || $check2 == $spr.'_'.$sekvenca.'_'.$value) ? true : false;
$disabled = ($check1 != null && $check2 != null && !$checked) ? ' disabled="disabled"' : '';
- echo '<label '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />('.$value.') - '.$option.'</label><br/>';
+ echo '<input id="subTtest_'.$reportElement['id'].'_'.$value.'" name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />';
+ echo '<label for="subTtest_'.$reportElement['id'].'_'.$value.'" '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'>('.$value.') - '.$option.'</label><br/>';
}
break;
case 16: #mcheck
#nardimo inpute za vse opcije
- # poi��emo pripadajo�o sekvenco
+ # poiščemo pripadajočo sekvenco
#nardimo inpute za vse opcije
$option = '1';
foreach ($_spr_data['grids'][$grid]['variables'] as $vid => $variable) {
$checked = ($check1 == $spr.'_'.$variable['sequence'].'_'.$option || $check2 == $spr.'_'.$variable['sequence'].'_'.$option) ? true : false;
$disabled = ($check1 != null && $check2 != null && !$checked) ? ' disabled="disabled"' : '';
- echo '<label '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />('.$variable['variable'].') - '.$variable['naslov'].'</label><br/>';
+ echo '<input id="subTtest_'.$reportElement['id'].'_'.$variable['variable'].'" name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />';
+ echo '<label for="subTtest_'.$reportElement['id'].'_'.$variable['variable'].'" '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'>('.$variable['variable'].') - '.$variable['naslov'].'</label><br/>';
}
break;
@@ -783,20 +843,10 @@ class SurveyCustomReport {
// Ikone za razsiritev, kopiranje, brisanje posameznega elementa
echo '<div class="report_element_icons '.($expanded == 1 ? ' active' : '').'">';
- // Print element
- echo ' <span class="faicon print_small icon-grey_dark_link" style="margin-left: 10px;" title="'.$lang['PRN_Izpis'].'" onClick="printCustomReportElement(\''.strip_tags($title).'\', \'report_element_'.$reportElement['id'].'\'); return false;"></span>';
// Kopiraj element
echo ' <span class="faicon copy icon-grey_dark_link" style="margin-left: 10px;" title="'.$lang['srv_custom_report_copy'].'" onClick="copyCustomReportElement(\''.$reportElement['id'].'\');"></span>';
// Brisi element
echo ' <span class="faicon delete icon-grey_dark_link" style="margin-left: 10px;" title="'.$lang['srv_custom_report_delete'].'" onClick="deleteCustomReportElement(\''.$reportElement['id'].'\');"></span>';
-
- // Uredi element
- /*if($reportElement['type'] != 8)
- if($expanded == 1)
- echo ' <span class="sprites pointer arrow_contract" style="margin-left: 10px;" title="'.$lang['srv_custom_report_contract'].'" onClick="expandCustomReportElement(\''.$reportElement['id'].'\');"></span>';
- else
- echo ' <span class="sprites pointer arrow_expand" style="margin-left: 10px;" title="'.$lang['srv_custom_report_expand'].'" onClick="expandCustomReportElement(\''.$reportElement['id'].'\');"></span>';
- */
echo '</div>';
@@ -835,17 +885,13 @@ class SurveyCustomReport {
function displayReportElementText($reportElement, $expanded){
global $lang;
- echo '<div class="report_element_text report_element_comment" '.($expanded == 0 ? ' style="display:none;"' : '').'>';
+ echo '<div class="report_element_text report_element_comment" '.($expanded == 0 ? 'style="display:none;"' : '').'>';
if($expanded == 1 && $this->isArchive == false && $this->publicCReport == false){
- echo '<span class="bold">'.$lang['srv_inv_archive_comment'].':</span>';
-
- echo '<span class="faicon edit2" title="'.$lang['srv_editor_title'].'" style="cursor:pointer; float:right; margin:20px 18px 0 0;" onclick="creport_load_editor(this); return false;"></span>';
-
- /*echo '<textarea style="width:100%; height:80px;" class="creport_textarea" el_id="'.$reportElement['id'].'" id="report_element_text_'.$reportElement['id'].'" onBlur="editCustomReportElement(\''.$reportElement['id'].'\', \'text\', this.value)">';
- echo $reportElement['text'];
- echo '</textarea>';*/
+ echo '<span class="title">'.$lang['srv_inv_archive_comment'].':</span>';
+ echo '<span class="faicon edit" title="'.$lang['srv_editor_title'].'" onclick="creport_load_editor(this); return false;"></span>';
+
echo '<div class="creport_text_inline" contenteditable="true" el_id="'.$reportElement['id'].'">';
echo $reportElement['text'];
echo '</div>';
@@ -862,14 +908,11 @@ class SurveyCustomReport {
// Izrisemo sumarnik element
function displaySum($reportElement, $expanded){
global $lang;
-
- // Naslov
- $spr = SurveyAnalysis::$_HEADERS[$reportElement['spr1']];
-
- if($reportElement['spr1'] == '')
+
+ if(!isset($reportElement['spr1'])||$reportElement['spr1'] == '')
$title = $lang['srv_select_spr'];
else
- $title = $spr['variable'].' - '.$spr['naslov'];
+ $title = SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['variable'].' - '.SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['naslov'];
$subtitle = '('.$lang['srv_sumarnik'].')';
$title .= ' <span class="anl_ita">'.$subtitle.'</span>';
@@ -883,7 +926,7 @@ class SurveyCustomReport {
// Izpis tabele ali grafa za posamezen vnos
echo '<div class="report_element_data" '.($expanded == 0 ? ' style="display:none;"' : '').'>';
- if($expanded != 0)
+ if(isset($reportElement['spr1'])&&$expanded != 0)
SurveyAnalysis::displaySums($reportElement['spr1']);
echo '</div>';
@@ -892,14 +935,11 @@ class SurveyCustomReport {
// Izrisemo sumarnik element
function displayFreq($reportElement, $expanded){
global $lang;
-
- // Naslov
- $spr = SurveyAnalysis::$_HEADERS[$reportElement['spr1']];
-
- if($reportElement['spr1'] == '')
+
+ if(!isset($reportElement['spr1'])||$reportElement['spr1'] == '')
$title = $lang['srv_select_spr'];
else
- $title = $spr['variable'].' - '.$spr['naslov'];
+ $title = SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['variable'].' - '.SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['naslov'];
$subtitle = '('.$lang['srv_frequency'].')';
$title .= ' <span class="anl_ita">'.$subtitle.'</span>';
@@ -914,7 +954,7 @@ class SurveyCustomReport {
// Izpis tabele ali grafa za posamezen vnos
echo '<div class="report_element_data" '.($expanded == 0 ? ' style="display:none;"' : '').'>';
- if($expanded != 0)
+ if(isset($reportElement['spr1'])&&$expanded != 0)
SurveyAnalysis::displayFrequency($reportElement['spr1']);
echo '</div>';
@@ -924,13 +964,10 @@ class SurveyCustomReport {
function displayDesc($reportElement, $expanded){
global $lang;
- // Naslov
- $spr = SurveyAnalysis::$_HEADERS[$reportElement['spr1']];
-
- if($reportElement['spr1'] == '')
+ if(isset($reportElement['spr1']) || $reportElement['spr1'] == '')
$title = $lang['srv_select_spr'];
else
- $title = $spr['variable'].' - '.$spr['naslov'];
+ $title = SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['variable'].' - '.SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['naslov'];
$subtitle = '('.$lang['srv_descriptor'].')';
$title .= ' <span class="anl_ita">'.$subtitle.'</span>';
@@ -945,7 +982,7 @@ class SurveyCustomReport {
// Izpis tabele ali grafa za posamezen vnos
echo '<div class="report_element_data" '.($expanded == 0 ? ' style="display:none;"' : '').'>';
- if($expanded != 0){
+ if(isset($reportElement['spr1'])&&$expanded != 0){
SurveyAnalysis::displayDescriptives($reportElement['spr1']);
@@ -960,13 +997,10 @@ class SurveyCustomReport {
function displayChart($reportElement, $expanded){
global $lang;
- // Naslov
- $spr = SurveyAnalysis::$_HEADERS[$reportElement['spr1']];
-
- if($reportElement['spr1'] == '')
+ if(!isset($reportElement['spr1'])||$reportElement['spr1'] == '')
$title = $lang['srv_select_spr'];
else
- $title = $spr['variable'].' - '.$spr['naslov'];
+ $title = SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['variable'].' - '.SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['naslov'];
$subtitle = '('.$lang['srv_chart'].')';
$title .= ' <span class="anl_ita">'.$subtitle.'</span>';
@@ -1010,7 +1044,8 @@ class SurveyCustomReport {
$crossData1 = explode("-", $reportElement['spr1']);
$crossData2 = explode("-", $reportElement['spr2']);
- $this->classInstance->setVariables($crossData1[0],$crossData1[1],$crossData1[2],$crossData2[0],$crossData2[1],$crossData2[2]);
+ $this->classInstance->setVariables($crossData1[0],(isset($crossData1[1])?$crossData1[1]:null),(isset($crossData1[2])?$crossData1[2]:null),
+ $crossData2[0],(isset($crossData2[1])?$crossData2[1]:null),(isset($crossData2[2])?$crossData2[2]:null));
// Naslov
if($reportElement['spr1'] == '' || $reportElement['spr2'] == '')
@@ -1024,7 +1059,7 @@ class SurveyCustomReport {
# za multicheckboxe popravimo naslov, na podtip
$sub_q1 = null;
$sub_q2 = null;
- if ($spr1['tip'] == '6' || $spr1['tip'] == '7' || $spr1['tip'] == '16' || $spr1['tip'] == '17' || $spr1['tip'] == '18' || $spr1['tip'] == '19' || $spr1['tip'] == '20' || $spr1['tip'] == '21' ) {
+ /* if ($spr1['tip'] == '6' || $spr1['tip'] == '7' || $spr1['tip'] == '16' || $spr1['tip'] == '17' || $spr1['tip'] == '18' || $spr1['tip'] == '19' || $spr1['tip'] == '20' || $spr1['tip'] == '21' ) {
foreach ($spr1['grids'] AS $grid) {
foreach ($grid['variables'] AS $variable) {
if ($variable['sequence'] == $v_first['seq']) {
@@ -1040,12 +1075,12 @@ class SurveyCustomReport {
}
}
}
- }
+ } */
if ($sub_q1 == null) {
$sub_q1 .= strip_tags($spr1['naslov']);
$sub_q1 .= ($show_variables_values == true ? '&nbsp;('.strip_tags($spr1['variable']).')' : '');
}
- if ($spr2['tip'] == '6' || $spr2['tip'] == '7' || $spr2['tip'] == '16' || $spr2['tip'] == '17' || $spr2['tip'] == '18' || $spr2['tip'] == '19' || $spr2['tip'] == '20' || $spr2['tip'] == '21') {
+ /* if ($spr2['tip'] == '6' || $spr2['tip'] == '7' || $spr2['tip'] == '16' || $spr2['tip'] == '17' || $spr2['tip'] == '18' || $spr2['tip'] == '19' || $spr2['tip'] == '20' || $spr2['tip'] == '21') {
foreach ($spr2['grids'] AS $grid) {
foreach ($grid['variables'] AS $variable) {
if ($variable['sequence'] == $v_second['seq']) {
@@ -1061,7 +1096,7 @@ class SurveyCustomReport {
}
}
}
- }
+ } */
if ($sub_q2 == null) {
$sub_q2 .= strip_tags($spr2['naslov']);
$sub_q2 .= ($show_variables_values == true ? ' ('.strip_tags($spr2['variable']).')' : '');
@@ -1165,9 +1200,9 @@ class SurveyCustomReport {
// Napolnimo podatke meansom
$meanData1 = explode("-", $reportElement['spr2']);
- $v_first = array('seq' => $meanData1[0], 'spr' => $meanData1[1], 'grd' => $meanData1[2]);
+ $v_first = array('seq' => $meanData1[0], 'spr' => (isset($meanData1[1])?$meanData1[1]:null), 'grd' => (isset($meanData1[2])?$meanData1[2]:null));
$meanData2 = explode("-", $reportElement['spr1']);
- $v_second = array('seq' => $meanData2[0], 'spr' => $meanData2[1], 'grd' => $meanData2[2]);
+ $v_second = array('seq' => $meanData2[0], 'spr' => (isset($meanData2[1])?$meanData2[1]:null), 'grd' => (isset($meanData1[2])?$meanData2[2]:null));
$means[0] = $this->classInstance->createMeans($v_first, $v_second);
@@ -1355,7 +1390,7 @@ class SurveyCustomReport {
$variables = $this->getBreakDependentVariableList();
foreach ($variables as $variable) {
- if($breakData2[0] == $variable['sequence']){
+ if(isset($variable['sequence'])&&$breakData2[0] == $variable['sequence']){
//$label2 = $variable['variableNaslov'];
$label2 = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
@@ -1464,13 +1499,13 @@ class SurveyCustomReport {
# zloopamo skozi header in dodamo variable (potrebujemo posamezne sekvence)
foreach ($this->classInstance->_HEADERS AS $skey => $spremenljivka) {
- $tip = $spremenljivka['tip'];
+ $tip = isset($spremenljivka['tip'])?$spremenljivka['tip']:null;
$_dropdown_condition = (is_numeric($tip) && $tip != 5 && $tip != 8 && $tip != 9) ? true : false;
if ($_dropdown_condition) {
$cnt_all = (int)$spremenljivka['cnt_all'];
- if ( $cnt_all == '1' || in_array($tip, array(1,2,3,4,7,17,18,21,22,25)) || ($tip == 6 && $spremenljivka['enota'] == 2) ) {
+ if ( $cnt_all == '1' || in_array($tip, array(1,2,3,4,7,17,18,21,22,25)) || ($tip == 6 && isset($spremenljivka['enota'])&&$spremenljivka['enota'] == 2) ) {
# pri tipu radio ali select dodamo tisto variablo ki ni polje "drugo"
if ($tip == 1 || $tip == 3 ) {
@@ -1537,7 +1572,7 @@ class SurveyCustomReport {
# imamo več gridov - tabele
foreach($spremenljivka['grids'] AS $gid => $grid) {
$sub = 0;
- if ($grid['variable'] != '') {
+ if (isset($grid['variable'])&&$grid['variable'] != '') {
$sub++;
$variablesList[] = array(
'tip'=>$tip,
@@ -1588,9 +1623,9 @@ class SurveyCustomReport {
function displayBreak($reportElement){
global $lang;
- echo '<span class="report_element_pb" title="'.$lang['srv_rem_pagebreak'].'" onClick="deleteCustomReportElement(\''.$reportElement['id'].'\');">';
-
- echo '</span>';
+ echo '<div class="pb_text" title="'.$lang['srv_rem_pagebreak'].'" onClick="deleteCustomReportElement(\''.$reportElement['id'].'\');">'.$lang['srv_rem_pagebreak'].'</div>';
+
+ echo '<div class="pb_line"></div>';
}
// Izrisemo element z besedilom
@@ -1600,25 +1635,15 @@ class SurveyCustomReport {
// Glava elementa (naslov, ikone...)
$this->displayReportElementHead($reportElement, $expanded);
- echo '<div class="report_element_text" style="padding-top:15px; '.($expanded == 0 ? ' display:none;' : '').'">';
-
- /*if($expanded == 1){
-
- echo '<span class="faicon edit2" title="'.$lang['srv_editor_title'].'" style="cursor:pointer; display:block; float:right;" onclick="creport_load_editor(this); return false;"></span>';
-
- echo '<textarea style="width:100%; height:80px;" class="creport_textarea" el_id="'.$reportElement['id'].'" id="report_element_text_'.$reportElement['id'].'" onBlur="editCustomReportElement(\''.$reportElement['id'].'\', \'text\', this.value)">';
- echo $reportElement['text'];
- echo '</textarea>';
- }*/
- //else{
+ echo '<div class="report_element_text" '.($expanded == 0 ? 'style="display:none;"' : '').'">';
+
if ($this->isArchive == false && $this->publicCReport == false) {
- echo '<span class="faicon edit2" title="'.$lang['srv_editor_title'].'" style="cursor:pointer; display:block; float:right; margin:20px 18px 0 0;" onclick="creport_load_editor(this); return false;"></span>';
+ echo '<span class="faicon edit" title="'.$lang['srv_editor_title'].'" onclick="creport_load_editor(this); return false;"></span>';
}
- echo '<br /><div class="creport_text_inline" '.($this->isArchive == false && $this->publicCReport == false ? ' contenteditable="true"':'').' el_id="'.$reportElement['id'].'">';
+ echo '<div class="creport_text_inline" '.($this->isArchive == false && $this->publicCReport == false ? ' contenteditable="true"':'').' el_id="'.$reportElement['id'].'">';
echo $reportElement['text'];
echo '</div>';
- //}
echo '</div>';
}
@@ -1630,19 +1655,18 @@ class SurveyCustomReport {
// Dodajanje vmes in na zacetku
if($id != 0){
- echo '<span class="pointer" title="'.$lang['srv_custom_report_add'].'" style="margin-left: 20px; " onClick="addEmptyCustomReportElement(\''.$id.'\');"><span class="faicon add small icon-blue_light"></span> '.$lang['srv_custom_report_add'].'</span>';
+ echo '<span title="'.$lang['srv_custom_report_add'].'" onClick="addEmptyCustomReportElement(\''.$id.'\');"><span class="faicon add"></span>'.$lang['srv_custom_report_add'].'</span>';
- echo '<span class="pointer" title="'.$lang['srv_custom_report_add_text'].'" style="margin-left: 20px;" onClick="addTextCustomReportElement(\''.$id.'\');"><span class="faicon add small icon-blue_dark"></span> '.$lang['srv_custom_report_add_text'].'</span>';
+ echo '<span title="'.$lang['srv_custom_report_add_text'].'" onClick="addTextCustomReportElement(\''.$id.'\');"><span class="faicon add"></span>'.$lang['srv_custom_report_add_text'].'</span>';
if($id > 0)
- echo '<span class="pointer" title="'.$lang['srv_add_pagebreak'].'" style="margin-left: 20px;" onClick="addPBCustomReportElement(\''.$id.'\');"><span class="faicon paragraph icon-blue"></span> '.$lang['srv_add_pagebreak'].'</span>';
+ echo '<span title="'.$lang['srv_add_pagebreak'].'" onClick="addPBCustomReportElement(\''.$id.'\');"><span class="faicon paragraph"></span>'.$lang['srv_add_pagebreak'].'</span>';
}
// Dodajanje na dnu (brez page breaka)
if($id == 0){
- echo '<span class="pointer" style="margin:-10px 0 10px 20px;" onClick="addEmptyCustomReportElement(\''.$id.'\');"><span class="faicon add small icon-blue_light" title="'.$lang['srv_custom_report_add'].'"></span> '.$lang['srv_custom_report_add'].'</span>';
-
- echo '<span class="pointer" style="margin:-10px 0 10px 20px;" onClick="addTextCustomReportElement(\''.$id.'\');"><span class="faicon add small icon-blue_dark" title="'.$lang['srv_custom_report_add_text'].'"></span> '.$lang['srv_custom_report_add_text'].'</span>';
+ echo '<button class="medium white-blue" onClick="addTextCustomReportElement(\''.$id.'\');" title="'.$lang['srv_custom_report_add_text'].'">'.$lang['srv_custom_report_add_text'].'</button>';
+ echo '<button class="medium blue" onClick="addEmptyCustomReportElement(\''.$id.'\');" title="'.$lang['srv_custom_report_add'].'">'.$lang['srv_custom_report_add'].'</button>';
}
}
@@ -1709,10 +1733,11 @@ class SurveyCustomReport {
}
$profile = $this->getProfile($this->creportProfile);
- $name = $profile['name'];
+ //$name = $profile['name'];
- echo '<h2>'.$lang['srv_custom_report_profile_title'].'</h2>';
+ echo '<h2>'.$lang['srv_custom_report_profile_title'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="close_creport_profile(); return false;">✕</a></div>';
echo '<div id="creport_settings_profiles_left">';
@@ -1774,19 +1799,18 @@ class SurveyCustomReport {
// Ce je izbran custom profil imamo na dnu gumba brisi in preimenuj, pri default pa samo preimenuj
// Preimenuje, brise in share lahko samo za lastna porocila
if($this->creportAuthor == $global_user_id){
- echo '<div style="float:left; margin-bottom:10px;">';
- echo '<a href="#" onclick="creport_profile_action(\'show_rename\'); return false;">'.$lang['srv_rename_profile'].'</a>'."\n";
+
+ echo '<p class="blue pointer top16 bottom8" onClick="creport_profile_action(\'show_rename\'); return false;">'.$lang['srv_rename_profile'].'</p>';
if($this->creportProfile > 0)
- echo '<br /><a href="#" onclick="creport_profile_action(\'show_delete\'); return false;">'.$lang['srv_delete_profile'].'</a>'."\n";
+ echo '<p class="blue pointer bottom8" onclick="creport_profile_action(\'show_delete\'); return false;">'.$lang['srv_delete_profile'].'</p>';
+
+ echo '<p class="blue pointer bottom16" onclick="creport_profile_action(\'show_share\'); return false;">'.$lang['srv_custom_report_share'].'</p>';
- // Deli poročilo z drugimi uredniki
- echo '<br /><a href="#" onclick="creport_profile_action(\'show_share\'); return false;">'.$lang['srv_custom_report_share'].'</a>'."\n";
- echo '</div>';
}
- // Preberemo najkasneje editiran element (cas spreminjanja)
+ /*/ Preberemo najkasneje editiran element (cas spreminjanja)
$sqlt = sisplet_query("SELECT MAX(time_edit) FROM srv_custom_report WHERE ank_id='$this->ank_id' AND usr_id='$this->creportAuthor' AND profile='$this->creportProfile'");
if(mysqli_num_rows($sqlt) > 0){
$rowt = mysqli_fetch_array($sqlt);
@@ -1796,16 +1820,16 @@ class SurveyCustomReport {
$time_edit = $time_created;
// Cas kreirranja in urejanja profila
- echo '<div style="float:right; text-align:right;">';
+ echo '<div class="top16 bottom16">';
if($time_created != '' && $time_created != '0000-00-00 00:00:00'){
$time_created = strtotime($time_created);
- echo $lang['srv_custom_report_time_created'].': <span class="bold">'.date("d.m.Y H:i", $time_created).'</span><br />';
+ echo '<p>'.$lang['srv_custom_report_time_created'].': <span class="bold">'.date("d.m.Y H:i", $time_created).'</span></p>';
}
if($time_edit != '' && $time_edit != '0000-00-00 00:00:00'){
$time_edit = strtotime($time_edit);
- echo $lang['srv_custom_report_time_edited'].': <span class="bold">'.date("d.m.Y H:i", $time_edit).'</span>';
- }
+ echo '<p>'.$lang['srv_custom_report_time_edited'].': <span class="bold">'.date("d.m.Y H:i", $time_edit).'</span></p>';
+ }*/
echo '</div>';
@@ -1825,10 +1849,10 @@ class SurveyCustomReport {
$comment = $row['value'];
}
- echo '<span class="bold clr">'.$lang['srv_inv_archive_comment'].':</span>';
+ echo '<p>'.$lang['srv_inv_archive_comment'].':</p>';
// Komentar lahko popravlja samo avtor porocila
if($this->creportAuthor == $global_user_id)
- echo '<textarea onBlur="creport_profile_comment(this.value)">'.$comment.'</textarea>';
+ echo '<textarea class="textarea" onBlur="creport_profile_comment(this.value)">'.$comment.'</textarea>';
else
echo '<span>'.$comment.'</span>';
@@ -1837,48 +1861,70 @@ class SurveyCustomReport {
// cover Div
echo '<div id="dsp_cover_div"></div>'."\n";
-
- echo '<span class="clr"></span>';
- echo '<div style="position:absolute; bottom:20px; right:20px;">';
- echo '<span class="floatRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="use_creport_profile(); return false;"><span>'.$lang['srv_save_and_run_profile'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_custom_report_create'].'"><div class="buttonwrapper"><a class="ovalbutton" href="#" onclick="creport_profile_action(\'show_new\'); return false;"><span>'.$lang['srv_custom_report_create'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton" href="#" onclick="close_creport_profile(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-black" onClick="close_creport_profile(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium white-blue" onclick="creport_profile_action(\'show_new\'); return false;">'.$lang['srv_custom_report_create'].'</button>';
+ echo '<button class="medium blue" onClick="use_creport_profile(); return false;">'.$lang['srv_save_and_run_profile'].'</button>';
+ echo '</div>';
- echo '</div>';
}
function displayProfilePopups(){
global $lang;
- global $global_user_id;
+ //global $global_user_id;
$profile = $this->getProfile($this->creportProfile);
- $name = $profile['name'];
+ //$name = $profile['name'];
// div za kreacijo novega
echo '<div id="newCReportProfile">';
- echo '<div style="float:left; width:410px; text-align:right;">'.$lang['srv_custom_report_name'].': '."\n";
- echo '<input id="newCReportProfileName" name="newCReportProfileName" type="text" value="" size="50" /></div>'."\n";
- echo '<div style="float:left; width:410px; text-align:right; padding:5px 0px;">'.$lang['srv_inv_archive_comment'].': '."\n";
- echo '<input id="newCReportProfileComment" name="newCReportProfileComment" type="text" value="" size="50" /></div>'."\n";
- echo '<br /><br /><br /><br /><span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="creport_profile_action(\'new\'); return false;"><span>'.$lang['srv_analiza_arhiviraj_save'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="creport_profile_action(\'cancel_new\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
-
+
+ echo '<h2>'.$lang['srv_custom_report_create2'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="creport_profile_action(\'cancel_new\'); return false;">✕</a></div>';
+
+ echo '<p>'.$lang['srv_custom_report_name'].':</p>';
+ echo '<input id="newCReportProfileName" name="newCReportProfileName" type="text" value="" class="text large" />';
+
+ echo '<p class="top16">'.$lang['srv_inv_archive_comment'].':</p>';
+
+ echo '<input id="newCReportProfileComment" name="newCReportProfileComment" type="text" value="" class="text large" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="creport_profile_action(\'cancel_new\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="creport_profile_action(\'new\'); return false;">'.$lang['srv_analiza_arhiviraj_save'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
+
+
// div za preimenovanje
- echo '<div id="renameCReportProfile">'.$lang['srv_custom_report_name'].': '."\n";
- echo '<input id="renameCReportProfileName" name="renameCReportProfileName" type="text" size="45" />'."\n";
- echo '<input id="renameCReportProfileId" type="hidden" value="' . $this->creportProfile . '" />'."\n";
- echo '<br /><br /><span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="creport_profile_action(\'rename\'); return false;"><span>'.$lang['srv_rename_profile_yes'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="creport_profile_action(\'cancel_rename\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="renameCReportProfile">';
+
+ echo '<p>'.$lang['srv_custom_report_name'].':</p>';
+ echo '<input id="renameCReportProfileName" name="renameCReportProfileName" type="text" class="text large" />';
+
+ echo '<input id="renameCReportProfileId" type="hidden" value="' . $this->creportProfile . '" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="creport_profile_action(\'cancel_rename\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="creport_profile_action(\'rename\'); return false;">'.$lang['srv_rename_profile_yes'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za brisanje
- echo '<div id="deleteCReportProfile">'.$lang['srv_custom_report_delete_confirm'].': <span id="deleteCReportProfileName" style="font-weight:bold;"></span>?'."\n";
+ echo '<div id="deleteCReportProfile">';
+
+ echo '<p>'.$lang['srv_custom_report_delete_confirm'].': <span id="deleteCReportProfileName" class="semi-bold"></span>?</p>';
echo '<input id="deleteCReportProfileId" type="hidden" value="' . $this->creportProfile . '" />'."\n";
- echo '<br /><br /><span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="creport_profile_action(\'delete\'); return false;"><span>'.$lang['srv_delete_profile_yes'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="creport_profile_action(\'cancel_delete\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="creport_profile_action(\'cancel_delete\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="creport_profile_action(\'delete\'); return false;">'.$lang['srv_delete_profile_yes'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za deljenje z drugimi uredniki
echo '<div id="shareCReportProfile">';
@@ -1979,7 +2025,7 @@ class SurveyCustomReport {
echo '</script>';
echo '</head>';
- echo '<body style="margin:5px; padding:5px;" >';
+ echo '<body class="public_link creport" style="margin:5px; padding:5px;" >';
$what = 'creport_title_profile_'.$this->creportProfile;
$sql = sisplet_query("SELECT value FROM srv_user_setting_for_survey WHERE sid='$anketa' AND uid='$this->creportAuthor' AND what='$what'");
@@ -1990,10 +2036,11 @@ class SurveyCustomReport {
$row = mysqli_fetch_array($sql);
$titleString = $row['value'];
}
- //echo '<h2>'.$lang['srv_publc_creport_title_for'] .$titleString.'</h2>';
+
echo '<h2>'.$titleString.'</h2>';
echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $anketa . '" />';
+ echo '<input type="hidden" name="anketa_hash" id="srv_meta_anketa_hash" value="' . SurveyInfo::getInstance()->getSurveyHash() . '" />';
echo '<div id="analiza_data">';
# ponastavimo nastavitve- filter
@@ -2198,7 +2245,7 @@ class SurveyCustomReport {
$vrstni_red = $row['vrstni_red'] + 1;
$sqlInsert = sisplet_query("INSERT INTO srv_custom_report (ank_id, usr_id, vrstni_red, type, sub_type, spr1, spr2, text, profile, time_edit) VALUES('$this->ank_id', '$this->creportAuthor', '$vrstni_red', '$row[type]', '$row[sub_type]', '$row[spr1]', '$row[spr2]', '$row[text]', '$row[profile]', NOW())");
- if (!$s) echo mysqli_error($GLOBALS['connect_db']);
+ if (!$sqlInsert) echo mysqli_error($GLOBALS['connect_db']);
$this->displayReport();
@@ -2225,16 +2272,17 @@ class SurveyCustomReport {
// Alert pri dodajanju prvega
if($_GET['a'] == 'first_alert'){
+ echo '<h2>'.$lang['srv_custom_report_insert'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\'); $(\'#custom_report_alert\').fadeOut();">✕</a></div>';
+
echo $lang['srv_custom_report_first'];
- /*Ozna�eni element (tabela/graf) se je prenesel v poro�ilo po meri, kjer lahko prilagajate prikaz in zaporedje elementov*/
-
- echo '<a href="#" onClick="window.location = \''.$site_url.'admin/survey/index.php?anketa='.$this->ank_id.'&a=analysis&m=analysis_creport\';"><span style="display: block; padding-top: 10px;">'.$lang['srv_custom_report_link'].'</span></a>';
- echo '<div class="buttons">';
-
- //echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_blue" href="#" onClick="window.location = \''.$site_url.'admin/survey/index.php?anketa='.$this->ank_id.'&a=analysis&m=analysis_creport\';"><span>'.$lang['srv_custom_report'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton" href="#" onClick="$(\'#fade\').fadeOut(\'slow\'); $(\'#custom_report_alert\').fadeOut();"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
-
+
+ echo '<div class="button_holder">';
+
+ echo '<button class="medium white-blue" onClick="$(\'#fade\').fadeOut(\'slow\'); $(\'#custom_report_alert\').fadeOut();">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="window.location = \''.$site_url.'admin/survey/index.php?anketa='.$this->ank_id.'&a=analysis&m=analysis_creport\';">'.$lang['srv_custom_report_link'].'</button>';
+
echo '</div>';
}
@@ -2334,7 +2382,7 @@ class SurveyCustomReport {
// prikaz previewja
if($_GET['a'] == 'report_preview'){
- echo '<h1 style="text-align: center; margin-top: 20px;">'.$lang['export_analisys_creport'].': '.SurveyInfo::getInstance()->getSurveyTitle().'</h1>';
+ echo '<h1 style="text-align: center; margin: 32px 0;">'.$lang['export_analisys_creport'].': '.SurveyInfo::getInstance()->getSurveyTitle().'</h1>';
$this->setUpReturnAsHtml(false);
$this->setUpIsForArchive(true);
@@ -2343,10 +2391,8 @@ class SurveyCustomReport {
$this->displayReport();
- echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="window.close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- //echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="window.print();return false;"><span><img src="icons/icons/printer.png" alt="'.$lang['hour_print2'].'" vartical-align="middle" />'.$lang['hour_print2'].'</span></a></div></span>';
- echo '<div class="clr"></div>';
+ echo '<div id="navigationBottom" class="button_holder below float-right printHide">';
+ echo ' <button class="medium blue" onclick="window.close(); return false;">'.$lang['srv_zapri'].'</button>';
echo '</div>';
}
@@ -2354,14 +2400,15 @@ class SurveyCustomReport {
if($_GET['a'] == 'all_elements_alert'){
$type = (isset($_POST['type'])) ? $_POST['type'] : 0;
+
+ echo '<h2>'.$lang['srv_custom_report_comments_add'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\'); $(\'#custom_report_alert\').fadeOut();">✕</a></div>';
- echo '<div style="margin-bottom: 10px;">'.$lang['srv_custom_report_comments_alert'.$type].'</div>';
-
- echo '<div class="buttons">';
-
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton" href="#" onClick="$(\'#fade\').fadeOut(\'slow\'); $(\'#custom_report_alert\').fadeOut();"><span>'.$lang['srv_custom_report_alert_no'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onClick="addCustomReportAllElements(\''.$type.'\');"><span>'.$lang['srv_custom_report_alert_yes'].'</span></a></div></span>';
-
+ echo '<p class="bottom16">'.$lang['srv_custom_report_comments_alert'.$type].'</p>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#fade\').fadeOut(\'slow\'); $(\'#custom_report_alert\').fadeOut();">'.$lang['srv_custom_report_alert_no'].'</button>';
+ echo '<button class="medium blue" onclick="addCustomReportAllElements(\''.$type.'\');">'.$lang['srv_custom_report_alert_yes'].'</button>';
echo '</div>';
}
@@ -2537,8 +2584,6 @@ class SurveyCustomReport {
SurveyUserSetting :: getInstance()->saveSettings('default_creport_profile', $id);
SurveyUserSetting :: getInstance()->saveSettings('default_creport_author', $author);
-
- //$this->displayReport();
}
// urejanje komentarja profila
@@ -2558,9 +2603,12 @@ class SurveyCustomReport {
// prikazemo deljenje profila z drugimi uredniki
if($_GET['a'] == 'shareProfileShow') {
-
- echo '<span class="bold clr" style="display:block; margin-bottom:25px;">'.$lang['srv_custom_report_share_long'].':</span>'."\n";
-
+
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_custom_report_share_long'].':</span>';
+
+
if (isset ($_POST['id'])){
$id = $_POST['id'];
@@ -2572,16 +2620,25 @@ class SurveyCustomReport {
if($user['id'] != $global_user_id){
$sql = sisplet_query("SELECT * FROM srv_custom_report_share WHERE ank_id='".$this->ank_id."' AND profile_id='".$id."' AND author_usr_id='".$global_user_id."' AND share_usr_id='".$user['id']."' LIMIT 1");
$checked = (mysqli_num_rows($sql) > 0) ? ' checked="checked"' : '';
-
+
+ echo '<div class="setting_item">';
echo '<input type="checkbox" '.$checked.' name="share_usr_id[]" id="share_usr_id'.$user['id'].'" value="'.$user['id'].'"> ';
- echo '<label for="share_usr_id'.$user['id'].'">'.$user['email'].'</label><br />';
+ echo '<label for="share_usr_id'.$user['id'].'">'.$user['email'].'</label>';
+ echo '</div>';
+
}
}
}
-
- echo '<input id="shareCReportProfileId" type="hidden" value="' . $id . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="creport_profile_action(\'share\'); return false;"><span>'.$lang['srv_custom_report_share'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="creport_profile_action(\'cancel_share\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
+
+ echo '</div>';
+
+ echo '<input id="shareCReportProfileId" type="hidden" value="' . $id . '" />';
+
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="creport_profile_action(\'cancel_share\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="creport_profile_action(\'share\'); return false;">'.$lang['srv_custom_report_share'].'</button>';
+ echo '</div>';
}
// delimo profil z drugimi uredniki