mirror of
https://github.com/Mibew/design.git
synced 2025-01-22 18:10:33 +03:00
Extend by thread statistics
This commit is contained in:
parent
18e6862949
commit
b33ccc4a84
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2005-2013 Evgeny Gryaznov
|
* Copyright 2005-2013 Evgeny Gryaznov
|
||||||
|
* Copyright 2013 Simushev Dmitriy
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -484,9 +485,9 @@ table.list, table.translate, table.statistics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
table.list th, table.translate th, table.statistics th {
|
table.list th, table.translate th, table.statistics th {
|
||||||
font-size: 1.2em;
|
font-size: 1em;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
padding: 10px 8px;
|
padding: 10px 6px;
|
||||||
border-bottom: 2px solid #2F7598;
|
border-bottom: 2px solid #2F7598;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +62,11 @@ $dbtables = array(
|
|||||||
"statid" => "int NOT NULL auto_increment PRIMARY KEY",
|
"statid" => "int NOT NULL auto_increment PRIMARY KEY",
|
||||||
"date" => "int NOT NULL DEFAULT 0",
|
"date" => "int NOT NULL DEFAULT 0",
|
||||||
"threads" => "int NOT NULL DEFAULT 0",
|
"threads" => "int NOT NULL DEFAULT 0",
|
||||||
|
"missedthreads" => "int NOT NULL DEFAULT 0",
|
||||||
|
"sentinvitations" => "int NOT NULL DEFAULT 0",
|
||||||
|
"acceptedinvitations" => "int NOT NULL DEFAULT 0",
|
||||||
|
"rejectedinvitations" => "int NOT NULL DEFAULT 0",
|
||||||
|
"ignoredinvitations" => "int NOT NULL DEFAULT 0",
|
||||||
"operatormessages" => "int NOT NULL DEFAULT 0",
|
"operatormessages" => "int NOT NULL DEFAULT 0",
|
||||||
"usermessages" => "int NOT NULL DEFAULT 0",
|
"usermessages" => "int NOT NULL DEFAULT 0",
|
||||||
"averagewaitingtime" => "FLOAT(10, 1) NOT NULL DEFAULT 0",
|
"averagewaitingtime" => "FLOAT(10, 1) NOT NULL DEFAULT 0",
|
||||||
@ -232,7 +237,7 @@ $memtables = array();
|
|||||||
|
|
||||||
$dbtables_can_update = array(
|
$dbtables_can_update = array(
|
||||||
"${mysqlprefix}chatthread" => array("agentId", "userTyping", "agentTyping", "messageCount", "nextagent", "shownmessageid", "userid", "userAgent", "groupid", "dtmchatstarted", "invitationstate"),
|
"${mysqlprefix}chatthread" => array("agentId", "userTyping", "agentTyping", "messageCount", "nextagent", "shownmessageid", "userid", "userAgent", "groupid", "dtmchatstarted", "invitationstate"),
|
||||||
"${mysqlprefix}chatthreadstatistics" => array(),
|
"${mysqlprefix}chatthreadstatistics" => array("missedthreads", "sentinvitations", "acceptedinvitations", "rejectedinvitations", "ignoredinvitations"),
|
||||||
"${mysqlprefix}requestbuffer" => array("requestid", "requestkey", "request"),
|
"${mysqlprefix}requestbuffer" => array("requestid", "requestkey", "request"),
|
||||||
"${mysqlprefix}chatmessage" => array("agentId"),
|
"${mysqlprefix}chatmessage" => array("agentId"),
|
||||||
"${mysqlprefix}indexedchatmessage" => array(),
|
"${mysqlprefix}indexedchatmessage" => array(),
|
||||||
|
@ -132,6 +132,26 @@ if ($act == "silentcreateall") {
|
|||||||
runsql("ALTER TABLE ${mysqlprefix}chatthread ADD invitationstate int NOT NULL DEFAULT 0 AFTER istate", $link);
|
runsql("ALTER TABLE ${mysqlprefix}chatthread ADD invitationstate int NOT NULL DEFAULT 0 AFTER istate", $link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (in_array("${mysqlprefix}chatthreadstatistics.missedthreads", $absent_columns)) {
|
||||||
|
runsql("ALTER TABLE ${mysqlprefix}chatthreadstatistics ADD missedthreads int NOT NULL DEFAULT 0 AFTER threads", $link);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array("${mysqlprefix}chatthreadstatistics.sentinvitations", $absent_columns)) {
|
||||||
|
runsql("ALTER TABLE ${mysqlprefix}chatthreadstatistics ADD sentinvitations int NOT NULL DEFAULT 0 AFTER missedthreads", $link);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array("${mysqlprefix}chatthreadstatistics.acceptedinvitations", $absent_columns)) {
|
||||||
|
runsql("ALTER TABLE ${mysqlprefix}chatthreadstatistics ADD acceptedinvitations int NOT NULL DEFAULT 0 AFTER sentinvitations", $link);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array("${mysqlprefix}chatthreadstatistics.rejectedinvitations", $absent_columns)) {
|
||||||
|
runsql("ALTER TABLE ${mysqlprefix}chatthreadstatistics ADD rejectedinvitations int NOT NULL DEFAULT 0 AFTER acceptedinvitations", $link);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array("${mysqlprefix}chatthreadstatistics.ignoredinvitations", $absent_columns)) {
|
||||||
|
runsql("ALTER TABLE ${mysqlprefix}chatthreadstatistics ADD ignoredinvitations int NOT NULL DEFAULT 0 AFTER rejectedinvitations", $link);
|
||||||
|
}
|
||||||
|
|
||||||
if (in_array("${mysqlprefix}chatoperator.iperm", $absent_columns)) {
|
if (in_array("${mysqlprefix}chatoperator.iperm", $absent_columns)) {
|
||||||
runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD iperm int DEFAULT 65535", $link);
|
runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD iperm int DEFAULT 65535", $link);
|
||||||
}
|
}
|
||||||
|
@ -62,45 +62,172 @@ function calculate_thread_statistics() {
|
|||||||
$today = floor(time() / (24*60*60)) * 24*60*60;
|
$today = floor(time() / (24*60*60)) * 24*60*60;
|
||||||
|
|
||||||
// Calculate statistics
|
// Calculate statistics
|
||||||
$db->query(
|
// Get base threads info
|
||||||
"INSERT INTO {chatthreadstatistics} ( " .
|
$db_results = $db->query(
|
||||||
"date, threads, operatormessages, usermessages, " .
|
"SELECT (FLOOR(t.dtmcreated / (24*60*60)) * 24*60*60) AS date, " .
|
||||||
"averagewaitingtime, averagechattime " .
|
"COUNT(t.threadid) AS threads, " .
|
||||||
") SELECT (FLOOR(t.dtmcreated / (24*60*60)) * 24*60*60) AS date, " .
|
"tmp.operator_msgs AS operator_msgs, " .
|
||||||
"COUNT(distinct t.threadid) AS threads, " .
|
"tmp.user_msgs AS user_msgs, " .
|
||||||
"SUM(m.ikind = :kind_agent) AS operators, " .
|
|
||||||
"SUM(m.ikind = :kind_user) AS users, " .
|
|
||||||
"ROUND(AVG(t.dtmchatstarted-t.dtmcreated),1) as avgwaitingtime, " .
|
|
||||||
// Prevent negative values of avgchattime field.
|
// Prevent negative values of avgchattime field.
|
||||||
// If avgchattime < 0 it becomes to zero.
|
// If avgchattime < 0 it becomes to zero.
|
||||||
// For random value 'a' result of expression ((abs(a) + a) / 2)
|
// For random value 'a' result of expression ((abs(a) + a) / 2)
|
||||||
// equals to 'a' if 'a' more than zero
|
// equals to 'a' if 'a' more than zero
|
||||||
// and equals to zero otherwise
|
// and equals to zero otherwise
|
||||||
"ROUND(AVG( " .
|
"ROUND(AVG( " .
|
||||||
"ABS(tmp.lastmsgtime-t.dtmchatstarted) + " .
|
"ABS(tmp.last_msg_time - t.dtmchatstarted) + " .
|
||||||
"(tmp.lastmsgtime-t.dtmchatstarted) " .
|
"(tmp.last_msg_time - t.dtmchatstarted) " .
|
||||||
")/2,1) as avgchattime " .
|
")/2,1) as avg_chat_time " .
|
||||||
"FROM {indexedchatmessage} m, " .
|
"FROM {chatthread} t, " .
|
||||||
"{chatthread} t, " .
|
"(SELECT SUM(m.ikind = :kind_agent) AS operator_msgs, " .
|
||||||
"(SELECT i.threadid, MAX(i.dtmcreated) AS lastmsgtime " .
|
"SUM(m.ikind = :kind_user) AS user_msgs, " .
|
||||||
"FROM {indexedchatmessage} i " .
|
"MAX(m.dtmcreated) as last_msg_time, " .
|
||||||
"WHERE (ikind = :kind_user OR ikind = :kind_agent) " .
|
"threadid " .
|
||||||
"GROUP BY i.threadid) tmp " .
|
"FROM {indexedchatmessage} m " .
|
||||||
"WHERE m.threadid = t.threadid " .
|
// Calculate only users' and operators' messages
|
||||||
"AND tmp.threadid = t.threadid " .
|
"WHERE m.ikind = :kind_user " .
|
||||||
"AND t.dtmchatstarted <> 0 " .
|
"OR m.ikind = :kind_agent " .
|
||||||
"AND (m.dtmcreated - :start) > 24*60*60 " .
|
"GROUP BY m.threadid) tmp " .
|
||||||
|
"WHERE t.threadid = tmp.threadid " .
|
||||||
|
"AND (t.dtmcreated - :start) > 24*60*60 " .
|
||||||
// Calculate statistics only for threads that older than one day
|
// Calculate statistics only for threads that older than one day
|
||||||
"AND (:today - m.dtmcreated) > 24*60*60 " .
|
"AND (:today - t.dtmcreated) > 24*60*60 " .
|
||||||
"GROUP BY date " .
|
// Ignore threads when operator does not start chat
|
||||||
"ORDER BY date",
|
"AND t.dtmchatstarted <> 0 " .
|
||||||
|
// Ignore not accepted invitations
|
||||||
|
"AND (t.invitationstate = :not_invited " .
|
||||||
|
"OR t.invitationstate = :invitation_accepted) " .
|
||||||
|
"GROUP BY date",
|
||||||
array(
|
array(
|
||||||
':kind_agent' => Thread::KIND_AGENT,
|
|
||||||
':kind_user' => Thread::KIND_USER,
|
|
||||||
':start' => $start,
|
':start' => $start,
|
||||||
':today' => $today
|
':today' => $today,
|
||||||
)
|
':not_invited' => Thread::INVITATION_NOT_INVITED,
|
||||||
|
':invitation_accepted' => Thread::INVITATION_ACCEPTED,
|
||||||
|
':kind_agent' => Thread::KIND_AGENT,
|
||||||
|
':kind_user' => Thread::KIND_USER
|
||||||
|
),
|
||||||
|
array('return_rows' => Database::RETURN_ALL_ROWS)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Store statistics data
|
||||||
|
$statistics = extend_statistics_info(array(), $db_results);
|
||||||
|
|
||||||
|
// Get info about missed threads
|
||||||
|
$db_results = $db->query(
|
||||||
|
"SELECT (FLOOR(dtmcreated / (24*60*60)) * 24*60*60) AS date, " .
|
||||||
|
"COUNT(*) as missed_threads " .
|
||||||
|
"FROM {chatthread} " .
|
||||||
|
"WHERE (dtmcreated - :start) > 24*60*60 " .
|
||||||
|
// Calculate statistics only for threads that older than one day
|
||||||
|
"AND (:today - dtmcreated) > 24*60*60 " .
|
||||||
|
// Ignore threads when operator does not start chat
|
||||||
|
"AND dtmchatstarted = 0 " .
|
||||||
|
// Ignore not accepted invitations
|
||||||
|
"AND invitationstate = :not_invited " .
|
||||||
|
"GROUP BY date ORDER BY date DESC",
|
||||||
|
array(
|
||||||
|
':start' => $start,
|
||||||
|
':today' => $today,
|
||||||
|
':not_invited' => Thread::INVITATION_NOT_INVITED
|
||||||
|
),
|
||||||
|
array('return_rows' => Database::RETURN_ALL_ROWS)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Add average waiting time to statistics data
|
||||||
|
$statistics = extend_statistics_info($statistics, $db_results);
|
||||||
|
|
||||||
|
// Get info about average chat time and missed threads count.
|
||||||
|
$db_results = $db->query(
|
||||||
|
"SELECT (FLOOR(dtmcreated / (24*60*60)) * 24*60*60) AS date, " .
|
||||||
|
"ROUND(AVG(dtmchatstarted-dtmcreated),1) AS avg_waiting_time,
|
||||||
|
SUM(dtmchatstarted = 0) AS missed_threads " .
|
||||||
|
"FROM {chatthread} " .
|
||||||
|
"WHERE (dtmcreated - :start) > 24*60*60 " .
|
||||||
|
// Calculate statistics only for threads that older than one day
|
||||||
|
"AND (:today - dtmcreated) > 24*60*60 " .
|
||||||
|
// Ignore threads when operator does not start chat
|
||||||
|
"AND dtmchatstarted <> 0 " .
|
||||||
|
// Ignore all invitations
|
||||||
|
"AND invitationstate = :not_invited " .
|
||||||
|
"GROUP BY date",
|
||||||
|
array(
|
||||||
|
':start' => $start,
|
||||||
|
':today' => $today,
|
||||||
|
':not_invited' => Thread::INVITATION_NOT_INVITED
|
||||||
|
),
|
||||||
|
array('return_rows' => Database::RETURN_ALL_ROWS)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Add average waiting time to statistics data
|
||||||
|
$statistics = extend_statistics_info($statistics, $db_results);
|
||||||
|
|
||||||
|
// Get invitation info
|
||||||
|
$db_results = $db->query(
|
||||||
|
"SELECT (FLOOR(dtmcreated / (24*60*60)) * 24*60*60) AS date, " .
|
||||||
|
"COUNT(*) AS invitation_sent, " .
|
||||||
|
"SUM(invitationstate = :invitation_accepted) AS invitation_accepted, " .
|
||||||
|
"SUM(invitationstate = :invitation_rejected) AS invitation_rejected, " .
|
||||||
|
"SUM(invitationstate = :invitation_ignored) AS invitation_ignored " .
|
||||||
|
"FROM {chatthread} " .
|
||||||
|
"WHERE (dtmcreated - :start) > 24*60*60 " .
|
||||||
|
// Calculate statistics only for threads that older than one day
|
||||||
|
"AND (:today - dtmcreated) > 24*60*60 " .
|
||||||
|
"AND (invitationstate = :invitation_accepted " .
|
||||||
|
"OR invitationstate = :invitation_rejected " .
|
||||||
|
"OR invitationstate = :invitation_ignored) " .
|
||||||
|
"GROUP BY date",
|
||||||
|
array(
|
||||||
|
':start' => $start,
|
||||||
|
':today' => $today,
|
||||||
|
':invitation_accepted' => Thread::INVITATION_ACCEPTED,
|
||||||
|
':invitation_rejected' => Thread::INVITATION_REJECTED,
|
||||||
|
':invitation_ignored' => Thread::INVITATION_IGNORED
|
||||||
|
),
|
||||||
|
array('return_rows' => Database::RETURN_ALL_ROWS)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Add invitation info to statistics data
|
||||||
|
$statistics = extend_statistics_info($statistics, $db_results);
|
||||||
|
|
||||||
|
// Sort statistics by date before save it in the database
|
||||||
|
ksort($statistics);
|
||||||
|
|
||||||
|
foreach($statistics as $row) {
|
||||||
|
// Add default values
|
||||||
|
$row += array(
|
||||||
|
'threads' => 0,
|
||||||
|
'missed_threads' => 0,
|
||||||
|
'operator_msgs' => 0,
|
||||||
|
'user_msgs' => 0,
|
||||||
|
'avg_chat_time' => 0,
|
||||||
|
'avg_waiting_time' => 0,
|
||||||
|
'invitation_sent' => 0,
|
||||||
|
'invitation_accepted' => 0,
|
||||||
|
'invitation_rejected' => 0,
|
||||||
|
'invitation_ignored' => 0
|
||||||
|
);
|
||||||
|
|
||||||
|
// Prepare data for insert
|
||||||
|
$insert_data = array();
|
||||||
|
foreach($row as $field_name => $field_value) {
|
||||||
|
$insert_data[':' . $field_name] = $field_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Store data in database
|
||||||
|
$db->query(
|
||||||
|
"INSERT INTO {chatthreadstatistics} (" .
|
||||||
|
"date, threads, missedthreads, sentinvitations, " .
|
||||||
|
"acceptedinvitations, rejectedinvitations, " .
|
||||||
|
"ignoredinvitations, operatormessages, usermessages, " .
|
||||||
|
"averagewaitingtime, averagechattime " .
|
||||||
|
") VALUES (" .
|
||||||
|
":date, :threads, :missed_threads, :invitation_sent, " .
|
||||||
|
":invitation_accepted, :invitation_rejected, " .
|
||||||
|
":invitation_ignored, :operator_msgs, :user_msgs, " .
|
||||||
|
":avg_waiting_time, :avg_chat_time " .
|
||||||
|
")",
|
||||||
|
$insert_data
|
||||||
|
);
|
||||||
|
}
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
// Something went wrong: warn and rollback transaction.
|
// Something went wrong: warn and rollback transaction.
|
||||||
trigger_error(
|
trigger_error(
|
||||||
@ -263,4 +390,24 @@ function calculate_page_statistics() {
|
|||||||
$db->throwExeptions($db_throw_exceptions);
|
$db->throwExeptions($db_throw_exceptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add info from $additional_info to $stat_info using value of 'date' item as
|
||||||
|
* a key.
|
||||||
|
*
|
||||||
|
* @param array $stat_info Statistics info
|
||||||
|
* @param array $additional_info Data that must be added to statistics info
|
||||||
|
* @return array Extended statistics info
|
||||||
|
*/
|
||||||
|
function extend_statistics_info($stat_info, $additional_info) {
|
||||||
|
$result = $stat_info;
|
||||||
|
foreach($additional_info as $row) {
|
||||||
|
$date = $row['date'];
|
||||||
|
if (empty($result[$date])) {
|
||||||
|
$result[$date] = array();
|
||||||
|
}
|
||||||
|
$result[$date] += $row;
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
@ -452,6 +452,11 @@ report.bydate.3=Messages from operators
|
|||||||
report.bydate.4=Messages from visitors
|
report.bydate.4=Messages from visitors
|
||||||
report.bydate.5=Average waiting time (in seconds)
|
report.bydate.5=Average waiting time (in seconds)
|
||||||
report.bydate.6=Average chat time (in seconds)
|
report.bydate.6=Average chat time (in seconds)
|
||||||
|
report.bydate.7=Missed threads
|
||||||
|
report.bydate.8=Invitations sent
|
||||||
|
report.bydate.9=Invitations accepted
|
||||||
|
report.bydate.10=Invitations rejected
|
||||||
|
report.bydate.11=Invitations ignored
|
||||||
report.bydate.title=Usage statistics for each date
|
report.bydate.title=Usage statistics for each date
|
||||||
report.byoperator.1=Operator
|
report.byoperator.1=Operator
|
||||||
report.byoperator.2=Chat Threads
|
report.byoperator.2=Chat Threads
|
||||||
|
@ -451,6 +451,11 @@ report.bydate.3=
|
|||||||
report.bydate.4=Сообщений посетителей
|
report.bydate.4=Сообщений посетителей
|
||||||
report.bydate.5=Среднее время ожидания (в секундах)
|
report.bydate.5=Среднее время ожидания (в секундах)
|
||||||
report.bydate.6=Среднее время диалога (в секундах)
|
report.bydate.6=Среднее время диалога (в секундах)
|
||||||
|
report.bydate.7=Диалогов пропущено
|
||||||
|
report.bydate.8=Приглашений отправлено
|
||||||
|
report.bydate.9=Приглашений принято
|
||||||
|
report.bydate.10=Приглашений отклонено
|
||||||
|
report.bydate.11=Приглашений проигнорировано
|
||||||
report.bydate.title=Использование мессенджера по дням
|
report.bydate.title=Использование мессенджера по дням
|
||||||
report.byoperator.1=Оператор
|
report.byoperator.1=Оператор
|
||||||
report.byoperator.2=Диалогов
|
report.byoperator.2=Диалогов
|
||||||
|
@ -40,6 +40,8 @@ $page['showbypage'] = ($statisticstype == 'bypage');
|
|||||||
$page['cron_path'] = cron_get_uri(Settings::get('cron_key'));
|
$page['cron_path'] = cron_get_uri(Settings::get('cron_key'));
|
||||||
$page['last_cron_run'] = Settings::get('_last_cron_run');
|
$page['last_cron_run'] = Settings::get('_last_cron_run');
|
||||||
|
|
||||||
|
$page['show_invitations_info'] = (bool)Settings::get('enabletracking');
|
||||||
|
|
||||||
$errors = array();
|
$errors = array();
|
||||||
|
|
||||||
if (isset($_GET['startday'])) {
|
if (isset($_GET['startday'])) {
|
||||||
@ -81,6 +83,11 @@ if ($statisticstype == 'bydate') {
|
|||||||
$page['reportByDate'] = $db->query(
|
$page['reportByDate'] = $db->query(
|
||||||
"SELECT DATE(FROM_UNIXTIME(date)) AS date, " .
|
"SELECT DATE(FROM_UNIXTIME(date)) AS date, " .
|
||||||
"threads, " .
|
"threads, " .
|
||||||
|
"missedthreads, " .
|
||||||
|
"sentinvitations, " .
|
||||||
|
"acceptedinvitations, " .
|
||||||
|
"rejectedinvitations, " .
|
||||||
|
"ignoredinvitations, " .
|
||||||
"operatormessages AS agents, " .
|
"operatormessages AS agents, " .
|
||||||
"usermessages AS users, " .
|
"usermessages AS users, " .
|
||||||
"averagewaitingtime AS avgwaitingtime, " .
|
"averagewaitingtime AS avgwaitingtime, " .
|
||||||
@ -99,6 +106,11 @@ if ($statisticstype == 'bydate') {
|
|||||||
$page['reportByDateTotal'] = $db->query(
|
$page['reportByDateTotal'] = $db->query(
|
||||||
"SELECT DATE(FROM_UNIXTIME(date)) AS date, " .
|
"SELECT DATE(FROM_UNIXTIME(date)) AS date, " .
|
||||||
"SUM(threads) AS threads, " .
|
"SUM(threads) AS threads, " .
|
||||||
|
"SUM(missedthreads) AS missedthreads, " .
|
||||||
|
"SUM(sentinvitations) AS sentinvitations, " .
|
||||||
|
"SUM(acceptedinvitations) AS acceptedinvitations, " .
|
||||||
|
"SUM(rejectedinvitations) AS rejectedinvitations, " .
|
||||||
|
"SUM(ignoredinvitations) AS ignoredinvitations, " .
|
||||||
"SUM(operatormessages) AS agents, " .
|
"SUM(operatormessages) AS agents, " .
|
||||||
"SUM(usermessages) AS users, " .
|
"SUM(usermessages) AS users, " .
|
||||||
"ROUND(SUM(averagewaitingtime * s.threads) / SUM(s.threads),1) AS avgwaitingtime, " .
|
"ROUND(SUM(averagewaitingtime * s.threads) / SUM(s.threads),1) AS avgwaitingtime, " .
|
||||||
|
@ -80,6 +80,8 @@ require_once('inc_errors.php');
|
|||||||
<?php echo getlocal("report.bydate.1") ?>
|
<?php echo getlocal("report.bydate.1") ?>
|
||||||
</th><th>
|
</th><th>
|
||||||
<?php echo getlocal("report.bydate.2") ?>
|
<?php echo getlocal("report.bydate.2") ?>
|
||||||
|
</th><th>
|
||||||
|
<?php echo getlocal("report.bydate.7") ?>
|
||||||
</th><th>
|
</th><th>
|
||||||
<?php echo getlocal("report.bydate.3") ?>
|
<?php echo getlocal("report.bydate.3") ?>
|
||||||
</th><th>
|
</th><th>
|
||||||
@ -88,7 +90,19 @@ require_once('inc_errors.php');
|
|||||||
<?php echo getlocal("report.bydate.5") ?>
|
<?php echo getlocal("report.bydate.5") ?>
|
||||||
</th><th>
|
</th><th>
|
||||||
<?php echo getlocal("report.bydate.6") ?>
|
<?php echo getlocal("report.bydate.6") ?>
|
||||||
</th></tr>
|
</th>
|
||||||
|
<?php if ($page['show_invitations_info']) { ?>
|
||||||
|
<th>
|
||||||
|
<?php echo getlocal("report.bydate.8") ?>
|
||||||
|
</th><th>
|
||||||
|
<?php echo getlocal("report.bydate.9") ?>
|
||||||
|
</th><th>
|
||||||
|
<?php echo getlocal("report.bydate.10") ?>
|
||||||
|
</th><th>
|
||||||
|
<?php echo getlocal("report.bydate.11") ?>
|
||||||
|
</th>
|
||||||
|
<?php } ?>
|
||||||
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php if( $page['reportByDate'] ) { ?>
|
<?php if( $page['reportByDate'] ) { ?>
|
||||||
@ -96,23 +110,37 @@ require_once('inc_errors.php');
|
|||||||
<tr>
|
<tr>
|
||||||
<td><?php echo $row['date'] ?></td>
|
<td><?php echo $row['date'] ?></td>
|
||||||
<td><?php echo $row['threads'] ?></td>
|
<td><?php echo $row['threads'] ?></td>
|
||||||
|
<td><?php echo $row['missedthreads'] ?></td>
|
||||||
<td><?php echo $row['agents'] ?></td>
|
<td><?php echo $row['agents'] ?></td>
|
||||||
<td><?php echo $row['users'] ?></td>
|
<td><?php echo $row['users'] ?></td>
|
||||||
<td><?php echo $row['avgwaitingtime'] ?></td>
|
<td><?php echo $row['avgwaitingtime'] ?></td>
|
||||||
<td><?php echo $row['avgchattime'] ?></td>
|
<td><?php echo $row['avgchattime'] ?></td>
|
||||||
|
<?php if ($page['show_invitations_info']) { ?>
|
||||||
|
<td><?php echo $row['sentinvitations'] ?></td>
|
||||||
|
<td><?php echo $row['acceptedinvitations'] ?></td>
|
||||||
|
<td><?php echo $row['rejectedinvitations'] ?></td>
|
||||||
|
<td><?php echo $row['ignoredinvitations'] ?></td>
|
||||||
|
<?php } ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b><?php echo getlocal("report.total") ?></b></td>
|
<td><b><?php echo getlocal("report.total") ?></b></td>
|
||||||
<td><?php echo $page['reportByDateTotal']['threads'] ?></td>
|
<td><?php echo $page['reportByDateTotal']['threads'] ?></td>
|
||||||
|
<td><?php echo $page['reportByDateTotal']['missedthreads'] ?></td>
|
||||||
<td><?php echo $page['reportByDateTotal']['agents'] ?></td>
|
<td><?php echo $page['reportByDateTotal']['agents'] ?></td>
|
||||||
<td><?php echo $page['reportByDateTotal']['users'] ?></td>
|
<td><?php echo $page['reportByDateTotal']['users'] ?></td>
|
||||||
<td><?php echo $page['reportByDateTotal']['avgwaitingtime'] ?></td>
|
<td><?php echo $page['reportByDateTotal']['avgwaitingtime'] ?></td>
|
||||||
<td><?php echo $page['reportByDateTotal']['avgchattime'] ?></td>
|
<td><?php echo $page['reportByDateTotal']['avgchattime'] ?></td>
|
||||||
|
<?php if ($page['show_invitations_info']) { ?>
|
||||||
|
<td><?php echo $page['reportByDateTotal']['sentinvitations'] ?></td>
|
||||||
|
<td><?php echo $page['reportByDateTotal']['acceptedinvitations'] ?></td>
|
||||||
|
<td><?php echo $page['reportByDateTotal']['rejectedinvitations'] ?></td>
|
||||||
|
<td><?php echo $page['reportByDateTotal']['ignoredinvitations'] ?></td>
|
||||||
|
<?php } ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6">
|
<td colspan="<?php $page['show_invitations_info'] ? 11 : 7; ?>">
|
||||||
<?php echo getlocal("report.no_items") ?>
|
<?php echo getlocal("report.no_items") ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user