Dodan filter po paketu pri aktivnosti
This commit is contained in:
parent
fc34fc6002
commit
1a42e36bc6
@ -15,8 +15,7 @@ class SurveyAktivnost{
|
||||
* @desc prikaze diagnostiko anket
|
||||
*/
|
||||
public function diagnostics() {
|
||||
global $lang;
|
||||
global $global_user_id, $admin_type;
|
||||
global $lang, $global_user_id, $admin_type, $app_settings;
|
||||
|
||||
$sum = 0;
|
||||
$sum_survey = 0;
|
||||
@ -54,6 +53,24 @@ class SurveyAktivnost{
|
||||
|
||||
$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>';
|
||||
|
||||
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>';
|
||||
}
|
||||
|
||||
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 '<input type="hidden" name="uvoz" id="uvoz_hidden" value="'.$uvoz.'" />';
|
||||
@ -163,25 +180,28 @@ class SurveyAktivnost{
|
||||
$interval
|
||||
) AS grupe, srv_anketa
|
||||
WHERE grupe.ank_id=srv_anketa.id
|
||||
AND (srv_anketa.dostop >= '" . $admin_type . "' OR srv_anketa.id IN
|
||||
(SELECT ank_id FROM srv_dostop WHERE uid='" . $global_user_id . "'))
|
||||
AND (srv_anketa.dostop >= '" . $admin_type . "' OR srv_anketa.id IN
|
||||
(SELECT ank_id FROM srv_dostop WHERE uid='" . $global_user_id . "'))
|
||||
GROUP BY grupe.ank_id
|
||||
ORDER BY responses DESC
|
||||
");
|
||||
|
||||
} elseif ($type == 'users') {
|
||||
$filter = $this->diagnostics_get_user_settings();
|
||||
$filter = $this->diagnostics_get_user_settings();
|
||||
$filter_package = $this->diagnostics_get_user_package();
|
||||
$filter_lang = $this->diagnostics_get_lang_filter();
|
||||
|
||||
$sql = sisplet_query("
|
||||
SELECT COUNT(srv_user.id) AS responses, users.email, srv_user.ank_id, srv_anketa.naslov
|
||||
FROM srv_user, srv_anketa, users
|
||||
WHERE ".$filter." AND ".$filter_lang." srv_user.ank_id > '0'
|
||||
AND srv_anketa.id=srv_user.ank_id
|
||||
AND (srv_anketa.dostop >= '" . $admin_type . "' OR srv_anketa.id IN
|
||||
(SELECT ank_id FROM srv_dostop WHERE uid='" . $global_user_id . "'))
|
||||
$interval
|
||||
AND srv_anketa.insert_uid = users.id
|
||||
SELECT COUNT(srv_user.id) AS responses, users.email, srv_user.ank_id, srv_anketa.naslov, user_access.package_id
|
||||
FROM srv_user, srv_anketa, users
|
||||
LEFT JOIN user_access
|
||||
ON user_access.usr_id=users.id
|
||||
WHERE ".$filter." AND ".$filter_lang." ".$filter_package." srv_user.ank_id > '0'
|
||||
AND srv_anketa.id=srv_user.ank_id
|
||||
AND (srv_anketa.dostop >= '" . $admin_type . "' OR srv_anketa.id IN
|
||||
(SELECT ank_id FROM srv_dostop WHERE uid='" . $global_user_id . "'))
|
||||
$interval
|
||||
AND srv_anketa.insert_uid = users.id
|
||||
GROUP BY ank_id
|
||||
ORDER BY responses DESC
|
||||
");
|
||||
@ -191,11 +211,11 @@ class SurveyAktivnost{
|
||||
SELECT COUNT(srv_tracking_active.ank_id) AS responses, srv_tracking_active.ank_id, srv_anketa.naslov
|
||||
FROM srv_tracking_active, srv_anketa
|
||||
WHERE srv_anketa.id = srv_tracking_active.ank_id
|
||||
AND (`get` LIKE '%analiza%' OR `get` LIKE '%analysis%' )
|
||||
AND NOT (`get` LIKE '%charts%')
|
||||
AND (srv_anketa.dostop >= '" . $admin_type . "' OR srv_anketa.id IN
|
||||
(SELECT ank_id FROM srv_dostop WHERE uid='" . $global_user_id . "'))
|
||||
$interval
|
||||
AND (`get` LIKE '%analiza%' OR `get` LIKE '%analysis%' )
|
||||
AND NOT (`get` LIKE '%charts%')
|
||||
AND (srv_anketa.dostop >= '" . $admin_type . "' OR srv_anketa.id IN
|
||||
(SELECT ank_id FROM srv_dostop WHERE uid='" . $global_user_id . "'))
|
||||
$interval
|
||||
GROUP BY ank_id
|
||||
ORDER BY responses DESC
|
||||
");
|
||||
@ -206,11 +226,11 @@ class SurveyAktivnost{
|
||||
SELECT COUNT(srv_tracking_active.ank_id) AS responses, srv_tracking_active.ank_id, srv_anketa.naslov
|
||||
FROM srv_tracking_active, srv_anketa
|
||||
WHERE srv_anketa.id = srv_tracking_active.ank_id
|
||||
AND (`get` LIKE '%analiza%' OR `get` LIKE '%analysis%' )
|
||||
AND (`get` LIKE '%charts%')
|
||||
AND (srv_anketa.dostop >= '" . $admin_type . "' OR srv_anketa.id IN
|
||||
(SELECT ank_id FROM srv_dostop WHERE uid='" . $global_user_id . "'))
|
||||
$interval
|
||||
AND (`get` LIKE '%analiza%' OR `get` LIKE '%analysis%' )
|
||||
AND (`get` LIKE '%charts%')
|
||||
AND (srv_anketa.dostop >= '" . $admin_type . "' OR srv_anketa.id IN
|
||||
(SELECT ank_id FROM srv_dostop WHERE uid='" . $global_user_id . "'))
|
||||
$interval
|
||||
GROUP BY ank_id
|
||||
ORDER BY responses DESC
|
||||
");
|
||||
@ -221,9 +241,9 @@ class SurveyAktivnost{
|
||||
SELECT COUNT(srv_tracking_active.ank_id) AS responses, srv_tracking_active.ank_id, srv_anketa.naslov
|
||||
FROM srv_tracking_active, srv_anketa
|
||||
WHERE srv_anketa.id = srv_tracking_active.ank_id
|
||||
AND (srv_anketa.dostop >= '" . $admin_type . "' OR srv_anketa.id IN
|
||||
(SELECT ank_id FROM srv_dostop WHERE uid='" . $global_user_id . "'))
|
||||
$interval
|
||||
AND (srv_anketa.dostop >= '" . $admin_type . "' OR srv_anketa.id IN
|
||||
(SELECT ank_id FROM srv_dostop WHERE uid='" . $global_user_id . "'))
|
||||
$interval
|
||||
GROUP BY ank_id
|
||||
ORDER BY responses DESC
|
||||
");
|
||||
@ -234,9 +254,9 @@ class SurveyAktivnost{
|
||||
SELECT COUNT(srv_invitations_recipients.id) AS responses, srv_invitations_recipients.ank_id, srv_anketa.naslov
|
||||
FROM srv_invitations_recipients, srv_anketa
|
||||
WHERE srv_anketa.id = srv_invitations_recipients.ank_id AND srv_invitations_recipients.sent = '1'
|
||||
AND (srv_anketa.dostop >= '" . $admin_type . "' OR srv_anketa.id IN
|
||||
(SELECT ank_id FROM srv_dostop WHERE uid='" . $global_user_id . "'))
|
||||
$interval
|
||||
AND (srv_anketa.dostop >= '" . $admin_type . "' OR srv_anketa.id IN
|
||||
(SELECT ank_id FROM srv_dostop WHERE uid='" . $global_user_id . "'))
|
||||
$interval
|
||||
GROUP BY ank_id
|
||||
ORDER BY responses DESC
|
||||
");
|
||||
@ -255,7 +275,7 @@ class SurveyAktivnost{
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
if ($max == -1)
|
||||
$max = max($row['responses'], $max)*1.3;
|
||||
$max = max($row['responses'], $max)*1.3;
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td><a href="'.SurveyInfo::getSurveyLink($row['ank_id']).'?preview=on&pages=all" target="_blank">' . $row['naslov'] . '</a></td>';
|
||||
@ -263,9 +283,7 @@ class SurveyAktivnost{
|
||||
$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 '</tr>
|
||||
';
|
||||
//$sum_survey = sizeof($row);
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '<script type="text/javascript">
|
||||
@ -284,21 +302,42 @@ class SurveyAktivnost{
|
||||
global $lang;
|
||||
|
||||
$interval = $this->diagnostics_get_interval('month');
|
||||
$filter = $this->diagnostics_get_user_settings();
|
||||
$filter = $this->diagnostics_get_user_settings();
|
||||
$filter_package = $this->diagnostics_get_user_package();
|
||||
$filter_lang = $this->diagnostics_get_lang_filter();
|
||||
|
||||
$this->diagnostics_show_interval('time_span');
|
||||
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_anketa] AS datedate, YEAR(insert_time) AS color, insert_time AS date FROM srv_anketa WHERE ".$filter_lang." insert_time > 0 AND YEAR(insert_time)>=2009 GROUP BY datedate ORDER BY insert_time ASC");
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_anketa] AS datedate, YEAR(insert_time) AS color, insert_time AS date
|
||||
FROM srv_anketa
|
||||
LEFT JOIN user_access
|
||||
ON user_access.usr_id=srv_anketa.insert_uid
|
||||
WHERE ".$filter_lang." ".$filter_package." insert_time > 0 AND YEAR(insert_time)>=2009
|
||||
GROUP BY datedate
|
||||
ORDER BY insert_time ASC
|
||||
");
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_month_survey'], 'day', 'year', false);
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_sum_survey'], 'day', 'year', true);
|
||||
|
||||
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[users] AS datedate, YEAR(when_reg) AS color, when_reg AS date FROM users WHERE when_reg > 0 AND YEAR(when_reg)>=2009 GROUP BY datedate ORDER BY when_reg ASC");
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[users] AS datedate, YEAR(when_reg) AS color, when_reg AS date
|
||||
FROM users
|
||||
LEFT JOIN user_access
|
||||
ON user_access.usr_id=users.id
|
||||
WHERE ".$filter_package." when_reg > 0 AND YEAR(when_reg)>=2009
|
||||
GROUP BY datedate
|
||||
ORDER BY when_reg ASC
|
||||
");
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_month_register'], 'day', 'year', false);
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_sum_register'], 'day', 'year', true);
|
||||
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_user] AS datedate, YEAR(srv_user.time_insert) AS color, srv_user.time_insert AS date FROM srv_user, srv_anketa WHERE srv_user.ank_id=srv_anketa.id AND ".$filter." AND ".$filter_lang." time_insert > 0 AND YEAR(time_insert)>=2009 GROUP BY datedate ORDER BY time_insert ASC");
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_user] AS datedate, YEAR(srv_user.time_insert) AS color, srv_user.time_insert AS date
|
||||
FROM srv_user, srv_anketa
|
||||
LEFT JOIN user_access
|
||||
ON user_access.usr_id=srv_anketa.insert_uid
|
||||
WHERE srv_user.ank_id=srv_anketa.id AND ".$filter." AND ".$filter_lang." ".$filter_package." time_insert > 0 AND YEAR(time_insert)>=2009
|
||||
GROUP BY datedate
|
||||
ORDER BY time_insert ASC
|
||||
");
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_month_answer'], 'day', 'year', false);
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_sum_answer'], 'day', 'year', true);
|
||||
}
|
||||
@ -307,42 +346,83 @@ class SurveyAktivnost{
|
||||
global $lang;
|
||||
|
||||
$interval = $this->diagnostics_get_interval('day');
|
||||
$filter = $this->diagnostics_get_user_settings();
|
||||
$filter = $this->diagnostics_get_user_settings();
|
||||
$filter_package = $this->diagnostics_get_user_package();
|
||||
$filter_lang = $this->diagnostics_get_lang_filter();
|
||||
|
||||
$this->diagnostics_show_interval('time_span_yearly');
|
||||
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_anketa] AS datedate, MONTH(insert_time) AS color, insert_time AS date FROM srv_anketa WHERE ".$filter_lang." insert_time > 0 AND insert_time >= '".date("Y-m-1 0:00:00", strtotime("-11 month"))."' GROUP BY datedate ORDER BY insert_time ASC");
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_anketa] AS datedate, MONTH(insert_time) AS color, insert_time AS date
|
||||
FROM srv_anketa
|
||||
LEFT JOIN user_access
|
||||
ON user_access.usr_id=srv_anketa.insert_uid
|
||||
WHERE ".$filter_lang." ".$filter_package." insert_time > 0 AND insert_time >= '".date("Y-m-1 0:00:00", strtotime("-11 month"))."'
|
||||
GROUP BY datedate
|
||||
ORDER BY insert_time ASC
|
||||
");
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_month_survey'], 'day', 'month', false);
|
||||
|
||||
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[users] AS datedate, MONTH(when_reg) AS color, when_reg AS date FROM users WHERE when_reg > 0 AND when_reg >= '".date("Y-m-1 0:00:00", strtotime("-11 month"))."' GROUP BY datedate ORDER BY when_reg ASC");
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[users] AS datedate, MONTH(when_reg) AS color, when_reg AS date
|
||||
FROM users
|
||||
LEFT JOIN user_access
|
||||
ON user_access.usr_id=users.id
|
||||
WHERE ".$filter_package." when_reg > 0 AND when_reg >= '".date("Y-m-1 0:00:00", strtotime("-11 month"))."'
|
||||
GROUP BY datedate
|
||||
ORDER BY when_reg ASC
|
||||
");
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_month_register'], 'day', 'month', false);
|
||||
|
||||
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_user] AS datedate, MONTH(srv_user.time_insert) AS color, srv_user.time_insert AS date FROM srv_user, srv_anketa WHERE srv_user.ank_id=srv_anketa.id AND ".$filter." AND ".$filter_lang." time_insert > 0 AND time_insert >= '".date("Y-m-1 0:00:00", strtotime("-11 month"))."' GROUP BY datedate ORDER BY time_insert ASC");
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_user] AS datedate, MONTH(srv_user.time_insert) AS color, srv_user.time_insert AS date
|
||||
FROM srv_user, srv_anketa
|
||||
LEFT JOIN user_access
|
||||
ON user_access.usr_id=srv_anketa.insert_uid
|
||||
WHERE srv_user.ank_id=srv_anketa.id AND ".$filter." AND ".$filter_lang." ".$filter_package." time_insert > 0 AND time_insert >= '".date("Y-m-1 0:00:00", strtotime("-11 month"))."'
|
||||
GROUP BY datedate
|
||||
ORDER BY time_insert ASC
|
||||
");
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_month_answer'], 'day', 'month', false);
|
||||
|
||||
}
|
||||
|
||||
public function diagnostics_time_span_monthly () {
|
||||
global $lang;
|
||||
|
||||
$interval = $this->diagnostics_get_interval('day');
|
||||
$filter = $this->diagnostics_get_user_settings();
|
||||
$filter = $this->diagnostics_get_user_settings();
|
||||
$filter_package = $this->diagnostics_get_user_package();
|
||||
$filter_lang = $this->diagnostics_get_lang_filter();
|
||||
|
||||
$this->diagnostics_show_interval('time_span_monthly');
|
||||
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_anketa] AS datedate, MONTH(insert_time) AS color, insert_time AS date FROM srv_anketa WHERE ".$filter_lang." insert_time > 0 AND insert_time >= '".date("Y-m-1 0:00:00", strtotime("-2 month"))."' GROUP BY datedate ORDER BY insert_time ASC");
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_anketa] AS datedate, MONTH(insert_time) AS color, insert_time AS date
|
||||
FROM srv_anketa
|
||||
LEFT JOIN user_access
|
||||
ON user_access.usr_id=srv_anketa.insert_uid
|
||||
WHERE ".$filter_lang." ".$filter_package." insert_time > 0 AND insert_time >= '".date("Y-m-1 0:00:00", strtotime("-2 month"))."'
|
||||
GROUP BY datedate
|
||||
ORDER BY insert_time ASC
|
||||
");
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_month_survey'], 'day', 'month', false);
|
||||
|
||||
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[users] AS datedate, MONTH(when_reg) AS color, when_reg AS date FROM users WHERE when_reg > 0 AND when_reg >= '".date("Y-m-1 0:00:00", strtotime("-2 month"))."' GROUP BY datedate ORDER BY when_reg ASC");
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[users] AS datedate, MONTH(when_reg) AS color, when_reg AS date
|
||||
FROM users
|
||||
LEFT JOIN user_access
|
||||
ON user_access.usr_id=users.id
|
||||
WHERE ".$filter_package." when_reg > 0 AND when_reg >= '".date("Y-m-1 0:00:00", strtotime("-2 month"))."'
|
||||
GROUP BY datedate
|
||||
ORDER BY when_reg ASC
|
||||
");
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_month_register'], 'day', 'month', false);
|
||||
|
||||
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_user] AS datedate, MONTH(srv_user.time_insert) AS color, srv_user.time_insert AS date FROM srv_user, srv_anketa WHERE srv_user.ank_id=srv_anketa.id AND ".$filter." AND ".$filter_lang." time_insert > 0 AND time_insert >= '".date("Y-m-1 0:00:00", strtotime("-2 month"))."' GROUP BY datedate ORDER BY time_insert ASC");
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_user] AS datedate, MONTH(srv_user.time_insert) AS color, srv_user.time_insert AS date
|
||||
FROM srv_user, srv_anketa
|
||||
LEFT JOIN user_access
|
||||
ON user_access.usr_id=srv_anketa.insert_uid
|
||||
WHERE srv_user.ank_id=srv_anketa.id AND ".$filter." AND ".$filter_lang." ".$filter_package." time_insert > 0 AND time_insert >= '".date("Y-m-1 0:00:00", strtotime("-2 month"))."'
|
||||
GROUP BY datedate
|
||||
ORDER BY time_insert ASC
|
||||
");
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_month_answer'], 'day', 'month', false);
|
||||
|
||||
}
|
||||
@ -352,19 +432,41 @@ class SurveyAktivnost{
|
||||
|
||||
$interval = $this->diagnostics_get_interval('hour');
|
||||
$filter = $this->diagnostics_get_user_settings();
|
||||
$filter_package = $this->diagnostics_get_user_package();
|
||||
$filter_lang = $this->diagnostics_get_lang_filter();
|
||||
|
||||
$this->diagnostics_show_interval('time_span_daily');
|
||||
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_anketa] AS datedate, DAYOFWEEK(insert_time) AS color, insert_time AS date FROM srv_anketa WHERE ".$filter_lang." insert_time >= '".date("Y-m-d 0:00:00", strtotime("-1 week"))."' GROUP BY datedate ORDER BY insert_time");
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_anketa] AS datedate, DAYOFWEEK(insert_time) AS color, insert_time AS date
|
||||
FROM srv_anketa
|
||||
LEFT JOIN user_access
|
||||
ON user_access.usr_id=srv_anketa.insert_uid
|
||||
WHERE ".$filter_lang." ".$filter_package." insert_time >= '".date("Y-m-d 0:00:00", strtotime("-1 week"))."'
|
||||
GROUP BY datedate
|
||||
ORDER BY insert_time
|
||||
");
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_week_survey'], 'hour', 'day', false);
|
||||
|
||||
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_tracking_active] AS datedate, DAYOFWEEK(datetime) AS color, datetime AS date FROM srv_tracking_active WHERE datetime >= '".date("Y-m-d 0:00:00", strtotime("-1 week"))."' GROUP BY datedate ORDER BY datetime");
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_tracking_active] AS datedate, DAYOFWEEK(datetime) AS color, datetime AS date
|
||||
FROM srv_tracking_active
|
||||
LEFT JOIN user_access
|
||||
ON user_access.usr_id=srv_tracking_active.user
|
||||
WHERE ".$filter_package." datetime >= '".date("Y-m-d 0:00:00", strtotime("-1 week"))."'
|
||||
GROUP BY datedate
|
||||
ORDER BY datetime
|
||||
");
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_week_edit'], 'hour', 'day', false);
|
||||
|
||||
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_user] AS datedate, DAYOFWEEK(srv_user.time_insert) AS color, srv_user.time_insert AS date FROM srv_user, srv_anketa WHERE srv_user.ank_id=srv_anketa.id AND ".$filter." AND ".$filter_lang." time_insert >= '".date("Y-m-d 0:00:00", strtotime("-1 week"))."' GROUP BY datedate ORDER BY time_insert");
|
||||
$sql = sisplet_query("SELECT COUNT(*) as count, $interval[srv_user] AS datedate, DAYOFWEEK(srv_user.time_insert) AS color, srv_user.time_insert AS date
|
||||
FROM srv_user, srv_anketa
|
||||
LEFT JOIN user_access
|
||||
ON user_access.usr_id=srv_anketa.insert_uid
|
||||
WHERE srv_user.ank_id=srv_anketa.id AND ".$filter." AND ".$filter_lang." ".$filter_package." time_insert >= '".date("Y-m-d 0:00:00", strtotime("-1 week"))."'
|
||||
GROUP BY datedate
|
||||
ORDER BY time_insert
|
||||
");
|
||||
$this->diagnostics_graph($sql, $lang['srv_diagnostics_graph_week_answer'], 'hour', 'day', false);
|
||||
}
|
||||
|
||||
@ -610,7 +712,7 @@ class SurveyAktivnost{
|
||||
}
|
||||
|
||||
private function diagnostics_show_interval ($t) {
|
||||
global $lang;
|
||||
global $lang, $app_settings;
|
||||
|
||||
echo '<form name="intr" action="index.php" method="get">';
|
||||
echo '<input type="hidden" name="a" value="diagnostics">';
|
||||
@ -627,6 +729,24 @@ class SurveyAktivnost{
|
||||
|
||||
$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>';
|
||||
|
||||
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>';
|
||||
}
|
||||
|
||||
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 '<input type="hidden" name="uvoz" id="uvoz_hidden" value="'.$uvoz.'" />';
|
||||
@ -708,7 +828,6 @@ class SurveyAktivnost{
|
||||
$neustrezni = (isset($_GET['neustrezni']) && $_GET['neustrezni']=='1') ? 1 : 0;
|
||||
$mailsent = (isset($_GET['mailsent']) && $_GET['mailsent']=='1') ? 1 : 0;
|
||||
|
||||
|
||||
// Vedno filtriramo preview vnose
|
||||
$filter = " srv_user.preview='0'";
|
||||
|
||||
@ -741,15 +860,39 @@ class SurveyAktivnost{
|
||||
else
|
||||
$filter .= "srv_user.last_status NOT IN ('0','1','2','3','4','5','6'))";
|
||||
|
||||
|
||||
// Filtriramo uvozene podatke
|
||||
if($uvoz == 0){
|
||||
$filter .= " AND !(srv_user.referer='' AND testdata='0' AND ip='' AND recnum='0')";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $filter;
|
||||
}
|
||||
}
|
||||
|
||||
// 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){
|
||||
|
||||
$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;
|
||||
|
||||
if($package_1ka == 0){
|
||||
$filter .= " ((user_access.package_id='2' OR user_access.package_id='3') AND user_access.time_expire > NOW()) AND ";
|
||||
}
|
||||
if($package_2ka == 0){
|
||||
$filter .= " (user_access.package_id!='2' OR user_access.time_expire < NOW()) AND ";
|
||||
}
|
||||
if($package_3ka == 0){
|
||||
$filter .= " (user_access.package_id!='3' OR user_access.time_expire < NOW()) AND ";
|
||||
}
|
||||
}
|
||||
|
||||
return $filter;
|
||||
}
|
||||
|
||||
// Vrnemo filter za srv_user (filtriranje testnih podatkov, preview, email vabil, ustreznih...)
|
||||
private function diagnostics_get_lang_filter(){
|
||||
@ -765,6 +908,4 @@ class SurveyAktivnost{
|
||||
return $filter;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user