From 353793c01d89e422cc2addcdf6c5a0c8b6cf5819 Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 25 May 2009 03:11:13 +0000 Subject: [PATCH] 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 --- agc_2-X/trunk/UPGRADE | 5 + agc_2-X/trunk/docs/REQUIRED_APPS_INSTALL.txt | 7 +- .../trunk/www/vicidial/AST_CLOSERstats.php | 128 +-- agc_2-X/trunk/www/vicidial/AST_VDADstats.php | 160 +--- .../vicidial/AST_agent_performance_detail.php | 403 +++------ .../www/vicidial/AST_agent_time_detail.php | 854 ++++++++++++++++++ .../www/vicidial/AST_agent_time_sheet.php | 203 ++--- .../trunk/www/vicidial/AST_timeonVDADall.php | 24 +- agc_2-X/trunk/www/vicidial/admin.php | 87 +- agc_2-X/trunk/www/vicidial/admin_header.php | 1 + agc_2-X/trunk/www/vicidial/functions.php | 61 ++ .../trunk/www/vicidial/group_hourly_stats.php | 30 +- agc_2-X/trunk/www/vicidial/timeclock_edit.php | 18 +- .../trunk/www/vicidial/timeclock_report.php | 7 +- .../trunk/www/vicidial/timeclock_status.php | 10 +- .../www/vicidial/user_group_bulk_change.php | 7 +- agc_2-X/trunk/www/vicidial/user_stats.php | 110 +-- agc_2-X/trunk/www/vicidial/user_status.php | 8 +- .../trunk/www/vicidial/user_territories.php | 1 + 19 files changed, 1305 insertions(+), 819 deletions(-) create mode 100644 agc_2-X/trunk/www/vicidial/AST_agent_time_detail.php create mode 100644 agc_2-X/trunk/www/vicidial/functions.php diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 11745c08..35f83f6e 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -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 + + diff --git a/agc_2-X/trunk/docs/REQUIRED_APPS_INSTALL.txt b/agc_2-X/trunk/docs/REQUIRED_APPS_INSTALL.txt index fd994148..9e77ade9 100644 --- a/agc_2-X/trunk/docs/REQUIRED_APPS_INSTALL.txt +++ b/agc_2-X/trunk/docs/REQUIRED_APPS_INSTALL.txt @@ -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 diff --git a/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php b/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php index bb2668a7..cc33d79c 100644 --- a/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php @@ -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"; ############################## diff --git a/agc_2-X/trunk/www/vicidial/AST_VDADstats.php b/agc_2-X/trunk/www/vicidial/AST_VDADstats.php index 4396d3b1..b1ea273d 100644 --- a/agc_2-X/trunk/www/vicidial/AST_VDADstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_VDADstats.php @@ -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 diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php b/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php index 1addc32d..7123dcf6 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php @@ -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 "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "
to
\n"; +echo " Campaigns:
"; +echo "\n"; +echo "User Groups:
"; +echo "\n"; +echo "Shift:
"; +echo "

\n"; +echo "\n"; +echo "         "; + +echo "          \n"; +echo " DOWNLOAD | \n"; +echo " REPORTS \n"; +echo "\n"; +echo ""; + +echo "\n\n"; +############################################################################ +##### END HTML form section +############################################################################ + + +$ENDtime = date("U"); +$RUNtime = ($ENDtime - $STARTtime); +echo "$RUNtime\n"; + + +##### BEGIN horizontal yellow transparent bar graph overlay on top of agent stats +echo "\n"; +echo "\n"; +echo "
\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 "                              ";
+		$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
+		$h=0;
+		while ($h <= $TOPsortPLOT)
+			{
+			echo " ";
+			$h++;
+			}
+		echo "\n";
+		}
+	$m++;
+	}
+
+echo "\n";
+##### END horizontal yellow transparent bar graph overlay on top of agent stats
+
+?>
+
+
diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_time_sheet.php b/agc_2-X/trunk/www/vicidial/AST_agent_time_sheet.php
index 025b815f..715fabe8 100644
--- a/agc_2-X/trunk/www/vicidial/AST_agent_time_sheet.php
+++ b/agc_2-X/trunk/www/vicidial/AST_agent_time_sheet.php
@@ -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 "ID EDIT $row[5]";
 			echo "$manager_edit";
 			echo "$row[0]";
 			echo " $TC_log_date\n";
 			echo " $row[4]\n";
 			echo " $row[2]\n";
-			echo " $event_hours_int:$event_minutes_int";
+			echo " $event_hours_minutes";
 			if ($DB) {echo " - $total_login_time - $login_sec";}
 			echo "\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 " ";
 echo " \n";
 echo " \n";
 echo " \n";
-echo "TOTAL \n";
-echo " $total_login_hours_int:$total_login_minutes_int  \n";
+echo "TOTAL \n";
+echo " $total_login_hours_minutes  \n";
 
 echo "\n";
 
@@ -407,4 +308,4 @@ echo "\n";
 
 ?>
 
-
\ No newline at end of file
+
diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php
index 60882537..b979ec2b 100644
--- a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php
+++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php
@@ -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')
diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php
index a62467e1..57292731 100644
--- a/agc_2-X/trunk/www/vicidial/admin.php
+++ b/agc_2-X/trunk/www/vicidial/admin.php
@@ -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)
 
 		
 		VICIDIAL: Server Stats and Reports
-		VICIDIAL: Server Stats and Reports

+ VICIDIAL: Server Stats and Reports

+
+ Real-Time Reports

+ Inbound and Outbound Calling Reports
+ + +
+       + + Agent Reports
+
+ Time Clock Reports
+
+ Other Reports and Links
+ +
+

+	
SERVERDESCRIPTIONIPACTLOADCHANDISKOUTBOUNDINBOUND
> SIZE=> Reports
 
BGCOLOR=#D9E6FE> diff --git a/agc_2-X/trunk/www/vicidial/functions.php b/agc_2-X/trunk/www/vicidial/functions.php new file mode 100644 index 00000000..240b3fe2 --- /dev/null +++ b/agc_2-X/trunk/www/vicidial/functions.php @@ -0,0 +1,61 @@ + 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"; + } + } +?> \ No newline at end of file diff --git a/agc_2-X/trunk/www/vicidial/group_hourly_stats.php b/agc_2-X/trunk/www/vicidial/group_hourly_stats.php index 2f6710e3..4d66e813 100644 --- a/agc_2-X/trunk/www/vicidial/group_hourly_stats.php +++ b/agc_2-X/trunk/www/vicidial/group_hourly_stats.php @@ -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)) { diff --git a/agc_2-X/trunk/www/vicidial/timeclock_edit.php b/agc_2-X/trunk/www/vicidial/timeclock_edit.php index 5ff55217..7fda24a8 100644 --- a/agc_2-X/trunk/www/vicidial/timeclock_edit.php +++ b/agc_2-X/trunk/www/vicidial/timeclock_edit.php @@ -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"); diff --git a/agc_2-X/trunk/www/vicidial/timeclock_report.php b/agc_2-X/trunk/www/vicidial/timeclock_report.php index fd92f208..41f14540 100644 --- a/agc_2-X/trunk/www/vicidial/timeclock_report.php +++ b/agc_2-X/trunk/www/vicidial/timeclock_report.php @@ -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 ##### diff --git a/agc_2-X/trunk/www/vicidial/timeclock_status.php b/agc_2-X/trunk/www/vicidial/timeclock_status.php index aab6361e..ae97edf2 100644 --- a/agc_2-X/trunk/www/vicidial/timeclock_status.php +++ b/agc_2-X/trunk/www/vicidial/timeclock_status.php @@ -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 ##### diff --git a/agc_2-X/trunk/www/vicidial/user_group_bulk_change.php b/agc_2-X/trunk/www/vicidial/user_group_bulk_change.php index d6d4c1ae..2cdc5cbe 100644 --- a/agc_2-X/trunk/www/vicidial/user_group_bulk_change.php +++ b/agc_2-X/trunk/www/vicidial/user_group_bulk_change.php @@ -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 ##### diff --git a/agc_2-X/trunk/www/vicidial/user_stats.php b/agc_2-X/trunk/www/vicidial/user_stats.php index cb82dbe5..3846c1de 100644 --- a/agc_2-X/trunk/www/vicidial/user_stats.php +++ b/agc_2-X/trunk/www/vicidial/user_stats.php @@ -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 "
\n"; echo "VICIDIAL TALK TIME AND STATUS:\n"; echo "
\n"; -echo "\n"; +echo "\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 ""; echo "\n"; - echo "\n"; + echo "\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 "\n"; +echo "\n"; echo "
STATUSCOUNTHOURS:MINUTES
STATUSCOUNTHOURS:MM:SS
$status[$o] $counts[$o] $call_hours_int:$call_minutes_int
$call_hours_minutes
TOTAL CALLS $total_calls $call_hours_int:$call_minutes_int
TOTAL CALLS $total_calls $call_hours_minutes
\n"; @@ -265,7 +269,7 @@ echo "
\n"; echo "VICIDIAL AGENT LOGIN/LOGOUT TIME:\n"; echo "\n"; -echo "\n"; +echo "\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 ""; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; $event_start_seconds=''; $event_stop_seconds=''; } @@ -328,19 +328,13 @@ echo ""; echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "
EVENT DATE CAMPAIGN GROUPHOURS:MINUTES
EVENT DATE CAMPAIGN GROUPHOURS:MM:SS
EVENT DATE$row[0] $row[2] $row[3] $row[4] $event_hours_int:$event_minutes_int
$event_hours_minutes
EVENT DATETOTAL $total_login_hours_int:$total_login_minutes_int
$total_login_hours_minutes
\n"; @@ -362,7 +356,7 @@ echo "
\n"; echo "TIMECLOCK LOGIN/LOGOUT TIME:\n"; echo "\n"; -echo "\n"; +echo "\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 ""; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; - echo "\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 ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "
ID EDIT EVENT DATE IP ADDRESS GROUPHOURS:MINUTES
ID EDIT EVENT DATE IP ADDRESS GROUPHOURS:MM:SS
ID EDIT $row[5]$manager_edit$row[0] $TC_log_date $row[4] $row[2] $event_hours_int:$event_minutes_int"; + echo " $event_hours_minutes"; if ($DB) {echo " - $total_login_time - $login_sec";} echo "
TOTAL $total_login_hours_int:$total_login_minutes_int
$total_login_hours_minutes
\n"; + ##### closer in-group selection logs ##### echo "

\n"; diff --git a/agc_2-X/trunk/www/vicidial/user_status.php b/agc_2-X/trunk/www/vicidial/user_status.php index 15919670..3533170f 100644 --- a/agc_2-X/trunk/www/vicidial/user_status.php +++ b/agc_2-X/trunk/www/vicidial/user_status.php @@ -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 ##### diff --git a/agc_2-X/trunk/www/vicidial/user_territories.php b/agc_2-X/trunk/www/vicidial/user_territories.php index cc367998..2416f0d0 100644 --- a/agc_2-X/trunk/www/vicidial/user_territories.php +++ b/agc_2-X/trunk/www/vicidial/user_territories.php @@ -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];