Added Agent Time Detail report

Added functions.php with a function to format seconds into HH:MM:SS
Fixed sidebar display bug in several scripts

git-svn-id: svn://192.168.202.10@1124 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-05-25 03:11:13 +00:00
parent d4aef7ba9e
commit 2b2bffe598
19 changed files with 1305 additions and 819 deletions
+5
View File
@@ -50,6 +50,11 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
top limit for Campaign Auto Dial Level pull-down menu in the Modify
Campaign screens
12. Added Agent Time Detail report showing the timeclock time, agent activity
time and pause codes time by agent across selected campaigns and/or
user groups. Also reformatted Reports screen in Administration
+4 -3
View File
@@ -166,11 +166,12 @@ wget http://www.openssl.org/source/openssl-0.9.8k.tar.gz
gunzip openssl-0.9.8k.tar.gz
tar xvf openssl-0.9.8k.tar
cd openssl-0.9.8k
./config
./config --prefix=/usr
make
make install
cd /usr/local
wget http://subversion.tigris.org/downloads/subversion-1.5.2.tar.gz
gunzip subversion-1.5.2.tar.gz
@@ -200,7 +201,7 @@ gunzip httpd-2.2.11.tar.gz
tar xvf httpd-2.2.11.tar
cd httpd-2.2.11
make clean
./configure --prefix=/usr/local/apache2 --enable-ssl --enable-setenvif --enable-so --with-apxs2 --enable-dav --enable-maintainer-mode
./configure --prefix=/usr/local/apache2 --enable-ssl --enable-setenvif --enable-so --with-apxs2 --enable-dav --enable-maintainer-mode --with-ssl=/usr/local/ssl
make
make install
mkdir /usr/local/apache2/conf/ssl.key
@@ -214,7 +215,7 @@ openssl rsa -in /usr/local/apache2/conf/ssl.key/server.key.cpy -out /usr/local/a
cd ../php-5.2.9
make clean
./configure --with-mysql=/usr/local/mysql --enable-inline-optimization --enable-memory-limit --enable-track-vars --enable-libgcc --enable-sysvsem --with-openssl --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib
./configure --with-mysql=/usr/local/mysql --enable-inline-optimization --enable-memory-limit --enable-track-vars --enable-libgcc --enable-sysvsem --with-openssl=/usr/local/ssl --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib
make
make install
cp php.ini-dist /usr/local/lib/php.ini
+29 -99
View File
@@ -21,9 +21,11 @@
# 90116-1040 - Rewrite of the 15-minute sections to speed it up and allow multi-day calculations
# 90310-2037 - Admin header
# 90508-0644 - Changed to PHP long tags
# 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion
#
require("dbconnect.php");
require("functions.php");
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
@@ -952,33 +954,9 @@ while ($i < $statuses_to_print)
{$STATUSrate = ($STATUScount / ($TOTALsec / 3600) );}
$STATUSrate = sprintf("%.2f", $STATUSrate);
$STATUShours_H = ($row[2] / 3600);
$STATUShours_H_int = round($STATUShours_H, 2);
$STATUShours_H_int = intval("$STATUShours_H_int");
$STATUShours_M = ($STATUShours_H - $STATUShours_H_int);
$STATUShours_M = ($STATUShours_M * 60);
$STATUShours_M_int = round($STATUShours_M, 2);
$STATUShours_M_int = intval("$STATUShours_M_int");
$STATUShours_S = ($STATUShours_M - $STATUShours_M_int);
$STATUShours_S = ($STATUShours_S * 60);
$STATUShours_S = round($STATUShours_S, 0);
if ($STATUShours_S < 10) {$STATUShours_S = "0$STATUShours_S";}
if ($STATUShours_M_int < 10) {$STATUShours_M_int = "0$STATUShours_M_int";}
$STATUShours = "$STATUShours_H_int:$STATUShours_M_int:$STATUShours_S";
$STATUSavg_H = (($row[2] / 3600) / $STATUScount);
$STATUSavg_H_int = round($STATUSavg_H, 2);
$STATUSavg_H_int = intval("$STATUSavg_H_int");
$STATUSavg_M = ($STATUSavg_H - $STATUSavg_H_int);
$STATUSavg_M = ($STATUSavg_M * 60);
$STATUSavg_M_int = round($STATUSavg_M, 2);
$STATUSavg_M_int = intval("$STATUSavg_M_int");
$STATUSavg_S = ($STATUSavg_M - $STATUSavg_M_int);
$STATUSavg_S = ($STATUSavg_S * 60);
$STATUSavg_S = round($STATUSavg_S, 0);
if ($STATUSavg_S < 10) {$STATUSavg_S = "0$STATUSavg_S";}
if ($STATUSavg_M_int < 10) {$STATUSavg_M_int = "0$STATUSavg_M_int";}
$STATUSavg = "$STATUSavg_H_int:$STATUSavg_M_int:$STATUSavg_S";
$STATUShours = sec_convert($row[2],'H');
$STATUSavg_sec = ($row[2] / $STATUScount);
$STATUSavg = sec_convert($STATUSavg_sec,'H');
$STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
$status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);}
@@ -1021,33 +999,9 @@ else
{$TOTALrate = ($TOTALcalls / ($TOTALsec / 3600) );}
$TOTALrate = sprintf("%.2f", $TOTALrate);
$TOTALhours_H = ($TOTALsec / 3600);
$TOTALhours_H_int = round($TOTALhours_H, 2);
$TOTALhours_H_int = intval("$TOTALhours_H_int");
$TOTALhours_M = ($TOTALhours_H - $TOTALhours_H_int);
$TOTALhours_M = ($TOTALhours_M * 60);
$TOTALhours_M_int = round($TOTALhours_M, 2);
$TOTALhours_M_int = intval("$TOTALhours_M_int");
$TOTALhours_S = ($TOTALhours_M - $TOTALhours_M_int);
$TOTALhours_S = ($TOTALhours_S * 60);
$TOTALhours_S = round($TOTALhours_S, 0);
if ($TOTALhours_S < 10) {$TOTALhours_S = "0$TOTALhours_S";}
if ($TOTALhours_M_int < 10) {$TOTALhours_M_int = "0$TOTALhours_M_int";}
$TOTALhours = "$TOTALhours_H_int:$TOTALhours_M_int:$TOTALhours_S";
$TOTALavg_H = (($TOTALsec / 3600) / $TOTALcalls);
$TOTALavg_H_int = round($TOTALavg_H, 2);
$TOTALavg_H_int = intval("$TOTALavg_H_int");
$TOTALavg_M = ($TOTALavg_H - $TOTALavg_H_int);
$TOTALavg_M = ($TOTALavg_M * 60);
$TOTALavg_M_int = round($TOTALavg_M, 2);
$TOTALavg_M_int = intval("$TOTALavg_M_int");
$TOTALavg_S = ($TOTALavg_M - $TOTALavg_M_int);
$TOTALavg_S = ($TOTALavg_S * 60);
$TOTALavg_S = round($TOTALavg_S, 0);
if ($TOTALavg_S < 10) {$TOTALavg_S = "0$TOTALavg_S";}
if ($TOTALavg_M_int < 10) {$TOTALavg_M_int = "0$TOTALavg_M_int";}
$TOTALavg = "$TOTALavg_H_int:$TOTALavg_M_int:$TOTALavg_S";
$TOTALhours = sec_convert($TOTALsec,'H');
$TOTALavg_sec = ($TOTALsec / $TOTALcalls);
$TOTALavg = sec_convert($TOTALavg_sec,'H');
}
$TOTALcalls = sprintf("%10s", $TOTALcalls);
$TOTALhours = sprintf("%10s", $TOTALhours);while(strlen($TOTALhours)>10) {$TOTALhours = substr("$TOTALhours", 0, -1);}
@@ -1102,9 +1056,9 @@ $TOTavg=0;
echo "\n";
echo "---------- AGENT STATS\n";
echo "+--------------------------+------------+----------+--------+\n";
echo "| AGENT | CALLS | TIME M | AVRG M |\n";
echo "+--------------------------+------------+----------+--------+\n";
echo "+--------------------------+------------+------------+--------+\n";
echo "| AGENT | CALLS | TIME H:M:S |AVERAGE |\n";
echo "+--------------------------+------------+------------+--------+\n";
$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
$rslt=mysql_query($stmt, $link);
@@ -1119,34 +1073,25 @@ while ($i < $users_to_print)
$TOTtime = ($TOTtime + $row[3]);
$user = sprintf("%-6s", $row[0]);
$full_name = sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
if ($non_latin < 1)
{
$full_name = sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
}
else
{
$full_name = sprintf("%-45s", $row[1]); while(mb_strlen($full_name,'utf-8')>15) {$full_name = mb_substr("$full_name", 0, -1,'utf-8');}
}
$USERcalls = sprintf("%10s", $row[2]);
$USERtotTALK = $row[3];
$USERavgTALK = $row[4];
$USERtotTALK_M = ($USERtotTALK / 60);
$USERtotTALK_M_int = round($USERtotTALK_M, 2);
$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
$USERtotTALK_S = ($USERtotTALK_S * 60);
$USERtotTALK_S = round($USERtotTALK_S, 0);
if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
$USERtotTALK_MS = eregi_replace('-','',$USERtotTALK_MS);
$USERtotTALK_MS = sprintf("%8s", $USERtotTALK_MS);
$USERtotTALK_MS = sec_convert($USERtotTALK,'H');
$USERavgTALK_MS = sec_convert($USERavgTALK,'H');
$USERavgTALK_M = ($USERavgTALK / 60);
$USERavgTALK_M_int = round($USERavgTALK_M, 2);
$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
$USERavgTALK_S = ($USERavgTALK_S * 60);
$USERavgTALK_S = round($USERavgTALK_S, 0);
if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
$USERavgTALK_MS = eregi_replace('-','',$USERavgTALK_MS);
$USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS);
$USERtotTALK_MS = sprintf("%9s", $USERtotTALK_MS);
$USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS);
echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
$i++;
}
@@ -1155,36 +1100,21 @@ if ($TOTcalls < 1) {$TOTcalls = 0; $TOTavg=0;}
else
{
$TOTavg = ($TOTtime / $TOTcalls);
$TOTavg = round($TOTavg, 0);
$TOTavg_M = ($TOTavg / 60);
$TOTavg_M_int = round($TOTavg_M, 2);
$TOTavg_M_int = intval("$TOTavg_M_int");
$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
$TOTavg_S = ($TOTavg_S * 60);
$TOTavg_S = round($TOTavg_S, 0);
if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
$TOTavg_MS = sec_convert($TOTavg,'H');
$TOTavg = sprintf("%6s", $TOTavg_MS);
}
$TOTtime_M = ($TOTtime / 60);
$TOTtime_M_int = round($TOTtime_M, 2);
$TOTtime_M_int = intval("$TOTtime_M_int");
$TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
$TOTtime_S = ($TOTtime_S * 60);
$TOTtime_S = round($TOTtime_S, 0);
if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";}
$TOTtime_MS = "$TOTtime_M_int:$TOTtime_S";
$TOTtime = sprintf("%6s", $TOTtime_MS);
$TOTtime_MS = sec_convert($TOTtime,'H');
$TOTtime = sprintf("%10s", $TOTtime_MS);
$TOTagents = sprintf("%10s", $i);
$TOTcalls = sprintf("%10s", $TOTcalls);
$TOTtime = sprintf("%8s", $TOTtime);
$TOTavg = sprintf("%6s", $TOTavg);
echo "+--------------------------+------------+----------+--------+\n";
echo "+--------------------------+------------+------------+--------+\n";
echo "| TOTAL Agents: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n";
echo "+--------------------------+------------+----------+--------+\n";
echo "+--------------------------+------------+------------+--------+\n";
##############################
+33 -127
View File
@@ -18,11 +18,13 @@
# 90225-1140 - Changed to multi-campaign capability
# 90310-2034 - Admin header
# 90508-0644 - Changed to PHP long tags
# 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion
#
header ("Content-type: text/html; charset=utf-8");
require("dbconnect.php");
require("functions.php");
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
@@ -519,33 +521,9 @@ while ($i < $statuses_to_print)
$AGENTrate = ($STATUScount / ($AGENTsec / 3600) );
$AGENTrate = sprintf("%.2f", $AGENTrate);
$STATUShours_H = ($row[2] / 3600);
$STATUShours_H_int = round($STATUShours_H, 2);
$STATUShours_H_int = intval("$STATUShours_H_int");
$STATUShours_M = ($STATUShours_H - $STATUShours_H_int);
$STATUShours_M = ($STATUShours_M * 60);
$STATUShours_M_int = round($STATUShours_M, 2);
$STATUShours_M_int = intval("$STATUShours_M_int");
$STATUShours_S = ($STATUShours_M - $STATUShours_M_int);
$STATUShours_S = ($STATUShours_S * 60);
$STATUShours_S = round($STATUShours_S, 0);
if ($STATUShours_S < 10) {$STATUShours_S = "0$STATUShours_S";}
if ($STATUShours_M_int < 10) {$STATUShours_M_int = "0$STATUShours_M_int";}
$STATUShours = "$STATUShours_H_int:$STATUShours_M_int:$STATUShours_S";
$STATUSavg_H = (($row[2] / 3600) / $STATUScount);
$STATUSavg_H_int = round($STATUSavg_H, 2);
$STATUSavg_H_int = intval("$STATUSavg_H_int");
$STATUSavg_M = ($STATUSavg_H - $STATUSavg_H_int);
$STATUSavg_M = ($STATUSavg_M * 60);
$STATUSavg_M_int = round($STATUSavg_M, 2);
$STATUSavg_M_int = intval("$STATUSavg_M_int");
$STATUSavg_S = ($STATUSavg_M - $STATUSavg_M_int);
$STATUSavg_S = ($STATUSavg_S * 60);
$STATUSavg_S = round($STATUSavg_S, 0);
if ($STATUSavg_S < 10) {$STATUSavg_S = "0$STATUSavg_S";}
if ($STATUSavg_M_int < 10) {$STATUSavg_M_int = "0$STATUSavg_M_int";}
$STATUSavg = "$STATUSavg_H_int:$STATUSavg_M_int:$STATUSavg_S";
$STATUShours = sec_convert($row[2],'H');
$STATUSavg_sec = ($row[2] / $STATUScount);
$STATUSavg = sec_convert($STATUSavg_sec,'H');
$STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);}
$status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);}
@@ -587,47 +565,10 @@ else
$aTOTALrate = ($TOTALcalls / ($AGENTsec / 3600) );
$aTOTALrate = sprintf("%.2f", $aTOTALrate);
$aTOTALhours_H = ($AGENTsec / 3600);
$aTOTALhours_H_int = round($aTOTALhours_H, 2);
$aTOTALhours_H_int = intval("$aTOTALhours_H_int");
$aTOTALhours_M = ($aTOTALhours_H - $aTOTALhours_H_int);
$aTOTALhours_M = ($aTOTALhours_M * 60);
$aTOTALhours_M_int = round($aTOTALhours_M, 2);
$aTOTALhours_M_int = intval("$aTOTALhours_M_int");
$aTOTALhours_S = ($aTOTALhours_M - $aTOTALhours_M_int);
$aTOTALhours_S = ($aTOTALhours_S * 60);
$aTOTALhours_S = round($aTOTALhours_S, 0);
if ($aTOTALhours_S < 10) {$aTOTALhours_S = "0$aTOTALhours_S";}
if ($aTOTALhours_M_int < 10) {$aTOTALhours_M_int = "0$aTOTALhours_M_int";}
$aTOTALhours = "$aTOTALhours_H_int:$aTOTALhours_M_int:$aTOTALhours_S";
$TOTALhours_H = ($TOTALsec / 3600);
$TOTALhours_H_int = round($TOTALhours_H, 2);
$TOTALhours_H_int = intval("$TOTALhours_H_int");
$TOTALhours_M = ($TOTALhours_H - $TOTALhours_H_int);
$TOTALhours_M = ($TOTALhours_M * 60);
$TOTALhours_M_int = round($TOTALhours_M, 2);
$TOTALhours_M_int = intval("$TOTALhours_M_int");
$TOTALhours_S = ($TOTALhours_M - $TOTALhours_M_int);
$TOTALhours_S = ($TOTALhours_S * 60);
$TOTALhours_S = round($TOTALhours_S, 0);
if ($TOTALhours_S < 10) {$TOTALhours_S = "0$TOTALhours_S";}
if ($TOTALhours_M_int < 10) {$TOTALhours_M_int = "0$TOTALhours_M_int";}
$TOTALhours = "$TOTALhours_H_int:$TOTALhours_M_int:$TOTALhours_S";
$TOTALavg_H = (($TOTALsec / 3600) / $TOTALcalls);
$TOTALavg_H_int = round($TOTALavg_H, 2);
$TOTALavg_H_int = intval("$TOTALavg_H_int");
$TOTALavg_M = ($TOTALavg_H - $TOTALavg_H_int);
$TOTALavg_M = ($TOTALavg_M * 60);
$TOTALavg_M_int = round($TOTALavg_M, 2);
$TOTALavg_M_int = intval("$TOTALavg_M_int");
$TOTALavg_S = ($TOTALavg_M - $TOTALavg_M_int);
$TOTALavg_S = ($TOTALavg_S * 60);
$TOTALavg_S = round($TOTALavg_S, 0);
if ($TOTALavg_S < 10) {$TOTALavg_S = "0$TOTALavg_S";}
if ($TOTALavg_M_int < 10) {$TOTALavg_M_int = "0$TOTALavg_M_int";}
$TOTALavg = "$TOTALavg_H_int:$TOTALavg_M_int:$TOTALavg_S";
$aTOTALhours = sec_convert($AGENTsec,'H');
$TOTALhours = sec_convert($TOTALsec,'H');
$TOTALavg_sec = ($TOTALsec / $TOTALcalls);
$TOTALavg = sec_convert($TOTALavg_sec,'H');
}
$TOTALcalls = sprintf("%10s", $TOTALcalls);
$TOTALhours = sprintf("%10s", $TOTALhours);while(strlen($TOTALhours)>10) {$TOTALhours = substr("$TOTALhours", 0, -1);}
@@ -687,9 +628,9 @@ $TOTavg=0;
echo "\n";
echo "---------- AGENT STATS\n";
echo "+--------------------------+------------+----------+--------+\n";
echo "| AGENT | CALLS | TIME M | AVRG M |\n";
echo "+--------------------------+------------+----------+--------+\n";
echo "+--------------------------+------------+------------+--------+\n";
echo "| AGENT | CALLS | TIME H:M:S |AVERAGE |\n";
echo "+--------------------------+------------+------------+--------+\n";
$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;";
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
@@ -706,64 +647,36 @@ while ($i < $users_to_print)
$user = sprintf("%-6s", $row[0]);while(strlen($user)>6) {$user = substr("$user", 0, -1);}
if ($non_latin < 1)
{
$full_name = sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
}
{
$full_name = sprintf("%-15s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
}
else
{
$full_name = sprintf("%-45s", $row[1]); while(mb_strlen($full_name,'utf-8')>15) {$full_name = mb_substr("$full_name", 0, -1,'utf-8');}
}
{
$full_name = sprintf("%-45s", $row[1]); while(mb_strlen($full_name,'utf-8')>15) {$full_name = mb_substr("$full_name", 0, -1,'utf-8');}
}
$USERcalls = sprintf("%10s", $row[2]);
$USERtotTALK = $row[3];
$USERavgTALK = $row[4];
$USERtotTALK_M = ($USERtotTALK / 60);
$USERtotTALK_M_int = round($USERtotTALK_M, 2);
$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
$USERtotTALK_S = ($USERtotTALK_S * 60);
$USERtotTALK_S = round($USERtotTALK_S, 0);
if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
$USERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS);
$USERtotTALK_MS = sec_convert($USERtotTALK,'H');
$USERavgTALK_MS = sec_convert($USERavgTALK,'H');
$USERavgTALK_M = ($USERavgTALK / 60);
$USERavgTALK_M_int = round($USERavgTALK_M, 2);
$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
$USERavgTALK_S = ($USERavgTALK_S * 60);
$USERavgTALK_S = round($USERavgTALK_S, 0);
if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
$USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS);
$USERtotTALK_MS = sprintf("%9s", $USERtotTALK_MS);
$USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS);
echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
$i++;
}
if (!$TOTcalls) {$TOTcalls = 1;}
$TOTavg = ($TOTtime / $TOTcalls);
$TOTavg = round($TOTavg, 0);
$TOTavg_M = ($TOTavg / 60);
$TOTavg_M_int = round($TOTavg_M, 2);
$TOTavg_M_int = intval("$TOTavg_M_int");
$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
$TOTavg_S = ($TOTavg_S * 60);
$TOTavg_S = round($TOTavg_S, 0);
if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
$TOTavg = sprintf("%6s", $TOTavg_MS);
$TOTtime_M = ($TOTtime / 60);
$TOTtime_M_int = round($TOTtime_M, 2);
$TOTtime_M_int = intval("$TOTtime_M_int");
$TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
$TOTtime_S = ($TOTtime_S * 60);
$TOTtime_S = round($TOTtime_S, 0);
if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";}
$TOTtime_MS = "$TOTtime_M_int:$TOTtime_S";
$TOTtime = sprintf("%6s", $TOTtime_MS);
$TOTavg_MS = sec_convert($TOTavg,'H');
$TOTtime_MS = sec_convert($TOTtime,'H');
$TOTavg = sprintf("%6s", $TOTavg_MS);
$TOTtime = sprintf("%10s", $TOTtime_MS);
$TOTagents = sprintf("%10s", $i);
$TOTcalls = sprintf("%10s", $TOTcalls);
@@ -776,21 +689,14 @@ if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
$AVGwait = $row[0];
$AVGwait_M = ($AVGwait / 60);
$AVGwait_M_int = round($AVGwait_M, 2);
$AVGwait_M_int = intval("$AVGwait_M_int");
$AVGwait_S = ($AVGwait_M - $AVGwait_M_int);
$AVGwait_S = ($AVGwait_S * 60);
$AVGwait_S = round($AVGwait_S, 0);
if ($AVGwait_S < 10) {$AVGwait_S = "0$AVGwait_S";}
$AVGwait_MS = "$AVGwait_M_int:$AVGwait_S";
$AVGwait_MS = sec_convert($AVGwait,'H');
$AVGwait = sprintf("%6s", $AVGwait_MS);
echo "+--------------------------+------------+----------+--------+\n";
echo "+--------------------------+------------+------------+--------+\n";
echo "| TOTAL Agents: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n";
echo "+--------------------------+------------+----------+--------+\n";
echo "| Average Wait time between calls $AVGwait |\n";
echo "+-----------------------------------------------------------+\n";
echo "+--------------------------+------------+------------+--------+\n";
echo "| Average Wait time between calls $AVGwait |\n";
echo "+-------------------------------------------------------------+\n";
##############################
######### TIME STATS
+102 -301
View File
@@ -17,9 +17,11 @@
# 81110-0056 - fixed pause code display bug
# 90310-2039 - Admin header
# 90508-0644 - Changed to PHP long tags
# 90523-0935 - Rewrite of seconds to minutes and hours conversion
#
require("dbconnect.php");
require("functions.php");
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
@@ -143,9 +145,9 @@ echo "<SELECT SIZE=1 NAME=group>\n";
$o=0;
while ($campaigns_to_print > $o)
{
if ($groups[$o] == $group) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
$o++;
if ($groups[$o] == $group) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
$o++;
}
echo "</SELECT>\n";
echo "<SELECT SIZE=1 NAME=user_group>\n";
@@ -153,9 +155,9 @@ echo "<option value=\"\">-- ALL USER GROUPS --</option>\n";
$o=0;
while ($user_groups_to_print > $o)
{
if ($user_groups[$o] == $user_group) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
else {echo "<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
$o++;
if ($user_groups[$o] == $user_group) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
else {echo "<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
$o++;
}
echo "</SELECT>\n";
echo "<SELECT SIZE=1 NAME=shift>\n";
@@ -265,9 +267,9 @@ while ($i < $rows_to_print)
}
echo "CALL STATS BREAKDOWN:\n";
echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n";
echo "| <a href=\"$LINKbase\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=CALLS\">CALLS</a> | <a href=\"$LINKbase&stage=TIME\">TIME</a> | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG|$statusesHTML\n";
echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n";
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
echo "| <a href=\"$LINKbase\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=CALLS\">CALLS</a> | <a href=\"$LINKbase&stage=TIME\">TIME</a> | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG |$statusesHTML\n";
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
### BEGIN loop through each user ###
@@ -338,110 +340,39 @@ while ($m < $k)
if ($non_latin < 1)
{
$Sfull_name= sprintf("%-15s", $Sfull_name);
while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);}
$Suser = sprintf("%-8s", $Suser);
while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);}
$Sfull_name= sprintf("%-15s", $Sfull_name);
while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);}
$Suser = sprintf("%-8s", $Suser);
while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);}
}
else
{
$Sfull_name= sprintf("%-45s", $Sfull_name);
while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');}
$Suser = sprintf("%-24s", $Suser);
while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');}
$Sfull_name= sprintf("%-45s", $Sfull_name);
while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');}
$Suser = sprintf("%-24s", $Suser);
while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');}
}
$USERtime_M = ($Stime / 60);
$USERtime_M_int = round($USERtime_M, 2);
$USERtime_M_int = intval("$USERtime_M_int");
$USERtime_S = ($USERtime_M - $USERtime_M_int);
$USERtime_S = ($USERtime_S * 60);
$USERtime_S = round($USERtime_S, 0);
if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";}
$USERtime_MS = "$USERtime_M_int:$USERtime_S";
$pfUSERtime_MS = sprintf("%7s", $USERtime_MS);
$pfUSERtime_MS = sec_convert($Stime,'H');
$pfUSERtotTALK_MS = sec_convert($Stalk_sec,'H');
$pfUSERavgTALK_MS = sec_convert($Stalk_avg,'M');
$USERtotPAUSE_MS = sec_convert($Spause_sec,'H');
$USERavgPAUSE_MS = sec_convert($Spause_avg,'M');
$USERtotWAIT_MS = sec_convert($Swait_sec,'H');
$USERavgWAIT_MS = sec_convert($Swait_avg,'M');
$USERtotDISPO_MS = sec_convert($Sdispo_sec,'H');
$USERavgDISPO_MS = sec_convert($Sdispo_avg,'M');
$USERtotTALK_M = ($Stalk_sec / 60);
$USERtotTALK_M_int = round($USERtotTALK_M, 2);
$USERtotTALK_M_int = intval("$USERtotTALK_M_int");
$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
$USERtotTALK_S = ($USERtotTALK_S * 60);
$USERtotTALK_S = round($USERtotTALK_S, 0);
if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
$pfUSERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS);
$USERavgTALK_M = ($Stalk_avg / 60);
$USERavgTALK_M_int = round($USERavgTALK_M, 2);
$USERavgTALK_M_int = intval("$USERavgTALK_M_int");
$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
$USERavgTALK_S = ($USERavgTALK_S * 60);
$USERavgTALK_S = round($USERavgTALK_S, 0);
if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
$pfUSERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS);
$USERtotPAUSE_M = ($Spause_sec / 60);
$USERtotPAUSE_M_int = round($USERtotPAUSE_M, 2);
$USERtotPAUSE_M_int = intval("$USERtotPAUSE_M_int");
$USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int);
$USERtotPAUSE_S = ($USERtotPAUSE_S * 60);
$USERtotPAUSE_S = round($USERtotPAUSE_S, 0);
if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";}
$USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S";
$pfUSERtotPAUSE_MS = sprintf("%6s", $USERtotPAUSE_MS);
$PAUSEtotal[$m] = $pfUSERtotPAUSE_MS;
$USERavgPAUSE_M = ($Spause_avg / 60);
$USERavgPAUSE_M_int = round($USERavgPAUSE_M, 2);
$USERavgPAUSE_M_int = intval("$USERavgPAUSE_M_int");
$USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int);
$USERavgPAUSE_S = ($USERavgPAUSE_S * 60);
$USERavgPAUSE_S = round($USERavgPAUSE_S, 0);
if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";}
$USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S";
$pfUSERavgPAUSE_MS = sprintf("%6s", $USERavgPAUSE_MS);
$USERtotWAIT_M = ($Swait_sec / 60);
$USERtotWAIT_M_int = round($USERtotWAIT_M, 2);
$USERtotWAIT_M_int = intval("$USERtotWAIT_M_int");
$USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int);
$USERtotWAIT_S = ($USERtotWAIT_S * 60);
$USERtotWAIT_S = round($USERtotWAIT_S, 0);
if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";}
$USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S";
$pfUSERtotWAIT_MS = sprintf("%6s", $USERtotWAIT_MS);
$USERavgWAIT_M = ($Swait_avg / 60);
$USERavgWAIT_M_int = round($USERavgWAIT_M, 2);
$USERavgWAIT_M_int = intval("$USERavgWAIT_M_int");
$USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int);
$USERavgWAIT_S = ($USERavgWAIT_S * 60);
$USERavgWAIT_S = round($USERavgWAIT_S, 0);
if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";}
$USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S";
$pfUSERtime_MS = sprintf("%9s", $pfUSERtime_MS);
$pfUSERtotTALK_MS = sprintf("%8s", $pfUSERtotTALK_MS);
$pfUSERavgTALK_MS = sprintf("%6s", $pfUSERavgTALK_MS);
$pfUSERtotPAUSE_MS = sprintf("%8s", $USERtotPAUSE_MS);
$pfUSERavgPAUSE_MS = sprintf("%6s", $USERavgPAUSE_MS);
$pfUSERtotWAIT_MS = sprintf("%8s", $USERtotWAIT_MS);
$pfUSERavgWAIT_MS = sprintf("%6s", $USERavgWAIT_MS);
$USERtotDISPO_M = ($Sdispo_sec / 60);
$USERtotDISPO_M_int = round($USERtotDISPO_M, 2);
$USERtotDISPO_M_int = intval("$USERtotDISPO_M_int");
$USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int);
$USERtotDISPO_S = ($USERtotDISPO_S * 60);
$USERtotDISPO_S = round($USERtotDISPO_S, 0);
if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";}
$USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S";
$pfUSERtotDISPO_MS = sprintf("%6s", $USERtotDISPO_MS);
$USERavgDISPO_M = ($Sdispo_avg / 60);
$USERavgDISPO_M_int = round($USERavgDISPO_M, 2);
$USERavgDISPO_M_int = intval("$USERavgDISPO_M_int");
$USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int);
$USERavgDISPO_S = ($USERavgDISPO_S * 60);
$USERavgDISPO_S = round($USERavgDISPO_S, 0);
if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";}
$USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S";
$pfUSERavgDISPO_MS = sprintf("%6s", $USERavgDISPO_MS);
$pfUSERtotDISPO_MS = sprintf("%8s", $USERtotDISPO_MS);
$pfUSERavgDISPO_MS = sprintf("%6s", $USERavgDISPO_MS);
$PAUSEtotal[$m] = $pfUSERtotPAUSE_MS;
$Toutput = "| $Sfull_name | <a href=\"./user_stats.php?user=$RAWuser\">$Suser</a> | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS |$SstatusesHTML\n";
@@ -518,120 +449,52 @@ while ($n < $j)
}
### END loop through each status ###
$TOTcalls = sprintf("%7s", $TOTcalls);
$TOT_AGENTS = sprintf("%-4s", $m);
$TOTcalls = sprintf("%7s", $TOTcalls);
$TOT_AGENTS = sprintf("%-4s", $m);
if ($TOTtotTALK < 1) {$TOTavgTALK = '0';}
else {$TOTavgTALK = ($TOTtotTALK / $TOTcalls);}
if ($TOTtotDISPO < 1) {$TOTavgDISPO = '0';}
else {$TOTavgDISPO = ($TOTtotDISPO / $TOTcalls);}
if ($TOTtotPAUSE < 1) {$TOTavgPAUSE = '0';}
else {$TOTavgPAUSE = ($TOTtotPAUSE / $TOTcalls);}
if ($TOTtotWAIT < 1) {$TOTavgWAIT = '0';}
else {$TOTavgWAIT = ($TOTtotWAIT / $TOTcalls);}
$TOTtime_M = ($TOTtime / 60);
$TOTtime_M_int = round($TOTtime_M, 2);
$TOTtime_M_int = intval("$TOTtime_M_int");
$TOTtime_S = ($TOTtime_M - $TOTtime_M_int);
$TOTtime_S = ($TOTtime_S * 60);
$TOTtime_S = round($TOTtime_S, 0);
if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";}
$TOTtime_MS = "$TOTtime_M_int:$TOTtime_S";
$TOTtime_MS = sprintf("%8s", $TOTtime_MS);
while(strlen($TOTtime_MS)>8) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
$TOTtime_MS = sec_convert($TOTtime,'H');
$TOTtotTALK_MS = sec_convert($TOTtotTALK,'H');
$TOTtotDISPO_MS = sec_convert($TOTtotDISPO,'H');
$TOTtotPAUSE_MS = sec_convert($TOTtotPAUSE,'H');
$TOTtotWAIT_MS = sec_convert($TOTtotWAIT,'H');
$TOTavgTALK_MS = sec_convert($TOTavgTALK,'M');
$TOTavgDISPO_MS = sec_convert($TOTavgDISPO,'H');
$TOTavgPAUSE_MS = sec_convert($TOTavgPAUSE,'H');
$TOTavgWAIT_MS = sec_convert($TOTavgWAIT,'H');
$TOTtotTALK_M = ($TOTtotTALK / 60);
$TOTtotTALK_M_int = round($TOTtotTALK_M, 2);
$TOTtotTALK_M_int = intval("$TOTtotTALK_M_int");
$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
$TOTtotTALK_S = ($TOTtotTALK_S * 60);
$TOTtotTALK_S = round($TOTtotTALK_S, 0);
if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
$TOTtotTALK_MS = sprintf("%8s", $TOTtotTALK_MS);
while(strlen($TOTtotTALK_MS)>8) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
$TOTtime_MS = sprintf("%10s", $TOTtime_MS);
$TOTtotTALK_MS = sprintf("%10s", $TOTtotTALK_MS);
$TOTtotDISPO_MS = sprintf("%10s", $TOTtotDISPO_MS);
$TOTtotPAUSE_MS = sprintf("%10s", $TOTtotPAUSE_MS);
$TOTtotWAIT_MS = sprintf("%10s", $TOTtotWAIT_MS);
$TOTavgTALK_MS = sprintf("%6s", $TOTavgTALK_MS);
$TOTavgDISPO_MS = sprintf("%6s", $TOTavgDISPO_MS);
$TOTavgPAUSE_MS = sprintf("%6s", $TOTavgPAUSE_MS);
$TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS);
if ($TOTtotDISPO < 1) {$TOTtotDISPO_M = '0';}
else {$TOTtotDISPO_M = ($TOTtotDISPO / 60);}
$TOTtotDISPO_M_int = round($TOTtotDISPO_M, 2);
$TOTtotDISPO_M_int = intval("$TOTtotDISPO_M_int");
$TOTtotDISPO_S = ($TOTtotDISPO_M - $TOTtotDISPO_M_int);
$TOTtotDISPO_S = ($TOTtotDISPO_S * 60);
$TOTtotDISPO_S = round($TOTtotDISPO_S, 0);
if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";}
$TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S";
$TOTtotDISPO_MS = sprintf("%8s", $TOTtotDISPO_MS);
while(strlen($TOTtotDISPO_MS)>8) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);}
if ($TOTtotPAUSE < 1) {$TOTtotPAUSE_M = '0';}
else {$TOTtotPAUSE_M = ($TOTtotPAUSE / 60);}
$TOTtotPAUSE_M_int = round($TOTtotPAUSE_M, 2);
$TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M_int");
$TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int);
$TOTtotPAUSE_S = ($TOTtotPAUSE_S * 60);
$TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0);
if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";}
$TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S";
$TOTtotPAUSE_MS = sprintf("%8s", $TOTtotPAUSE_MS);
while(strlen($TOTtotPAUSE_MS)>8) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
if ($TOTtotWAIT < 1) {$TOTtotWAIT_M = '0';}
else {$TOTtotWAIT_M = ($TOTtotWAIT / 60);}
$TOTtotWAIT_M_int = round($TOTtotWAIT_M, 2);
$TOTtotWAIT_M_int = intval("$TOTtotWAIT_M_int");
$TOTtotWAIT_S = ($TOTtotWAIT_M - $TOTtotWAIT_M_int);
$TOTtotWAIT_S = ($TOTtotWAIT_S * 60);
$TOTtotWAIT_S = round($TOTtotWAIT_S, 0);
if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";}
$TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S";
$TOTtotWAIT_MS = sprintf("%8s", $TOTtotWAIT_MS);
while(strlen($TOTtotWAIT_MS)>8) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
if ($TOTtotTALK < 1) {$TOTavgTALK_M = '0';}
else {$TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60);}
$TOTavgTALK_M_int = round($TOTavgTALK_M, 2);
$TOTavgTALK_M_int = intval("$TOTavgTALK_M_int");
$TOTavgTALK_S = ($TOTavgTALK_M - $TOTavgTALK_M_int);
$TOTavgTALK_S = ($TOTavgTALK_S * 60);
$TOTavgTALK_S = round($TOTavgTALK_S, 0);
if ($TOTavgTALK_S < 10) {$TOTavgTALK_S = "0$TOTavgTALK_S";}
$TOTavgTALK_MS = "$TOTavgTALK_M_int:$TOTavgTALK_S";
$TOTavgTALK_MS = sprintf("%6s", $TOTavgTALK_MS);
while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
if ($TOTtotDISPO < 1) {$TOTavgDISPO_M = '0';}
else {$TOTavgDISPO_M = ( ($TOTtotDISPO / $TOTcalls) / 60);}
$TOTavgDISPO_M_int = round($TOTavgDISPO_M, 2);
$TOTavgDISPO_M_int = intval("$TOTavgDISPO_M_int");
$TOTavgDISPO_S = ($TOTavgDISPO_M - $TOTavgDISPO_M_int);
$TOTavgDISPO_S = ($TOTavgDISPO_S * 60);
$TOTavgDISPO_S = round($TOTavgDISPO_S, 0);
if ($TOTavgDISPO_S < 10) {$TOTavgDISPO_S = "0$TOTavgDISPO_S";}
$TOTavgDISPO_MS = "$TOTavgDISPO_M_int:$TOTavgDISPO_S";
$TOTavgDISPO_MS = sprintf("%6s", $TOTavgDISPO_MS);
while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
if ($TOTtotPAUSE < 1) {$TOTavgPAUSE_M = '0';}
else {$TOTavgPAUSE_M = ( ($TOTtotPAUSE / $TOTcalls) / 60);}
$TOTavgPAUSE_M_int = round($TOTavgPAUSE_M, 2);
$TOTavgPAUSE_M_int = intval("$TOTavgPAUSE_M_int");
$TOTavgPAUSE_S = ($TOTavgPAUSE_M - $TOTavgPAUSE_M_int);
$TOTavgPAUSE_S = ($TOTavgPAUSE_S * 60);
$TOTavgPAUSE_S = round($TOTavgPAUSE_S, 0);
if ($TOTavgPAUSE_S < 10) {$TOTavgPAUSE_S = "0$TOTavgPAUSE_S";}
$TOTavgPAUSE_MS = "$TOTavgPAUSE_M_int:$TOTavgPAUSE_S";
$TOTavgPAUSE_MS = sprintf("%6s", $TOTavgPAUSE_MS);
while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
if ($TOTtotWAIT < 1) {$TOTavgWAIT_M = '0';}
else {$TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60);}
$TOTavgWAIT_M_int = round($TOTavgWAIT_M, 2);
$TOTavgWAIT_M_int = intval("$TOTavgWAIT_M_int");
$TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int);
$TOTavgWAIT_S = ($TOTavgWAIT_S * 60);
$TOTavgWAIT_S = round($TOTavgWAIT_S, 0);
if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";}
$TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S";
$TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS);
while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);}
while(strlen($TOTtime_MS)>10) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);}
while(strlen($TOTtotTALK_MS)>10) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
while(strlen($TOTtotDISPO_MS)>10) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);}
while(strlen($TOTtotPAUSE_MS)>10) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
while(strlen($TOTtotWAIT_MS)>10) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);}
while(strlen($TOTavgTALK_MS)>6) {$TOTavgTALK_MS = substr("$TOTavgTALK_MS", 0, -1);}
while(strlen($TOTavgDISPO_MS)>6) {$TOTavgDISPO_MS = substr("$TOTavgDISPO_MS", 0, -1);}
while(strlen($TOTavgPAUSE_MS)>6) {$TOTavgPAUSE_MS = substr("$TOTavgPAUSE_MS", 0, -1);}
while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);}
echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n";
echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$SUMstatusesHTML\n";
echo "+----------------------------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n";
echo "+----------------------------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
echo "\n\n";
@@ -696,9 +559,9 @@ while ($i < $subs_to_print)
}
echo "PAUSE CODE BREAKDOWN:\n";
echo "+-----------------+----------+--------+--------+--------+ +$sub_statusesHEAD\n";
echo "| USER NAME | ID | TOTAL |NONPAUSE| PAUSE | |$sub_statusesHTML\n";
echo "+-----------------+----------+--------+--------+--------+ +$sub_statusesHEAD\n";
echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n";
echo "| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n";
echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n";
### BEGIN loop through each user ###
@@ -739,15 +602,8 @@ while ($m < $k)
$Snon_pause_sec = ($Snon_pause_sec + $PCnon_pause_sec[$i]);
$Stotal_sec = ($Stotal_sec + $PCnon_pause_sec[$i] + $PCpause_sec[$i]);
$USERcodePAUSE_M = ($PCpause_sec[$i] / 60);
$USERcodePAUSE_M_int = round($USERcodePAUSE_M, 2);
$USERcodePAUSE_M_int = intval("$USERcodePAUSE_M_int");
$USERcodePAUSE_S = ($USERcodePAUSE_M - $USERcodePAUSE_M_int);
$USERcodePAUSE_S = ($USERcodePAUSE_S * 60);
$USERcodePAUSE_S = round($USERcodePAUSE_S, 0);
if ($USERcodePAUSE_S < 10) {$USERcodePAUSE_S = "0$USERcodePAUSE_S";}
$USERcodePAUSE_MS = "$USERcodePAUSE_M_int:$USERcodePAUSE_S";
$pfUSERcodePAUSE_MS = sprintf("%6s", $USERcodePAUSE_MS);
$USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],'H');
$pfUSERcodePAUSE_MS = sprintf("%6s", $USERcodePAUSE_MS);
$SstatusTXT = sprintf("%8s", $pfUSERcodePAUSE_MS);
$SstatusesHTML .= " $SstatusTXT |";
@@ -776,7 +632,6 @@ while ($m < $k)
{
$Sfull_name= sprintf("%-45s", $Sfull_name);
while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');}
$Suser = sprintf("%-24s", $Suser);
while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');}
}
@@ -784,44 +639,19 @@ while ($m < $k)
$TOTtotNONPAUSE = ($TOTtotNONPAUSE + $Snon_pause_sec);
$TOTtotTOTAL = ($TOTtotTOTAL + $Stotal_sec);
$USERtotPAUSE_M = ($Spause_sec / 60);
$USERtotPAUSE_M_int = round($USERtotPAUSE_M, 2);
$USERtotPAUSE_M_int = intval("$USERtotPAUSE_M_int");
$USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int);
$USERtotPAUSE_S = ($USERtotPAUSE_S * 60);
$USERtotPAUSE_S = round($USERtotPAUSE_S, 0);
if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";}
$USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S";
$pfUSERtotPAUSE_MS = sprintf("%6s", $USERtotPAUSE_MS);
$USERtotPAUSE_MS = sec_convert($Spause_sec,'H');
$USERtotNONPAUSE_MS = sec_convert($Snon_pause_sec,'H');
$USERtotTOTAL_MS = sec_convert($Stotal_sec,'H');
$USERtotNONPAUSE_M = ($Snon_pause_sec / 60);
$USERtotNONPAUSE_M_int = round($USERtotNONPAUSE_M, 2);
$USERtotNONPAUSE_M_int = intval("$USERtotNONPAUSE_M_int");
$USERtotNONPAUSE_S = ($USERtotNONPAUSE_M - $USERtotNONPAUSE_M_int);
$USERtotNONPAUSE_S = ($USERtotNONPAUSE_S * 60);
$USERtotNONPAUSE_S = round($USERtotNONPAUSE_S, 0);
if ($USERtotNONPAUSE_S < 10) {$USERtotNONPAUSE_S = "0$USERtotNONPAUSE_S";}
$USERtotNONPAUSE_MS = "$USERtotNONPAUSE_M_int:$USERtotNONPAUSE_S";
$pfUSERtotNONPAUSE_MS = sprintf("%6s", $USERtotNONPAUSE_MS);
$USERtotTOTAL_M = ($Stotal_sec / 60);
$USERtotTOTAL_M_int = round($USERtotTOTAL_M, 2);
$USERtotTOTAL_M_int = intval("$USERtotTOTAL_M_int");
$USERtotTOTAL_S = ($USERtotTOTAL_M - $USERtotTOTAL_M_int);
$USERtotTOTAL_S = ($USERtotTOTAL_S * 60);
$USERtotTOTAL_S = round($USERtotTOTAL_S, 0);
if ($USERtotTOTAL_S < 10) {$USERtotTOTAL_S = "0$USERtotTOTAL_S";}
$USERtotTOTAL_MS = "$USERtotTOTAL_M_int:$USERtotTOTAL_S";
$pfUSERtotTOTAL_MS = sprintf("%6s", $USERtotTOTAL_MS);
$pfUSERtotPAUSE_MS = sprintf("%8s", $USERtotPAUSE_MS);
$pfUSERtotNONPAUSE_MS = sprintf("%8s", $USERtotNONPAUSE_MS);
$pfUSERtotTOTAL_MS = sprintf("%8s", $USERtotTOTAL_MS);
$BOTTOMoutput = "| $Sfull_name | $Suser | $pfUSERtotTOTAL_MS | $pfUSERtotNONPAUSE_MS | $pfUSERtotPAUSE_MS | |$SstatusesHTML\n";
$BOTTOMsorted_output[$m] = $BOTTOMoutput;
# if (!ereg("ID|TIME|CALLS",$stage))
# {
echo "$BOTTOMoutput";
# }
echo "$BOTTOMoutput";
$m++;
}
@@ -874,15 +704,8 @@ while ($n < $j)
{
$TOTtotPAUSE = ($TOTtotPAUSE + $Scalls);
$USERsumstatPAUSE_M = ($Scalls / 60);
$USERsumstatPAUSE_M_int = round($USERsumstatPAUSE_M, 2);
$USERsumstatPAUSE_M_int = intval("$USERsumstatPAUSE_M_int");
$USERsumstatPAUSE_S = ($USERsumstatPAUSE_M - $USERsumstatPAUSE_M_int);
$USERsumstatPAUSE_S = ($USERsumstatPAUSE_S * 60);
$USERsumstatPAUSE_S = round($USERsumstatPAUSE_S, 0);
if ($USERsumstatPAUSE_S < 10) {$USERsumstatPAUSE_S = "0$USERsumstatPAUSE_S";}
$USERsumstatPAUSE_MS = "$USERsumstatPAUSE_M_int:$USERsumstatPAUSE_S";
$pfUSERsumstatPAUSE_MS = sprintf("%6s", $USERsumstatPAUSE_MS);
$USERsumstatPAUSE_MS = sec_convert($Scalls,'H');
$pfUSERsumstatPAUSE_MS = sprintf("%8s", $USERsumstatPAUSE_MS);
$SUMstatusTXT = sprintf("%8s", $pfUSERsumstatPAUSE_MS);
$SUMstatusesHTML .= " $SUMstatusTXT |";
@@ -893,44 +716,22 @@ while ($n < $j)
$TOT_AGENTS = sprintf("%-4s", $m);
$TOTtotPAUSE_M = ($TOTtotPAUSE / 60);
$TOTtotPAUSE_M_int = round($TOTtotPAUSE_M, 2);
$TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M_int");
$TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int);
$TOTtotPAUSE_S = ($TOTtotPAUSE_S * 60);
$TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0);
if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";}
$TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S";
$TOTtotPAUSE_MS = sprintf("%8s", $TOTtotPAUSE_MS);
while(strlen($TOTtotPAUSE_MS)>8) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
$TOTtotPAUSE_MS = sec_convert($TOTtotPAUSE,'H');
$TOTtotNONPAUSE_MS = sec_convert($TOTtotNONPAUSE,'H');
$TOTtotTOTAL_MS = sec_convert($TOTtotTOTAL,'H');
$TOTtotNONPAUSE_M = ($TOTtotNONPAUSE / 60);
$TOTtotNONPAUSE_M_int = round($TOTtotNONPAUSE_M, 2);
$TOTtotNONPAUSE_M_int = intval("$TOTtotNONPAUSE_M_int");
$TOTtotNONPAUSE_S = ($TOTtotNONPAUSE_M - $TOTtotNONPAUSE_M_int);
$TOTtotNONPAUSE_S = ($TOTtotNONPAUSE_S * 60);
$TOTtotNONPAUSE_S = round($TOTtotNONPAUSE_S, 0);
if ($TOTtotNONPAUSE_S < 10) {$TOTtotNONPAUSE_S = "0$TOTtotNONPAUSE_S";}
$TOTtotNONPAUSE_MS = "$TOTtotNONPAUSE_M_int:$TOTtotNONPAUSE_S";
$TOTtotNONPAUSE_MS = sprintf("%8s", $TOTtotNONPAUSE_MS);
while(strlen($TOTtotNONPAUSE_MS)>8) {$TOTtotNONPAUSE_MS = substr("$TOTtotNONPAUSE_MS", 0, -1);}
$TOTtotPAUSE_MS = sprintf("%10s", $TOTtotPAUSE_MS);
$TOTtotNONPAUSE_MS = sprintf("%10s", $TOTtotNONPAUSE_MS);
$TOTtotTOTAL_MS = sprintf("%10s", $TOTtotTOTAL_MS);
$TOTtotTOTAL_M = ($TOTtotTOTAL / 60);
$TOTtotTOTAL_M_int = round($TOTtotTOTAL_M, 2);
$TOTtotTOTAL_M_int = intval("$TOTtotTOTAL_M_int");
$TOTtotTOTAL_S = ($TOTtotTOTAL_M - $TOTtotTOTAL_M_int);
$TOTtotTOTAL_S = ($TOTtotTOTAL_S * 60);
$TOTtotTOTAL_S = round($TOTtotTOTAL_S, 0);
if ($TOTtotTOTAL_S < 10) {$TOTtotTOTAL_S = "0$TOTtotTOTAL_S";}
$TOTtotTOTAL_MS = "$TOTtotTOTAL_M_int:$TOTtotTOTAL_S";
$TOTtotTOTAL_MS = sprintf("%8s", $TOTtotTOTAL_MS);
while(strlen($TOTtotTOTAL_MS)>8) {$TOTtotTOTAL_MS = substr("$TOTtotTOTAL_MS", 0, -1);}
while(strlen($TOTtotPAUSE_MS)>10) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
while(strlen($TOTtotNONPAUSE_MS)>10) {$TOTtotNONPAUSE_MS = substr("$TOTtotNONPAUSE_MS", 0, -1);}
while(strlen($TOTtotTOTAL_MS)>10) {$TOTtotTOTAL_MS = substr("$TOTtotTOTAL_MS", 0, -1);}
echo "+-----------------+----------+--------+--------+--------+ +$sub_statusesHEAD\n";
echo "+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n";
echo "| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n";
echo "+----------------------------+--------+--------+--------+ +$sub_statusesHEAD\n";
echo "+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n";
echo "\n\n";
@@ -941,4 +742,4 @@ echo "\n\n";
</TD></TR></TABLE>
</BODY></HTML>
</BODY></HTML>
+854
View File
@@ -0,0 +1,854 @@
<?php
# AST_agent_time_detail.php
#
# Pulls time stats per agent selectable by campaign or user group
# should be most accurate agent stats of all of the reports
#
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 90522-0723 - First build
#
require("dbconnect.php");
require("functions.php");
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
$PHP_SELF=$_SERVER['PHP_SELF'];
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
if (isset($_GET["group"])) {$group=$_GET["group"];}
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];}
elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];}
if (isset($_GET["shift"])) {$shift=$_GET["shift"];}
elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];}
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
if (strlen($shift)<2) {$shift='ALL';}
if (strlen($stage)<2) {$stage='NAME';}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
$i=0;
while ($i < $qm_conf_ct)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$i++;
}
##### END SETTINGS LOOKUP #####
###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";}
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
{
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
Header("HTTP/1.0 401 Unauthorized");
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
exit;
}
$MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = '';}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
$stmt="select campaign_id from vicidial_campaigns;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$campaigns_to_print = mysql_num_rows($rslt);
$i=0;
while ($i < $campaigns_to_print)
{
$row=mysql_fetch_row($rslt);
$groups[$i] =$row[0];
$i++;
}
$stmt="select user_group from vicidial_user_groups;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$user_groups_to_print = mysql_num_rows($rslt);
$i=0;
while ($i < $user_groups_to_print)
{
$row=mysql_fetch_row($rslt);
$user_groups[$i] =$row[0];
$i++;
}
$i=0;
$group_string='|';
$group_ct = count($group);
while($i < $group_ct)
{
$group_string .= "$group[$i]|";
$group_SQL .= "'$group[$i]',";
$groupQS .= "&group[]=$group[$i]";
$i++;
}
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) )
{$group_SQL = "";}
else
{
$group_SQL = eregi_replace(",$",'',$group_SQL);
$group_SQL = "and campaign_id IN($group_SQL)";
}
$i=0;
$user_group_string='|';
$user_group_ct = count($user_group);
while($i < $user_group_ct)
{
$user_group_string .= "$user_group[$i]|";
$user_group_SQL .= "'$user_group[$i]',";
$user_groupQS .= "&user_group[]=$user_group[$i]";
$i++;
}
if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) )
{$user_group_SQL = "";}
else
{
$user_group_SQL = eregi_replace(",$",'',$user_group_SQL);
$user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)";
$TCuser_group_SQL = eregi_replace(",$",'',$TCuser_group_SQL);
$TCuser_group_SQL = "and user_group IN($TCuser_group_SQL)";
}
if ($DB) {echo "$user_group_string|$user_group_ct|$user_groupQS|$i<BR>";}
$stmt="select distinct pause_code,pause_code_name from vicidial_pause_codes;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$statha_to_print = mysql_num_rows($rslt);
$i=0;
while ($i < $statha_to_print)
{
$row=mysql_fetch_row($rslt);
$pause_code[$i] = "$row[0]";
$pause_code_name[$i] = "$row[1]";
$i++;
}
$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date$groupQS$user_groupQS&shift=$shift&DB=$DB";
if ($file_download < 1)
{
?>
<HTML>
<HEAD>
<STYLE type="text/css">
<!--
.yellow {color: white; background-color: yellow}
.red {color: white; background-color: red}
.blue {color: white; background-color: blue}
.purple {color: white; background-color: purple}
-->
</STYLE>
<?php
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo "<TITLE>VICIDIAL: Agent Time Detail</TITLE></HEAD><BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
echo "<span style=\"position:absolute;left:0px;top:0px;z-index:20;\" id=admin_header>";
$short_header=1;
require("admin_header.php");
echo "</span>\n";
echo "<span style=\"position:absolute;left:3px;top:3px;z-index:19;\" id=agent_status_stats>\n";
echo "<PRE><FONT SIZE=2>\n";
}
if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
{
echo "\n";
echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
echo " NOTE: stats taken from shift specified\n";
}
else
{
if ($shift == 'TEST')
{
$time_BEGIN = "09:45:00";
$time_END = "10:00:00";
}
if ($shift == 'AM')
{
$time_BEGIN=$AM_shift_BEGIN;
$time_END=$AM_shift_END;
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}
if (strlen($time_END) < 6) {$time_END = "15:15:00";}
}
if ($shift == 'PM')
{
$time_BEGIN=$PM_shift_BEGIN;
$time_END=$PM_shift_END;
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
if (strlen($time_END) < 6) {$time_END = "23:15:00";}
}
if ($shift == 'ALL')
{
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
if (strlen($time_END) < 6) {$time_END = "23:59:59";}
}
$query_date_BEGIN = "$query_date $time_BEGIN";
$query_date_END = "$end_date $time_END";
if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
else {$ugSQL='';}
if ($file_download < 1)
{
echo "VICIDIAL: Agent Time Detail $NOW_TIME\n";
echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
}
else
{
$file_output .= "VICIDIAL: Agent Time Detail $NOW_TIME\n";
$file_output .= "Time range: $query_date_BEGIN to $query_date_END\n\n";
}
############################################################################
##### BEGIN gathering information from the database section
############################################################################
### BEGIN gather user IDs and names for matching up later
$stmt="select full_name,user from vicidial_users order by user limit 100000;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$users_to_print = mysql_num_rows($rslt);
$i=0;
while ($i < $users_to_print)
{
$row=mysql_fetch_row($rslt);
$ULname[$i] = $row[0];
$ULuser[$i] = $row[1];
$i++;
}
### END gather user IDs and names for matching up later
### BEGIN gather timeclock records per agent
$stmt="select user,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$punches_to_print = mysql_num_rows($rslt);
$i=0;
while ($i < $punches_to_print)
{
$row=mysql_fetch_row($rslt);
$TCuser[$i] = $row[0];
$TCtime[$i] = $row[1];
$i++;
}
### END gather timeclock records per agent
### BEGIN gather pause code information by user IDs
$sub_statuses='-';
$sub_statusesTXT='';
$sub_statusesHEAD='';
$sub_statusesHTML='';
$sub_statusesFILE='';
$sub_statusesARY=$MT;
$sub_status_count=0;
$PCusers='-';
$PCusersARY=$MT;
$PCuser_namesARY=$MT;
$user_count=0;
$stmt="select user,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 30000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$subs_to_print = mysql_num_rows($rslt);
$i=0;
while ($i < $subs_to_print)
{
$row=mysql_fetch_row($rslt);
$PCuser[$i] = $row[0];
$PCpause_sec[$i] = $row[1];
$sub_status[$i] = $row[2];
if (!eregi("-$sub_status[$i]-", $sub_statuses))
{
$sub_statusesTXT = sprintf("%10s", $sub_status[$i]);
$sub_statusesHEAD .= "------------+";
$sub_statusesHTML .= " $sub_statusesTXT |";
$sub_statusesFILE .= ",$sub_status[$i]";
$sub_statuses .= "$sub_status[$i]-";
$sub_statusesARY[$sub_status_count] = $sub_status[$i];
$sub_status_count++;
}
if (!eregi("-$PCuser[$i]-", $PCusers))
{
$PCusers .= "$PCuser[$i]-";
$PCusersARY[$user_count] = $PCuser[$i];
$user_count++;
}
$i++;
}
### END gather pause code information by user IDs
##### BEGIN Gather all agent time records and parse through them in PHP to save on DB load
$stmt="select user,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$rows_to_print = mysql_num_rows($rslt);
$i=0;
$j=0;
$k=0;
$uc=0;
while ($i < $rows_to_print)
{
$row=mysql_fetch_row($rslt);
$user = $row[0];
$wait = $row[1];
$talk = $row[2];
$dispo = $row[3];
$pause = $row[4];
$lead = $row[5];
if ($wait > 30000) {$wait=0;}
if ($talk > 30000) {$talk=0;}
if ($dispo > 30000) {$dispo=0;}
if ($pause > 30000) {$pause=0;}
$TOTwait = ($TOTwait + $wait);
$TOTtalk = ($TOTtalk + $talk);
$TOTdispo = ($TOTdispo + $dispo);
$TOTpause = ($TOTpause + $pause);
$TOTALtime = ($TOTALtime + $pause + $dispo + $talk + $wait);
if ($lead > 0) {$TOTcalls++;}
$user_found=0;
if ($uc < 1)
{
$Suser[$uc] = $user;
$uc++;
}
$m=0;
while ( ($m < $uc) and ($m < 50000) )
{
if ($user == "$Suser[$m]")
{
$user_found++;
$Swait[$m] = ($Swait[$m] + $wait);
$Stalk[$m] = ($Stalk[$m] + $talk);
$Sdispo[$m] = ($Sdispo[$m] + $dispo);
$Spause[$m] = ($Spause[$m] + $pause);
if ($lead > 0) {$Scalls[$m]++;}
}
$m++;
}
if ($user_found < 1)
{
$Scalls[$uc] = 0;
$Suser[$uc] = $user;
$Swait[$uc] = $wait;
$Stalk[$uc] = $talk;
$Sdispo[$uc] = $dispo;
$Spause[$uc] = $pause;
if ($lead > 0) {$Scalls[$uc]++;}
$uc++;
}
$i++;
}
if ($DB) {echo "Done gathering $i records, analyzing...<BR>\n";}
##### END Gather all agent time records and parse through them in PHP to save on DB load
############################################################################
##### END gathering information from the database section
############################################################################
##### BEGIN print the output to screen or put into file output variable
if ($file_download < 1)
{
echo "AGENT TIME BREAKDOWN:\n";
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
echo "| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=CALLS\">CALLS</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | <a href=\"$LINKbase&stage=TIME\">AGENT TIME</a> | WAIT | TALK | DISPO | PAUSE | |$sub_statusesHTML\n";
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
}
else
{
$file_output .= "USER,ID,CALLS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE$sub_statusesFILE\n";
}
##### END print the output to screen or put into file output variable
############################################################################
##### BEGIN formatting data for output section
############################################################################
##### BEGIN loop through each user formatting data for output
$AUTOLOGOUTflag=0;
$m=0;
while ( ($m < $uc) and ($m < 50000) )
{
$SstatusesHTML='';
$SstatusesFILE='';
$Stime[$m] = ($Swait[$m] + $Stalk[$m] + $Sdispo[$m] + $Spause[$m]);
$RAWuser = $Suser[$m];
$RAWcalls = $Scalls[$m];
$RAWtimeSEC = $Stime[$m];
$Swait[$m]= sec_convert($Swait[$m],'H');
$Stalk[$m]= sec_convert($Stalk[$m],'H');
$Sdispo[$m]= sec_convert($Sdispo[$m],'H');
$Spause[$m]= sec_convert($Spause[$m],'H');
$Stime[$m]= sec_convert($Stime[$m],'H');
$RAWtime = $Stime[$m];
$RAWwait = $Swait[$m];
$RAWtalk = $Stalk[$m];
$RAWdispo = $Sdispo[$m];
$RAWpause = $Spause[$m];
$n=0;
$user_name_found=0;
while ($n < $users_to_print)
{
if ($Suser[$m] == "$ULuser[$n]")
{
$user_name_found++;
$RAWname = $ULname[$n];
$Sname[$m] = $ULname[$n];
}
$n++;
}
if ($user_name_found < 1)
{
$RAWname = "NOT IN SYSTEM";
$Sname[$m] = $RAWname;
}
$n=0;
$punches_found=0;
while ($n < $punches_to_print)
{
if ($Suser[$m] == "$TCuser[$n]")
{
$punches_found++;
$RAWtimeTCsec = $TCtime[$n];
$TOTtimeTC = ($TOTtimeTC + $TCtime[$n]);
$StimeTC[$m]= sec_convert($TCtime[$n],'H');
$RAWtimeTC = $StimeTC[$m];
$StimeTC[$m] = sprintf("%10s", $StimeTC[$m]);
}
$n++;
}
if ($punches_found < 1)
{
$RAWtimeTCsec = "0";
$StimeTC[$m]= "0:00";
$RAWtimeTC = $StimeTC[$m];
$StimeTC[$m] = sprintf("%10s", $StimeTC[$m]);
}
### Check if the user had an AUTOLOGOUT timeclock event during the time period
$TCuserAUTOLOGOUT = ' ';
$stmt="select count(*) from vicidial_timeclock_log where event='AUTOLOGOUT' and user='$Suser[$m]' and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$autologout_results = mysql_num_rows($rslt);
if ($autologout_results > 0)
{
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
$TCuserAUTOLOGOUT = '*';
$AUTOLOGOUTflag++;
}
}
### BEGIN loop through each status ###
$n=0;
while ($n < $sub_status_count)
{
$Sstatus=$sub_statusesARY[$n];
$SstatusTXT='';
### BEGIN loop through each stat line ###
$i=0; $status_found=0;
while ( ($i < $subs_to_print) and ($status_found < 1) )
{
if ( ($Suser[$m]=="$PCuser[$i]") and ($Sstatus=="$sub_status[$i]") )
{
$USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],'H');
$pfUSERcodePAUSE_MS = sprintf("%10s", $USERcodePAUSE_MS);
$SstatusTXT = sprintf("%10s", $pfUSERcodePAUSE_MS);
$SstatusesHTML .= " $SstatusTXT |";
$SstatusesFILE .= ",$pfUSERcodePAUSE_MS";
$status_found++;
}
$i++;
}
if ($status_found < 1)
{
$SstatusesHTML .= " 0:00 |";
}
### END loop through each stat line ###
$n++;
}
### END loop through each status ###
$Swait[$m]= sprintf("%10s", $Swait[$m]);
$Stalk[$m]= sprintf("%10s", $Stalk[$m]);
$Sdispo[$m]= sprintf("%10s", $Sdispo[$m]);
$Spause[$m]= sprintf("%10s", $Spause[$m]);
$Scalls[$m]= sprintf("%8s", $Scalls[$m]);
$Stime[$m]= sprintf("%10s", $Stime[$m]);
if ($non_latin < 1)
{
$Sname[$m]= sprintf("%-15s", $Sname[$m]);
while(strlen($Sname[$m])>15) {$Sname[$m] = substr("$Sname[$m]", 0, -1);}
$Suser[$m] = sprintf("%-8s", $Suser[$m]);
while(strlen($Suser[$m])>8) {$Suser[$m] = substr("$Suser[$m]", 0, -1);}
}
else
{
$Sname[$m]= sprintf("%-45s", $Sname[$m]);
while(mb_strlen($Sname[$m],'utf-8')>15) {$Sname[$m] = mb_substr("$Sname[$m]", 0, -1,'utf-8');}
$Suser[$m] = sprintf("%-24s", $Suser[$m]);
while(mb_strlen($Suser[$m],'utf-8')>8) {$Suser[$m] = mb_substr("$Suser[$m]", 0, -1,'utf-8');}
}
if ($file_download < 1)
{
$Toutput = "| $Sname[$m] | <a href=\"./user_stats.php?user=$RAWuser\">$Suser[$m]</a> | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] | $Swait[$m] | $Stalk[$m] | $Sdispo[$m] | $Spause[$m] | |$SstatusesHTML\n";
}
else
{
$fileToutput = "$RAWname,$RAWuser,$RAWcalls,$RAWtimeTC,$RAWtime,$RAWwait,$RAWtalk,$RAWdispo,$RAWpause$SstatusesFILE\n";
}
$TOPsorted_output[$m] = $Toutput;
$TOPsorted_outputFILE[$m] = $fileToutput;
if ($stage == 'NAME')
{
$TOPsort[$m] = '' . sprintf("%020s", $RAWname) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
$TOPsortTALLY[$m]=$RAWcalls;
}
if ($stage == 'ID')
{
$TOPsort[$m] = '' . sprintf("%08s", $RAWuser) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
$TOPsortTALLY[$m]=$RAWcalls;
}
if ($stage == 'CALLS')
{
$TOPsort[$m] = '' . sprintf("%08s", $RAWcalls) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
$TOPsortTALLY[$m]=$RAWcalls;
}
if ($stage == 'TIME')
{
$TOPsort[$m] = '' . sprintf("%010s", $RAWtimeSEC) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
$TOPsortTALLY[$m]=$RAWtimeSEC;
}
if ($stage == 'TCLOCK')
{
$TOPsort[$m] = '' . sprintf("%010s", $RAWtimeTCsec) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
$TOPsortTALLY[$m]=$RAWtimeTCsec;
}
if (!ereg("NAME|ID|TIME|CALLS|TCLOCK",$stage))
if ($file_download < 1)
{echo "$Toutput";}
else
{$file_output .= "$fileToutput";}
if ($TOPsortMAX < $TOPsortTALLY[$m]) {$TOPsortMAX = $TOPsortTALLY[$m];}
# echo "$Suser[$m]|$Sname[$m]|$Swait[$m]|$Stalk[$m]|$Sdispo[$m]|$Spause[$m]|$Scalls[$m]\n";
$m++;
}
##### END loop through each user formatting data for output
$TOT_AGENTS = sprintf("%4s", $m);
$k=$m;
if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|<BR>\n";}
### BEGIN sort through output to display properly ###
if (ereg("NAME|ID|TIME|CALLS|TCLOCK",$stage))
{
if (ereg("ID",$stage))
{sort($TOPsort, SORT_NUMERIC);}
if (ereg("NAME|TIME|CALLS|TCLOCK",$stage))
{rsort($TOPsort, SORT_NUMERIC);}
$m=0;
while ($m < $k)
{
$sort_split = explode("-----",$TOPsort[$m]);
$i = $sort_split[1];
$sort_order[$m] = "$i";
if ($file_download < 1)
{echo "$TOPsorted_output[$i]";}
else
{$file_output .= "$TOPsorted_outputFILE[$i]";}
$m++;
}
}
### END sort through output to display properly ###
############################################################################
##### END formatting data for output section
############################################################################
############################################################################
##### BEGIN last line totals output section
############################################################################
$SUMstatusesHTML='';
$SUMstatusesFILE='';
$TOTtotPAUSE=0;
$n=0;
while ($n < $sub_status_count)
{
$Scalls=0;
$Sstatus=$sub_statusesARY[$n];
$SUMstatusTXT='';
### BEGIN loop through each stat line ###
$i=0; $status_found=0;
while ($i < $subs_to_print)
{
if ($Sstatus=="$sub_status[$i]")
{
$Scalls = ($Scalls + $PCpause_sec[$i]);
$status_found++;
}
$i++;
}
### END loop through each stat line ###
if ($status_found < 1)
{
$SUMstatusesHTML .= " 0 |";
}
else
{
$TOTtotPAUSE = ($TOTtotPAUSE + $Scalls);
$USERsumstatPAUSE_MS = sec_convert($Scalls,'H');
$pfUSERsumstatPAUSE_MS = sprintf("%11s", $USERsumstatPAUSE_MS);
$SUMstatusTXT = sprintf("%10s", $pfUSERsumstatPAUSE_MS);
$SUMstatusesHTML .= "$SUMstatusTXT |";
$SUMstatusesFILE .= ",$pfUSERsumstatPAUSE_MS";
}
$n++;
}
### END loop through each status ###
### call function to calculate and print dialable leads
$TOTwait = sec_convert($TOTwait,'H');
$TOTtalk = sec_convert($TOTtalk,'H');
$TOTdispo = sec_convert($TOTdispo,'H');
$TOTpause = sec_convert($TOTpause,'H');
$TOTALtime = sec_convert($TOTALtime,'H');
$TOTtimeTC = sec_convert($TOTtimeTC,'H');
$TOTcalls = sprintf("%8s", $TOTcalls);
$TOTwait = sprintf("%11s", $TOTwait);
$TOTtalk = sprintf("%11s", $TOTtalk);
$TOTdispo = sprintf("%11s", $TOTdispo);
$TOTpause = sprintf("%11s", $TOTpause);
$TOTALtime = sprintf("%11s", $TOTALtime);
$TOTtimeTC = sprintf("%11s", $TOTtimeTC);
###### END LAST LINE TOTALS FORMATTING ##########
if ($file_download < 1)
{
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls |$TOTtimeTC |$TOTALtime |$TOTwait |$TOTtalk |$TOTdispo |$TOTpause | |$SUMstatusesHTML\n";
echo "+----------------------------+----------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
if ($AUTOLOGOUTflag > 0)
{echo " * denotes AUTOLOGOUT from timeclock\n";}
echo "\n\n</PRE>";
}
else
{
$file_output .= "TOTALS,$TOT_AGENTS,$TOTcalls,$TOTtimeTC,$TOTALtime,$TOTwait,$TOTtalk,$TOTdispo,$TOTpause$SUMstatusesFILE\n";
}
}
############################################################################
##### END formatting data for output section
############################################################################
if ($file_download > 0)
{
$FILE_TIME = date("Ymd-His");
$CSVfilename = "AGENT_TIME$US$FILE_TIME.csv";
// We'll be outputting a TXT file
header('Content-type: application/octet-stream');
// It will be called LIST_101_20090209-121212.txt
header("Content-Disposition: attachment; filename=\"$CSVfilename\"");
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
ob_clean();
flush();
echo "$file_output";
exit;
}
############################################################################
##### BEGIN HTML form section
############################################################################
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
echo "<TABLE CELLSPACING=3><TR><TD VALIGN=TOP> Dates:<BR>";
echo "<INPUT TYPE=hidden NAME=DB VALUE=\"$DB\">\n";
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">\n";
echo "<BR> to <BR><INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n";
echo "</TD><TD VALIGN=TOP> Campaigns:<BR>";
echo "<SELECT SIZE=5 NAME=group[] multiple>\n";
if (eregi("--ALL--",$group_string))
{echo "<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";}
else
{echo "<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";}
$o=0;
while ($campaigns_to_print > $o)
{
if (eregi("$groups[$o]\|",$group_string)) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
$o++;
}
echo "</SELECT>\n";
echo "</TD><TD VALIGN=TOP>User Groups:<BR>";
echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n";
if (eregi("--ALL--",$user_group_string))
{echo "<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";}
else
{echo "<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";}
$o=0;
while ($user_groups_to_print > $o)
{
if (eregi("$user_groups[$o]\|",$user_group_string)) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
else {echo "<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
$o++;
}
echo "</SELECT>\n";
echo "</TD><TD VALIGN=TOP>Shift:<BR>";
echo "<SELECT SIZE=1 NAME=shift>\n";
echo "<option selected value=\"$shift\">$shift</option>\n";
echo "<option value=\"\">--</option>\n";
echo "<option value=\"AM\">AM</option>\n";
echo "<option value=\"PM\">PM</option>\n";
echo "<option value=\"ALL\">ALL</option>\n";
echo "</SELECT><BR><BR>\n";
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
echo "</TD><TD VALIGN=TOP> &nbsp; &nbsp; &nbsp; &nbsp; ";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n";
echo " <a href=\"$LINKbase&stage=$stage&file_download=1\">DOWNLOAD</a> | \n";
echo " <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
echo "</FONT>\n";
echo "</TD></TR></TABLE>";
echo "</FORM>\n\n";
############################################################################
##### END HTML form section
############################################################################
$ENDtime = date("U");
$RUNtime = ($ENDtime - $STARTtime);
echo "<font size=1 color=white>$RUNtime</font>\n";
##### BEGIN horizontal yellow transparent bar graph overlay on top of agent stats
echo "</span>\n";
echo "<span style=\"position:absolute;left:3px;top:3px;z-index:18;\" id=agent_status_bars>\n";
echo "<PRE><FONT SIZE=2>\n\n\n\n\n\n\n\n\n\n";
if ($stage == 'NAME') {$k=0;}
$m=0;
while ($m < $k)
{
$sort_split = explode("-----",$TOPsort[$m]);
$i = $sort_split[1];
$sort_order[$m] = "$i";
if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
{echo " \n";}
else
{
echo " <SPAN class=\"yellow\">";
$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
$h=0;
while ($h <= $TOPsortPLOT)
{
echo " ";
$h++;
}
echo "</SPAN>\n";
}
$m++;
}
echo "</span>\n";
##### END horizontal yellow transparent bar graph overlay on top of agent stats
?>
</BODY></HTML>
+52 -151
View File
@@ -10,9 +10,27 @@
# 80624-0132 - Added vicidial_timeclock entries
# 90310-0745 - Added admin header
# 90508-0644 - Changed to PHP long tags
# 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion
#
require("dbconnect.php");
require("functions.php");
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$ss_conf_ct = mysql_num_rows($rslt);
if ($ss_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$SSoutbound_autodial_active = $row[1];
$user_territories_active = $row[2];
}
##### END SETTINGS LOOKUP #####
###########################################
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
@@ -33,11 +51,12 @@ $user=$agent;
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";}
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
{
@@ -137,120 +156,25 @@ if ($calls_summary)
$TOTAL_TIME = ($row[1] + $row[3] + $row[5] + $row[7]);
$TOTAL_TIME_H = ($TOTAL_TIME / 3600);
$TOTAL_TIME_H = round($TOTAL_TIME_H, 2);
$TOTAL_TIME_H_int = intval("$TOTAL_TIME_H");
$TOTAL_TIME_M = ($TOTAL_TIME_H - $TOTAL_TIME_H_int);
$TOTAL_TIME_M = ($TOTAL_TIME_M * 60);
$TOTAL_TIME_M = round($TOTAL_TIME_M, 2);
$TOTAL_TIME_M_int = intval("$TOTAL_TIME_M");
$TOTAL_TIME_S = ($TOTAL_TIME_M - $TOTAL_TIME_M_int);
$TOTAL_TIME_S = ($TOTAL_TIME_S * 60);
$TOTAL_TIME_S = round($TOTAL_TIME_S, 0);
if ($TOTAL_TIME_S < 10) {$TOTAL_TIME_S = "0$TOTAL_TIME_S";}
if ($TOTAL_TIME_M_int < 10) {$TOTAL_TIME_M_int = "0$TOTAL_TIME_M_int";}
$TOTAL_TIME_HMS = "$TOTAL_TIME_H_int:$TOTAL_TIME_M_int:$TOTAL_TIME_S";
$pfTOTAL_TIME_HMS = sprintf("%8s", $TOTAL_TIME_HMS);
$TOTAL_TIME_HMS = sec_convert($TOTAL_TIME,'H');
$TALK_TIME_HMS = sec_convert($row[1],'H');
$PAUSE_TIME_HMS = sec_convert($row[3],'H');
$WAIT_TIME_HMS = sec_convert($row[5],'H');
$WRAPUP_TIME_HMS = sec_convert($row[7],'H');
$TALK_AVG_MS = sec_convert($row[2],'H');
$PAUSE_AVG_MS = sec_convert($row[4],'H');
$WAIT_AVG_MS = sec_convert($row[6],'H');
$WRAPUP_AVG_MS = sec_convert($row[8],'H');
$TALK_TIME_H = ($row[1] / 3600);
$TALK_TIME_H = round($TALK_TIME_H, 2);
$TALK_TIME_H_int = intval("$TALK_TIME_H");
$TALK_TIME_M = ($TALK_TIME_H - $TALK_TIME_H_int);
$TALK_TIME_M = ($TALK_TIME_M * 60);
$TALK_TIME_M = round($TALK_TIME_M, 2);
$TALK_TIME_M_int = intval("$TALK_TIME_M");
$TALK_TIME_S = ($TALK_TIME_M - $TALK_TIME_M_int);
$TALK_TIME_S = ($TALK_TIME_S * 60);
$TALK_TIME_S = round($TALK_TIME_S, 0);
if ($TALK_TIME_S < 10) {$TALK_TIME_S = "0$TALK_TIME_S";}
if ($TALK_TIME_M_int < 10) {$TALK_TIME_M_int = "0$TALK_TIME_M_int";}
$TALK_TIME_HMS = "$TALK_TIME_H_int:$TALK_TIME_M_int:$TALK_TIME_S";
$pfTALK_TIME_HMS = sprintf("%8s", $TALK_TIME_HMS);
$PAUSE_TIME_H = ($row[3] / 3600);
$PAUSE_TIME_H = round($PAUSE_TIME_H, 2);
$PAUSE_TIME_H_int = intval("$PAUSE_TIME_H");
$PAUSE_TIME_M = ($PAUSE_TIME_H - $PAUSE_TIME_H_int);
$PAUSE_TIME_M = ($PAUSE_TIME_M * 60);
$PAUSE_TIME_M = round($PAUSE_TIME_M, 2);
$PAUSE_TIME_M_int = intval("$PAUSE_TIME_M");
$PAUSE_TIME_S = ($PAUSE_TIME_M - $PAUSE_TIME_M_int);
$PAUSE_TIME_S = ($PAUSE_TIME_S * 60);
$PAUSE_TIME_S = round($PAUSE_TIME_S, 0);
if ($PAUSE_TIME_S < 10) {$PAUSE_TIME_S = "0$PAUSE_TIME_S";}
if ($PAUSE_TIME_M_int < 10) {$PAUSE_TIME_M_int = "0$PAUSE_TIME_M_int";}
$PAUSE_TIME_HMS = "$PAUSE_TIME_H_int:$PAUSE_TIME_M_int:$PAUSE_TIME_S";
$pfPAUSE_TIME_HMS = sprintf("%8s", $PAUSE_TIME_HMS);
$WAIT_TIME_H = ($row[5] / 3600);
$WAIT_TIME_H = round($WAIT_TIME_H, 2);
$WAIT_TIME_H_int = intval("$WAIT_TIME_H");
$WAIT_TIME_M = ($WAIT_TIME_H - $WAIT_TIME_H_int);
$WAIT_TIME_M = ($WAIT_TIME_M * 60);
$WAIT_TIME_M = round($WAIT_TIME_M, 2);
$WAIT_TIME_M_int = intval("$WAIT_TIME_M");
$WAIT_TIME_S = ($WAIT_TIME_M - $WAIT_TIME_M_int);
$WAIT_TIME_S = ($WAIT_TIME_S * 60);
$WAIT_TIME_S = round($WAIT_TIME_S, 0);
if ($WAIT_TIME_S < 10) {$WAIT_TIME_S = "0$WAIT_TIME_S";}
if ($WAIT_TIME_M_int < 10) {$WAIT_TIME_M_int = "0$WAIT_TIME_M_int";}
$WAIT_TIME_HMS = "$WAIT_TIME_H_int:$WAIT_TIME_M_int:$WAIT_TIME_S";
$pfWAIT_TIME_HMS = sprintf("%8s", $WAIT_TIME_HMS);
$WRAPUP_TIME_H = ($row[7] / 3600);
$WRAPUP_TIME_H = round($WRAPUP_TIME_H, 2);
$WRAPUP_TIME_H_int = intval("$WRAPUP_TIME_H");
$WRAPUP_TIME_M = ($WRAPUP_TIME_H - $WRAPUP_TIME_H_int);
$WRAPUP_TIME_M = ($WRAPUP_TIME_M * 60);
$WRAPUP_TIME_M = round($WRAPUP_TIME_M, 2);
$WRAPUP_TIME_M_int = intval("$WRAPUP_TIME_M");
$WRAPUP_TIME_S = ($WRAPUP_TIME_M - $WRAPUP_TIME_M_int);
$WRAPUP_TIME_S = ($WRAPUP_TIME_S * 60);
$WRAPUP_TIME_S = round($WRAPUP_TIME_S, 0);
if ($WRAPUP_TIME_S < 10) {$WRAPUP_TIME_S = "0$WRAPUP_TIME_S";}
if ($WRAPUP_TIME_M_int < 10) {$WRAPUP_TIME_M_int = "0$WRAPUP_TIME_M_int";}
$WRAPUP_TIME_HMS = "$WRAPUP_TIME_H_int:$WRAPUP_TIME_M_int:$WRAPUP_TIME_S";
$pfWRAPUP_TIME_HMS = sprintf("%8s", $WRAPUP_TIME_HMS);
$TALK_AVG_M = ($row[2] / 60);
$TALK_AVG_M = round($TALK_AVG_M, 2);
$TALK_AVG_M_int = intval("$TALK_AVG_M");
$TALK_AVG_S = ($TALK_AVG_M - $TALK_AVG_M_int);
$TALK_AVG_S = ($TALK_AVG_S * 60);
$TALK_AVG_S = round($TALK_AVG_S, 0);
if ($TALK_AVG_S < 10) {$TALK_AVG_S = "0$TALK_AVG_S";}
$TALK_AVG_MS = "$TALK_AVG_M_int:$TALK_AVG_S";
$pfTALK_AVG_MS = sprintf("%6s", $TALK_AVG_MS);
$PAUSE_AVG_M = ($row[4] / 60);
$PAUSE_AVG_M = round($PAUSE_AVG_M, 2);
$PAUSE_AVG_M_int = intval("$PAUSE_AVG_M");
$PAUSE_AVG_S = ($PAUSE_AVG_M - $PAUSE_AVG_M_int);
$PAUSE_AVG_S = ($PAUSE_AVG_S * 60);
$PAUSE_AVG_S = round($PAUSE_AVG_S, 0);
if ($PAUSE_AVG_S < 10) {$PAUSE_AVG_S = "0$PAUSE_AVG_S";}
$PAUSE_AVG_MS = "$PAUSE_AVG_M_int:$PAUSE_AVG_S";
$pfPAUSE_AVG_MS = sprintf("%6s", $PAUSE_AVG_MS);
$WAIT_AVG_M = ($row[6] / 60);
$WAIT_AVG_M = round($WAIT_AVG_M, 2);
$WAIT_AVG_M_int = intval("$WAIT_AVG_M");
$WAIT_AVG_S = ($WAIT_AVG_M - $WAIT_AVG_M_int);
$WAIT_AVG_S = ($WAIT_AVG_S * 60);
$WAIT_AVG_S = round($WAIT_AVG_S, 0);
if ($WAIT_AVG_S < 10) {$WAIT_AVG_S = "0$WAIT_AVG_S";}
$WAIT_AVG_MS = "$WAIT_AVG_M_int:$WAIT_AVG_S";
$pfWAIT_AVG_MS = sprintf("%6s", $WAIT_AVG_MS);
$WRAPUP_AVG_M = ($row[8] / 60);
$WRAPUP_AVG_M = round($WRAPUP_AVG_M, 2);
$WRAPUP_AVG_M_int = intval("$WRAPUP_AVG_M");
$WRAPUP_AVG_S = ($WRAPUP_AVG_M - $WRAPUP_AVG_M_int);
$WRAPUP_AVG_S = ($WRAPUP_AVG_S * 60);
$WRAPUP_AVG_S = round($WRAPUP_AVG_S, 0);
if ($WRAPUP_AVG_S < 10) {$WRAPUP_AVG_S = "0$WRAPUP_AVG_S";}
$WRAPUP_AVG_MS = "$WRAPUP_AVG_M_int:$WRAPUP_AVG_S";
$pfWRAPUP_AVG_MS = sprintf("%6s", $WRAPUP_AVG_MS);
$pfTOTAL_TIME_HMS = sprintf("%8s", $TOTAL_TIME_HMS);
$pfTALK_TIME_HMS = sprintf("%8s", $TALK_TIME_HMS);
$pfPAUSE_TIME_HMS = sprintf("%8s", $PAUSE_TIME_HMS);
$pfWAIT_TIME_HMS = sprintf("%8s", $WAIT_TIME_HMS);
$pfWRAPUP_TIME_HMS = sprintf("%8s", $WRAPUP_TIME_HMS);
$pfTALK_AVG_MS = sprintf("%6s", $TALK_AVG_MS);
$pfPAUSE_AVG_MS = sprintf("%6s", $PAUSE_AVG_MS);
$pfWAIT_AVG_MS = sprintf("%6s", $WAIT_AVG_MS);
$pfWRAPUP_AVG_MS = sprintf("%6s", $WRAPUP_AVG_MS);
echo "TOTAL CALLS TAKEN: $row[0]\n";
echo "TALK TIME: $pfTALK_TIME_HMS AVERAGE: $pfTALK_AVG_MS\n";
@@ -285,23 +209,11 @@ echo "LAST LOG ACTIVITY: $row[0]\n";
$end = $row[1];
$login_time = ($end - $start);
$LOGIN_TIME_H = ($login_time / 3600);
$LOGIN_TIME_H = round($LOGIN_TIME_H, 2);
$LOGIN_TIME_H_int = intval("$LOGIN_TIME_H");
$LOGIN_TIME_M = ($LOGIN_TIME_H - $LOGIN_TIME_H_int);
$LOGIN_TIME_M = ($LOGIN_TIME_M * 60);
$LOGIN_TIME_M = round($LOGIN_TIME_M, 2);
$LOGIN_TIME_M_int = intval("$LOGIN_TIME_M");
$LOGIN_TIME_S = ($LOGIN_TIME_M - $LOGIN_TIME_M_int);
$LOGIN_TIME_S = ($LOGIN_TIME_S * 60);
$LOGIN_TIME_S = round($LOGIN_TIME_S, 0);
if ($LOGIN_TIME_S < 10) {$LOGIN_TIME_S = "0$LOGIN_TIME_S";}
if ($LOGIN_TIME_M_int < 10) {$LOGIN_TIME_M_int = "0$LOGIN_TIME_M_int";}
$LOGIN_TIME_HMS = "$LOGIN_TIME_H_int:$LOGIN_TIME_M_int:$LOGIN_TIME_S";
$pfLOGIN_TIME_HMS = sprintf("%8s", $LOGIN_TIME_HMS);
$LOGIN_TIME_HMS = sec_convert($login_time,'H');
$pfLOGIN_TIME_HMS = sprintf("%8s", $LOGIN_TIME_HMS);
echo "-----------------------------------------\n";
echo "TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n";
echo "TOTAL LOGGED-IN TIME: $pfLOGIN_TIME_HMS\n";
### timeclock records
@@ -355,20 +267,15 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f
{
$login_sec = $row[3];
$total_login_time = ($total_login_time + $login_sec);
$event_hours = ($login_sec / 3600);
$event_hours_int = round($event_hours, 2);
$event_hours_int = intval("$event_hours_int");
$event_minutes = ($event_hours - $event_hours_int);
$event_minutes = ($event_minutes * 60);
$event_minutes_int = round($event_minutes, 0);
if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";}
$event_hours_minutes = sec_convert($login_sec,'H');
echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
echo "<td align=right><font size=2>$manager_edit</td>";
echo "<td align=right><font size=2>$row[0]</td>";
echo "<td align=right><font size=2> $TC_log_date</td>\n";
echo "<td align=right><font size=2> $row[4]</td>\n";
echo "<td align=right><font size=2> $row[2]</td>\n";
echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int";
echo "<td align=right><font size=2> $event_hours_minutes";
if ($DB) {echo " - $total_login_time - $login_sec";}
echo "</td></tr>\n";
}
@@ -380,13 +287,7 @@ if (strlen($login_sec)<1)
$total_login_time = ($total_login_time + $login_sec);
if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";}
}
$total_login_hours = ($total_login_time / 3600);
$total_login_hours_int = round($total_login_hours, 2);
$total_login_hours_int = intval("$total_login_hours_int");
$total_login_minutes = ($total_login_hours - $total_login_hours_int);
$total_login_minutes = ($total_login_minutes * 60);
$total_login_minutes_int = round($total_login_minutes, 0);
if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";}
$total_login_hours_minutes = sec_convert($total_login_time,'H');
if ($DB) {echo " - $total_login_time - $login_sec";}
@@ -394,8 +295,8 @@ echo "<tr><td align=right><font size=2> </td>";
echo "<td align=right><font size=2> </td>\n";
echo "<td align=right><font size=2> </td>\n";
echo "<td align=right><font size=2> </td>\n";
echo "<td align=right><font size=2><font size=2>TOTAL </td>\n";
echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n";
echo "<td align=right colspan=2><font size=2><font size=2>TOTAL </td>\n";
echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n";
echo "</TABLE>\n";
@@ -407,4 +308,4 @@ echo "</TABLE>\n";
?>
</BODY></HTML>
</BODY></HTML>
+6 -18
View File
@@ -48,14 +48,16 @@
# 90428-0727 - Changed listen and barge to use the API and manager must enter phone
# 90508-0623 - Changed to PHP long tags
# 90518-0930 - Fixed $CALLSdisplay static assignment bug for some links(bug #210)
# 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion
#
$version = '2.0.5-39';
$build = '90518-0930';
$version = '2.0.5-40';
$build = '90524-2231';
header ("Content-type: text/html; charset=utf-8");
require("dbconnect.php");
require("functions.php");
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
@@ -1197,14 +1199,7 @@ while($p<$k)
$Cqueue_priority = sprintf("%8s", $CDqueue_priority[$p]);
$Ccall_time_S = ($STARTtime - $CDcall_time[$p]);
$Ccall_time_M = ($Ccall_time_S / 60);
$Ccall_time_M = round($Ccall_time_M, 2);
$Ccall_time_M_int = intval("$Ccall_time_M");
$Ccall_time_SEC = ($Ccall_time_M - $Ccall_time_M_int);
$Ccall_time_SEC = ($Ccall_time_SEC * 60);
$Ccall_time_SEC = round($Ccall_time_SEC, 0);
if ($Ccall_time_SEC < 10) {$Ccall_time_SEC = "0$Ccall_time_SEC";}
$Ccall_time_MS = "$Ccall_time_M_int:$Ccall_time_SEC";
$Ccall_time_MS = sec_convert($Ccall_time_S,'M');
$Ccall_time_MS = sprintf("%7s", $Ccall_time_MS);
$G = ''; $EG = '';
@@ -1583,14 +1578,7 @@ $calls_to_list = mysql_num_rows($rslt);
else
{$call_time_S = ($STARTtime - $Acall_time[$i]);}
$call_time_M = ($call_time_S / 60);
$call_time_M = round($call_time_M, 2);
$call_time_M_int = intval("$call_time_M");
$call_time_SEC = ($call_time_M - $call_time_M_int);
$call_time_SEC = ($call_time_SEC * 60);
$call_time_SEC = round($call_time_SEC, 0);
if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
$call_time_MS = "$call_time_M_int:$call_time_SEC";
$call_time_MS = sec_convert($call_time_S,'M');
$call_time_MS = sprintf("%7s", $call_time_MS);
$G = ''; $EG = '';
if ($Lstatus=='INCALL')
+56 -31
View File
@@ -1774,12 +1774,13 @@ else
# 90512-0440 - Added sounds settings to system_settings table
# 90514-0607 - Added select prompts from list in call menu and in-group screens
# 90521-0029 - Added user territories enable option
# 90522-0506 - Security fix
# 90522-0506 - Security fix for logins when using non-latin setting
# 90524-2307 - Chaned Reports screen layout
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
$admin_version = '2.2.0-187';
$build = '90522-0506';
$build = '90524-2307';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -21211,42 +21212,66 @@ if ($ADD==999999)
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>VICIDIAL: Server Stats and Reports</TITLE></HEAD><BODY BGCOLOR=WHITE>
<FONT SIZE=4><B>VICIDIAL: Server Stats and Reports</B></font><BR><BR>
<FONT SIZE=4><B>VICIDIAL: Server Stats and Reports</B></FONT><BR><BR>
<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0><TR><TD VALIGN=TOP>
<B>Real-Time Reports</B><BR>
<UL>
<LI><a href="AST_timeonVDADall.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>TIME ON VDAD (per campaign)</a> &nbsp; <a href="AST_timeonVDADallSUMMARY.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>(all campaigns SUMMARY)</a> &nbsp; &nbsp; SIP <a href="AST_timeonVDADall.php?SIPmonitorLINK=1"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Listen</a> - <a href="AST_timeonVDADall.php?SIPmonitorLINK=2"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Barge</a> &nbsp; &nbsp; IAX <a href="AST_timeonVDADall.php?IAXmonitorLINK=1"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Listen</a> - <a href="AST_timeonVDADall.php?IAXmonitorLINK=2"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Barge</a></FONT>
<LI><a href="AST_VDADstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>VDAD CAMPAIGN OUTBOUND REPORT</a></FONT>
<LI><a href="AST_CLOSERstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>INBOUND/CLOSER REPORT</a></FONT>
<LI><a href="AST_CLOSER_service_level.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>INBOUND/CLOSER SERVICE_LEVEL REPORT</a></FONT>
<LI><a href="AST_agent_performance_detail.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>AGENT PERFORMANCE DETAIL</a></FONT> &nbsp; &nbsp;
<a href="AST_agent_status_detail.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>AGENT STATUS DETAIL</a></FONT> &nbsp; &nbsp;
<a href="AST_agent_days_detail.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>SINGLE AGENT DAILY</a></FONT>
<LI><a href="fcstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>FRONTER - CLOSER REPORT</a></FONT>
<LI><a href="vicidial_sales_viewer.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>AGENT SPREADSHEET PERFORMANCE</a></FONT>
<LI><a href="timeclock_report.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>USER TIMECLOCK REPORT</a></FONT> &nbsp; &nbsp;
<a href="timeclock_status.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>USER GROUP TIMECLOCK STATUS REPORT</a></FONT>
<LI><a href="AST_server_performance.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>SERVER PERFORMANCE</a></FONT>
<LI><a href="AST_timeonVDADall.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Real-Time Main Report</a></FONT>
<BR> &nbsp; Real-Time SIP: <a href="AST_timeonVDADall.php?SIPmonitorLINK=1"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Listen</a></FONT> - <a href="AST_timeonVDADall.php?SIPmonitorLINK=2"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Barge</a></FONT>
<BR> &nbsp; Real-Time IAX: <a href="AST_timeonVDADall.php?IAXmonitorLINK=1"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Listen</a></FONT> - <a href="AST_timeonVDADall.php?IAXmonitorLINK=2"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Barge</a></FONT><BR><BR>
<LI><a href="AST_timeonVDADallSUMMARY.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Real-Time Campaign Summary</a></FONT>
</UL><BR>
<B>Inbound and Outbound Calling Reports</B><BR>
<UL>
<LI><a href="AST_CLOSERstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Inbound Report</a></FONT>
<LI><a href="AST_CLOSER_service_level.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Inbound Service Level Report</a></FONT>
<LI><a href="AST_IVRstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Inbound IVR Report</a></FONT>
<LI><a href="AST_VDADstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Outbound Calling Report</a></FONT>
<LI><a href="fcstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Fronter - Closer Report</a></FONT>
<!-- <LI><a href="vicidial_sales_viewer.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>AGENT SPREADSHEET PERFORMANCE</a></FONT> -->
<?php
if ($LOGexport_reports >= 1)
{
echo "<LI><a href=\"call_report_export.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>EXPORT CALLS REPORT</a></FONT>\n";
}
if ($LOGuser_level >= 9)
{
echo "<LI><a href=\"$PHP_SELF?ADD=700000000000000\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>ADMIN CHANGE LOG</a></FONT>\n";
}
if ($SSenable_queuemetrics_logging > 0)
{
echo "<LI><a href=\"$queuemetrics_url_LU\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>QUEUEMETRICS REPORTS</a></FONT>\n";
}
if ($SSenable_vtiger_integration > 0)
{
echo "<LI><a href=\"$vtiger_url_LU\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>VTIGER HOME</a></FONT>\n";
echo "<LI><a href=\"call_report_export.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Export Calls Report</a></FONT>\n";
}
?>
</UL>
</TD><TD VALIGN=TOP>
&nbsp; &nbsp; &nbsp;
</TD><TD VALIGN=TOP>
<B>Agent Reports</B><BR>
<UL>
<LI><a href="AST_agent_time_detail.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Agent Time Detail</a></FONT>
<LI><a href="AST_agent_status_detail.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Agent Status Detail</a></FONT>
<LI><a href="AST_agent_performance_detail.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Agent Performance Detail</a></FONT>
<LI><a href="AST_agent_days_detail.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Single Agent Daily</a></FONT>
</UL><BR>
<B>Time Clock Reports</B><BR>
<UL>
<LI><a href="timeclock_report.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>User Timeclock Report</a></FONT>
<LI><a href="timeclock_status.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>User Group Timeclock Status Report</a></FONT>
</UL><BR>
<B>Other Reports and Links</B><BR>
<UL>
<LI><a href="AST_server_performance.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Server Perforrmance Report</a></FONT>
<?php
if ($LOGuser_level >= 9)
{
echo "<LI><a href=\"$PHP_SELF?ADD=700000000000000\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Administration Change Log</a></FONT>\n";
}
if ($SSenable_queuemetrics_logging > 0)
{
echo "<LI><a href=\"$queuemetrics_url_LU\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>QueueMetrics Reports</a></FONT>\n";
}
if ($SSenable_vtiger_integration > 0)
{
echo "<LI><a href=\"$vtiger_url_LU\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>VtigerCRM Home</a></FONT>\n";
}
?>
</UL>
</TD></TR></TABLE>
<PRE><TABLE BORDER=1 CELLPADDING=2 cellspacing=0>
<TR><TD>SERVER</TD><TD>DESCRIPTION</TD><TD>IP</TD><TD>ACT</TD><TD>LOAD</TD><TD>CHAN</TD><TD>DISK</TD><TD>OUTBOUND</TD><TD>INBOUND</TD></TR>
<?php
+1
View File
@@ -723,6 +723,7 @@ $admin_home_url_LU = $row[0];
<TR><TD <?php echo $reports_hh ?>>
<a href="<?php echo $ADMIN ?>?ADD=999999"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $reports_fc ?> SIZE=<?php echo $header_font_size ?>><?php echo $reports_bold ?> Reports </a>
</TD></TR>
<TR><TD> &nbsp; </TD></TR>
</TABLE>
</TD><TD VALIGN=TOP WIDTH=<?php echo $page_width ?> BGCOLOR=#D9E6FE>
<!-- END SIDEBAR NAVIGATION -->
+61
View File
@@ -0,0 +1,61 @@
<?php
#
# functions.php version 2.2.0
#
# functions for administrative scripts and reports
#
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
#
# CHANGES:
# 90524-1503 - First Build
#
##### reformat seconds into HH:MM:SS or MM:SS #####
function sec_convert($sec,$precision)
{
$sec = round($sec,0);
if ($sec < 1)
{
return "0:00";
}
else
{
if ($sec < 3600) {$precision='M';}
if ($precision == 'H')
{
$Fhours_H = ($sec / 3600);
$Fhours_H_int = floor($Fhours_H);
$Fhours_H_int = intval("$Fhours_H_int");
$Fhours_M = ($Fhours_H - $Fhours_H_int);
$Fhours_M = ($Fhours_M * 60);
$Fhours_M_int = floor($Fhours_M);
$Fhours_M_int = intval("$Fhours_M_int");
$Fhours_S = ($Fhours_M - $Fhours_M_int);
$Fhours_S = ($Fhours_S * 60);
$Fhours_S = round($Fhours_S, 0);
if ($Fhours_S < 10) {$Fhours_S = "0$Fhours_S";}
if ($Fhours_M_int < 10) {$Fhours_M_int = "0$Fhours_M_int";}
$Ftime = "$Fhours_H_int:$Fhours_M_int:$Fhours_S";
}
if ($precision == 'M')
{
$Fminutes_M = ($sec / 60);
$Fminutes_M_int = floor($Fminutes_M);
$Fminutes_M_int = intval("$Fminutes_M_int");
$Fminutes_S = ($Fminutes_M - $Fminutes_M_int);
$Fminutes_S = ($Fminutes_S * 60);
$Fminutes_S = round($Fminutes_S, 0);
if ($Fminutes_S < 10) {$Fminutes_S = "0$Fminutes_S";}
$Ftime = "$Fminutes_M_int:$Fminutes_S";
}
if ($precision == 'S')
{
$Ftime = $sec;
}
return "$Ftime";
}
}
?>
+25 -5
View File
@@ -27,14 +27,34 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
$i=0;
while ($i < $qm_conf_ct)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$webroot_writable = $row[1];
$SSoutbound_autodial_active = $row[2];
$user_territories_active = $row[3];
$i++;
}
##### END SETTINGS LOOKUP #####
###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";}
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
{
+10 -8
View File
@@ -51,7 +51,7 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;";
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
@@ -59,8 +59,10 @@ $i=0;
while ($i < $qm_conf_ct)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$webroot_writable = $row[1];
$non_latin = $row[0];
$webroot_writable = $row[1];
$SSoutbound_autodial_active = $row[2];
$user_territories_active = $row[3];
$i++;
}
##### END SETTINGS LOOKUP #####
@@ -78,11 +80,11 @@ $invalid_record=0;
if (!isset($begin_date)) {$begin_date = $TODAY;}
if (!isset($end_date)) {$end_date = $TODAY;}
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';";
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';";
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
$fp = fopen ("./project_auth_entries.txt", "a");
$date = date("r");
+4 -3
View File
@@ -42,7 +42,7 @@ if (strlen($order)<2) {$order='hours_down';}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;";
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
@@ -50,8 +50,9 @@ $i=0;
while ($i < $qm_conf_ct)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$webroot_writable = $row[1];
$non_latin = $row[0];
$webroot_writable = $row[1];
$SSoutbound_autodial_active = $row[2];
$i++;
}
##### END SETTINGS LOOKUP #####
+6 -4
View File
@@ -36,7 +36,7 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day FROM system_settings;";
$stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day,outbound_autodial_active FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
@@ -44,9 +44,11 @@ $i=0;
while ($i < $qm_conf_ct)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$webroot_writable = $row[1];
$timeclock_end_of_day = $row[2];
$non_latin = $row[0];
$webroot_writable = $row[1];
$timeclock_end_of_day = $row[2];
$SSoutbound_autodial_active = $row[3];
$i++;
}
##### END SETTINGS LOOKUP #####
+4 -3
View File
@@ -32,7 +32,7 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;";
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
@@ -40,8 +40,9 @@ $i=0;
while ($i < $qm_conf_ct)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$webroot_writable = $row[1];
$non_latin = $row[0];
$webroot_writable = $row[1];
$SSoutbound_autodial_active = $row[2];
$i++;
}
##### END SETTINGS LOOKUP #####
+47 -63
View File
@@ -18,11 +18,29 @@
# 90305-1226 - Added user_call_log manual dial logs
# 90310-0734 - Added admin header
# 90508-0644 - Changed to PHP long tags
# 90524-2009 - Changed time display to use functions.php
#
header ("Content-type: text/html; charset=utf-8");
require("dbconnect.php");
require("functions.php");
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$ss_conf_ct = mysql_num_rows($rslt);
if ($ss_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$SSoutbound_autodial_active = $row[1];
$user_territories_active = $row[2];
}
##### END SETTINGS LOOKUP #####
###########################################
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
@@ -51,10 +69,11 @@ $TODAY = date("Y-m-d");
if (!isset($begin_date)) {$begin_date = $TODAY;}
if (!isset($end_date)) {$end_date = $TODAY;}
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';";
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
$fp = fopen ("./project_auth_entries.txt", "a");
$date = date("r");
@@ -73,10 +92,10 @@ $browser = getenv("HTTP_USER_AGENT");
if($auth>0)
{
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$LOGfullname=$row[0];
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$LOGfullname=$row[0];
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
fclose($fp);
@@ -93,7 +112,6 @@ $browser = getenv("HTTP_USER_AGENT");
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$full_name = $row[0];
}
@@ -170,7 +188,7 @@ echo "<br><center>\n";
echo "<B>VICIDIAL TALK TIME AND STATUS:</B>\n";
echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n";
echo "<tr><td><font size=2>STATUS</td><td align=right><font size=2>COUNT</td><td align=right><font size=2>HOURS:MINUTES</td></tr>\n";
echo "<tr><td><font size=2>STATUS</td><td align=right><font size=2>COUNT</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n";
$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status";
$rslt=mysql_query($stmt, $link);
@@ -226,34 +244,20 @@ while ($o < $p)
else
{$bgcolor='bgcolor="#9BB9FB"';}
$call_seconds = $call_sec[$o];
$call_hours = ($call_seconds / 3600);
$call_hours_int = round($call_hours, 2);
$call_hours_int = intval("$call_hours_int");
$call_minutes = ($call_hours - $call_hours_int);
$call_minutes = ($call_minutes * 60);
$call_minutes_int = round($call_minutes, 0);
if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";}
$call_hours_minutes = sec_convert($call_sec[$o],'H');
echo "<tr $bgcolor><td><font size=2>$status[$o]</td>";
echo "<td align=right><font size=2> $counts[$o]</td>\n";
echo "<td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n";
echo "<td align=right><font size=2> $call_hours_minutes</td></tr>\n";
$total_calls = ($total_calls + $counts[$o]);
$total_sec = ($total_sec + $call_sec[$o]);
$call_seconds=0;
$o++;
}
$call_seconds = $total_sec;
$call_hours = ($call_seconds / 3600);
$call_hours_int = round($call_hours, 2);
$call_hours_int = intval("$call_hours_int");
$call_minutes = ($call_hours - $call_hours_int);
$call_minutes = ($call_minutes * 60);
$call_minutes_int = round($call_minutes, 0);
if ($call_minutes_int < 10) {$call_minutes_int = "0$call_minutes_int";}
$call_hours_minutes = sec_convert($total_sec,'H');
echo "<tr><td><font size=2>TOTAL CALLS </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_int:$call_minutes_int</td></tr>\n";
echo "<tr><td><font size=2>TOTAL CALLS </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n";
echo "</TABLE></center>\n";
@@ -265,7 +269,7 @@ echo "<center>\n";
echo "<B>VICIDIAL AGENT LOGIN/LOGOUT TIME:</B>\n";
echo "<TABLE width=500 cellspacing=0 cellpadding=1>\n";
echo "<tr><td><font size=2>EVENT </td><td align=right><font size=2> DATE</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MINUTES</td></tr>\n";
echo "<tr><td><font size=2>EVENT </td><td align=right><font size=2> DATE</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n";
$stmt="SELECT event,event_epoch,event_date,campaign_id,user_group from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'";
$rslt=mysql_query($stmt, $link);
@@ -295,21 +299,17 @@ echo "<tr><td><font size=2>EVENT </td><td align=right><font size=2> DATE</td><td
{
if ($event_start_seconds)
{
$event_stop_seconds = $row[1];
$event_seconds = ($event_stop_seconds - $event_start_seconds);
$total_login_time = ($total_login_time + $event_seconds);
$event_hours = ($event_seconds / 3600);
$event_hours_int = round($event_hours, 2);
$event_hours_int = intval("$event_hours_int");
$event_minutes = ($event_hours - $event_hours_int);
$event_minutes = ($event_minutes * 60);
$event_minutes_int = round($event_minutes, 0);
if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";}
$event_hours_minutes = sec_convert($event_seconds,'H');
echo "<tr $bgcolor><td><font size=2>$row[0]</td>";
echo "<td align=right><font size=2> $row[2]</td>\n";
echo "<td align=right><font size=2> $row[3]</td>\n";
echo "<td align=right><font size=2> $row[4]</td>\n";
echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int</td></tr>\n";
echo "<td align=right><font size=2> $event_hours_minutes</td></tr>\n";
$event_start_seconds='';
$event_stop_seconds='';
}
@@ -328,19 +328,13 @@ echo "<tr><td><font size=2>EVENT </td><td align=right><font size=2> DATE</td><td
$o++;
}
$total_login_hours = ($total_login_time / 3600);
$total_login_hours_int = round($total_login_hours, 2);
$total_login_hours_int = intval("$total_login_hours_int");
$total_login_minutes = ($total_login_hours - $total_login_hours_int);
$total_login_minutes = ($total_login_minutes * 60);
$total_login_minutes_int = round($total_login_minutes, 0);
if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";}
$total_login_hours_minutes = sec_convert($total_login_time,'H');
echo "<tr><td><font size=2>TOTAL</td>";
echo "<td align=right><font size=2> </td>\n";
echo "<td align=right><font size=2> </td>\n";
echo "<td align=right><font size=2> </td>\n";
echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int</td></tr>\n";
echo "<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n";
echo "</TABLE></center>\n";
@@ -362,7 +356,7 @@ echo "<center>\n";
echo "<B>TIMECLOCK LOGIN/LOGOUT TIME:</B>\n";
echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n";
echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENT </td><td align=right><font size=2> DATE</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MINUTES</td></tr>\n";
echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENT </td><td align=right><font size=2> DATE</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n";
$stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';";
if ($DB>0) {echo "|$stmt|";}
@@ -398,20 +392,15 @@ echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><f
{
$login_sec = $row[3];
$total_login_time = ($total_login_time + $login_sec);
$event_hours = ($login_sec / 3600);
$event_hours_int = round($event_hours, 2);
$event_hours_int = intval("$event_hours_int");
$event_minutes = ($event_hours - $event_hours_int);
$event_minutes = ($event_minutes * 60);
$event_minutes_int = round($event_minutes, 0);
if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";}
$event_hours_minutes = sec_convert($login_sec,'H');
echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
echo "<td align=right><font size=2>$manager_edit</td>";
echo "<td align=right><font size=2>$row[0]</td>";
echo "<td align=right><font size=2> $TC_log_date</td>\n";
echo "<td align=right><font size=2> $row[4]</td>\n";
echo "<td align=right><font size=2> $row[2]</td>\n";
echo "<td align=right><font size=2> $event_hours_int:$event_minutes_int";
echo "<td align=right><font size=2> $event_hours_minutes";
if ($DB) {echo " - $total_login_time - $login_sec";}
echo "</td></tr>\n";
}
@@ -423,26 +412,21 @@ if (strlen($login_sec)<1)
$total_login_time = ($total_login_time + $login_sec);
if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";}
}
$total_login_hours = ($total_login_time / 3600);
$total_login_hours_int = round($total_login_hours, 2);
$total_login_hours_int = intval("$total_login_hours_int");
$total_login_minutes = ($total_login_hours - $total_login_hours_int);
$total_login_minutes = ($total_login_minutes * 60);
$total_login_minutes_int = round($total_login_minutes, 0);
if ($total_login_minutes_int < 10) {$total_login_minutes_int = "0$total_login_minutes_int";}
$total_login_hours_minutes = sec_convert($total_login_time,'H');
if ($DB) {echo " - $total_login_time - $login_sec";}
if ($DB) {echo " - $total_login_time - $login_sec";}
echo "<tr><td align=right><font size=2> </td>";
echo "<td align=right><font size=2> </td>\n";
echo "<td align=right><font size=2> </td>\n";
echo "<td align=right><font size=2> </td>\n";
echo "<td align=right><font size=2><font size=2>TOTAL </td>\n";
echo "<td align=right><font size=2> $total_login_hours_int:$total_login_minutes_int </td></tr>\n";
echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n";
echo "</TABLE></center>\n";
##### closer in-group selection logs #####
echo "<br><br>\n";
+5 -3
View File
@@ -39,7 +39,7 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;";
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
@@ -47,8 +47,10 @@ $i=0;
while ($i < $qm_conf_ct)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$webroot_writable = $row[1];
$non_latin = $row[0];
$webroot_writable = $row[1];
$SSoutbound_autodial_active = $row[2];
$user_territories_active = $row[3];
$i++;
}
##### END SETTINGS LOOKUP #####
+1
View File
@@ -91,6 +91,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_users='1'";
if ($DB) {echo "|$stmt|\n";}
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];