summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/tracking
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/classes/tracking')
-rw-r--r--admin/survey/classes/tracking/CrossRoad.php432
-rw-r--r--admin/survey/classes/tracking/TrackingClass.php242
-rw-r--r--admin/survey/classes/tracking/UserTrackingClass.php20
3 files changed, 553 insertions, 141 deletions
diff --git a/admin/survey/classes/tracking/CrossRoad.php b/admin/survey/classes/tracking/CrossRoad.php
index cd8c2e4..01f9475 100644
--- a/admin/survey/classes/tracking/CrossRoad.php
+++ b/admin/survey/classes/tracking/CrossRoad.php
@@ -13,26 +13,49 @@
*/
class CrossRoad {
+
static function MainNavigation($anketa=null){
+
+ // Status za tracking sprememb
$status = -1;
+
+ // Lokacija v navigaciji
+ $first_action = '';
+ $second_action = '';
+ $third_action = '';
+
+ // Layout strani glede na to kje se nahajamo (imamo levi meni in sirina holderja)
+ $layout_menu = '';
+ $layout_width = '';
+ $hide_header = '';
+
# ajaxa se poslje skupaj z ajaxom, da ob updatu vemo kaksen 'a' je bil na originalni strani
# (drugace se ob updatu z ajaxom informacija o 'a'ju zgubi)
$get = $_GET['a'];
+
if (isset ($_GET['ajaxa']))
$get = $_GET['ajaxa'];
- if (trim($get) == '') {
+
+ if ($get === null || trim($get) == '')
$get = A_BRANCHING;
- }
-
+
+
//smo vezani na anketo
if($anketa != null && $anketa > 0){
+
switch ($get) {
- # status
+
+ # STATUS
case A_REPORTI:
$first_action = NAVI_STATUS;
$second_action = NAVI_STATUS_OSNOVNI;
+
+ $layout_width = 'wide';
+
$status = 3;
+
break;
+
case A_NONRESPONSE_GRAPH:
case A_USABLE_RESP:
case A_KAKOVOST_RESP:
@@ -45,19 +68,33 @@ class CrossRoad {
case A_PARA_GRAPH:
case 'langStatistic':
case 'AAPOR':
+ case A_STATUS_ADVANCED:
$first_action = NAVI_STATUS;
$second_action = NAVI_STATUS_OSNOVNI;
+
+ $layout_width = 'wide';
+ if ($_GET['m'] == 'advanced')
+ $layout_width = 'fullwidth';
+
$status = 4;
+
break;
- # urejanje
+
+ # UREJANJE ANKETE
case A_BRANCHING:
case A_GLASOVANJE:
$first_action = NAVI_UREJANJE;
$second_action = NAVI_UREJANJE_BRANCHING;
+
+ $layout_width = 'fullwidth';
+
$status = 0;
+
break;
+
+ # TESTIRANJE
case A_TESTIRANJE:
$first_action = NAVI_TESTIRANJE;
$second_action = M_TESTIRANJE_DIAGNOSTIKA;
@@ -70,26 +107,45 @@ class CrossRoad {
if ($_GET['m'] == M_TESTIRANJE_CAS) {
$second_action = NAVI_TESTIRANJE_CAS;
}
+
+ $layout_width = 'narrow';
+
+ if (isset($_GET['m']) && ($_GET['m'] == 'cas' || $_GET['m'] == 'predvidenicas')) {
+ $layout_width = 'wide';
+
+ }
+
$status = 4;
+
break;
+
+ # NASTAVITVE ANKETE
case A_KOMENTARJI:
case A_KOMENTARJI_ANKETA:
$first_action = NAVI_TESTIRANJE;
$second_action = NAVI_TESTIRANJE_KOMENTARJI;
+
+ $layout_width = 'narrow';
+ if (isset($_GET['a']) && ($_GET['a'] == 'komentarji' || $_GET['a'] == 'komentarji_anketa'))
+ $layout_width = 'wide';
+
+ $layout_menu = '';
+
$status = 0;
- break;
+ break;
+
case A_SETTINGS:
case A_OSNOVNI_PODATKI:
case A_FORMA:
-
case A_COOKIE:
case A_TRAJANJE:
case A_DOSTOP:
case A_MISSING:
case A_METADATA:
case A_MOBILESETTINGS:
+ case A_TABLESETTINGS:
case A_JEZIK: # nastavitve jezik
case A_UREJANJE: # nastavitve komentarjev
case A_PRIKAZ: # nastavitve komentarjev
@@ -98,7 +154,12 @@ class CrossRoad {
case A_GDPR:
$first_action = NAVI_UREJANJE;
$second_action = NAVI_UREJANJE_ANKETA;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
$status = 0;
+
break;
case A_TEMA: # nastavitve prevajanje
@@ -106,51 +167,143 @@ class CrossRoad {
case 'edit_css': # nastavitve prevajanje
$first_action = NAVI_UREJANJE;
$second_action = NAVI_UREJANJE_TEMA;
+
+ $layout_width = 'wide';
+ if($_GET['t'] == 'upload')
+ $layout_width = 'narrow';
+
$status = 0;
+
break;
case A_HIERARHIJA:
$first_action = NAVI_HIERARHIJA;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
break;
case A_PREVAJANJE: # nastavitve prevajanje
$first_action = NAVI_UREJANJE;
$second_action = NAVI_UREJANJE_PREVAJANJE;
+
+ $layout_width = 'fullwidth';
+
$status = 0;
+
break;
case A_ALERT:
$first_action = NAVI_UREJANJE;
$second_action = NAVI_UREJANJE_ANKETA;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
$status = 0;
+
break;
case A_NAGOVORI:
+ $first_action = NAVI_UREJANJE;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
+ $status = 0;
+
+ break;
+
+
+ # ARHIVI
case A_ARHIVI:
+ $first_action = ($_GET['m'] == 'data') ? NAVI_RESULTS : NAVI_UREJANJE;
+ $second_action = NAVI_ARHIVI;
+
+ if(isset($_GET['m']) && $_GET['m'] == 'survey')
+ $third_action = NAVI_UREJANJE_ARHIVI_EXPORT1;
+ elseif(isset($_GET['m']) && $_GET['m'] == 'survey_data')
+ $third_action = NAVI_UREJANJE_ARHIVI_EXPORT2;
+ elseif(!isset($_GET['m']) || $_GET['m'] != 'data')
+ $third_action = NAVI_UREJANJE_ARHIVI;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
+
+ $status = 0;
+
+ break;
+
case A_TRACKING:
$first_action = NAVI_UREJANJE;
+ $second_action = NAVI_ARHIVI;
+
+ if(isset($_GET['appendMerge']) && $_GET['appendMerge'] == '1')
+ $third_action = NAVI_UREJANJE_ARHIVI_TRACKING3;
+ elseif($_GET['m'] == 'tracking_data')
+ $third_action = NAVI_UREJANJE_ARHIVI_TRACKING2;
+ else
+ $third_action = NAVI_UREJANJE_ARHIVI_TRACKING1;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
$status = 0;
+
break;
- # objave, vabila
+
+ # OBJAVA, VABILA
case A_VABILA:
$first_action = NAVI_OBJAVA;
+ $_GET['m'] == 'settings' ? $second_action = NAVI_OBJAVA_SETTINGS : (isset($_GET['m']) && $_GET['m'] == 'url' ? $second_action = NAVI_OBJAVA_URL : $second_action = '');
+
+ $layout_width = 'narrow';
+
$status = 5;
+
break;
case A_EMAIL:
$first_action = NAVI_OBJAVA;
$second_action = NAVI_OBJAVA;
+
+ $layout_width = 'wide';
+
$status = 5;
+
break;
case 'invitations':
$first_action = NAVI_OBJAVA;
- $second_action = 'invitations';
+ $second_action = (isset($_GET['m']) && $_GET['m'] == 'view_archive') ? NAVI_ARHIVI : 'invitations';
+
+ $layout_width = 'wide';
+
+ if ($_GET['m'] == 'view_archive')
+ $layout_menu = "menu_left";
+
$status = 5;
+
break;
- # analize, podatki
+ case A_OTHER_INV:
+ $first_action = NAVI_OBJAVA;
+ $second_action = (isset($_GET['m']) && $_GET['m'] == 'view_archive') ? NAVI_ARHIVI : NAVI_OBJAVA;
+
+ $layout_width = 'narrow';
+
+ if ($_GET['m'] == 'view_archive')
+ $layout_menu = "menu_left";
+
+ $status = 5;
+
+ break;
+
+
+ # ANALIZE, PODATKI
case A_ANALYSIS:
$first_action = NAVI_ANALYSIS;
@@ -158,39 +311,163 @@ class CrossRoad {
if ($_GET['m'] == M_ANALYSIS_LINKS) {
$second_action = NAVI_ANALYSIS_LINKS;
}
+ elseif($_GET['m'] == 'anal_arch'){
+ $second_action = NAVI_ARHIVI;
+ }
+
+ if ($_GET['m'] == 'sumarnik') {
+ $third_action = M_ANALYSIS_SUMMARY;
+ }
+ elseif ($_GET['m'] == 'descriptor') {
+ $third_action = M_ANALYSIS_DESCRIPTOR;
+ }
+ elseif ($_GET['m'] == 'frequency') {
+ $third_action = M_ANALYSIS_FREQUENCY;
+ }
+ elseif ($_GET['m'] == 'crosstabs') {
+ $third_action = M_ANALYSIS_CROSSTAB;
+ }
+ elseif ($_GET['m'] == 'multicrosstabs') {
+ $third_action = M_ANALYSIS_MULTICROSSTABS;
+ }
+ elseif ($_GET['m'] == 'means') {
+ $third_action = M_ANALYSIS_MEANS;
+ }
+ elseif ($_GET['m'] == 'ttest') {
+ $third_action = M_ANALYSIS_TTEST;
+ }
+ elseif ($_GET['m'] == 'break') {
+ $third_action = M_ANALYSIS_BREAK;
+ }
+
+
+ if ($_GET['m'] == 'charts') {
+ $layout_width = 'narrow';
+ }
+ else{
+ $layout_width = 'wide';
+ }
+
+ if ($_GET['m'] == 'anal_arch') {
+ $layout_menu = 'menu_left';
+ }
+
$status = 2;
+
break;
case A_COLLECT_DATA:
$first_action = NAVI_RESULTS;
$second_action = NAVI_DATA;
+
+ $layout_width = 'fullwidth';
+
+ if ($_GET['m'] == M_COLLECT_DATA_CALCULATION) {
+ $second_action = NAVI_DATA_CALC;
+ $third_action = NAVI_DATA_CALC_CALCULATION;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+ }
+ elseif($_GET['m'] == M_COLLECT_DATA_CODING){
+ $second_action = NAVI_DATA_CALC;
+ $third_action = NAVI_DATA_CALC_CODING;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+ }
+ elseif($_GET['m'] == M_COLLECT_DATA_CODING_AUTO){
+ $second_action = NAVI_DATA_CALC;
+ $third_action = NAVI_DATA_CALC_CODING_AUTO;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+ }
+ elseif($_GET['m'] == M_COLLECT_DATA_RECODING){
+ $second_action = NAVI_DATA_CALC;
+ $third_action = NAVI_DATA_CALC_RECODING;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+ }
+
+ elseif(isset($_GET['m']) && ($_GET['m'] == M_COLLECT_DATA_APPEND || $_GET['m'] == 'upload_xls' || $_GET['m'] == 'append_xls' || $_GET['m'] == 'merge_xls')){
+ $second_action = NAVI_DATA_IMPORT;
+ $third_action = NAVI_DATA_IMPORT_APPEND;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+ }
+ elseif(isset($_GET['m']) && $_GET['m'] == M_COLLECT_DATA_MERGE){
+ $second_action = NAVI_DATA_IMPORT;
+ $third_action = NAVI_DATA_IMPORT_MERGE;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+ }
+ elseif (isset($_GET['m']) && $_GET['m'] == 'quick_edit') {
+ $layout_width = 'wide';
+ }
+ elseif (isset($_GET['m']) && $_GET['m'] == 'variables') {
+ $layout_width = 'wide';
+ }
+
$status = 4;
+
break;
- #izvozi
+
+ # IZVOZI
case A_COLLECT_DATA_EXPORT:
$first_action = NAVI_RESULTS;
$second_action = NAVI_DATA_EXPORT;
+
+ if(isset($_GET['m']) && $_GET['m'] == M_EXPORT_EXCEL){
+ $third_action = NAVI_DATA_EXPORT_EXCEL;
+ }
+ elseif(isset($_GET['m']) && $_GET['m'] == M_EXPORT_EXCEL_XLS){
+ $third_action = NAVI_DATA_EXPORT_EXCEL_XLS;
+ }
+ elseif(isset($_GET['m']) && $_GET['m'] == M_EXPORT_SAV){
+ $third_action = NAVI_DATA_EXPORT_SAV;
+ }
+ elseif(isset($_GET['m']) && $_GET['m'] == M_EXPORT_TXT){
+ $third_action = NAVI_DATA_EXPORT_TXT;
+ }
+ else{
+ $third_action = NAVI_DATA_EXPORT_SPSS;
+ }
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
$status = 4;
- if ($_GET['m'] == A_COLLECT_DATA_EXPORT_ALL) {
+
+ if (isset($_GET['m']) && $_GET['m'] == A_COLLECT_DATA_EXPORT_ALL) {
$first_action = NAVI_RESULTS;
$second_action = NAVI_ANALYSIS_LINKS;
+ $third_action = '';
+
$status = 2;
}
+
break;
- # dodatne nastavitve
+
+ # DODATNE NASTAVITVE
case A_ADVANCED:
case A_UPORABNOST:
case A_HIERARHIJA_SUPERADMIN:
case A_KVIZ:
case A_VOTING:
case A_ADVANCED_PARADATA:
+ case A_ADVANCED_TIMESTAMPS:
case A_JSON_SURVEY_EXPORT:
case A_VNOS:
case A_SOCIAL_NETWORK:
case A_CHAT:
case A_PANEL:
+ case A_EMAIL_ACCESS:
case A_SLIDESHOW:
case A_360:
case A_360_1KA:
@@ -209,7 +486,12 @@ class CrossRoad {
case 'fieldwork':
$first_action = NAVI_UREJANJE;
$second_action = NAVI_UREJANJE_ANKETA;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
$status = 0;
+
break;
case A_TELEPHONE:
@@ -217,35 +499,125 @@ class CrossRoad {
case T_PHONE:
$first_action = NAVI_UREJANJE;
$second_action = NAVI_UREJANJE_ANKETA;
+
+ $layout_width = 'wide';
+
+ // Anektar (telefonska anketa) nima leve navigacije
+ global $global_user_id;
+ if(!Common::isUserAnketar($anketa, $global_user_id))
+ $layout_menu = 'menu_left';
+
$status = 5;
+
break;
- case A_LANGUAGE_TECHNOLOGY:
- $first_action = NAVI_TESTIRANJE;
- $second_action = NAVI_TESTIRANJE_LANGUAGE_TECHNOLOGY;
- $status = 4;
+ default:
break;
+ }
+
+ // shrani tracking za anketo
+ if(!isDemoSurvey($anketa)
+ && $third_action != NAVI_UREJANJE_ARHIVI_TRACKING1
+ && $third_action != NAVI_UREJANJE_ARHIVI_TRACKING2
+ && $third_action != NAVI_UREJANJE_ARHIVI_TRACKING3
+ ){
+ TrackingClass::update($anketa, $status);
+ }
+ }
+ // Nismo vezani na anketo, tracking uporabnika
+ else{
+
+ switch ($get) {
+
+ # AKTIVNOST in UPORABNIKI
+ case 'diagnostics':
+
+ // Uporabniki
+ if(isset($_GET['t']) && $_GET['t'] == 'uporabniki'){
+ $layout_width = 'narrow';
+ if(!isset($_GET['m']) || $_GET['m'] == 'all' || $_GET['m'] == ''){
+ $layout_width = 'fullwidth';
+ }
+ }
+ // Ativnost
+ else{
+ $layout_width = 'narrow';
+ }
- case A_LANGUAGE_TECHNOLOGY_OLD:
- $first_action = NAVI_TESTIRANJE;
- $second_action = NAVI_TESTIRANJE_LANGUAGE_TECHNOLOGY_OLD;
- $status = 4;
break;
+
+ # KNJIZNICA
+ case 'knjiznica':
+ $layout_width = 'wide';
+
+ break;
+
+
+ # NASTAVITVE
+ case 'nastavitve':
+ $layout_width = 'narrow';
+
+ break;
+
+
+ # OBVESTILA
+ case 'obvestila':
+ $layout_width = 'narrow';
+
+ break;
+
+
+ # GDPR
+ case 'gdpr':
+ if (isset($_GET['m']) && $_GET['m'] == 'gdpr_requests')
+ $layout_width = 'wide';
+ elseif (isset($_GET['m']) && $_GET['m'] == 'gdpr_requests_all')
+ $layout_width = 'fullwidth';
+ else
+ $layout_width = 'narrow';
+
+ break;
+
+
+ # MODUL UL EVALVACIJE
+ case 'ul_evalvation':
+ $layout_width = 'wide';
+
+ break;
+
+
+ # MOJE ANKETE
+ case 'pregledovanje':
default:
+ $layout_width = 'wide';
+
+ if ((isset($_GET['a']) && $_GET['a'] == 'ustvari_anketo') || (isset($_GET['b']) && $_GET['b'] == 'new_survey')) {
+ $layout_width = 'fullwidth';
+ $layout_menu = 'menu_left';
+ $hide_header = 'hide_header';
+ }
+
+ if ($_GET['a'] == 'narocila') {
+ $layout_width = 'narrow';
+ }
+
break;
}
- //shrani tracking
- TrackingClass::update($anketa, $status);
- //vrni podatke o navigaciji nazaj v SurveyAdmin
- return array('first_action' => $first_action, 'second_action' => $second_action);
- }
- //nismo vezani na anketo, tracking uporabnika
- else{
+ // shrani tracking za userja
TrackingClass::update_user();
}
-
-
+
+ // vrni podatke o navigaciji nazaj v SurveyAdmin
+ return array(
+ 'first_action' => $first_action,
+ 'second_action' => $second_action,
+ 'third_action' => $third_action,
+
+ 'layout_width' => $layout_width,
+ 'layout_menu' => $layout_menu,
+ 'hide_header' => $hide_header,
+ );
}
}
diff --git a/admin/survey/classes/tracking/TrackingClass.php b/admin/survey/classes/tracking/TrackingClass.php
index f635d4f..fe31ddf 100644
--- a/admin/survey/classes/tracking/TrackingClass.php
+++ b/admin/survey/classes/tracking/TrackingClass.php
@@ -23,12 +23,11 @@ class TrackingClass
# poiščemo aktivno anketo
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
- if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
- $this->db_table = '_active';
+ $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
- if ($_GET['m'] == 'tracking_data')
+ if (isset($_GET['m']) && $_GET['m'] == 'tracking_data')
$this->sub = 'data';
- elseif ($_GET['appendMerge'] == '1')
+ elseif (isset($_GET['appendMerge']) && $_GET['appendMerge'] == '1')
$this->sub = 'append';
else
$this->sub = 'survey';
@@ -118,15 +117,11 @@ class TrackingClass
{
global $lang;
+ $surveyName = SurveyInfo::getInstance()->getSurveyTitle();
+
echo '<fieldset>';
echo '<legend>' . $lang['srv_survey_archives_tracking_' . $this->sub] . '</legend>';
- // Izvoz v Excel
- echo '<p><a href="index.php?anketa=' . $this->anketa . '&a=' . $_GET['a'] . '&d=download">Download Excel</a></p>';
-
-
- echo '<table id="tracking">';
-
// Tabela s podatki o spremembah podatkov
if ($this->sub == 'data') {
@@ -139,74 +134,96 @@ class TrackingClass
OR (`get` LIKE \'%urejanje: "1"%\' AND status=\'4\')
)';
- // Prva vrstica
- echo '<tr>';
- echo ' <th>' . $lang['date'] . '</th>';
- echo ' <th>User</th>';
- echo ' <th class="center">IP</th>';
- echo ' <th class="center">Recnum</th>';
- echo ' <th>GET</th>';
- echo ' <th>POST</th>';
- echo '</tr>';
-
+
// Vrstice s podatki
- $sql = sisplet_query("SELECT * FROM srv_tracking".$this->db_table." WHERE ank_id = '$this->anketa' " . $appendMerge . " " . $data . " ORDER BY datetime DESC");
- while ($row = mysqli_fetch_array($sql)) {
+ $sql = sisplet_query("SELECT * FROM srv_tracking".$this->db_table." WHERE ank_id = '$this->anketa' " . $data . " ORDER BY datetime DESC");
+
+ if(!empty(mysqli_fetch_array($sql))) {
+
+
+ echo '<p class="bottom16">'.$lang['srv_survey_archives_tracking_survey_text1'].' '.$lang['srv_survey_archives_tracking_survey_text1b'].' <a href="index.php?anketa=' . $this->anketa . '&a=data">\'<span class="caps">'.$lang['navigation_NAVI_RESULTS'].'</span>\' - \''.$lang['navigation_NAVI_DATA'].'\'</a> '.$lang['srv_survey_archives_tracking_survey_text1c'].' \''.$surveyName.'\'. '.$lang['srv_survey_archives_tracking_survey_text2'].' <a href="index.php?anketa=' . $this->anketa . '&a=' . $_GET['a'] . '&d=download">'.$lang['srv_survey_archives_tracking_survey_text3'].'</a>.</p>';
+
+ // Izvoz v Excel
+ echo '<div class="izvoz_nad_tabelo">';
+ echo '<a class="noline" href="index.php?anketa=' . $this->anketa . '&a=' . $_GET['a'] . '&d=download"><span class="faicon xls green link-right"></span>'.$lang['srv_export_excel'].'</a>';
+ echo '</div>';
+
+ echo '<table id="tracking" class="fullwidth">';
+ // Prva vrstica
echo '<tr>';
+ echo ' <th>' . $lang['date'] . '</th>';
+ echo ' <th>' . $lang['user'] . '</th>';
+ echo ' <th>IP</th>';
+ echo ' <th>Respondent</th>';
+ echo ' <th>GET</th>';
+ echo ' <th>POST</th>';
+ echo '</tr>';
- $sqlu = sisplet_query("SELECT name, surname FROM users WHERE id = '$row[user]'");
- $rowu = mysqli_fetch_array($sqlu);
+ $count = 0;
+ while ($row = mysqli_fetch_array($sql)) {
+ echo '<tr '.($count > 24 ? 'class="displayNone"' : '').($count == 24 ? ' class="show_as_last_row"' : '').'>';
- // Pri podatkih dobimo posebej podatke o editiranem respondentu
- $usr_id = '';
- $cookie = '';
+ $sqlu = sisplet_query("SELECT name, surname FROM users WHERE id = '$row[user]'");
+ $rowu = mysqli_fetch_array($sqlu);
- // Preverimo ce imamo usr_id v GET-u
- $get_array_temp = explode(', ', $row['get']);
- foreach ($get_array_temp AS $get_val) {
- $param = explode(': ', $get_val);
- $get_array[$param[0]] = $param[1];
- }
+ // Pri podatkih dobimo posebej podatke o editiranem respondentu
+ $usr_id = '';
+ $cookie = '';
- if (isset($get_array['usr_id']) && $get_array['usr_id'] != '') {
- $usr_id = trim($get_array['usr_id'], '"');
- } // Preverimo ce iammo slucajno cookie
- elseif (isset($get_array['survey-' . $this->anketa]) && $get_array['survey-' . $this->anketa] != '') {
- $cookie = trim($get_array['survey-' . $this->anketa], '"');
- } else {
- // Preverimo ce imamo usr_id v POST-u
- $post_array_temp = explode(', ', $row['post']);
- foreach ($post_array_temp AS $post_val) {
- $param = explode(': ', $post_val);
- $post_array[$param[0]] = $param[1];
+ // Preverimo ce imamo usr_id v GET-u
+ $get_array_temp = explode(', ', $row['get']);
+ foreach ($get_array_temp AS $get_val) {
+ $param = explode(': ', $get_val);
+ $get_array[$param[0]] = $param[1];
}
- if (isset($post_array['usr_id']) && $post_array['usr_id'] != '')
- $usr_id = trim($post_array['usr_id'], '"');
- }
+ if (isset($get_array['usr_id']) && $get_array['usr_id'] != '') {
+ $usr_id = trim($get_array['usr_id'], '"');
+ } // Preverimo ce iammo slucajno cookie
+ elseif (isset($get_array['survey-' . $this->anketa]) && $get_array['survey-' . $this->anketa] != '') {
+ $cookie = trim($get_array['survey-' . $this->anketa], '"');
+ } else {
+ // Preverimo ce imamo usr_id v POST-u
+ $post_array_temp = explode(', ', $row['post']);
+ foreach ($post_array_temp AS $post_val) {
+ $param = explode(': ', $post_val);
+ $post_array[$param[0]] = $param[1];
+ }
+
+ if (isset($post_array['usr_id']) && $post_array['usr_id'] != '')
+ $usr_id = trim($post_array['usr_id'], '"');
+ }
- if ($usr_id != '') {
- $sqlR = sisplet_query("SELECT recnum FROM srv_user WHERE id = '$usr_id'");
- $rowR = mysqli_fetch_array($sqlR);
+ if ($usr_id != '') {
+ $sqlR = sisplet_query("SELECT recnum FROM srv_user WHERE id = '$usr_id'");
+ $rowR = mysqli_fetch_array($sqlR);
- $recnum = $rowR['recnum'];
- } elseif ($cookie != '') {
- $sqlR = sisplet_query("SELECT recnum FROM srv_user WHERE cookie = '$cookie'");
- $rowR = mysqli_fetch_array($sqlR);
+ $recnum = $rowR['recnum'];
+ } elseif ($cookie != '') {
+ $sqlR = sisplet_query("SELECT recnum FROM srv_user WHERE cookie = '$cookie'");
+ $rowR = mysqli_fetch_array($sqlR);
- $recnum = $rowR['recnum'];
- } else
- $recnum = 0;
+ $recnum = $rowR['recnum'];
+ } else
+ $recnum = 0;
- echo ' <td>' . datetime($row['datetime']) . '</td>';
- echo ' <td>' . $rowu['name'] . ' ' . $rowu['surname'] . '</td>';
- echo ' <td class="center">' . $row['ip'] . '</td>';
- echo ' <td class="center">' . $recnum . '</td>';
- echo ' <td>' . $row['get'] . '</td>';
- echo ' <td>' . $row['post'] . '</td>';
+ echo ' <td><div class="no_wrap">' . datetime($row['datetime']) . '</div></td>';
+ echo ' <td><div class="no_wrap">' . $rowu['name'] . ' ' . $rowu['surname'] . '</div></td>';
+ echo ' <td>' . $row['ip'] . '</td>';
+ echo ' <td>' . $recnum . '</td>';
+ echo ' <td><div class="postget_wrap">' . $row['get'] . '</div></td>';
+ echo ' <td><div class="postget_wrap">' . (($row['post'] != "") ? $row['post'] : '/') . '</div></td>';
- echo '</tr>';
+ echo '</tr>';
+
+ $count++;
+ }
+ }
+ else {
+ echo '<p>'.ucfirst($lang['srv_survey_archives_tracking_survey_text1b']).' <a href="index.php?anketa=' . $this->anketa . '&a=data">\'<span class="caps">'.$lang['navigation_NAVI_RESULTS'].'</span>\' - \''.$lang['navigation_NAVI_DATA'].'\'</a> '.$lang['srv_survey_archives_tracking_survey_text1d'].'.</p>';
}
+
+
} // Tabela s podatki o spremembah - vse oz. merge/append
else {
@@ -231,32 +248,53 @@ class TrackingClass
else
$appendMerge = "";
- // Prva vrstica
- echo '<tr>';
- echo ' <th>' . $lang['date'] . '</th>';
- echo ' <th>User</th>';
- echo ' <th class="center">IP</th>';
- echo ' <th class="center">Podstran</th>';
- echo ' <th>GET</th>';
- echo ' <th>POST</th>';
- echo '</tr>';
// Vrstice s podatki
- $sql = sisplet_query("SELECT * FROM srv_tracking".$this->db_table." WHERE ank_id = '$this->anketa' " . $this->status . " " . $appendMerge . " " . $data . " ORDER BY datetime DESC");
- while ($row = mysqli_fetch_array($sql)) {
+ $sql = sisplet_query("SELECT * FROM srv_tracking".$this->db_table." WHERE ank_id = '$this->anketa' " . $this->status . " " . $appendMerge . " ORDER BY datetime DESC");
+
+ if(!empty(mysqli_fetch_array($sql))) {
+
+ if($appendMerge == "")
+ echo '<p class="bottom16">'.$lang['srv_survey_archives_tracking_survey_text1'].' '.$lang['srv_survey_archives_tracking_survey_text1a'].' \''. $surveyName .'\'. '.$lang['srv_survey_archives_tracking_survey_text2'].' <a href="index.php?anketa=' . $this->anketa . '&a=' . $_GET['a'] . '&d=download">'.$lang['srv_survey_archives_tracking_survey_text3'].'</a>.</p>';
+ else
+ echo '<p class="bottom16">'.$lang['srv_survey_archives_tracking_survey_text1'].', '.$lang['srv_survey_archives_tracking_survey_text_appendmerge'].' '.$lang['srv_survey_archives_tracking_survey_text1a'].' \''. $surveyName .'\'. '.$lang['srv_survey_archives_tracking_survey_text2'].' <a href="index.php?anketa=' . $this->anketa . '&a=' . $_GET['a'] . '&d=download">'.$lang['srv_survey_archives_tracking_survey_text3'].'</a>.</p>';
+
+ // Izvoz v Excel
+ echo '<div class="izvoz_nad_tabelo">';
+ echo '<a class="noline" href="index.php?anketa=' . $this->anketa . '&a=' . $_GET['a'] . '&d=download"><span class="faicon xls green link-right"></span>'.$lang['srv_export_excel'].'</a>';
+ echo '</div>';
+
+ echo '<table id="tracking" class="fullwidth">';
+ // Prva vrstica
echo '<tr>';
-
- $sqlu = sisplet_query("SELECT name, surname FROM users WHERE id = '$row[user]'");
- $rowu = mysqli_fetch_array($sqlu);
-
- echo ' <td>' . datetime($row['datetime']) . '</td>';
- echo ' <td>' . $rowu['name'] . ' ' . $rowu['surname'] . '</td>';
- echo ' <td class="center">' . $row['ip'] . '</td>';
- echo ' <td class="center">' . $statuses[$row['status']] . '</td>';
- echo ' <td>' . $row['get'] . '</td>';
- echo ' <td>' . $row['post'] . '</td>';
-
+ echo ' <th>' . $lang['date'] . '</th>';
+ echo ' <th>' . $lang['user'] . '</th>';
+ echo ' <th>IP</th>';
+ echo ' <th>Podstran</th>';
+ echo ' <th>GET</th>';
+ echo ' <th>POST</th>';
echo '</tr>';
+
+ $count = 0;
+ while ($row = mysqli_fetch_array($sql)) {
+ echo '<tr '.($count > 24 ? 'class="displayNone"' : '').($count == 24 ? ' class="show_as_last_row"' : '').'>';
+
+ $sqlu = sisplet_query("SELECT name, surname FROM users WHERE id = '$row[user]'");
+ $rowu = mysqli_fetch_array($sqlu);
+
+ echo ' <td><div class="no_wrap">' . datetime($row['datetime']) . '</div></td>';
+ echo ' <td><div class="no_wrap">' . $rowu['name'] . ' ' . $rowu['surname'] . '</div></td>';
+ echo ' <td>' . $row['ip'] . '</td>';
+ echo ' <td>' . $statuses[$row['status']] . '</td>';
+ echo ' <td><div class="postget_wrap">' . $row['get'] . '</div></td>';
+ echo ' <td><div class="postget_wrap">' . (($row['post'] != "") ? $row['post'] : '/') . '</div></td>';
+
+ echo '</tr>';
+ $count++;
+ }
+ }
+ else{
+ echo $lang['srv_survey_archives_tracking_append_no_data'];
}
}
@@ -265,13 +303,13 @@ class TrackingClass
echo '</fieldset>';
}
- public function csvExport()
- {
+ public function csvExport(){
+
define('delimiter', ';');
-
$podatki = 'datetime' . delimiter;
- $podatki .= 'uid' . delimiter;
+ $podatki .= 'user_id' . delimiter;
+ $podatki .= 'user_name' . delimiter;
$podatki .= 'ip' . delimiter;
$podatki .= 'status' . delimiter;
$podatki .= 'parameter' . delimiter;
@@ -279,18 +317,19 @@ class TrackingClass
$podatki .= 'parameter' . delimiter;
$podatki .= 'value' . delimiter;
-
$podatki .= "\n";
- $sql = sisplet_query("SELECT * FROM srv_tracking".$this->db_table." WHERE ank_id = '" . $this->anketa . "' " . $this->status . " ORDER BY datetime DESC");
+ $sql = sisplet_query("SELECT t.*, u.name, u.surname
+ FROM srv_tracking".$this->db_table." t, users u
+ WHERE t.ank_id = '" . $this->anketa."' ".str_replace('status', 't.status', $this->status)."
+ AND u.id=t.user
+ ORDER BY t.datetime DESC
+ ");
while ($row = mysqli_fetch_array($sql)) {
-
- $sqlu = sisplet_query("SELECT name, surname, id FROM users WHERE id = '$row[user]'");
- $rowu = mysqli_fetch_array($sqlu);
-
$podatki .= '' . datetime($row['datetime']) . delimiter;
- $podatki .= '' . $rowu['id'] . delimiter;
+ $podatki .= '' . $row['user'] . delimiter;
+ $podatki .= '' . $row['name'].' '.$row['surname'] . delimiter;
$podatki .= '' . $row['ip'] . delimiter;
$podatki .= '' . $row['status'] . delimiter;
@@ -304,6 +343,7 @@ class TrackingClass
}
$ime = str_replace('-', '_', $_GET['a']);
+
return Export::init()->csv('Spremembe_' . $ime, $podatki);
}
@@ -322,7 +362,7 @@ class TrackingClass
# poiščemo aktivno anketo
SurveyInfo :: getInstance()->SurveyInit($anketa);
- $db_table = (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) ? '_active' : '';
+ $db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$get = '';
foreach ($_GET AS $key => $val) {
@@ -336,9 +376,6 @@ class TrackingClass
if ($post != '')
$post .= ', ';
-// if (is_array($val))
-// $val = implode(',', $val);
-
if (is_array($val))
$val = self::arrayToString($val);
@@ -374,9 +411,6 @@ class TrackingClass
if ($post != '')
$post .= ', ';
-// if (is_array($val))
-// $val = implode(',', $val);
-
if (is_array($val))
$val = self::arrayToString($val);
diff --git a/admin/survey/classes/tracking/UserTrackingClass.php b/admin/survey/classes/tracking/UserTrackingClass.php
index 3833003..edb29ee 100644
--- a/admin/survey/classes/tracking/UserTrackingClass.php
+++ b/admin/survey/classes/tracking/UserTrackingClass.php
@@ -40,12 +40,16 @@ class UserTrackingClass
echo '<div id="div_archive_content" class="tracking">';
echo '<fieldset>';
- echo '<legend>' . $lang['srv_survey_archives_tracking'] . '</legend>';
+ echo '<legend>' . $lang['srv_survey_archives_tracking_history'] . '</legend>';
// Izvoz v Excel
- echo '<p>'.$lang['srv_survey_archives_tracking_last_changes'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_survey_archives_tracking_last_changes'].'</p>';
+ //echo '<div id="table-horizontal-scroll-wrapper1-userchanges">';
+ //echo '<div id="table-horizontal-scroll-wrapper2-userchanges">'; - wrapperja za scroll na mobilnem
+ echo '<div class="table-horizontal-scroll-wrapper1">';
+ echo '<div class="table-horizontal-scroll-wrapper2">';
echo '<table id="tracking">';
// Prva vrstica
@@ -62,20 +66,22 @@ class UserTrackingClass
while ($row = mysqli_fetch_array($sql)) {
echo '<tr>';
- echo ' <td>' . datetime($row['datetime']) . '</td>';
+ echo ' <td><div class="no_wrap">' . datetime($row['datetime']) . '</div></td>';
echo ' <td class="center">' . $row['ip'] . '</td>';
- echo ' <td>' . $row['get'] . '</td>';
- echo ' <td>' . $row['post'] . '</td>';
+ echo ' <td><div class="postget_wrap">' . $row['get'] . '</div></td>';
+ echo ' <td><div class="postget_wrap">' . $row['post'] . '</div></td>';
echo '</tr>';
}
echo '</table>';
+ echo '</div>';
+ echo '</div>'; //- wrapperja za scroll na mobilnem
+
echo '</fieldset>';
- echo '<br class="clr" />';
- echo '</div>';
+ echo '</div>';
}
public function csvExport()