summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.SurveyStatistic.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/classes/class.SurveyStatistic.php')
-rw-r--r--admin/survey/classes/class.SurveyStatistic.php1361
1 files changed, 733 insertions, 628 deletions
diff --git a/admin/survey/classes/class.SurveyStatistic.php b/admin/survey/classes/class.SurveyStatistic.php
index 89910fe..76b92f0 100644
--- a/admin/survey/classes/class.SurveyStatistic.php
+++ b/admin/survey/classes/class.SurveyStatistic.php
@@ -140,8 +140,7 @@ class SurveyStatistic {
# poiščemo aktivno anketo
SurveyInfo :: getInstance()->SurveyInit($this->getSurveyId());
- if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
- $this->db_table = '_active';
+ $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
# nastavimo spremenljivko ali imamo vse default vrednosti
$this->isDefaultFilters = true;
@@ -538,7 +537,8 @@ class SurveyStatistic {
*/
function prepareStatusView() {
- $email_filter_string = null;
+ $email_filter_string = null;
+ $user_id_to_check_link = array(); # id-ji uporabnikov pri katerih imamo direkten klik. naknadno ugotavljamo ali je slučajno e-mail vabilo
if ($this->emailInvitation > 0) {
if ($this->emailInvitation == 1) {
$email_filter_string = ' AND inv_res_id is not NULL ';
@@ -555,9 +555,7 @@ class SurveyStatistic {
.$email_filter_string
);
if (mysqli_num_rows($qry) > 0) {
-
- $user_id_to_check_link = array(); # id-ji uporabnikov pri katerih imamo direkten klik. naknadno ugotavljamo ali je slučajno e-mail vabilo
-
+ $_tmp_direct = 0;
while ($row = mysqli_fetch_assoc($qry)) {
if ($this->emailInvitation == 1 && $row['inv_res_id'] != null){
@@ -612,8 +610,12 @@ class SurveyStatistic {
else if ($row['referer'] != "" && $row['referer'] != "0"){
$parsed = parse_url($row['referer']);
$this->cntValidRedirections += 1;
- $this->userRedirections["valid"][$parsed['host']] += 1;
- //$this->userRedirections["cntAll"] += 1;
+
+ if(isset($this->userRedirections["valid"][$parsed['host']]))
+ $this->userRedirections["valid"][$parsed['host']] += 1;
+ else
+ $this->userRedirections["valid"][$parsed['host']] = 1;
+
$this->maxCharRedirection = max($this->maxCharRedirection , strlen ($parsed['host']) );
$this->maxRedirection = max($this->maxRedirection , $this->userRedirections["valid"][$parsed['host']] );
}
@@ -639,7 +641,7 @@ class SurveyStatistic {
}
# od direktnega klika odštejemo e-mail vabila
- if (count($user_id_to_check_link)> 0) {
+ if (is_countable($user_id_to_check_link) && count($user_id_to_check_link)> 0) {
$qryEmail = sisplet_query("SELECT COUNT(*) as cnt FROM srv_userstatus WHERE usr_id IN (".implode(',', $user_id_to_check_link).") AND status IN (".implode(',', $this->emailStatus).")");
$rwsEmail = mysqli_fetch_assoc($qryEmail);
@@ -653,7 +655,12 @@ class SurveyStatistic {
}
// prestejemo max stevilo klikov za lepsi izris tabele
- $this->maxRedirection = max($this->maxRedirection , $this->userRedirections["2"], $this->userRedirections["1"], $this->userRedirections["0"],$this->userRedirections["direct"], $this->userRedirections['email']);
+ $this->userRedirections["0"] = isset($this->userRedirections["0"]) ? $this->userRedirections["0"] : 0;
+ $this->userRedirections["1"] = isset($this->userRedirections["1"]) ? $this->userRedirections["1"] : 0;
+ $this->userRedirections["2"] = isset($this->userRedirections["2"]) ? $this->userRedirections["2"] : 0;
+ $this->userRedirections["direct"] = isset($this->userRedirections["direct"]) ? $this->userRedirections["direct"] : 0;
+ $this->userRedirections['email'] = isset($this->userRedirections['email']) ? $this->userRedirections['email'] : 0;
+ $this->maxRedirection = max($this->maxRedirection , $this->userRedirections["2"], $this->userRedirections["1"], $this->userRedirections["0"], $this->userRedirections["direct"], $this->userRedirections['email']);
# izracunamo realne frekvence po statusih
# Klik na anketo - vsak ki je končal anketo (itd...) je "najbrž" tudi kliknil na anketo..
@@ -705,7 +712,7 @@ class SurveyStatistic {
* DisplayDataView - prikate panelo z kliki po datumih
*/
function Display() {
- global $lang, $site_url;
+ global $lang, $site_url, $admin_type;
$dashboardHtml = null;
@@ -728,34 +735,69 @@ class SurveyStatistic {
$_sql_string = "SELECT DATE_FORMAT(dashboard_update_time,'%d.%m.%Y %H:%i:%s') FROM srv_data_files WHERE sid = '".$this->surveyId."'";
$_sql_qry = sisplet_query($_sql_string);
list($dashboard_update_time) = mysqli_fetch_row($_sql_qry);
- echo '<span id="srv_dashboard_updated">'.$lang['srv_dashboard_updated'].$dashboard_update_time.'</span>';
-
- #preberemo podatke o datoteki
- echo $SDF->getDataFileInfo();
-
+
+
+ echo '<div class="dashboard_top_settings">';
+
+ // Obvestilo o datoteki vidijo samo admini
+ if($admin_type == 0){
+ echo '<div class="dashboard_top_info">';
+ echo ' <span id="srv_dashboard_updated">'.$lang['srv_dashboard_updated'].$dashboard_update_time.'</span>';
+ echo $SDF->getDataFileInfo();
+ echo '</div>';
+ }
+
+ echo ' <div id="div_status_filtri_right" class="dashboard_top_filters">';
+ $this->displayTopFilters();
+ echo ' </div>';
+
+ echo '</div>';
+
+
# preberemo cache file in ga zehamo
echo $this->ReadCacheFile();
}
else {
+
+ // Ce ne zbiramo parapodatkov casov resevanja izpisemo opozorilo
+ if($paradata_date == 1){
+ echo '<div class="top_note dashboard_paradata_note">';
+ echo ' <div class="title">';
+ echo ' <span class="faicon warning"></span> '.$lang['srv_warning'];
+ echo ' </div>';
+ echo $lang['srv_dashboard_paradata_date_warning'];
+ echo '</div>';
+ }
- $dashboard_update_time = date("d.m.Y, H:i:s");
- echo '<span id="srv_dashboard_updated">'.$lang['srv_dashboard_updated'].$dashboard_update_time.'</span>';
-
- #preberemo podatke o datoteki
- echo $SDF->getDataFileInfo();
-
- // Ce ne zbiramo parapodatkov casov resevanja izpisemo opozorilo
- if($paradata_date == 1)
- echo '<br /><br /><span>'.$lang['srv_dashboard_paradata_date_warning'].'</span>';
+ echo '<div class="dashboard_top_settings">';
+
+ echo ' <div class="dashboard_top_info">';
+
+ // Obvestilo o datoteki vidijo samo admini
+ if($admin_type == 0){
+ $dashboard_update_time = date("d.m.Y, H:i:s");
+ echo ' <span id="srv_dashboard_updated">'.$lang['srv_dashboard_updated'].$dashboard_update_time.'</span>';
+
+ #preberemo podatke o datoteki
+ echo $SDF->getDataFileInfo();
+ }
// Prikazemo filter na datum ce je vklopljen
if (SurveyTimeProfiles::getCurentProfileId() != STP_DEFAULT_PROFILE){
- echo '<br class="clr" /><br class="clr" />';
- echo '<div id="displayFilterNotes">';
+ echo ' <div id="displayFilterNotes">';
SurveyTimeProfiles :: printIsDefaultProfile();
- echo '</div>';
+ echo ' </div>';
}
+ echo ' </div>';
+
+ echo ' <div id="div_status_filtri_right" class="dashboard_top_filters">';
+ $this->displayTopFilters();
+ echo ' </div>';
+
+ echo '</div>';
+
+
# Cache file ne obstaja. Če imamo privzete nastavitve vseh filtrov, shranimo prikazan html v datoteko
# spodnje ehote shranimo v spremenljivko ki jo popotrebi keširanja shranimo v datoteko.
@@ -775,19 +817,19 @@ class SurveyStatistic {
$row_all_users = mysqli_fetch_assoc($qry_all_users);
$allUserCount = $row_all_users['user_count'];
+
+ echo '<div class="dashboard_boxes">';
+
// nimamo še vnosov
- if ($allUserCount == 0 || $paradata_date == 1) {
+ if ($allUserCount == 0 || ($paradata_date == 1 && !SurveyInfo::getInstance()->checkSurveyModule('voting'))){
- // zgornji boxi
- echo '<table class="dashboard dashboard_single">';
- echo '<tr>';
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_info" id="div_statistic_info" >'."\n";
- $this -> DisplayInfoView();
+ echo '<div class="dashboard_box" name="div_statistic_info" id="div_statistic_info">';
+ $this->DisplayInfoView();
+ echo '</div>';
+
+ echo '<div class="dashboard_box">';
+ Common::noDataAlert('status');
echo '</div>';
- echo '</td>';
- echo '</tr>';
- echo '</table>';
}
// imamo vnose, prikažemo statistiko
else {
@@ -795,57 +837,46 @@ class SurveyStatistic {
$this->PrepareDateView();
$this->PrepareStatusView();
- echo '<table class="dashboard">';
- echo '<tr>';
-
- // zgornji boxi
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_info" id="div_statistic_info" >'."\n";
- $this -> DisplayInfoView();
+
+ echo '<div class="dashboard_box" name="div_statistic_info" id="div_statistic_info" >';
+ $this->DisplayInfoView();
echo '</div>';
- echo '</td>';
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_status" id="div_statistic_status" >'."\n";
- $this -> DisplayStatusView();
+
+ echo '<div class="dashboard_box" name="div_statistic_status" id="div_statistic_status" >';
+ $this->DisplayStatusView();
echo '</div>';
- echo '</td>';
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_answer_state" id="div_statistic_answer_state" >'."\n";
- $this -> DisplayAnswerStateView();
+
+ echo '<div class="dashboard_box" name="div_statistic_answer_state" id="div_statistic_answer_state" >';
+ $this->DisplayAnswerStateView();
echo '</div>';
- echo '</td>';
- echo '</tr>';
- // spodnji boxi
- echo '<tr>';
- echo '<td>';
- echo '<div class="dashboard_cell" id="div_statistic_referals">';
- $this -> DisplayReferalsView();
+
+ echo '<div class="dashboard_box" id="div_statistic_referals">';
+ $this->DisplayReferalsView();
echo '</div>';
- echo '</td>';
- echo '<td>';
- echo '<div class="dashboard_cell" id="div_statistic_visit">';
- echo '<span class="dashboard_title">'.$lang['srv_statistic_timeline_title'].'</span>'.Help :: display('srv_statistic_timeline_title');
- $this -> DisplayFilters();
- echo '<br/>';
- echo '<div name="div_statistic_visit_data" id="div_statistic_visit_data" >'."\n";
- $this -> DisplayDateView();
- echo '</div>';
+
+ echo '<div class="dashboard_box" id="div_statistic_visit">';
+ echo ' <div class="box_title">'.$lang['srv_statistic_timeline_title'].' '.Help :: display('srv_statistic_timeline_title').'</div>';
+
+ $this->DisplayFilters();
+
+ echo ' <div name="div_statistic_visit_data" id="div_statistic_visit_data" >';
+ $this->DisplayDateView();
+ echo ' </div>';
+
echo '</div>';
- echo '</td>';
- echo '<td>';
- echo '<div class="dashboard_cell" id="div_statistic_pages_state">';
- $this -> DisplayPagesStateView();
- echo '</div>';
- echo '</td>';
- echo '</tr>';
- echo '</table>';
+ echo '<div class="dashboard_box" id="div_statistic_pages_state">';
+ $this->DisplayPagesStateView();
+ echo '</div>';
}
+
+ echo '</div>';
+
# HTML zapišemo v spremenljivko
@@ -866,19 +897,67 @@ class SurveyStatistic {
$timestamp = (int)$time1 + (int)$time2;
- $this->WriteToCacheFile($dashboardHtml,$timestamp);
+ $this->WriteToCacheFile($dashboardHtml, $timestamp);
}
+
# izpišemo HTML v browser
echo $dashboardHtml;
}
-
- echo '<div class="clr"></div>';
- echo '<span >';
- echo '</span>';
-
+
$dashboardHtml = null;
}
+
+ // Prikazemo filtre na vrhu dashboarda
+ function DisplayTopFilters(){
+ global $lang;
+
+ if($this->emailInvitation == 1 || $this->emailInvitation == 2){
+ echo '<div id="dashboardEmailInvitationFilter" class="filter_setting">';
+ $this->emailInvitationFilter($this->emailInvitation);
+ echo '</div>';
+ }
+
+ # če imamo vabila - filter za emaile
+ $row = SurveyInfo::getSurveyRow();
+
+ if ($row['user_base']) {
+
+ if ($this->cnt_all == $this->cnt_email) {
+
+ echo '<div class="filter_setting">';
+
+ echo $lang['srv_statistic_email_invitation'];
+ echo ' <select id="filter_email_status" name="filter_email_status" class="dropdown small" onchange="statisticRefreshAllBoxes(\'invitation\'); return false;" >';
+ echo ' <option value="0" disabled="disabled">' . $lang['srv_statistic_email_invitation_all'] . '</option>';
+ echo ' <option value="1" selected="selected">' . $lang['srv_statistic_email_invitation_only_email'] . '</option>';
+ echo ' <option value="2" disabled="disabled">' . $lang['srv_statistic_email_invitation_no_email'] . '</option>';
+ echo ' </select>';
+
+ echo '</div>';
+ }
+ else {
+ echo '<div class="filter_setting">';
+
+ echo $lang['srv_statistic_email_invitation'];
+ echo ' <select id="filter_email_status" name="filter_email_status" class="dropdown small" onchange="statisticRefreshAllBoxes(\'invitation\'); return false;" >';
+ echo ' <option value="0"' . ($this->emailInvitation == 0 ? ' selected="selected"' : '') . '>' . $lang['srv_statistic_email_invitation_all'] . '</option>';
+ echo ' <option value="1"' . ($this->emailInvitation == 1 ? ' selected="selected"' : '') . '>' . $lang['srv_statistic_email_invitation_only_email'] . '</option>';
+ echo ' <option value="2"' . ($this->emailInvitation == 2 ? ' selected="selected"' : '') . '>' . $lang['srv_statistic_email_invitation_no_email'] . '</option>';
+ echo ' </select>';
+
+ echo '</div>';
+ }
+ }
+
+ # filter za čase
+ echo '<div class="filter_setting">';
+ echo ' <div id="link_time_profile" class="filter_time_profile" title="' . $lang['srv_time_profile_link_title'] . '" onClick="timeProfileAction(\'showProfiles\');">';
+ echo ' <span class="faicon calendar_icon"></span>'.$lang['srv_time_profile_link'];
+ echo ' </div>';
+ echo '</div>';
+ }
+
/** Funkcija prikaze osnovnih informacij
*
*/
@@ -886,28 +965,29 @@ class SurveyStatistic {
global $lang;
global $site_url;
- echo '<div class="dashboard_title">'.$lang['srv_statistic_info_title'].Help :: display('srv_statistic_info_title').'</div><br/>';
- //SurveyInfo::getInstance()->DisplayInfoBox(false);
- /* zaradi nenehnih sprememb (Vasja) se ne da naredit univerzalno, */
+ echo '<div class="box_title">'.$lang['srv_statistic_info_title'].Help :: display('srv_statistic_info_title').'</div>';
-
- echo '<table style="width:100%;">';
+ echo '<table>';
echo '<COLGROUP><COL width="90px"><COL width="100px"><COL width="90px"><COL width="100px"></COLGROUP>';
# ime ankete
- echo '<tr><td>';
+ echo '<tr>';
+ echo '<td>';
echo $lang['srv_info_name'].':';
echo '</td><td colspan="3">';
echo htmlentities(SurveyInfo::getSurveyTitle(), ENT_QUOTES, "UTF-8");
echo '</td>';
echo '</tr>';
+
+
+ #opomba
if (SurveyInfo::getSurveyInfo()) {
- #opomba
+
// prikažemo 30 znakov na mouseover pa kompletno
echo '<tr><td>';
echo $lang['srv_info_note'].':';
echo '</td><td colspan="3" title="' . SurveyInfo::getSurveyInfo() . '">';
- echo htmlentities($this->limitString(SurveyInfo::getSurveyInfo(),30), ENT_QUOTES, "UTF-8");
+ echo htmlentities(is_string($this->limitString(SurveyInfo::getSurveyInfo(),30)), ENT_QUOTES, "UTF-8");
echo '</td></tr>';
}
@@ -948,7 +1028,8 @@ class SurveyStatistic {
echo '</td><td colspan="3">';
echo $lang['srv_vrsta_survey_type_'.(SurveyInfo::getSurveyType()>2 ? 2 : SurveyInfo::getSurveyType())] . ($enabled_advanced != null ? ' ('.$enabled_advanced.')' : '' );
echo '</td></tr>';
- # vprašanj, variabel
+
+ # vprašanj, variabel
echo '<tr><td>';
echo $lang['srv_info_questions']. ':';
echo '</td><td>';
@@ -958,13 +1039,15 @@ class SurveyStatistic {
echo '</td><td>';
echo SurveyInfo::getSurveyVariableCount();
echo '</td></tr>';
- # stevilo strani
+
+ # stevilo strani
echo '<tr><td>';
echo $lang['srv_info_pages']. ':';
echo '</td><td>';
echo SurveyInfo::getSurveyGroupCount();
echo '</td></tr>';
- # uporabnikov, odgovorov
+
+ # uporabnikov, odgovorov
echo '<tr><td>';
echo $lang['srv_analiza_stUporabnikov']. ':';
echo '</td><td>';
@@ -974,32 +1057,51 @@ class SurveyStatistic {
echo '</td><td>';
echo SurveyInfo::getSurveyApropriateAnswersCount();
echo '</td></tr>';
- # jezik izpolnjevanja
+
+ # jezik izpolnjevanja
echo '<tr><td>';
echo $lang['srv_info_language']. ':';
echo '</td><td colspan="3" >';
echo SurveyInfo::getRespondentLanguage();
echo '</td></tr>';
- # autor
+
+ # autor
echo '<tr><td>';
echo $lang['srv_info_creator']. ':';
- echo '</td><td colspan="3" title="'.SurveyInfo::getSurveyInsertEmail().'">';
- echo SurveyInfo::getSurveyInsertName();
+ // Demo anketa ima to fiksno
+ if(isDemoSurvey($this->surveyId)){
+ echo '</td><td colspan="3" title="1KA user">';
+ echo '1KA user, 1.1.24, 00:00';
+ echo '</td></tr>';
+ }
+ else{
+ echo '</td><td colspan="3" title="'.SurveyInfo::getSurveyInsertEmail().'">';
+ echo SurveyInfo::getSurveyInsertName();
if (SurveyInfo::getSurveyInsertDate() && SurveyInfo::getSurveyInsertDate() != "00.00.0000")
echo SurveyInfo::getDateTimeSeperator() . $this->dateFormat(SurveyInfo::getSurveyInsertDate(),DATE_FORMAT_SHORT);
if (SurveyInfo::getSurveyInsertTime() && SurveyInfo::getSurveyInsertTime() != "00:00:00")
echo SurveyInfo::getDateTimeSeperator() . $this->dateFormat(SurveyInfo::getSurveyInsertTime(),TIME_FORMAT_SHORT);
- echo '</td></tr>';
- # spreminjal
+ echo '</td></tr>';
+ }
+
+ # spreminjal
echo '<tr><td>';
echo $lang['srv_info_modify']. ':';
- echo '</td><td colspan="3" title="'.SurveyInfo::getSurveyEditEmail().'">';
- echo SurveyInfo::getSurveyEditName();
+ // Demo anketa ima to fiksno
+ if(isDemoSurvey($this->surveyId)){
+ echo '</td><td colspan="3" title="1KA user">';
+ echo '1KA user, 1.1.24, 00:00';
+ echo '</td></tr>';
+ }
+ else{
+ echo '</td><td colspan="3" title="'.SurveyInfo::getSurveyEditEmail().'">';
+ echo SurveyInfo::getSurveyEditName();
if (SurveyInfo::getSurveyEditDate() && SurveyInfo::getSurveyEditDate() != "00.00.0000")
echo SurveyInfo::getDateTimeSeperator() . $this->dateFormat(SurveyInfo::getSurveyEditDate(),DATE_FORMAT_SHORT);
if (SurveyInfo::getSurveyEditTime() && SurveyInfo::getSurveyEditTime() != "00:00:00")
echo SurveyInfo::getDateTimeSeperator() . $this->dateFormat(SurveyInfo::getSurveyEditTime(),TIME_FORMAT_SHORT);
- echo '</td></tr>';
+ echo '</td></tr>';
+ }
#dostop, Kdo razen avtorja ima dostop
$dostop = SurveyInfo::getSurveyAccessUsers();
@@ -1016,28 +1118,31 @@ class SurveyStatistic {
echo '</td></tr>';
}
- # aktivnost
+
+ # aktivnost
$activity = SurveyInfo:: getSurveyActivity();
$_last_active = end($activity);
echo '<tr><td>';
echo $lang['srv_displaydata_status']. ':';
echo '</td><td colspan="3">';
if (SurveyInfo::getSurveyColumn('active') == 1) {
- echo '<span style="width:auto; color: green;">'.$lang['srv_anketa_active2'].'</span>';
- } else {
+ echo '<span class="active">'.$lang['srv_anketa_active2'].'</span>';
+ }
+ else {
# preverimo ali je bila anketa že aktivirana
if (!isset($_last_active['starts'])) {
# anketa še sploh ni bila aktivirana
- echo '<span style="width:auto; color:orange;">'.$lang['srv_survey_non_active_notActivated'].'</span>';
- } else {
+ echo '<span class="not_activated">'.$lang['srv_survey_non_active_notActivated'].'</span>';
+ }
+ else {
# anketa je že bila aktivirna ampak je sedaj neaktivna
- echo '<span style="width:auto; color:orange;">'.$lang['srv_survey_non_active'].'</span>';
+ echo '<span class="non_active">'.$lang['srv_survey_non_active'].'</span>';
}
}
-
echo '</td></tr>';
+
# trajanje: datumi aktivnosti
- if ( count($activity) > 0 ) {
+ if (is_countable($activity) && count($activity) > 0 ) {
echo '<tr><td>';
echo $lang['srv_info_activity']. ':';
echo '</td><td colspan="3">';
@@ -1048,31 +1153,44 @@ class SurveyStatistic {
echo $prefix.$_starts[2].'.'.$_starts[1].'.'.$_starts[0].'-'.$_expire[2].'.'.$_expire[1].'.'.$_expire[0];
- # echo $prefix . $this->dateFormat($active['starts'],DATE_FORMAT_SHORT).'-'.$this->dateFormat($active['expire'],DATE_FORMAT_SHORT);
$prefix = '; ';
}
echo '</td></tr>';
}
-
- # predviceni cas trajanja enkete
+
+ # Dejanski in predviceni cas trajanja enkete
$sas = new SurveyAdminSettings();
- $skupni_cas = $sas->testiranje_cas(1);
$skupni_predvideni_cas = $sas->testiranje_predvidenicas(1);
-
+
$d = new Dostop();
-
+
echo '<tr><td>';
echo $lang['srv_info_duration']. ':';
echo '</td><td colspan="3">';
- echo ($skupni_cas!=''?'<a href="index.php?anketa='.$this->surveyId.'&a='.A_REPORTI . '&m='.M_TESTIRANJE_CAS.'">':'').$skupni_cas.($skupni_cas!=''?'</a>, ':'');
- echo ''.$lang['srv_predvideno'].': ';
+ list($skupni_cas, $mediana) = $sas->testiranje_cas(2);
+
+ // Dejanski cas imamo samo ce imamo response
+ if($skupni_cas != ''){
+ echo ($skupni_cas != '' ? '<a href="index.php?anketa='.$this->surveyId.'&a=testiranje&m=cas">' : '').$skupni_cas.($mediana != '' ? '</a>' : '');
+
+ // Mediana
+ if($mediana != ''){
+ echo ' ('.$lang['median'].': ';
+ echo '<a href="index.php?anketa='.$this->surveyId.'&a=testiranje&m=cas">'.$mediana.'</a>)';
+ }
+
+ echo ', ';
+ }
+
+ // Predvideni cas imamo vedno
+ echo $lang['srv_predvideno'].': ';
+
if ($d->checkDostopSub('test'))
- echo '<a href="index.php?anketa='.$this->surveyId.'&a=testiranje&m=predvidenicas">';
- echo $skupni_predvideni_cas;
- if ($d->checkDostopSub('test'))
- echo '</a>';
+ echo '<a href="index.php?anketa='.$this->surveyId.'&a=testiranje&m=predvidenicas">'.$skupni_predvideni_cas.'</a>';
+ else
+ echo $skupni_predvideni_cas;
echo '</td></tr>';
@@ -1085,33 +1203,20 @@ class SurveyStatistic {
if ($prvi_vnos_date != null) {
echo '<tr><td>';
echo $lang['srv_info_first_entry']. ':';
- echo '</td><td '.( $zadnji_vnos_date == null ? 'colspan="3"' : '').'>';
+ echo '</td><td colspan="3">';
echo $this->dateFormat($prvi_vnos_date,DATE_FORMAT_SHORT);
echo $prvi_vnos_time != null ? (SurveyInfo::$dateTimeSeperator .$this->dateFormat($prvi_vnos_time,TIME_FORMAT_SHORT)) : '';
- echo '</td>';
+ echo '</td></tr>';
}
if ($zadnji_vnos_date != null) {
- echo '<td>';
+ echo '<tr><td>';
echo $lang['srv_info_last_entry']. ':';
- echo '</td><td '.( $prvi_vnos_date == null ? 'colspan="3"' : '').'>';
+ echo '</td><td colspan="3">';
echo $this->dateFormat($zadnji_vnos_date,DATE_FORMAT_SHORT);
echo $zadnji_vnos_time != null ? (SurveyInfo::$dateTimeSeperator .$this->dateFormat($zadnji_vnos_time,TIME_FORMAT_SHORT)) : '';
echo'</td></tr>';
}
-/*
- #linki - urejanje
- echo '<tr><td>';
- echo $lang['srv_stat_edit'] . ':';
- echo '</td><td colspan="3">';
- echo '<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->getSurveyId().'">' . $lang['srv_stat_edit_survey'] . '</a>,';
- echo ' <a href="index.php?anketa='.$this->getSurveyId().'&a=komentarji">'.$lang['comments'].'</a>';
- echo '</td></tr>';
-
- #linki - povezave
-
- */
-
list($commentsAll,$commentsUnresolved,$commentsQuestionAll,$commentsQuestionUnresolved,$commentsUser,$commentsUserFinished,$commentsUserSurveyAll,$commentsUserSurveyUnresolved) = $this->comments;
@@ -1156,98 +1261,259 @@ class SurveyStatistic {
echo '</table>';
}
+ /** Funkcija prikaže statuse
+ * KONČNI STATUSI
+ */
+ function DisplayStatusView() {
+ global $lang;
+
+ echo '<div class="box_title">';
+ echo $lang['srv_statistic_status_title'].' '.Help :: display('srv_statistic_status_title');
+ echo '</div>';
+
+ echo '<div class="box_top_settings">';
+ echo ' <input id="hideNullValues_status" name="hideNullValues_status" type="checkbox" onchange="statisticStatusRefresh(); return false;"'.($this->hideNullValues_status ? ' checked="checked"' : '').' autocomplete="off">';
+ echo ' <label for="hideNullValues_status">'.$lang['srv_statistic_hide_null'].Help::display('srv_status_koncni0').'</label>';
+ echo '</div>';
+
+
+ $cntValid = 0; // da vemo ali izpisemo skupne
+ $cntNonValid = 0; // da vemo ali izpisemo skupne
+ $cntInvitation = 0; // da vemo ali izpisemo skupne
+
+
+ echo '<table>';
+
+ echo '<tr class="row1">';
+ echo '<td>'.$lang['srv_statistic_metric'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_frequency'].'</td>';
+ echo '</tr>';
+
+
+ foreach ($this->appropriateStatus as $status) {
+ if (!($this->hideNullValues_status && $this->userByStatus['valid'][$status] == 0)) {// da ne delamo po neporebnem
+ echo '<tr>';
+ echo '<td>'. $lang['srv_userstatus_'.$status] . ' ('.$status.')</td>';
+ echo '<td>'. $this->userByStatus['valid'][$status].'</td>';
+ echo '</tr>';
+
+ $cntValid++;
+ }
+ }
+ // vsota vlejavnih
+ if ($cntValid > 0 || !$this->hideNullValues_status) {
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_redirection_sum_valid'].'</td>';
+ echo '<td>'.($this->cntUserByStatus['valid']).'</td>';
+ echo '</tr>';
+ }
+
+ // izpišemo še neveljavne
+ foreach ($this->unAppropriateStatus as $status) {
+ if (!($this->hideNullValues_status && $this->userByStatus['nonvalid'][$status] == 0)) {// da ne delamo po neporebnem
+
+ echo '<tr>';
+
+ echo '<td>' . $lang['srv_userstatus_'.$status] . ' ('.$status.')</td>';
+ echo '<td>' . $this->userByStatus['nonvalid'][$status]
+ . ( ( isset($this->userByStatus['valid'][$status]) && $this->userByStatus['valid'][$status] > 0 )
+ ? '&nbsp;<a href="#" onclick="survey_statistic_status(\''.$status.'\')">'.$lang['srv_statistic_detail'].'</a>'
+ : '').'</td>';
+
+ echo '</tr>';
+
+ $cntNonValid++;
+ }
+ }
+
+ // vsota nevlejavnih
+ if ($cntNonValid > 0 || !$this->hideNullValues_status) {
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_redirection_sum_nonvalid'].'</td>';
+ echo '<td>'.($this->cntUserByStatus['nonvalid']).'</td>';
+ echo '</tr>';
+ }
+
+ // Klikov na povezavo
+ SurveySetting::getInstance()->setSID($this->surveyId);
+ $view_count = SurveySetting::getInstance()->getSurveyMiscSetting('view_count');
+ if ($view_count == "") $view_count = 0;
+ if ($view_count > 0 || !$this->hideNullValues_status){
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_redirection_sum_view'].'</td>';
+ echo '<td>'.($view_count).'</td>';
+ echo '</tr>';
+ }
+
+ // Vsota anketiranih
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_redirection_sum_surveyed'].'</td>';
+ echo '<td>'.($this->cntUserByStatus['valid']+$this->cntUserByStatus['nonvalid']).'</td>';
+ echo '</tr>';
+
+ // Testni
+ if ((int)$this->testDataCount > 0) {
+ echo '<tr>';
+ echo '<td>('.$lang['srv_statistic_redirection_test'].')</td>';
+ echo '<td>'.((int)$this->testDataCount).'</td>';
+ echo '</tr>';
+ }
+
+
+ # preštejemo še neposlana vabila
+ $str = "SELECT count(*) FROM srv_invitations_recipients WHERE ank_id='".$this->getSurveyId()."' AND sent='0' AND deleted='0'";
+
+ $qry = sisplet_query($str);
+ list($cntUnsent) = mysqli_fetch_row($qry);
+ $this->userByStatus['invitation'][0] = (int)$cntUnsent;
+
+ # še email vabila
+ // ker izpade čudno, statusov email neposlan
+ if (count(array_filter($this->userByStatus['invitation'])) > 0 || !$this->hideNullValues_status){
+
+ echo '</tr>';
+ echo '<td>'.$lang['srv_statistic_nonsurveyed_title'].'</td>';
+ echo '<tr>';
+
+ foreach ($this->invitationStatus as $status){
+
+ if (!($this->hideNullValues_status && $this->userByStatus['invitation'][$status] == 0)) {// da ne delamo po neporebnem
+ echo '<tr>';
+ echo '<td>'.$lang['srv_statistic_email_status_'.$status].' ('.$status.')</td>';
+ echo '<td>'.$this->userByStatus['invitation'][$status].'</td>';
+ echo '</tr>';
+
+ $cntInvitation++;
+ }
+ }
+ }
+
+ // vsota emaili
+ if ($cntInvitation > 0 || !$this->hideNullValues_status) {
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_sum2'].'</td>';
+ echo '<td>'.($this->cntUserByStatus['invitation']).'</td>';
+ echo '</tr>';
+ }
+
+
+ // Vsota vseh
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_sum_all'].'</td>';
+ echo '<td>'.($this->cntUserByStatus['valid']+$this->cntUserByStatus['nonvalid']+$this->cntUserByStatus['invitation']).'</td>';
+ echo '</tr>';
+
+ echo '</table>';
+
+
+ // Uporabnost respondentov
+ $sur = new SurveyUsableResp($this->surveyId, $generateDatafile=false);
+ if($sur->hasDataFile()){
+ $usability = $sur->calculateData();
+
+ echo '<table id="tbl_answ_usability">';
+
+ echo '<tr class="row1">';
+ echo '<td>'.$lang['srv_statistic_answer_state_usability'].' ('.$sur->bottom_usable_limit.'%/'.$sur->top_usable_limit.'%)</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_frequency'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_percent'].'</td>';
+ echo '</tr>';
+
+ echo '<tr>';
+ echo '<td>'.$lang['srv_usableResp_usable_unit'].'</td>';
+ echo '<td>'.$usability['usable'].'</td>';
+ if($usability['all'] > 0)
+ echo '<td>'.$this->formatNumber($usability['usable']/$usability['all']*100, NUM_DIGIT_PERCENT, '%').'</td>';
+ else
+ echo '<td>'.$this->formatNumber(0, NUM_DIGIT_PERCENT, '%').'</td>';
+ echo '</tr>';
+
+ echo '<tr>';
+ echo '<td>'.$lang['srv_usableResp_partusable_unit'].'</td>';
+ echo '<td>'.$usability['partusable'].'</td>';
+ if($usability['all'] > 0)
+ echo '<td>'.$this->formatNumber($usability['partusable']/$usability['all']*100, NUM_DIGIT_PERCENT, '%').'</td>';
+ else
+ echo '<td>'.$this->formatNumber(0, NUM_DIGIT_PERCENT, '%').'</td>';
+ echo '</tr>';
+
+ echo '<tr><td>'.$lang['srv_usableResp_unusable_unit'].'</td>';
+ echo '<td>'.$usability['unusable'].'</td>';
+ if($usability['all'] > 0)
+ echo '<td>'.$this->formatNumber($usability['unusable']/$usability['all']*100, NUM_DIGIT_PERCENT, '%').'</td>';
+ else
+ echo '<td>'.$this->formatNumber(0, NUM_DIGIT_PERCENT, '%').'</td>';
+ echo '</tr>';
+
+ echo '</table>';
+ }
+ }
+
/** Funkcija prikaže statuse odgovorov
*
*/
- function DisplayAnswerStateView() {
+ function DisplayAnswerStateView() {
global $lang;
if ($this->emailInvitation == 1) {
$order = array('email','3ll','4ll','5ll',5,6);
- } else {
+ }
+ else {
$order = array('3ll','4ll','5ll',5,6);
}
+
if(true) {
$this->realUsersByStatus[0]['cnt'] = $this->cntUserByStatus['invitation'];
}
- echo '<div class="floatLeft"><span class="dashboard_title">'.$lang['srv_statistic_answer_state_title'].'</span>'.Help :: display('srv_statistic_answer_state_title');
- echo '</div>';
- echo '<div class="floatRight">'.$lang['srv_statistic_answer_state_base'].': ';
- echo '<select id="userStatusBase" onchange="changeUserStatusBase()">';
+
+
+ echo '<div class="box_title">'.$lang['srv_statistic_answer_state_title'].' '.Help :: display('srv_statistic_answer_state_title').'</div>';
+
+ echo '<div class="box_top_settings">';
+ echo $lang['srv_statistic_answer_state_base'].': ';
+ echo '<select id="userStatusBase" class="dropdown small" onchange="changeUserStatusBase()">';
foreach ($order as $key) {
echo '<option '.($this->realUsersByStatus_base.'' == $key.'' ? ' selected="selected"' : '').' value="'.$key.'" >'.$lang['srv_userstatus_'.$key].'</option>';
}
echo '</select>';
echo '</div>';
- echo '<br class="clr"/>';
- echo '<br />';
- echo '<table id="tbl_answ_state">';
- echo '<tr class="anl_dash_bb "><th><strong>'.$lang['srv_statistic_answer_state_status'].'</strong></th><td><strong>'.$lang['srv_statistic_answer_state_frequency'].'</strong></td><td><strong>'.$lang['srv_statistic_answer_state_percent'].'</strong></td></tr>';
- foreach ($order as $key) {
+
+ echo '<table id="tbl_answ_state">';
+
+ echo '<tr class="row1">';
+ echo '<td>'.$lang['srv_statistic_answer_state_status'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_frequency'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_percent'].'</td>';
+ echo '</tr>';
+
+ foreach ($order as $key) {
+
if ($this->realUsersByStatus_base == $key) {
$base_found = true;
}
- echo '<tr><th>'.$lang['srv_userstatus_'.$key].'</th>';
+
+ echo '<tr>';
+
+ echo '<td>'.$lang['srv_userstatus_'.$key].'</td>';
+
#frekvenca
echo '<td>'.($this->realUsersByStatus[$key]['cnt'] > 0 ? $this->realUsersByStatus[$key]['cnt'] : '0').'</td>';
- #procenti
- ;
+
+ #procenti
echo '<td>';
- #echo ( (float)$this->realUsersByStatus[$key]['percent'] > 1.0)
echo ( $base_found == false)
? '--'
: $this->formatNumber($this->realUsersByStatus[$key]['percent']*100,NUM_DIGIT_PERCENT,'%');
echo '</td>';
- echo '</tr>';
- }
- echo '</table>';
-
-
- echo '<br />';
-
-
- // Uporabnost respondentov
- $sur = new SurveyUsableResp($this->surveyId, $generateDatafile=false);
- if(!$sur->hasDataFile())
- echo '<br />';
-// echo $lang['srv_dashboard_no_file'].'<br /><br />';
- else{
- $usability = $sur->calculateData();
- echo '<table id="tbl_answ_usability">';
- echo '<tr class="anl_dash_bb "><th><strong>'.$lang['srv_statistic_answer_state_usability'].' ('.$sur->bottom_usable_limit.'%/'.$sur->top_usable_limit.'%)</strong></th><td><strong>'./*$lang['srv_statistic_answer_state_frequency'].*/'</strong></td><td><strong>'./*$lang['srv_statistic_answer_state_percent'].*/'</strong></td></tr>';
+ echo '</tr>';
+ }
- echo '<tr><th>'.$lang['srv_usableResp_usable_unit'].'</th>';
- echo '<td>'.$usability['usable'].'</td>';
- if($usability['all'] > 0)
- echo '<td>'.$this->formatNumber($usability['usable']/$usability['all']*100, NUM_DIGIT_PERCENT, '%').'</td>';
- else
- echo '<td>'.$this->formatNumber(0, NUM_DIGIT_PERCENT, '%').'</td>';
- echo '</tr>';
-
- echo '<tr><th>'.$lang['srv_usableResp_partusable_unit'].'</th>';
- echo '<td>'.$usability['partusable'].'</td>';
- if($usability['all'] > 0)
- echo '<td>'.$this->formatNumber($usability['partusable']/$usability['all']*100, NUM_DIGIT_PERCENT, '%').'</td>';
- else
- echo '<td>'.$this->formatNumber(0, NUM_DIGIT_PERCENT, '%').'</td>';
- echo '</tr>';
-
- echo '<tr><th>'.$lang['srv_usableResp_unusable_unit'].'</th>';
- echo '<td>'.$usability['unusable'].'</td>';
- if($usability['all'] > 0)
- echo '<td>'.$this->formatNumber($usability['unusable']/$usability['all']*100, NUM_DIGIT_PERCENT, '%').'</td>';
- else
- echo '<td>'.$this->formatNumber(0, NUM_DIGIT_PERCENT, '%').'</td>';
- echo '</tr>';
+ echo '</table>';
- echo '</table>';
-
- echo '<br />';
- }
-
+
// Breakoffi
$status3 = (isset($this->userByStatus['nonvalid']['3'])) ? $this->userByStatus['nonvalid']['3'] : 0;
$status4 = (isset($this->userByStatus['nonvalid']['4'])) ? $this->userByStatus['nonvalid']['4'] : 0;
@@ -1255,13 +1521,21 @@ class SurveyStatistic {
$status5l = (isset($this->userByStatus['nonvalid']['5l'])) ? $this->userByStatus['nonvalid']['5l'] : 0;
$status6 = (isset($this->userByStatus['valid']['6'])) ? $this->userByStatus['valid']['6'] : 0;
$all = (isset($this->realUsersByStatus['3ll']['cnt'])) ? $this->realUsersByStatus['3ll']['cnt'] : 0;
- if($all > 0){
+
+ if($all > 0){
+
echo '<table id="tbl_answ_breakoff">';
- echo '<tr class="anl_dash_bb "><th><strong>'.$lang['srv_statistic_answer_state_breakoff'].'</strong></th><td><strong>'./*$lang['srv_statistic_answer_state_frequency'].*/'</strong></td><td><strong>'./*$lang['srv_statistic_answer_state_percent'].*/'</strong></td></tr>';
+
+ echo '<tr class="row1">';
+ echo '<td>'.$lang['srv_statistic_answer_state_breakoff'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_frequency'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_percent'].'</td>';
+ echo '</tr>';
$introBreakoff = $status3 + $status4;
$introBreakoffPercent = $introBreakoff / $all;
- echo '<tr><th>'.$lang['srv_statistic_answer_state_breakoff_1'].'</th>';
+ echo '<tr>';
+ echo '<td>'.$lang['srv_statistic_answer_state_breakoff_1'].'</td>';
echo '<td>'.$introBreakoff.'</td>';
echo '<td>'.$this->formatNumber($introBreakoffPercent*100, NUM_DIGIT_PERCENT, '%').'</td>';
echo '</tr>';
@@ -1270,14 +1544,16 @@ class SurveyStatistic {
$qBreakoffPercent = $qBreakoff / $all;
if(($all - $status3 - $status4) > 0)
$qBreakoffNeto = $qBreakoff / ($all - $status3 - $status4);
- echo '<tr><th>'.$lang['srv_statistic_answer_state_breakoff_2'].'</th>';
+ echo '<tr>';
+ echo '<td>'.$lang['srv_statistic_answer_state_breakoff_2'].'</td>';
echo '<td>'.$qBreakoff.'</td>';
echo '<td>'.$this->formatNumber($qBreakoffPercent*100, NUM_DIGIT_PERCENT, '%').' (neto '.$this->formatNumber($qBreakoffNeto*100, NUM_DIGIT_PERCENT, '%').')</td>';
echo '</tr>';
$totalBreakoff = $status3 + $status4 + $status5 + $status5l;
$totalBreakoffPercent = $totalBreakoff / $all;
- echo '<tr><th>'.$lang['srv_statistic_answer_state_breakoff_3'].'</th>';
+ echo '<tr>';
+ echo '<td>'.$lang['srv_statistic_answer_state_breakoff_3'].'</td>';
echo '<td>'.$totalBreakoff.'</td>';
echo '<td>'.$this->formatNumber($totalBreakoffPercent*100, NUM_DIGIT_PERCENT, '%').'</td>';
echo '</tr>';
@@ -1372,262 +1648,160 @@ class SurveyStatistic {
}
return $json_array;
- }
-
- /** Funkcija prikaže statuse
- * KONČNI STATUSI
- */
- function DisplayStatusView() {
- global $lang;
-
- echo '<span class="floatLeft dashboard_title">'.$lang['srv_statistic_status_title'].Help :: display('srv_statistic_status_title');
- echo '</span>';
-
- echo '<span class="floatRight">';
- echo $lang['srv_statistic_hide_null'];
- echo '<input id="hideNullValues_status" name="hideNullValues_status" type="checkbox" onchange="statisticStatusRefresh(); return false;"'.($this->hideNullValues_status ? ' checked="checked"' : '').' autocomplete="off">';
- echo '</span>';
-
- echo '<br class="clr"/><br/>';
-
- $cntValid = 0; // da vemo ali izpisemo skupne
- $cntNonValid = 0; // da vemo ali izpisemo skupne
- $cntInvitation = 0; // da vemo ali izpisemo skupne
- foreach ($this->appropriateStatus as $status) {
- if (!($this->hideNullValues_status && $this->userByStatus['valid'][$status] == 0)) {// da ne delamo po neporebnem
- echo '<span class="dashboard_status_span">' . $lang['srv_userstatus_'.$status] . ' ('.$status.') :</span>' . $this->userByStatus['valid'][$status].'<br/>';
- $cntValid++;
- }
- }
- // vsota vlejavnih
- if ($cntValid > 0 || !$this->hideNullValues_status) {
- echo '<div class="anl_dash_bt full strong"><span class="dashboard_status_span">'.$lang['srv_statistic_redirection_sum_valid'].'</span>'.($this->cntUserByStatus['valid']).'<br/></div><br/>';
- }
-
- // izpišemo še neveljavne
- foreach ($this->unAppropriateStatus as $status) {
- if (!($this->hideNullValues_status && $this->userByStatus['nonvalid'][$status] == 0)) {// da ne delamo po neporebnem
- echo '<span class="dashboard_status_span">' . $lang['srv_userstatus_'.$status] . ' ('.$status.') :</span>' . $this->userByStatus['nonvalid'][$status]
- . ( ( $index <= 2 && $this->userByStatus['valid'][$status] > 0 )
- ? '&nbsp;<a href="#" onclick="survey_statistic_status(\''.$status.'\')">'.$lang['srv_statistic_detail'].'</a>'
- : '')
- . '<br/>';
- $cntNonValid++;
- }
- }
- // se status null (neznan status)
- /*if (!($this->hideNullValues_status && $this->userByStatus['nonvalid'][-1] == 0)) {// da ne delamo po neporebnem
- echo '<span class="dashboard_status_span">' . $lang['srv_userstatus_null'] . ' (null) :</span>' . (isset($this->userByStatus['nonvalid'][-1]) ? $this->userByStatus['nonvalid'][-1] : '0') . '<br/>';
- $cntNonValid++;
- }*/
-
- // vsota nevlejavnih
- if ($cntNonValid > 0 || !$this->hideNullValues_status) {
- echo '<div class="anl_dash_bt full strong"><span class="dashboard_status_span">'.$lang['srv_statistic_redirection_sum_nonvalid'].'</span>'.($this->cntUserByStatus['nonvalid']).'<br></div><br/>';
- }
-
- // Klikov na povezavo
- SurveySetting::getInstance()->setSID($this->surveyId);
- $view_count = SurveySetting::getInstance()->getSurveyMiscSetting('view_count');
- if ($view_count == "") $view_count = 0;
- if ($view_count > 0 || !$this->hideNullValues_status)
- echo '<div class="full strong"><span class="dashboard_status_span">'.$lang['srv_statistic_redirection_sum_view'].'</span>'.($view_count).'<br /><br /></div>';
-
- // Vsota anketiranih
- echo '<div class="anl_dash_bt full strong "><span class="dashboard_status_span">'.$lang['srv_statistic_redirection_sum_surveyed'].'</span>'.($this->cntUserByStatus['valid']+$this->cntUserByStatus['nonvalid']).'<br></div>';
- // Testni
- if ((int)$this->testDataCount > 0) {
- echo '<div class="full"><span class="dashboard_status_span">('.$lang['srv_statistic_redirection_test'].')</span>'.((int)$this->testDataCount).'<br></div>';
- }
-
- echo '<br class="clr"/>';
-
-
- # preštejemo še neposlana vabila
- $str = "SELECT count(*) FROM srv_invitations_recipients WHERE ank_id='".$this->getSurveyId()."' AND sent='0' AND deleted='0'";
-
- $qry = sisplet_query($str);
- list($cntUnsent) = mysqli_fetch_row($qry);
- $this->userByStatus['invitation'][0] = (int)$cntUnsent;
-
- # še email vabila
- // ker izpade čudno, statusov email neposlan
- if (count(array_filter($this->userByStatus['invitation'])) > 0 || !$this->hideNullValues_status){
-
- echo '<span class="floatLeft strong">'.$lang['srv_statistic_nonsurveyed_title'];
- echo '</span>';
- echo '<br class="clr"/>';
-
- foreach ($this->invitationStatus as $status)
- {
- if (!($this->hideNullValues_status && $this->userByStatus['invitation'][$status] == 0)) {// da ne delamo po neporebnem
- echo '<span class="dashboard_status_span">' . $lang['srv_statistic_email_status_'.$status] . ' ('.$status.') :</span>' . $this->userByStatus['invitation'][$status]
- #. ( ( $status <= 2 && $this->userByStatus['invitation'][$status] > 0 )
- # ? '&nbsp;<a href="#" onclick="survey_statistic_status(\''.$status.'\')">'.$lang['srv_statistic_detail'].'</a>'
- # : '')
- . '<br/>';
- $cntInvitation++;
- }
- }
- }
-
- // vsota emaili
- if ($cntInvitation > 0 || !$this->hideNullValues_status) {
- echo '<div class="anl_dash_bt full strong"><span class="dashboard_status_span">'.$lang['srv_statistic_sum2'].'</span>'.($this->cntUserByStatus['invitation']).'<br/></div><br/>';
- }
-
-
- // Vsota vseh
- echo '<div class="anl_dash_bt full strong"><span class="dashboard_status_span">'.$lang['srv_statistic_sum_all'].'</span>'.($this->cntUserByStatus['valid']+$this->cntUserByStatus['nonvalid']+$this->cntUserByStatus['invitation']).'<br></div>';
- }
-
+ }
+
/** Funkcija za prikaz referalov
* #KLIK NA ANKETO#
* #PREUSMERITVE#
*/
- function DisplayReferalsView() {
+ function DisplayReferalsView() {
global $lang;
global $admin_type;
- echo '<div><span class="dashboard_title">'.$lang['srv_statistic_redirection_title'].'</span>'.Help :: display('srv_statistic_redirection_title').'</div>';
+ echo '<div class="box_title">'.$lang['srv_statistic_redirection_title'].' '.Help :: display('srv_statistic_redirection_title').'</div>';
// izrisemo graf
if ( ( $this->cntValidRedirections + $this->cntNonValidRedirections ) > 0) {
$maxValue = $this->maxRedirection * GRAPH_REDUCE;
$value_sum = 0;
- echo '<table class="survey_referals_tbl">'."\n";
- echo '<tr class="anl_dash_bb">'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;"><strong>' . $lang['srv_statistic_redirection_site'] . '</strong></th>'."\n";
- echo '<td class="anl_ar"><strong>'.$lang['srv_statistic_redirection_click'].'</strong></td>'."\n";
- echo '</tr>'."\n";
+ echo '<table class="survey_referals_tbl">';
+
+ echo '<tr class="row1">';
+ echo '<td>'.$lang['srv_statistic_redirection_site'].'</td>';
+ echo '<td>'.$lang['srv_statistic_redirection_click'].'</td>';
+ echo '</tr>';
if (count($this->userRedirections["valid"])) {
foreach ($this->userRedirections["valid"] as $key => $value) {
if ($key == 'email')
{
- echo '<tr>'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;">' . $lang['srv_statistic_redirection_email'] . '</th>'."\n";
+ echo '<tr>';
+
+ echo '<td>' . $lang['srv_statistic_redirection_email'] . '</td>';
+
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+
+ echo '</tr>';
}
else
{
- echo '<tr>'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;">' . $key . '</th>'."\n";
+ echo '<tr>';
+
+ echo '<td>' . $key . '</td>';
+
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+
+ echo '</tr>';
}
$value_sum += $value;
}
}
+
// dodamo še direktni link
if ($this->userRedirections["direct"] > 0) {
$value = $this->userRedirections["direct"];
- echo '<tr>'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;">' . $lang['srv_statistic_redirection_direct'] . '</th>'."\n";
+
+ echo '<tr>';
+
+ echo '<td>' . $lang['srv_statistic_redirection_direct'] . '</td>';
+
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+
+ echo '</tr>';
+
$value_sum += $value;
- }
+ }
+
// dodamo še email klik
- // @Uros to je identicno, kot zgoraj v foreach, na koncu se gleda rezultat iz valid...se to sploh rabi?
+ // @Uros to je identicno, kot zgoraj v foreach, na koncu se gleda rezultat iz valid...se to sploh rabi?
if ($this->userRedirections["email"] > 0) {
$value = $this->userRedirections["email"];
- echo '<tr>'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;">' . $lang['srv_statistic_redirection_email'] . '</th>'."\n";
+
+ echo '<tr>';
+
+ echo '<td>' . $lang['srv_statistic_redirection_email'] . '</td>';
+
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+
+ echo '</tr>';
+
$value_sum += $value;
}
+
// dodamo sumo
- echo '<tr class="anl_dash_bt strong">'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;"><strong>' . $lang['srv_statistic_redirection_sum_clicked'] . '</strong></th>'."\n";
- echo '<td style="text-align:left">'.$value_sum.'</td>'."\n";
- echo '</tr>'."\n";
- echo '<tr class="">'."\n";
- echo '<th colspan="2">&nbsp;</th>'."\n";
- echo '</tr>'."\n";
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_redirection_sum'].'</td>';
+ echo '<td>'.$value_sum.'</td>';
+ echo '</tr>';
- /*
- // dodamo se neveljavne
- $value_sum_nonvalid = 0;
- for ($key = 2; $key >= 0; $key--) {
- $value = $this->userRedirections["$key"];
- if ($value > 0) {
- echo '<tr>'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;">' . $lang['srv_statistic_redirection_email_'.$key] . '</th>'."\n";
- $width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_ly" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
- $value_sum_nonvalid += $value;
- }
- }
- // dodamo sumo
- if ($value_sum_nonvalid > 0 ) {
- echo '<tr class="anl_dash_bt strong">'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;"><strong>' . $lang['srv_statistic_redirection_sum_nonvalid'] . '</strong></th>'."\n";
- echo '<td style="text-align:left">'.$value_sum_nonvalid.'</td>'."\n";
- echo '</tr>'."\n";
- echo '<tr class="">'."\n";
- echo '<th colspan="2">&nbsp;</th>'."\n";
- echo '</tr>'."\n";
- }
- */
- if (!($value_sum_nonvalid == 0 || $value_sum == 0 )) {
- echo '<tr class="anl_dash_bt strong">'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;"><strong>' . $lang['srv_statistic_redirection_sum'] . '</strong></th>'."\n";
- echo '<td style="text-align:left">'.($value_sum+$value_sum_nonvalid).'</td>'."\n";
- echo '</tr>'."\n";
- }
- echo '</table>'."\n";
+ echo '</table>';
- echo '<div id="referal_detail"><span class="dashboard_title">'.$lang['srv_statistic_details'].'</span></div>';
+
+ echo '<div id="referal_detail">';
+
+ echo '<span class="dashboard_title">'.$lang['srv_statistic_details'].'</span>';
+
if ($this->cntValidRedirections > 0) {
- echo '<div class="spaceLeft"><a href="#" onclick="survey_statistic_referal(this); return false;" value="0" title="'.$lang['srv_statistic_detail_referal'].'">'.$lang['srv_statistic_detail_referal'].'</a></div>';
- } else {
- echo '<div class="spaceLeft">'.$lang['srv_statistic_show_no_referals'].'</div>';
+ echo '<span><a href="#" onclick="survey_statistic_referal(this); return false;" value="0" title="'.$lang['srv_statistic_detail_referal'].'">'.$lang['srv_statistic_detail_referal'].'</a></span>';
+ }
+ else {
+ echo '<span>'.$lang['srv_statistic_show_no_referals'].'</span>';
}
- echo '<div class="spaceLeft"><a href="#" onclick="ip_list_podrobno(this); return false;" value="0" title="'.$lang['srv_statistic_detail_IP'].'">'.$lang['srv_statistic_detail_IP'].'</a></div>';
- }
-/*
- #echo '<div><p><strong>'.$lang['srv_count_ip_list'].': '.count($this->ip_list).'</strong></p></div>';
- echo '<div><p><strong>'.$lang['srv_detail_ip_list'].': </strong></p></div>';
- echo '<p>&nbsp;<a href="#" onclick="ip_list_podrobno(this); return false;" value="0">'.$lang['srv_statistic_detail'].'</a></p>';
-*/
- # skrita div aza podrobnosti
- echo '<div id="survey_referals" class="displayNone"></div>';
- echo '<div id="ip_list_podrobno" class="displayNone"></div>';
+
+ echo '<span><a href="#" onclick="ip_list_podrobno(this); return false;" value="0" title="'.$lang['srv_statistic_detail_IP'].'">'.$lang['srv_statistic_detail_IP'].'</a></span>';
+
+ # skrita div aza podrobnosti
+ echo '<div id="survey_referals" style="display:none;"></div>';
+ echo '<div id="ip_list_podrobno" style="display:none;"></div>';
+
+ echo '</div>';
+ }
}
/** Funkcija za prikaz klikov po straneh
*
*/
- function DisplayPagesStateView() {
+ function DisplayPagesStateView() {
global $lang;
# ali lovimo samo strani ki niso bile preskočene
$grupa_jump = "AND ug.preskocena = 0 ";
- echo '<span class="dashboard_title">'.$lang['srv_statistic_pages_state_title'].'</span>'.Help :: display('srv_statistic_pages_state_title');
+ echo '<div class="box_title">'.$lang['srv_statistic_pages_state_title'].' '.Help :: display('srv_statistic_pages_state_title').'</div>';
+
+ echo '<div class="box_top_settings">';
+
// Filter po osnovi
if ($this->emailInvitation == 1) {
$order = array('email','3ll','4ll','5ll',5,6);
- } else {
+ }
+ else {
$order = array('3ll','4ll','5ll',5,6);
}
- echo '<div class="floatRight">'.$lang['srv_statistic_answer_state_base'].': ';
- echo '<select id="pageUserStatusBase" onchange="changePageUserStatusBase()">';
+
+ echo $lang['srv_statistic_answer_state_base'].': ';
+ echo '<select id="pageUserStatusBase" class="dropdown small" onchange="changePageUserStatusBase()">';
foreach ($order as $key) {
echo '<option '.($this->pageUsersByStatus_base.'' == $key.'' ? ' selected="selected"' : '').' value="'.$key.'" >'.$lang['srv_userstatus_'.$key].'</option>';
}
echo '</select>';
+
echo '</div>';
+
$status_filter_string = '';
switch($this->pageUsersByStatus_base){
@@ -1655,15 +1829,16 @@ class SurveyStatistic {
$status_filter_string = "AND u.last_status='6' AND u.lurker='0'";
break;
}
-
- echo '<br class="clr">';
-
+
$pages=array();
$maxValue = 0;
+
+ $email_filter_string = '';
if ($this->emailInvitation > 0) {
if ($this->emailInvitation == 1) {
$email_filter_string = ' AND inv_res_id is not NULL ';
- } else if($this->emailInvitation == 2) {
+ }
+ else if($this->emailInvitation == 2) {
$email_filter_string = ' AND inv_res_id is NULL ';
}
}
@@ -1683,66 +1858,77 @@ class SurveyStatistic {
$maxValue = max($maxValue, $this->realUsersByStatus['3ll']['cnt']);
$maxValue = $maxValue * GRAPH_REDUCE;
- echo '<table class="survey_referals_tbl">'."\n";
- echo '<tr class="anl_dash_bb">'."\n";
- echo '<th style="width:10pt;"><strong>' . $lang['srv_statistic_answer_state_status'] . '</strong></th>'."\n";
- echo '<td class="anl_ar"><strong>'.$lang['srv_statistic_redirection_click'].'</strong></td>'."\n";
- echo '</tr>'."\n";
+
+ echo '<table class="survey_referals_tbl">';
+
+ echo '<tr class="row1">';
+ echo '<td>'.$lang['srv_statistic_answer_state_status'].'</td>';
+ echo '<td>'.$lang['srv_statistic_redirection_click'].'</td>';
+ echo '</tr>';
# status 3 - "Klik na anketo"
$value = $this->realUsersByStatus['3ll']['cnt'];
- echo '<tr>'."\n";
- echo '<th style="width: 10pt;">' . $lang['srv_userstatus_3'] . '</th>'."\n";
+ echo '<tr>';
+ echo '<td>' . $lang['srv_userstatus_3'] . '</td>';
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+ echo '</tr>';
# status 4 - "Klik na prvo stran"
$value = $this->realUsersByStatus['4ll']['cnt'];
- echo '<tr>'."\n";
- echo '<th style="width: 10pt;">' . $lang['srv_userstatus_4'] . '</th>'."\n";
+ echo '<tr>';
+ echo '<td>' . $lang['srv_userstatus_4'] . '</td>';
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+ echo '</tr>';
# status 5 - "Za&#269;el izpolnjevati",
$value = $this->realUsersByStatus[5]['cnt'];
- echo '<tr>'."\n";
- echo '<th style="width: 10pt;">' . $lang['srv_userstatus_5'] . '</th>'."\n";
+ echo '<tr>';
+ echo '<td>' . $lang['srv_userstatus_5'] . '</td>';
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+ echo '</tr>';
#strani
- echo '<tr class="anl_dash_bb">'."\n";
- echo '<th style="width:10pt;">' . $lang[''] . '</th>'."\n";
- echo '<td style="text-align:center">'.$lang[' '].'</td>'."\n";
- echo '</tr>'."\n";
+ /*echo '<tr>';
+ echo '<td></td>';
+ echo '<td></td>';
+ echo '</tr>';*/
foreach ($pages as $key => $page) {
$value = $page['cnt'];
- echo '<tr>'."\n";
- //echo '<th style="width: 10pt;">' . $page['naslov'] . '</th>'."\n";
- echo '<th style="width: 10pt;">' . $lang['srv_stran'].' '.$page['vrstni_red']. '</th>'."\n";
+ echo '<tr>';
+ echo '<td>' . $lang['srv_stran'].' '.$page['vrstni_red']. '</td>';
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+ echo '</tr>';
}
#strani
- echo '<tr class="anl_dash_bb">'."\n";
- echo '<th style="width:10pt;">' . $lang[''] . '</th>'."\n";
- echo '<td style="text-align:center">'.$lang[' '].'</td>'."\n";
- echo '</tr>'."\n";
+ /*echo '<tr>';
+ echo '<td></td>';
+ echo '<td</td>';
+ echo '</tr>';*/
# status 6 - "Koncal",
$value6 = $this->realUsersByStatus[6]['cnt'];
- echo '<tr>'."\n";
- echo '<th style="width: 10pt;">' . $lang['srv_userstatus_6'] . '</th>'."\n";
+ echo '<tr>';
+ echo '<td>' . $lang['srv_userstatus_6'] . '</td>';
$width = ($maxValue && $value6) ? (round($value6/ $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value6.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value6.'</span>';
+ echo '</td>';
+ echo '</tr>';
#če imamo lurkerje 6l dodamo skupaj konačal anketo (to je 6 + 6l) in nato še koliko jih je samo s statusom 6 (končal anketo)
# status 6l - "Koncal - lurker", izpišemo samo če obstajajo 6l
@@ -1751,28 +1937,31 @@ class SurveyStatistic {
$valueall = $this->realUsersByStatus['6ll']['cnt'] ;
# končal s tem da je lurker (6l)
- echo '<tr>'."\n";
- echo '<th style="width: 10pt;">' . $lang['srv_userstatus_6l'].'' . '</th>'."\n";
+ echo '<tr>';
+ echo '<td>' . $lang['srv_userstatus_6l'].'' . '</td>';
$width = ($maxValue && $lurkerjev) ? (round($lurkerjev / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$lurkerjev.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$lurkerjev.'</span>';
+ echo '</td>';
+ echo '</tr>';
#črta
- echo '<tr class="anl_dash_bb">'."\n";
- echo '<th style="width:10pt;">' . $lang[''] . '</th>'."\n";
- echo '<td style="text-align:center">'.$lang[' '].'</td>'."\n";
- echo '</tr>'."\n";
+ /*echo '<tr>';
+ echo '<td></td>';
+ echo '<td></td>';
+ echo '</tr>';*/
# končal ne glede na to ali je lurker
- echo '<tr>'."\n";
- echo '<th style="width: 10pt;">' . $lang['srv_userstatus_all'] . '</th>'."\n";
+ echo '<tr>';
+ echo '<td>' . $lang['srv_userstatus_all'] . '</td>';
$width = ($maxValue && $valueall) ? (round($valueall / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$valueall.'</span></td>'."\n";
- echo '</tr>'."\n";
-
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$valueall.'</span>';
+ echo '</td>';
+ echo '</tr>';
}
- echo '</table>'."\n";
+ echo '</table>';
}
/** Funkcija za prikaz seznam referalov
@@ -1788,9 +1977,7 @@ class SurveyStatistic {
$email_filter_string = ' AND inv_res_id is NULL ';
}
}
-
- echo '<br/><div class="dashboard_title">'.$lang['srv_statistic_referals_list'].Help :: display('srv_statistic_referals_list').'</div>';
-
+
// še podatke o uporabniku
$sql_userInfo = sisplet_query("SELECT referer, COUNT(*) as cnt FROM srv_user WHERE ank_id = '".$this->getSurveyId()."' AND preview = '0' AND deleted='0' AND time_insert BETWEEN '".$this->startDate."' AND '".$this->endDate."' + INTERVAL 1 ".$email_filter_string ." DAY GROUP BY referer");
if (mysqli_num_rows($sql_userInfo) > 0) {
@@ -1805,7 +1992,8 @@ class SurveyStatistic {
}
}
echo '</table>';
- } else {
+ }
+ else {
echo $lang['srv_statistic_show_no_referals'];
}
}
@@ -1827,10 +2015,8 @@ class SurveyStatistic {
# IP-je lovimo preko ajaxa
$string_sql = "SELECT COUNT(id) AS count, ip FROM srv_user WHERE ank_id='".$this->getSurveyId()."' AND preview = '0' AND deleted='0' AND (time_insert BETWEEN '".$this->startDate."' AND '".$this->endDate."' + INTERVAL 1 DAY) ".$email_filter_string." GROUP BY ip ORDER BY count DESC, ip ASC";
$sql = sisplet_query($string_sql);
-
- echo '<br/><div class="dashboard_title">'.$lang['srv_statistic_IP_list'].Help :: display('srv_statistic_IP_list').'</div>';
- if (mysqli_num_rows($sql) > 0) {
- #echo '<div class="dashboard_title">'.$lang[''].'</div>';
+
+ if (mysqli_num_rows($sql) > 0) {
echo '<table>';
while ($row = mysqli_fetch_array($sql)) {
@@ -1885,34 +2071,41 @@ class SurveyStatistic {
function DisplayFilters () {
global $lang;
+ echo '<div class="box_top_settings">';
+
// Kumulativa
- echo '<span class="floatRight" style="display:inline-block; vertical-align: middle;">';
- echo $lang['srv_statistic_hide_null'];
- echo '<input id="hideNullValues_dates" name="hideNullValues_dates" type="checkbox" onclick="statisticFilterDateRefresh();"'.($this->hideNullValues_dates ? ' checked="checked"' : '').' autocomplete="off">';
- echo '</span>';
+ echo '<div>';
+ echo ' <input id="hideNullValues_dates" name="hideNullValues_dates" type="checkbox" onclick="statisticFilterDateRefresh();"'.($this->hideNullValues_dates ? ' checked="checked"' : '').' autocomplete="off">';
+ echo ' <label for="hideNullValues_dates">'.$lang['srv_statistic_hide_null'].Help::display('srv_status_cas0').'</label>';
+ echo '</div>';
// Skrij 0
- echo '<span class="floatRight" style="display:inline-block; margin-right:10px; vertical-align: middle;">';
- echo '<label for="timelineDropDownType" autocomplete="off">'.$lang['srv_statistic_kumulativa'].': </label>';
- echo '<input type="checkbox" id="timelineDropDownType" name="timelineDropDownType" value="0" '.($this->timelineDropDownType == 1 ? ' checked="checked"' : '').' autocomplete="off" style="margin:0px!important;" onclick="statisticDropdownChange();" >';
- echo '</span>';
-
- echo '<br class="clr"/>';
+ echo '<div>';
+ echo ' <input type="checkbox" id="timelineDropDownType" name="timelineDropDownType" value="0" '.($this->timelineDropDownType == 1 ? ' checked="checked"' : '').' autocomplete="off" style="margin:0px!important;" onclick="statisticDropdownChange();" >';
+ echo ' <label for="timelineDropDownType" autocomplete="off">'.$lang['srv_statistic_kumulativa'].'</label>';
+ echo '</div>';
+ echo '</div>';
+
+
+ echo '<div class="box_top_settings">';
+
// Osnova
- echo '<span id="span_timelineDropDownType" class="floatLeft">';
+ echo '<div id="span_timelineDropDownType">';
$this->DisplayTimelineDropdowns();
- echo '</span>';
+ echo '</div>';
// Oblika
- echo '<span class="floatRight">';
- echo '<label>'.$lang['srv_statistic_period'].'</label>:'."\n";
- echo '<select id="period" name="period" size="1" onchange="statisticFilterDateRefresh();" autocomplete="off" >'."\n";
+ echo '<div>';
+ echo $lang['srv_statistic_period'].':';
+ echo ' <select id="period" name="period" class="dropdown small" size="1" onchange="statisticFilterDateRefresh();" autocomplete="off" >';
foreach ( $this->periods as $key => $_period) {
- echo '<option value="' . $_period . '" ' . ( $_period == $this->period ? ' selected="selected" ' : '') . '>'.$lang['srv_statistic_period_' . $_period ].'</option>'."\n";
+ echo ' <option value="' . $_period . '" ' . ( $_period == $this->period ? ' selected="selected" ' : '') . '>'.$lang['srv_statistic_period_' . $_period ].'</option>';
}
- echo '</select>'."\n";
- echo '</span>';
+ echo ' </select>';
+ echo '</div>';
+
+ echo '</div>';
}
function DisplayTimelineDropdowns() {
@@ -1921,25 +2114,25 @@ class SurveyStatistic {
echo $lang['srv_statistic_answer_state_base'].': ';
if ($this->timelineDropDownType == 0) {
- echo '<select name="type" id="type" onchange="statisticFilterDateRefresh();" autocomplete="off">'."\n";
+ echo '<select name="type" id="type" class="dropdown small" onchange="statisticFilterDateRefresh();" autocomplete="off">';
echo '<option value="'.TYPE_ALL.'"' . ($this -> type == TYPE_ALL ? ' selected' : '') . ' class="opt_bold">'.$lang['srv_userstatus_total'].'</option>';
echo '<option value="'.TYPE_APPROPRIATE.'"' . ($this -> type == TYPE_APPROPRIATE ? ' selected' : '') . ' class="opt_bold">'.$lang['srv_userstatus_appropriate'].'</option>';
- echo '<option value="'.TYPE_STATUS_6.'"' . ($this -> type == TYPE_STATUS_6 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_6'].' (6)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_5.'"' . ($this -> type == TYPE_STATUS_5 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_5'].' (5)</option>'."\n";
+ echo '<option value="'.TYPE_STATUS_6.'"' . ($this -> type == TYPE_STATUS_6 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_6'].' (6)</option>';
+ echo '<option value="'.TYPE_STATUS_5.'"' . ($this -> type == TYPE_STATUS_5 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_5'].' (5)</option>';
echo '<option value="'.TYPE_INAPPROPRIATE.'"' . ($this -> type == TYPE_INAPPROPRIATE ? ' selected' : '') . 'class="opt_bold">'.$lang['srv_userstatus_inappropriate'].'</option>';
- echo '<option value="'.TYPE_STATUS_6l.'"' . ($this -> type == TYPE_STATUS_6l ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_6l'].' (6l)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_5l.'"' . ($this -> type == TYPE_STATUS_5l ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_5l'].' (5l)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_4.'"' . ($this -> type == TYPE_STATUS_4 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_4'].' (4)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_3.'"' . ($this -> type == TYPE_STATUS_3 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_3'].' (3)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_2.'"' . ($this -> type == TYPE_STATUS_2 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_2'].' (2)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_1.'"' . ($this -> type == TYPE_STATUS_1 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_1'].' (1)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_0.'"' . ($this -> type == TYPE_STATUS_0 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_0'].' (0)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_NULL.'"' . ($this -> type == TYPE_STATUS_NULL ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_null'].' (-1)</option>'."\n";
- echo '<option value="'.TYPE_PAGES.'"' . ($this -> type == TYPE_PAGES ? ' selected' : '') . ' class="opt_bold">'.$lang['srv_diagnostics_strani'].'</option>'."\n";
- echo '<option value="'.TYPE_ANALYSIS.'"' . ($this -> type == TYPE_ANALYSIS ? ' selected' : '') . ' class="opt_bold">'.$lang['srv_diagnostics_analiza'].'</option>'."\n";
+ echo '<option value="'.TYPE_STATUS_6l.'"' . ($this -> type == TYPE_STATUS_6l ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_6l'].' (6l)</option>';
+ echo '<option value="'.TYPE_STATUS_5l.'"' . ($this -> type == TYPE_STATUS_5l ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_5l'].' (5l)</option>';
+ echo '<option value="'.TYPE_STATUS_4.'"' . ($this -> type == TYPE_STATUS_4 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_4'].' (4)</option>';
+ echo '<option value="'.TYPE_STATUS_3.'"' . ($this -> type == TYPE_STATUS_3 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_3'].' (3)</option>';
+ echo '<option value="'.TYPE_STATUS_2.'"' . ($this -> type == TYPE_STATUS_2 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_2'].' (2)</option>';
+ echo '<option value="'.TYPE_STATUS_1.'"' . ($this -> type == TYPE_STATUS_1 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_1'].' (1)</option>';
+ echo '<option value="'.TYPE_STATUS_0.'"' . ($this -> type == TYPE_STATUS_0 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_0'].' (0)</option>';
+ echo '<option value="'.TYPE_STATUS_NULL.'"' . ($this -> type == TYPE_STATUS_NULL ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_null'].' (-1)</option>';
+ echo '<option value="'.TYPE_PAGES.'"' . ($this -> type == TYPE_PAGES ? ' selected' : '') . ' class="opt_bold">'.$lang['srv_diagnostics_strani'].'</option>';
+ echo '<option value="'.TYPE_ANALYSIS.'"' . ($this -> type == TYPE_ANALYSIS ? ' selected' : '') . ' class="opt_bold">'.$lang['srv_diagnostics_analiza'].'</option>';
- echo '</select>'."\n";
+ echo '</select>';
}
else {
$order = array(
@@ -1948,7 +2141,7 @@ class SurveyStatistic {
'5ll'=>TYPE_STATUS_KUMULATIVE_5ll,
5=>TYPE_STATUS_KUMULATIVE_5,
6=>TYPE_STATUS_KUMULATIVE_6,);
- echo '<select name="type" id="type" onchange="statisticFilterDateRefresh();" autocomplete="off">'."\n";
+ echo '<select name="type" id="type" class="dropdown small" onchange="statisticFilterDateRefresh();" autocomplete="off">';
foreach ($order as $key => $value) {
echo '<option value="'.$value.'" '.($this -> type .'' == $value.'' ? ' selected="selected"' : '').' value="'.$value.'" >'.$lang['srv_userstatus_'.$key].'</option>';
}
@@ -1965,34 +2158,39 @@ class SurveyStatistic {
$this->maxValue *= GRAPH_REDUCE;
$cnt=0;
- echo '<table class="survey_referals_tbl">'."\n";
+ echo '<table class="survey_referals_tbl">';
if ($this->arrayRange) {
foreach ($this->arrayRange as $key => $value) {
$label = $this->formatStatsString($key, $this->period);
- echo '<tr>'."\n";
- echo '<td style="width:90px;">' . $label . '</td>'."\n";
+ echo '<tr>';
+
+ echo '<td>' . $label . '</td>';
+
$width = ($this->maxValue && $value) ? (round($value / $this->maxValue * 100, 0)) : "0";
- echo '<td style=""><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+
+ echo '</tr>';
$cnt+=$value;
}
// dodamo sumo
- echo '<tr >'."\n";
- echo '<th class="anl_dash_bt strong" style="width:'.($this->maxCharRedirection+2).'pt;"><strong>' . $lang['srv_statistic_redirection_sum'] . '</strong></th>'."\n";
- echo '<td class="anl_dash_bt strong" style="text-align:left">'.$cnt.' </td>'."\n";
- echo '</tr>'."\n";
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_redirection_sum'].'</td>';
+ echo '<td>'.$cnt.' </td>';
+ echo '</tr>';
}
else {
- echo '<td style="width:70%"><div style="background-color:#EFF2F7; border-left:1px solid #B9C5D9;">'.$lang['srv_no_data'].'</div></td>'."\n";
+ echo '<td style="width:70%"><div style="background-color:#EFF2F7; border-left:1px solid #B9C5D9;">'.$lang['srv_no_data'].'</div></td>';
}
- echo '</table>'."\n";
+ echo '</table>';
}
// pomozne funkcije
@@ -2146,7 +2344,7 @@ class SurveyStatistic {
global $site_path;
# nastavimo folder
$folder = $site_path . EXPORT_FOLDER.'/';
-
+ $lastFiles = '';
# preverimo timestampe
$str_qry_surveys = "SELECT id, UNIX_TIMESTAMP(GREATEST(insert_time,edit_time)) as time FROM srv_anketa WHERE id ='".$this->surveyId."'";
$qry_surveys = sisplet_query($str_qry_surveys);
@@ -2211,21 +2409,25 @@ class SurveyStatistic {
*
* @param HTML $data
*/
- function WriteToCacheFile($data,$timestamp) {
+ function WriteToCacheFile($data, $timestamp) {
global $site_path;
+
if ($this->surveyId !== null && $data !== null && $data !== '') {
+
# če imamo default filtre zapišemo v datoteko; Prav tako mora bit izbran osnovni profil intervala z id = 0
if ( $this->isDefaultFilters == true) {
+
# nastavimo folder
$folder = $site_path . EXPORT_FOLDER.'/';
$fileToUse = $folder . 'export_dashboard_'.$this->surveyId.'.html';
+
# pobrišemo morebitne predhodne header datoteke ankete
if (file_exists($fileToUse)) {
unlink($fileToUse);
}
$df = fopen($fileToUse, 'w') or die("can't open file");
- fwrite($df, $data);
+ fwrite($df, is_string($data));
fclose($df);
$str_qry_exist_files_update = "INSERT INTO srv_data_files (sid, dashboard_file_time, dashboard_update_time) VALUES ('".$this->surveyId."','".$timestamp."',NOW()) ON DUPLICATE KEY UPDATE dashboard_file_time = '".$timestamp."', dashboard_update_time = NOW()";
@@ -2240,10 +2442,13 @@ class SurveyStatistic {
*/
function ReadCacheFile() {
global $site_path;
+
if ($this->surveyId !== null) {
+
# nastavimo folder
$folder = $site_path . EXPORT_FOLDER.'/';
$dashboardFile = null;
+
# prebermo fajl:
foreach (glob($folder . 'export_dashboard_'.$this->surveyId.'.html') as $filesToUse) {
if ( $dashboardFile == null) {
@@ -2256,123 +2461,13 @@ class SurveyStatistic {
$data = fread($df, filesize($dashboardFile));
fclose($df);
+
return $data;
}
+
return null;
}
-
-
- /** Funkcija klice funkcije za prikaz statistike
- * DisplayInfoView - prikaze panelo z osnovnimi informacijami
- * DisplayStatusView - prikaze panelo z kliki po statusih
- * DisplayReferalsView - prikaze panelo z redirekcijami in referali
- * DisplayDataView - prikate panelo z kliki po datumih
- */
- function WriteDashboardToFile($sid,$timestamp) {
-
- global $lang, $site_url;
- if ((int)$sid > 0) {
-
- # spodnje ehote shranimo v spremenljivko ki jo popotrebi keširanja shranimo v datoteko.
-
- // preverimo ali ima anketa kakšne vnose
- $str_qry_all_users = "SELECT count(u.id) AS user_count FROM srv_user AS u " . "WHERE u.ank_id = '".$this->getSurveyId()."' AND preview = '0' AND deleted='0' ";
- $qry_all_users = sisplet_query($str_qry_all_users);
- $row_all_users = mysqli_fetch_assoc($qry_all_users);
- $allUserCount = $row_all_users['user_count'];
-
- ob_start();
-
- #echo '<div class="floatLeft" id="updateTime">'.$lang['srv_dashboard_updated'].date("d.m.Y, H:i").'</div>';
-
- if ($allUserCount == 0) { // nimamo še vnosov
-
- // zgornji boxi
- echo '<table class="dashboard dashboard_single">';
- echo '<tr>';
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_info" id="div_statistic_info" >'."\n";
- $this -> DisplayInfoView();
- echo '</div>';
- echo '</td>';
- echo '</tr>';
- echo '</table>';
-
- // 1) če ankete še nima nobenega klika, naj se pri poročilu ne prikaže nobena od šestih analiza,
- // ampak naj pise: Anketa nima še nobenega vnosa« zreaven naj bo v SIVEM zavihka UREJANJE
- // 2) Če nima anketa nobenega klika in ni niti aktivirana, pa napisite:
- // Anketa še ni aktivvirajna. Zraven naj bo sta siva zavihkja Urejanje vprašalnika in Objave&vabila
-
-
- } else {
-
- // imamo vnose, prikažemo statistiko
- $this->PrepareDateView();
- $this->PrepareStatusView();
-
- echo '<table class="dashboard">';
- echo '<tr>';
-
- // zgornji boxi
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_info" id="div_statistic_info" >'."\n";
- $this -> DisplayInfoView();
- echo '</div>';
- echo '</td>';
-
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_status" id="div_statistic_status" >'."\n";
- $this -> DisplayStatusView();
- echo '</div>';
- echo '</td>';
-
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_answer_state" id="div_statistic_answer_state" >'."\n";
- $this -> DisplayAnswerStateView();
- echo '</div>';
- echo '</td>';
- echo '</tr>';
-
- // spodnji boxi
- echo '<tr>';
- echo '<td>';
- echo '<div class="dashboard_cell" id="div_statistic_referals">';
- $this -> DisplayReferalsView();
- echo '</div>';
- echo '</td>';
-
- echo '<td>';
- echo '<div class="dashboard_cell" id="div_statistic_visit">';
- echo '<span class="dashboard_title">'.$lang['srv_statistic_timeline_title'].'</span>'.Help :: display('srv_statistic_timeline_title');
- echo '<form name="frm_statistic_filter" id="frm_statistic_filter" autocomplete="off">'."\n";
- // echo '<div name="div_statistic_filter" id="div_statistic_filter" >'."\n";
- $this -> DisplayFilters();
- // echo '</div>';
- echo '</form>';
- echo '<br/>';
-
- echo '<div name="div_statistic_visit_data" id="div_statistic_visit_data" >'."\n";
- $this -> DisplayDateView();
- echo '</div>';
- echo '</div>';
- echo '</td>';
-
- echo '<td>';
- echo '<div class="dashboard_cell" id="div_statistic_pages_state">';
- $this -> DisplayPagesStateView();
- echo '</div>';
- echo '</td>';
-
- echo '</tr>';
- echo '</table>';
- }
-
- # HTML zapišemo v spremenljivko
- $dashboardHtml = ob_get_clean();
- $this->WriteToCacheFile($dashboardHtml,$timestamp);
- }
- }
-
+
function changeInvitationFilter() {
$this->emailInvitationFilter($_POST['filter_email_status']);
}
@@ -2424,14 +2519,14 @@ class SurveyStatistic {
$this->PrepareDateView();
$this->PrepareStatusView();
-
+ $allCnt = 0;
echo '<table class="dashboard dashboard_single">';
echo '<tr>';
// zgornji boxi
echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_info" id="div_statistic_info" >'."\n";
+ echo '<div class="dashboard_cell" name="div_statistic_info" id="div_statistic_info" >';
{
$lang_array = array();
@@ -2442,13 +2537,20 @@ class SurveyStatistic {
$lang_array[$rowl['lang_id']] = $rowl['language'];
}
- echo '<span class="dashboard_title">'.$lang['srv_statistic_lang_title'].'</span>';
- echo '<br/>';
+ echo '<div class="box_title">'.$lang['srv_statistic_lang_title'].'</div>';
+
+
echo '<table id="tbl_answ_state">';
- echo '<tr class="anl_dash_bb "><th><strong>'.$lang['srv_statistic_lang'].'</strong></th><td><strong>'.$lang['srv_statistic_answer_state_frequency'].'</strong></td><td><strong>'.$lang['srv_statistic_answer_state_percent'].'</strong></td></tr>';
- foreach ($this->respondentLangArray as $key => $cnt) {
+
+ echo '<tr class="anl_dash_bb ">';
+ echo '<td>'.$lang['srv_statistic_lang'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_frequency'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_percent'].'</td>';
+ echo '</tr>';
+
+ foreach ($this->respondentLangArray as $key => $cnt) {
$allCnt+=$cnt;
- echo '<tr><th>'.$lang_array[$key].'</th>';
+ echo '<tr><td>'.$lang_array[$key].'</td>';
#frekvenca
echo '<td>'.(int)$cnt.'</td>';
#procenti
@@ -2460,10 +2562,13 @@ class SurveyStatistic {
echo '</td>';
echo '</tr>';
}
- echo '<tr class="anl_dash_bt "><th><strong>'.$lang['srv_statistic_sum'].'</strong></th>';
- #frekvenca
+
+ echo '<tr class="anl_dash_bt "><td>'.$lang['srv_statistic_sum'].'</td>';
+
+ #frekvenca
echo '<td><strong>'.(int)$allCnt.'</strong></td>';
- #procenti
+
+ #procenti
echo '<td>';
$percent = 100;
echo $this->formatNumber((int)$percent,NUM_DIGIT_PERCENT,'%');
@@ -2475,8 +2580,8 @@ class SurveyStatistic {
echo '</div>';
echo '</td>';
echo '</tr>';
+
echo '</table>';
-
}
}
?> \ No newline at end of file