diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
commit | 75160b12821f7f4299cce7f0b69c83c1502ae071 (patch) | |
tree | 27e25e4ccaef45f0c58b22831164050d1af1d4db /admin/survey/classes/class.SurveyAktivnost.php | |
parent | prvi-commit (diff) | |
download | 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip |
Diffstat (limited to '')
-rw-r--r-- | admin/survey/classes/class.SurveyAktivnost.php | 518 |
1 files changed, 391 insertions, 127 deletions
diff --git a/admin/survey/classes/class.SurveyAktivnost.php b/admin/survey/classes/class.SurveyAktivnost.php index 28b9e3f..3574f43 100644 --- a/admin/survey/classes/class.SurveyAktivnost.php +++ b/admin/survey/classes/class.SurveyAktivnost.php @@ -2,7 +2,6 @@ class SurveyAktivnost{
-
public function __construct(){
global $lang;
@@ -15,12 +14,12 @@ class SurveyAktivnost{ * @desc prikaze diagnostiko anket
*/
public function diagnostics() {
- global $lang, $global_user_id, $admin_type, $app_settings;
+ global $lang, $global_user_id, $admin_type;
$sum = 0;
$sum_survey = 0;
- if ($_GET['time'] > 0)
+ if (isset($_GET['time']) && $_GET['time'] > 0)
$time = $_GET['time'];
else
$time = '1 month';
@@ -53,56 +52,141 @@ class SurveyAktivnost{ $language = (isset($_GET['language'])) ? $_GET['language'] : 0;
- if(isset($app_settings['commercial_packages']) && $app_settings['commercial_packages'] == true){
+
+ // Nastavitve nad tabelo
+ echo '<div class="data_table_top_holder">';
- $package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
- $package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
- $package_3ka = (isset($_GET['package_3ka']) && $_GET['package_3ka']=='0') ? 0 : 1;
-
- echo '<span>'.$lang['srv_narocilo_paket'].':</span>';
- echo '<input type="hidden" name="package_1ka" id="package_1ka_hidden" value="'.$package_1ka.'" />';
- echo '<input type="checkbox" value="1" id="package_1ka" '.($package_1ka == 1 ? ' checked="checked"' : '').'" onchange="$(\'#package_1ka_hidden\').val('.($package_1ka==1 ? '0' : '1').');"><label for="package_1ka">1KA</label>';
- echo '<input type="hidden" name="package_2ka" id="package_2ka_hidden" value="'.$package_2ka.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="package_2ka" '.($package_2ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_2ka_hidden\').val('.($package_2ka==1 ? '0' : '1').');"><label for="package_2ka">2KA</label></span>';
- echo '<input type="hidden" name="package_3ka" id="package_3ka_hidden" value="'.$package_3ka.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="package_3ka" '.($package_3ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_3ka_hidden\').val('.($package_3ka==1 ? '0' : '1').');"><label for="package_3ka">3KA</label></span>';
-
- echo '<span class="spaceLeft spaceRight bold">|</span>';
- }
+ //Osnova
+ echo '<div class="osnova">';
+ echo $lang['srv_diagnostics_basis'];
- echo '<input type="checkbox" value="1" id="testdata" name="testdata" '.($testdata == 1 ? ' checked="checked"' : '').'"><label for="testdata">'.$lang['srv_diagnostics_filter_test'].'</label>';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="testdataauto" name="testdataauto" '.($testdataauto == 1 ? ' checked="checked"' : '').'"><label for="testdataauto">'.$lang['srv_diagnostics_filter_autotest'].'</label></span>';
+ echo '<select class="dropdown" name="type" onchange="this.form.submit();">';
+ echo ' <option value="users"' . ($type == 'users' ? ' selected' : '') . '>'.$lang['srv_diagnostics_respondentov'].'</option>';
+ echo ' <option value="emails"' . ($type == 'emails' ? ' selected' : '') . '>'.$lang['srv_diagnostics_emails'].'</option>';
+ echo ' <option value="pages"' . ($type == 'pages' ? ' selected' : '') . '>'.$lang['srv_diagnostics_strani'].'</option>';
+ echo ' <option value="analiza"' . ($type == 'analiza' ? ' selected' : '') . '>'.$lang['srv_diagnostics_analiza'].'</option>';
+ echo ' <option value="graph"' . ($type == 'graph' ? ' selected' : '') . '>'.$lang['srv_diagnostics_graph'].'</option>';
+ echo ' <option value="editing"' . ($type == 'editing' ? ' selected' : '') . '>'.$lang['srv_diagnostics_editing'].'</option>';
+ echo '</select>';
+ echo '</div>';
+
+
+ //Upoštevane enote
+ echo '<div class="enote">';
+ echo ' <button id="toggleDataCheckboxes" class="small white-blue" onClick="toggleAktivnostCheckboxes(\'units\'); return false;"><span class="faicon plus"></span>'.$lang['srv_diagnostics_upostevane'].'</button>';
+ echo '</div>';
+
+ // Dodatne nastavitve, ki se razprejo
+ echo '<div id="dataSettingsCheckboxes" class="displayNone">';
+ echo ' <div class="dataSettingsCheckboxes_holder">';
+
+ // Upoštevaj enote
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_diagnostics_upostevaj'].'</span>';
+
echo '<input type="hidden" name="uvoz" id="uvoz_hidden" value="'.$uvoz.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" id="uvoz" '.($uvoz == 1 ? ' checked="checked"' : '').' onchange="$(\'#uvoz_hidden\').val('.($uvoz==1 ? '0' : '1').');"><label for="uvoz">'.$lang['srv_diagnostics_filter_import'].'</label></span>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="testdata" name="testdata" '.($testdata == 1 ? ' checked="checked"' : '').'"><label for="testdata">'.$lang['srv_diagnostics_filter_test'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="testdataauto" name="testdataauto" '.($testdataauto == 1 ? ' checked="checked"' : '').'"><label for="testdataauto">'.$lang['srv_diagnostics_filter_autotest'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="uvoz" '.($uvoz == 1 ? ' checked="checked"' : '').' onchange="$(\'#uvoz_hidden\').val('.($uvoz==1 ? '0' : '1').');"><label for="uvoz">'.$lang['srv_diagnostics_filter_import'].'</label>';
+ echo '</div>';
echo '<input type="hidden" name="ustrezni" id="ustrezni_hidden" value="'.$ustrezni.'" />';
- echo '<span class="spaceLeft bold">|</span><span class="spaceLeft"></span><input type="checkbox" id="ustrezni" '.($ustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#ustrezni_hidden\').val('.($ustrezni==1 ? '0' : '1').');"><label for="ustrezni">'.$lang['srv_diagnostics_filter_6'].'</label>';
+ echo '<div class="setting_item">';
+ echo '</span><input type="checkbox" id="ustrezni" '.($ustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#ustrezni_hidden\').val('.($ustrezni==1 ? '0' : '1').');"><label for="ustrezni">'.$lang['srv_diagnostics_filter_6'].'</label>';
+ echo '</div>';
echo '<input type="hidden" name="delnoustrezni" id="delnoustrezni_hidden" value="'.$delnoustrezni.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" id="delnoustrezni" '.($delnoustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#delnoustrezni_hidden\').val('.($delnoustrezni==1 ? '0' : '1').');"><label for="delnoustrezni">'.$lang['srv_diagnostics_filter_5'].'</label></span>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="delnoustrezni" '.($delnoustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#delnoustrezni_hidden\').val('.($delnoustrezni==1 ? '0' : '1').');"><label for="delnoustrezni">'.$lang['srv_diagnostics_filter_5'].'</label>';
+ echo '</div>';
echo '<input type="hidden" name="neustrezni" id="neustrezni_hidden" value="'.$neustrezni.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="neustrezni" '.($neustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#neustrezni_hidden\').val('.($neustrezni==1 ? '0' : '1').');"><label for="neustrezni">'.$lang['srv_diagnostics_filter_34'].'</label></span>';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="mailsent" name="mailsent" '.($mailsent == 1 ? ' checked="checked"' : '').'><label for="mailsent">'.$lang['srv_diagnostics_filter_012'].'</label></span>';
-
- echo '<span class="spaceLeft bold">|</span><span class="spaceLeft"></span>'.$lang['lang'].': <select id="language" name="language">';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="neustrezni" '.($neustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#neustrezni_hidden\').val('.($neustrezni==1 ? '0' : '1').');"><label for="neustrezni">'.$lang['srv_diagnostics_filter_34'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="mailsent" name="mailsent" '.($mailsent == 1 ? ' checked="checked"' : '').'><label for="mailsent">'.$lang['srv_diagnostics_filter_012'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div id="jezikpaket">';
+
+ //Jezik
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_diagnostics_jezik'].'</span>';
+
+ echo '<select class="dropdown w130" id="language" name="language">';
echo '<option value="0" '.($language=='0' ? ' selected' : '').'>'.$lang['srv_diagnostics_filter_lang_all'].'</option>';
echo '<option value="1" '.($language=='1' ? ' selected' : '').'>'.$lang['srv_diagnostics_filter_lang_slo'].'</option>';
echo '<option value="2" '.($language=='2' ? ' selected' : '').'>'.$lang['srv_diagnostics_filter_lang_ang'].'</option>';
+ echo '</select>';
+
+ echo '</div>';
+
+ //Paketi
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
+
+ $package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
+ $package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
+ $package_3ka = (isset($_GET['package_3ka']) && $_GET['package_3ka']=='0') ? 0 : 1;
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_narocilo_paket'].'</span>';
+
+ echo '<input type="hidden" name="package_1ka" id="package_1ka_hidden" value="'.$package_1ka.'" />';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="package_1ka" '.($package_1ka == 1 ? ' checked="checked"' : '').'" onchange="$(\'#package_1ka_hidden\').val('.($package_1ka==1 ? '0' : '1').');"><label for="package_1ka">1KA</label>';
+ echo '</div>';
+ echo '<input type="hidden" name="package_2ka" id="package_2ka_hidden" value="'.$package_2ka.'" />';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="package_2ka" '.($package_2ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_2ka_hidden\').val('.($package_2ka==1 ? '0' : '1').');"><label for="package_2ka">2KA</label>';
+ echo '</div>';
+ echo '<input type="hidden" name="package_3ka" id="package_3ka_hidden" value="'.$package_3ka.'" />';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="package_3ka" '.($package_3ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_3ka_hidden\').val('.($package_3ka==1 ? '0' : '1').');"><label for="package_3ka">3KA</label>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ echo '</div>'; //div#jezikpaket
+
+ // Gumb filtriraj
+ echo '<div class="button_holder">';
+ echo ' <button class="small blue" onClick="this.form.submit();">'.$lang['srv_diagnostics_filter'].'</button>';
+ echo '</div>';
- echo '<input type="button" class="spaceLeft" value="'.$lang['srv_coding_filter'].'" onClick="this.form.submit();">';
-
- echo '<br /><br />';
-
- echo ''.$lang['srv_diagnostics_total'].' <select name="type" onchange="this.form.submit();">';
- echo '<option value="users"' . ($type == 'users' ? ' selected' : '') . '>'.$lang['srv_diagnostics_respondentov'].'</option>';
- echo '<option value="emails"' . ($type == 'emails' ? ' selected' : '') . '>'.$lang['srv_email-vabila'].'</option>';
- echo '<option value="pages"' . ($type == 'pages' ? ' selected' : '') . '>'.$lang['srv_diagnostics_strani'].'</option>';
- echo '<option value="analiza"' . ($type == 'analiza' ? ' selected' : '') . '>'.$lang['srv_diagnostics_analiza'].'</option>';
- echo '<option value="graph"' . ($type == 'graph' ? ' selected' : '') . '>'.$lang['srv_diagnostics_graph'].'</option>';
- echo '<option value="editing"' . ($type == 'editing' ? ' selected' : '') . '>'.$lang['srv_diagnostics_editing'].'</option>';
- echo '</select> '.$lang['srv_diagnostics_in'].' ';
-
- echo '<select id="diagnostics_date_selected" name="time" onchange="diagnosticsChooseDate()">';
+ echo ' </div>';
+
+ echo '</div>'; //div#dataSettingsCheckboxes
+
+
+ // n, število anket
+ echo '<div class="counter">';
+ echo ' <span class="counter_line"><span class="srv_diagnostic_total_sub">'.$lang['srv_diagnostics_sum_total'].' </span><span class="srv_diagnostic_total_sub_label">'.$sum.'</span></span>';
+ echo ' <span class="counter_line"><span class="srv_diagnostic_total_sub">'.$lang['srv_diagnostics_sum_total_survey'].' </span><span class="srv_diagnostic_total_survey_label">'.$sum_survey.'</span></span>';
+ echo '</div>';
+
+
+ // Datum
+ echo '<div id="end">';
+ echo '<div class="dataSettingsBasic">';
+ echo ' <button id="toggleDataCheckboxes_Date" class="small white-blue" onClick="toggleAktivnostCheckboxes(\'date\'); return false;"><span class="faicon calendar_icon"></span>'.$lang['srv_diagnostics_date'].'</button>';
+ echo '</div>';
+ echo '</div>';
+
+ // Dodatne nastavitve, ki se razprejo
+ echo '<div id="dataSettingsCheckboxes_Date" class="displayNone">';
+ echo ' <div class="dataSettingsCheckboxes_holder">';
+
+ echo '<div class="setting_holder">';
+ echo $lang['srv_diagnostics_date2'];
+ echo '<select class="dropdown w130" id="diagnostics_date_selected" name="time" onChange="this.form.submit();">';
echo '<option value="1 minute"' . ($time == '1 minute' ? ' selected' : '') . '>'.$lang['srv_diagnostics_1 minute'].'</option>';
echo '<option value="5 minute"' . ($time == '5 minute' ? ' selected' : '') . '>'.$lang['srv_diagnostics_5 minute'].'</option>';
echo '<option value="10 minute"' . ($time == '10 minute' ? ' selected' : '') . '>'.$lang['srv_diagnostics_10 minute'].'</option>';
@@ -119,26 +203,60 @@ class SurveyAktivnost{ echo '<option value="3 month"' . ($time == '3 month' ? ' selected' : '') . '>'.$lang['srv_diagnostics_3 month'].'</option>';
echo '<option value="6 month"' . ($time == '6 month' ? ' selected' : '') . '>'.$lang['srv_diagnostics_6 month'].'</option>';
echo '<option id="option_99date" value="99date"' . ($time == '99date' ? ' selected' : '') . '>'.$lang['srv_diagnostics_choose_date'].'</option>';
- echo '</select> ';
-
+ echo '</select>';
+ echo '</div>';
+
// Datum - od
- echo ''.$lang['srv_diagnostics_orfrom'].' <input type="text" id="from" name="from" value="' . $from . '" '. ($time != '99date' ? ' disabled' : '') .' />';
- echo ' <span class="faicon calendar_icon icon-as_link" onclick="changeSelectOption()" id="from_img"></span>';
+ echo '<div class="setting_holder">';
+ echo $lang['srv_diagnostics_orfrom'];
+ echo '<div class="date_holder">';
+ echo '<input type="text" class="text '.($time != '99date'? 'disabled' : '').'" id="from" name="from" value="' . $from . '"/>';
+ echo '<span class="faicon calendar_icon blue" onclick="changeSelectOption()" id="from_img"></span>';
+ echo '</div>';
+ echo '</div>';
// Datum - do
- echo ' '.$lang['srv_diagnostics_to'].' <input type="text" id="to" name="to" value="' . $to . '" '. ($time != '99date' ? ' disabled' : '') .'/>';
- echo ' <span class="faicon calendar_icon icon-as_link" onclick="changeSelectOption()" id="to_img"></span>';
+ echo '<div class="setting_holder">';
+ echo $lang['srv_diagnostics_to'];
+ echo '<div class="date_holder">';
+ echo '<input type="text" class="text '. ($time != '99date'? 'disabled' : '') .'" id="to" name="to" value="' . $to . '"/>';
+ echo '<span class="faicon calendar_icon blue" onclick="changeSelectOption()" id="from_img"></span>';
+ echo '</div>';
+ echo '</div>';
- echo '<input type="submit" class="spaceLeft pointer" value="'.$lang['hour_show'].'" />';
- echo '<label class="srv_diagnostic_total_sub">'.$lang['srv_diagnostics_sum_total'].'</label><label class="srv_diagnostic_total_sub_label">'.$sum.'</label>';
- echo '<label class="srv_diagnostic_total_sub">'.$lang['srv_diagnostics_sum_total_survey'].'</label><label class="srv_diagnostic_total_survey_label">'.$sum_survey.'</label>';
-
- echo '</form><br />';
+ // Gumb filtriraj
+ echo '<div class="button_holder">';
+ echo ' <button class="small blue" onClick="this.form.submit();">'.$lang['srv_diagnostics_filter'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>'; //div#dataSettingsCheckboxes_Date
+
+ // Klik izven razprith nastavitev - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container1 = $("#dataSettingsCheckboxes");
+ var container2 = $("#dataSettingsCheckboxes_Date");
+
+ if (!container1.is(e.target) && container1.has(e.target).length === 0){
+ $("#dataSettingsCheckboxes").addClass("displayNone");
+ $("#toggleDataCheckboxes").removeClass("border_blue");
+ }
+ if (!container2.is(e.target) && container2.has(e.target).length === 0){
+ $("#dataSettingsCheckboxes_Date").addClass("displayNone");
+ $("#toggleDataCheckboxes_Date").removeClass("border_blue");
+ }
+ });
+ </script>';
+
+
+ echo '</div>'; // div.data_table_top_holder
+
+
+ echo '</form>';
if ($type == 'pages')
$time_edit = 'srv_user_grupa_active.time_edit';
- // ker je time_edit vcasih 0000-00-00 bi mogli v teh primerih pobrat time_insert
- // $time_edit = 'srv_user_grupa'.$this->db_table.'.time_insert';
elseif ($type == 'users')
$time_edit = 'srv_user.time_edit';
elseif ($type=='analiza')
@@ -268,21 +386,32 @@ class SurveyAktivnost{ echo mysqli_error($GLOBALS['connect_db']);
}
+ // Tabela
global $site_url;
-
- echo '<table style="width:70%">';
+
+ echo '<table id="aktivnost_ankete_table">';
$max = -1;
+ echo '<tr>';
+ echo '<th>'.$lang['srv_ime'].'</th>';
+ echo '<th>'.$lang['email'].'</th>';
+ echo '<th>'.$lang['srv_stevilo_enot'].'</th>';
+ echo '</tr>';
while ($row = mysqli_fetch_array($sql)) {
if ($max == -1)
$max = max($row['responses'], $max)*1.3;
+ SurveyInfo::getInstance()->SurveyInit($row['ank_id']);
+
echo '<tr>';
- echo '<td><a href="'.SurveyInfo::getSurveyLink($row['ank_id']).'?preview=on&pages=all" target="_blank">' . $row['naslov'] . '</a></td>';
- echo '<td>'.$row['email'].'</td>';
+ echo '<td><a href="'.SurveyInfo::getSurveyLink().'?preview=on&pages=all" target="_blank">' . $row['naslov'] . '</a></td>';
+ echo '<td class="gray">'.$row['email'].'</td>';
$sum = $sum + $row['responses'];
$sum_survey = $sum_survey + 1;
- echo '<td style="width:60%"><div class="graph_lb" style="float: left; width:' . (round($row['responses'] / $max * 100, 0)) . '%"> </div><div style="float:left"> '.$row['responses'].'</div></td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo '<div class="graph_full" style="width:' . (round($row['responses'] / $max * 100, 0)) . '%"> </div><div> '.$row['responses'].'</div';
+ echo '</div></td>';
echo '</tr>';
}
@@ -492,23 +621,71 @@ class SurveyAktivnost{ echo '<input type="hidden" name="a" value="diagnostics">';
echo '<input type="hidden" name="t" value="paradata">';
-
- // Vseh random enot
- echo '<span>'.$lang['srv_inv_dashboard_tbl_all'].'</span> <input type="text" name="limit" value="'.$limit.'" style="padding:1px 3px; font-size:12px; width:70px; margin-right:20px;" />';
-
+
+ // Nastavitve nad tabelo
+ echo '<div class="data_table_top_holder">';
+
+ //Vseh random enot
+ echo '<div class="osnova no_border">';
+ echo $lang['srv_inv_dashboard_tbl_all'];
+
+ echo '<input class="text" type="text" name="limit" value="'.$limit.'" />';
+ echo '</div>';
+
// Datum
- echo $lang['s_from'].' <input type="text" id="from" name="from" value="' . $date_from . '" />';
- echo ' <span class="faicon calendar_icon icon-as_link" onclick="diagnosticsParadataChooseDate();" id="from_img"></span> ';
+ echo '<div id="end">';
+ echo '<div class="dataSettingsBasic">';
+ echo ' <button id="toggleDataCheckboxes_Date" class="small white-blue" onClick="toggleAktivnostCheckboxes(\'date\'); return false;"><span class="faicon calendar_icon"></span>'.$lang['srv_diagnostics_date'].'</button>';
+ echo '</div>';
+ echo '</div>';
+
+ // Dodatne nastavitve, ki se razprejo
+ echo '<div id="dataSettingsCheckboxes_Date" class="displayNone">';
+ echo ' <div class="dataSettingsCheckboxes_holder">';
+
+ // Datum - od
+ echo '<div class="setting_holder">';
+ echo $lang['srv_diagnostics_orfrom'];
+ echo '<div class="date_holder">';
+ echo '<input class="text" type="text" id="from" name="from" value="' . $date_from . '" />';
+ echo '<span class="faicon calendar_icon blue" onclick="diagnosticsParadataChooseDate();" id="from_img"></span>';
+ echo '</div>';
+ echo '</div>';
+
+ // Datum - do
+ echo '<div class="setting_holder">';
+ echo $lang['srv_diagnostics_to'];
+ echo '<div class="date_holder">';
+ echo '<input class="text" type="text" id="to" name="to" value="' . $date_to . '" />';
+ echo '<span class="faicon calendar_icon blue" onclick="diagnosticsParadataChooseDate();" id="from_img"></span>';
+ echo '</div>';
+ echo '</div>';
- echo $lang['s_to'].' <input type="text" id="to" name="to" value="' . $date_to . '" />';
- echo ' <span class="faicon calendar_icon icon-as_link" onclick="diagnosticsParadataChooseDate();" id="to_img"></span>';
-
echo '<script>diagnosticsParadataChooseDate();</script>';
+
+ // Gumb filtriraj
+ echo '<div class="button_holder">';
+ echo ' <button class="small blue" onClick="this.form.submit();">'.$lang['srv_diagnostics_filter'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>'; //div#dataSettingsCheckboxes_Date
+
+ // Klik izven razprith nastavitev - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container1 = $("#dataSettingsCheckboxes_Date");
+
+ if (!container1.is(e.target) && container1.has(e.target).length === 0){
+ $("#dataSettingsCheckboxes_Date").addClass("displayNone");
+ $("#toggleDataCheckboxes_Date").removeClass("border_blue");
+ }
+ });
+ </script>';
+
+ echo '</div>'; // div.data_table_top_holder
- // Gumb prikazi
- echo '<input type="button" class="pointer" value="'.$lang['hour_show'].'" onClick="this.form.submit();" style="margin-left:20px;">';
-
- echo '</form><br />';
+ echo '</form>';
// Gledamo vse veljavne respondente iz leta 2016
@@ -559,13 +736,17 @@ class SurveyAktivnost{ foreach($statistics as $key => $vals){
- echo '<fieldset style="width:60%;"><legend>'.$vals['title'].'</legend>';
+ echo '<fieldset><legend>'.$vals['title'].'</legend>';
// Sortiramo vrednosti po velikosti (od najvecje do najmanjse)
//ksort($vals);
arsort($vals);
- echo '<table style="width:100%;">';
+ echo '<table class="aktivnost_paradata_table">';
+ echo '<tr>';
+ echo '<th>'.$vals['title'].'</th>';
+ echo '<th>'.$lang['srv_stevilo_enot'].'</th>';
+ echo '</tr>';
$max = -1;
foreach($vals as $key2 => $val){
@@ -581,7 +762,11 @@ class SurveyAktivnost{ echo '<td>'.$key2.'</td>';
$max = max($val, $max) * 1.2;
- echo '<td style="width:80%"><div class="graph_lb" style="float: left; width:' . (round($val / $max * 100, 0)) . '%"> </div><div style="float:left"> '.$val.'</div></td>';
+
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo '<div class="graph_full" style="width:' . (round($val / $max * 100, 0)) . '%"> </div><div> '.$val.'</div>';
+ echo '</div></td>';
echo '</tr>';
}
@@ -589,7 +774,7 @@ class SurveyAktivnost{ echo '</table>';
- echo '</fieldset><br />';
+ echo '</fieldset>';
}
}
@@ -690,9 +875,9 @@ class SurveyAktivnost{ if ($color == 'month') $label = date('M Y', strtotime($row['date']));
if ($color == 'day') $label = date('j.n.Y', strtotime($row['date']));
- echo '<span style="position: absolute; bottom: -15px; width: 90px;">'.$label;
+ /*echo '<span style="position: absolute; bottom: -15px; width: 90px;">'.$label;
if ( !$sumarium ) echo ' <span style="color:darkgray; font-size:70%" title="x̄ = '.$avg[$row['color']].'">('.$avg[$row['color']].')</span>';
- echo '</span>';
+ echo '</span>';*/
$prev_color = $row['color'];
}
@@ -712,12 +897,12 @@ class SurveyAktivnost{ }
private function diagnostics_show_interval ($t) {
- global $lang, $app_settings;
-
+ global $lang;
+
echo '<form name="intr" action="index.php" method="get">';
echo '<input type="hidden" name="a" value="diagnostics">';
echo '<input type="hidden" name="t" value="'.$t.'">';
-
+
$testdata = (isset($_GET['testdata']) && $_GET['testdata']=='1') ? 1 : 0;
$testdataauto = (isset($_GET['testdataauto']) && $_GET['testdataauto']=='1') ? 1 : 0;
$uvoz = (isset($_GET['uvoz']) && $_GET['uvoz']=='1') ? 1 : 0;
@@ -728,85 +913,165 @@ class SurveyAktivnost{ $mailsent = (isset($_GET['mailsent']) && $_GET['mailsent']=='1') ? 1 : 0;
$language = (isset($_GET['language'])) ? $_GET['language'] : 0;
-
- if(isset($app_settings['commercial_packages']) && $app_settings['commercial_packages'] == true){
- $package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
- $package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
- $package_3ka = (isset($_GET['package_3ka']) && $_GET['package_3ka']=='0') ? 0 : 1;
-
- echo '<span>'.$lang['srv_narocilo_paket'].':</span>';
+ // Nastavitve nad tabelo
+ echo '<div class="data_table_top_holder graphs">';
- echo '<input type="hidden" name="package_1ka" id="package_1ka_hidden" value="'.$package_1ka.'" />';
- echo '<input type="checkbox" value="1" id="package_1ka" '.($package_1ka == 1 ? ' checked="checked"' : '').'" onchange="$(\'#package_1ka_hidden\').val('.($package_1ka==1 ? '0' : '1').');"><label for="package_1ka">1KA</label>';
- echo '<input type="hidden" name="package_2ka" id="package_2ka_hidden" value="'.$package_2ka.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="package_2ka" '.($package_2ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_2ka_hidden\').val('.($package_2ka==1 ? '0' : '1').');"><label for="package_2ka">2KA</label></span>';
- echo '<input type="hidden" name="package_3ka" id="package_3ka_hidden" value="'.$package_3ka.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="package_3ka" '.($package_3ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_3ka_hidden\').val('.($package_3ka==1 ? '0' : '1').');"><label for="package_3ka">3KA</label></span>';
-
- echo '<span class="spaceLeft spaceRight bold">|</span>';
- }
+ //Interval
+ echo '<div class="osnova">';
+ echo 'Interval:';
- echo '<input type="checkbox" value="1" id="testdata" name="testdata" '.($testdata == 1 ? ' checked="checked"' : '').'"><label for="testdata">'.$lang['srv_diagnostics_filter_test'].'</label>';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="testdataauto" name="testdataauto" '.($testdataauto == 1 ? ' checked="checked"' : '').'"><label for="testdataauto">'.$lang['srv_diagnostics_filter_autotest'].'</label></span>';
+ echo '<select class="dropdown" name="interval" onchange="document.intr.submit();">';
+ if ( ! in_array($t, array('time_span_yearly', 'time_span')) ) {
+ echo '<option value="hour" '.($_GET['interval']=='hour'?'selected':'').'>'.$lang['srv_diagnostics_interval_hour'].'</option>';
+ }
+ echo '<option value="day" '.($_GET['interval']=='day'?'selected':'').'>'.$lang['srv_diagnostics_interval_day'].'</option>';
+ echo '<option value="week" '.($_GET['interval']=='week'?'selected':'').'>'.$lang['srv_diagnostics_interval_week'].'</option>';
+ echo '<option value="month" '.($_GET['interval']=='month'?'selected':'').'>'.$lang['srv_diagnostics_interval_month'].'</option>';
+ echo '<option value="year" '.($_GET['interval']=='year'?'selected':'').'>'.$lang['srv_diagnostics_interval_year'].'</option>';
+ echo '</select>';
+ echo '</div>';
+
+ //Upoštevane enote
+ echo '<div class="dataSettingsBasic">';
+ echo ' <button id="toggleDataCheckboxes" class="small white-blue" onClick="toggleAktivnostCheckboxes(\'units\'); return false;"><span class="faicon plus"></span>'.$lang['srv_diagnostics_upostevane'].'</button>';
+ echo '</div>';
+
+ // Dodatne nastavitve, ki se razprejo
+ echo '<div id="dataSettingsCheckboxes" class="displayNone">';
+ echo ' <div class="dataSettingsCheckboxes_holder">';
+
+ // Upoštevaj enote
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_diagnostics_upostevaj'].'</span>';
+
echo '<input type="hidden" name="uvoz" id="uvoz_hidden" value="'.$uvoz.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" id="uvoz" '.($uvoz == 1 ? ' checked="checked"' : '').' onchange="$(\'#uvoz_hidden\').val('.($uvoz==1 ? '0' : '1').');"><label for="uvoz">'.$lang['srv_diagnostics_filter_import'].'</label></span>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="testdata" name="testdata" '.($testdata == 1 ? ' checked="checked"' : '').'"><label for="testdata">'.$lang['srv_diagnostics_filter_test'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="testdataauto" name="testdataauto" '.($testdataauto == 1 ? ' checked="checked"' : '').'"><label for="testdataauto">'.$lang['srv_diagnostics_filter_autotest'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="uvoz" '.($uvoz == 1 ? ' checked="checked"' : '').' onchange="$(\'#uvoz_hidden\').val('.($uvoz==1 ? '0' : '1').');"><label for="uvoz">'.$lang['srv_diagnostics_filter_import'].'</label>';
+ echo '</div>';
echo '<input type="hidden" name="ustrezni" id="ustrezni_hidden" value="'.$ustrezni.'" />';
- echo '<span class="spaceLeft bold">|</span><span class="spaceLeft"></span><input type="checkbox" id="ustrezni" '.($ustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#ustrezni_hidden\').val('.($ustrezni==1 ? '0' : '1').');"><label for="ustrezni">'.$lang['srv_diagnostics_filter_6'].'</label>';
+ echo '<div class="setting_item">';
+ echo '</span><input type="checkbox" id="ustrezni" '.($ustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#ustrezni_hidden\').val('.($ustrezni==1 ? '0' : '1').');"><label for="ustrezni">'.$lang['srv_diagnostics_filter_6'].'</label>';
+ echo '</div>';
echo '<input type="hidden" name="delnoustrezni" id="delnoustrezni_hidden" value="'.$delnoustrezni.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" id="delnoustrezni" '.($delnoustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#delnoustrezni_hidden\').val('.($delnoustrezni==1 ? '0' : '1').');"><label for="delnoustrezni">'.$lang['srv_diagnostics_filter_5'].'</label></span>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="delnoustrezni" '.($delnoustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#delnoustrezni_hidden\').val('.($delnoustrezni==1 ? '0' : '1').');"><label for="delnoustrezni">'.$lang['srv_diagnostics_filter_5'].'</label>';
+ echo '</div>';
echo '<input type="hidden" name="neustrezni" id="neustrezni_hidden" value="'.$neustrezni.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="neustrezni" '.($neustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#neustrezni_hidden\').val('.($neustrezni==1 ? '0' : '1').');"><label for="neustrezni">'.$lang['srv_diagnostics_filter_34'].'</label></span>';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="mailsent" name="mailsent" '.($mailsent == 1 ? ' checked="checked"' : '').'><label for="mailsent">'.$lang['srv_diagnostics_filter_012'].'</label></span>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="neustrezni" '.($neustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#neustrezni_hidden\').val('.($neustrezni==1 ? '0' : '1').');"><label for="neustrezni">'.$lang['srv_diagnostics_filter_34'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="mailsent" name="mailsent" '.($mailsent == 1 ? ' checked="checked"' : '').'><label for="mailsent">'.$lang['srv_diagnostics_filter_012'].'</label>';
+ echo '</div>';
- echo '<span class="spaceLeft bold">|</span><span class="spaceLeft"></span>'.$lang['lang'].': <select id="language" name="language">';
+ echo '</div>';
+
+ echo '<div id="jezikpaket">';
+
+ //Jezik
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_diagnostics_jezik'].'</span>';
+
+ echo '<select class="dropdown w130" id="language" name="language">';
echo '<option value="0" '.($language=='0' ? ' selected' : '').'>'.$lang['srv_diagnostics_filter_lang_all'].'</option>';
echo '<option value="1" '.($language=='1' ? ' selected' : '').'>'.$lang['srv_diagnostics_filter_lang_slo'].'</option>';
echo '<option value="2" '.($language=='2' ? ' selected' : '').'>'.$lang['srv_diagnostics_filter_lang_ang'].'</option>';
+ echo '</select>';
+
+ echo '</div>';
+
+ //Paketi
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
+
+ $package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
+ $package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
+ $package_3ka = (isset($_GET['package_3ka']) && $_GET['package_3ka']=='0') ? 0 : 1;
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_narocilo_paket'].'</span>';
+
+ echo '<input type="hidden" name="package_1ka" id="package_1ka_hidden" value="'.$package_1ka.'" />';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="package_1ka" '.($package_1ka == 1 ? ' checked="checked"' : '').'" onchange="$(\'#package_1ka_hidden\').val('.($package_1ka==1 ? '0' : '1').');"><label for="package_1ka">1KA</label>';
+ echo '</div>';
+ echo '<input type="hidden" name="package_2ka" id="package_2ka_hidden" value="'.$package_2ka.'" />';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="package_2ka" '.($package_2ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_2ka_hidden\').val('.($package_2ka==1 ? '0' : '1').');"><label for="package_2ka">2KA</label>';
+ echo '</div>';
+ echo '<input type="hidden" name="package_3ka" id="package_3ka_hidden" value="'.$package_3ka.'" />';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="package_3ka" '.($package_3ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_3ka_hidden\').val('.($package_3ka==1 ? '0' : '1').');"><label for="package_3ka">3KA</label>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ echo '</div>'; //div#jezikpaket
+
+
+ // Gumb filtriraj
+ echo '<div class="button_holder">';
+ echo ' <button class="small blue" onClick="this.form.submit();">'.$lang['srv_diagnostics_filter'].'</button>';
+ echo '</div>';
- echo '<input type="button" class="spaceLeft" value="'.$lang['srv_coding_filter'].'" onClick="this.form.submit();">';
-
- echo '<br /><br />';
-
- echo 'Interval: <select name="interval" onchange="document.intr.submit();">';
- if ( ! in_array($t, array('time_span_yearly', 'time_span')) ) {
- echo '<option value="hour" '.($_GET['interval']=='hour'?'selected':'').'>'.$lang['srv_diagnostics_interval_hour'].'</option>';
- }
- echo '<option value="day" '.($_GET['interval']=='day'?'selected':'').'>'.$lang['srv_diagnostics_interval_day'].'</option>';
- echo '<option value="week" '.($_GET['interval']=='week'?'selected':'').'>'.$lang['srv_diagnostics_interval_week'].'</option>';
- echo '<option value="month" '.($_GET['interval']=='month'?'selected':'').'>'.$lang['srv_diagnostics_interval_month'].'</option>';
- echo '<option value="year" '.($_GET['interval']=='year'?'selected':'').'>'.$lang['srv_diagnostics_interval_year'].'</option>';
- echo '</select>';
-
- echo '</form><br />';
+ echo ' </div>';
+ echo '</div>'; //div#dataSettingsCheckboxes
+
+ // Klik izven razprith nastavitev - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container1 = $("#dataSettingsCheckboxes");
+
+ if (!container1.is(e.target) && container1.has(e.target).length === 0){
+ $("#dataSettingsCheckboxes").addClass("displayNone");
+ $("#toggleDataCheckboxes").removeClass("border_blue");
+ }
+ });
+ </script>';
+
+ echo '</div>'; // div.data_table_top_holder
+
+ echo '</form>';
}
private function diagnostics_get_interval ($def = '') {
- if ($_GET['interval'] == '') $_GET['interval'] = $def;
+ if (!isset($_GET['interval']) || $_GET['interval'] == '')
+ $_GET['interval'] = $def;
if ($_GET['interval'] == 'year') {
$interval['srv_anketa'] = "YEAR(srv_anketa.insert_time)";
$interval['users'] = "YEAR(users.when_reg)";
$interval['srv_user'] = "YEAR(srv_user.time_insert)";
$interval['srv_tracking_active'] = "YEAR(srv_tracking_active.datetime)";
- } elseif ($_GET['interval'] == 'month') {
+ }
+ elseif ($_GET['interval'] == 'month') {
$interval['srv_anketa'] = "CONCAT( YEAR(srv_anketa.insert_time), '-', MONTH(srv_anketa.insert_time) )";
$interval['users'] = "CONCAT( YEAR(users.when_reg), '-', MONTH(users.when_reg) )";
$interval['srv_user'] = "CONCAT( YEAR(srv_user.time_insert), '-', MONTH(srv_user.time_insert) )";
$interval['srv_tracking_active'] = "CONCAT( YEAR(srv_tracking_active.datetime), '-', MONTH(srv_tracking_active.datetime) )";
- } elseif ($_GET['interval'] == 'week') {
+ }
+ elseif ($_GET['interval'] == 'week') {
$interval['srv_anketa'] = "CONCAT( YEAR(srv_anketa.insert_time), '-', WEEKOFYEAR(srv_anketa.insert_time) )";
$interval['users'] = "CONCAT( YEAR(users.when_reg), '-', WEEKOFYEAR(users.when_reg) )";
$interval['srv_user'] = "CONCAT( YEAR(srv_user.time_insert), '-', WEEKOFYEAR(srv_user.time_insert) )";
$interval['srv_tracking_active'] = "CONCAT( YEAR(srv_tracking_active.datetime), '-', WEEKOFYEAR(srv_tracking_active.datetime) )";
- } elseif ($_GET['interval'] == 'day') {
+ }
+ elseif ($_GET['interval'] == 'day') {
$interval['srv_anketa'] = "DATE(srv_anketa.insert_time)";
$interval['users'] = "DATE(users.when_reg)";
$interval['srv_user'] = "DATE(srv_user.time_insert)";
$interval['srv_tracking_active'] = "DATE(datetime)";
- } elseif ($_GET['interval'] == 'hour') {
+ }
+ elseif ($_GET['interval'] == 'hour') {
$interval['srv_anketa'] = "CONCAT( DATE(srv_anketa.insert_time), ' ', HOUR(srv_anketa.insert_time)) ";
$interval['users'] = "CONCAT( DATE(users.when_reg), ' ', HOUR(users.when_reg)) ";
$interval['srv_user'] = "CONCAT( DATE(srv_user.time_insert), ' ', HOUR(srv_user.time_insert)) ";
@@ -870,11 +1135,10 @@ class SurveyAktivnost{ // Filter po paketih, ce jih imamo
private function diagnostics_get_user_package(){
- global $app_settings;
$filter = '';
- if(isset($app_settings['commercial_packages']) && $app_settings['commercial_packages'] == true){
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
$package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
$package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
|