From 771c01cd583df3e18a83d005151b8fdb2ab109c9 Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 27 Apr 2007 16:20:39 +0000 Subject: [PATCH] updated LANG_www builds git-svn-id: svn://192.168.202.10@603 3d104415-ff17-0410-8863-d5cf3c621b8a --- LANG_www/agc/manager_send.php | 2 +- LANG_www/agc/vdc_db_query.php | 42 ++++++- LANG_www/agc_br/manager_send.php | 2 +- LANG_www/agc_br/vdc_db_query.php | 42 ++++++- LANG_www/agc_de/manager_send.php | 2 +- LANG_www/agc_de/vdc_db_query.php | 42 ++++++- LANG_www/agc_el/manager_send.php | 2 +- LANG_www/agc_el/vdc_db_query.php | 42 ++++++- LANG_www/agc_en/manager_send.php | 2 +- LANG_www/agc_en/vdc_db_query.php | 42 ++++++- LANG_www/agc_es/manager_send.php | 2 +- LANG_www/agc_es/vdc_db_query.php | 42 ++++++- LANG_www/agc_fr/manager_send.php | 2 +- LANG_www/agc_fr/vdc_db_query.php | 42 ++++++- LANG_www/agc_it/manager_send.php | 2 +- LANG_www/agc_it/vdc_db_query.php | 42 ++++++- LANG_www/agc_pl/manager_send.php | 2 +- LANG_www/agc_pl/vdc_db_query.php | 42 ++++++- LANG_www/agc_pt/manager_send.php | 2 +- LANG_www/agc_pt/vdc_db_query.php | 42 ++++++- LANG_www/vicidial/AST_VDADstats.php | 6 +- LANG_www/vicidial/AST_server_performance.php | 103 +++++++++--------- LANG_www/vicidial/admin_modify_lead.php | 85 ++++++++++----- LANG_www/vicidial/listloader.php | 9 +- LANG_www/vicidial/listloader.pl | 4 +- LANG_www/vicidial/listloader_super.pl | 4 +- LANG_www/vicidial/new_listloader_superL.php | 11 +- LANG_www/vicidial_de/AST_VDADstats.php | 6 +- .../vicidial_de/AST_agent_performance.php | 45 ++++++-- .../AST_agent_performance_detail.php | 95 +++++++++++++--- .../vicidial_de/AST_server_performance.php | 103 +++++++++--------- LANG_www/vicidial_de/admin_modify_lead.php | 86 ++++++++++----- LANG_www/vicidial_de/listloader.php | 11 +- LANG_www/vicidial_de/listloader.pl | 6 +- LANG_www/vicidial_de/listloader_super.pl | 6 +- .../vicidial_de/new_listloader_superL.php | 11 +- LANG_www/vicidial_el/AST_VDADstats.php | 6 +- .../vicidial_el/AST_agent_performance.php | 45 ++++++-- .../AST_agent_performance_detail.php | 95 +++++++++++++--- .../vicidial_el/AST_server_performance.php | 103 +++++++++--------- LANG_www/vicidial_el/admin_modify_lead.php | 86 ++++++++++----- LANG_www/vicidial_el/listloader.php | 11 +- LANG_www/vicidial_el/listloader.pl | 6 +- LANG_www/vicidial_el/listloader_super.pl | 6 +- .../vicidial_el/new_listloader_superL.php | 11 +- LANG_www/vicidial_en/AST_VDADstats.php | 6 +- .../vicidial_en/AST_server_performance.php | 103 +++++++++--------- LANG_www/vicidial_en/admin_modify_lead.php | 85 ++++++++++----- LANG_www/vicidial_en/listloader.php | 9 +- LANG_www/vicidial_en/listloader.pl | 4 +- LANG_www/vicidial_en/listloader_super.pl | 4 +- .../vicidial_en/new_listloader_superL.php | 11 +- LANG_www/vicidial_es/AST_VDADstats.php | 6 +- .../vicidial_es/AST_agent_performance.php | 45 ++++++-- .../AST_agent_performance_detail.php | 95 +++++++++++++--- .../vicidial_es/AST_server_performance.php | 103 +++++++++--------- LANG_www/vicidial_es/admin_modify_lead.php | 86 ++++++++++----- LANG_www/vicidial_es/listloader.php | 11 +- LANG_www/vicidial_es/listloader.pl | 6 +- LANG_www/vicidial_es/listloader_super.pl | 6 +- .../vicidial_es/new_listloader_superL.php | 11 +- 61 files changed, 1383 insertions(+), 608 deletions(-) diff --git a/LANG_www/agc/manager_send.php b/LANG_www/agc/manager_send.php index 10aa003d..a82cc03f 100644 --- a/LANG_www/agc/manager_send.php +++ b/LANG_www/agc/manager_send.php @@ -610,7 +610,7 @@ if ($ACTION=="RedirectXtraCX") if ($WeBRooTWritablE > 0) { $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); fclose($fp); } } diff --git a/LANG_www/agc/vdc_db_query.php b/LANG_www/agc/vdc_db_query.php index 801dff0d..7d75cb1a 100644 --- a/LANG_www/agc/vdc_db_query.php +++ b/LANG_www/agc/vdc_db_query.php @@ -128,10 +128,12 @@ # 70313-1052 - Allow pound signs(hash) in comments to pass through # 70319-1544 - Added agent disable update customer data function # 70322-1545 - Added sipsak display ability +# 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns +# 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records # -$version = '2.0.55'; -$build = '70322-1545'; +$version = '2.0.57'; +$build = '70424-1100'; require("dbconnect.php"); @@ -881,12 +883,12 @@ if ($stage == "end") { if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; } else { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_log table $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; } $rslt=mysql_query($stmt, $link); @@ -902,6 +904,24 @@ if ($stage == "end") { $length_in_sec = 0; } + if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + { + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log + $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $start_epoch =$row[0]; + $length_in_sec = ($StarTtime - $start_epoch); + } + else + { + $length_in_sec = 0; + } + } } else {$length_in_sec = ($StarTtime - $start_epoch);} @@ -1059,11 +1079,12 @@ if ($stage == "end") } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1124,7 +1145,7 @@ if ($stage == "end") mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1447,6 +1468,15 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[1]; $dialed_label =$row[2]; } + else + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); + fclose($fp); + } + } $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/agc_br/manager_send.php b/LANG_www/agc_br/manager_send.php index cdef0c9d..3dca483d 100644 --- a/LANG_www/agc_br/manager_send.php +++ b/LANG_www/agc_br/manager_send.php @@ -610,7 +610,7 @@ if ($ACTION=="RedirectXtraCX") if ($WeBRooTWritablE > 0) { $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); fclose($fp); } } diff --git a/LANG_www/agc_br/vdc_db_query.php b/LANG_www/agc_br/vdc_db_query.php index 0db2aeaa..f33704c0 100644 --- a/LANG_www/agc_br/vdc_db_query.php +++ b/LANG_www/agc_br/vdc_db_query.php @@ -128,10 +128,12 @@ # 70313-1052 - Allow pound signs(hash) in comments to pass through # 70319-1544 - Added agent disable update customer data function # 70322-1545 - Added sipsak display ability +# 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns +# 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records # -$version = '2.0.55'; -$build = '70322-1545'; +$version = '2.0.57'; +$build = '70424-1100'; require("dbconnect.php"); @@ -881,12 +883,12 @@ if ($stage == "end") { if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; } else { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_log table $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; } $rslt=mysql_query($stmt, $link); @@ -902,6 +904,24 @@ if ($stage == "end") { $length_in_sec = 0; } + if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + { + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log + $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $start_epoch =$row[0]; + $length_in_sec = ($StarTtime - $start_epoch); + } + else + { + $length_in_sec = 0; + } + } } else {$length_in_sec = ($StarTtime - $start_epoch);} @@ -1059,11 +1079,12 @@ if ($stage == "end") } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1124,7 +1145,7 @@ if ($stage == "end") mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1447,6 +1468,15 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[1]; $dialed_label =$row[2]; } + else + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); + fclose($fp); + } + } $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/agc_de/manager_send.php b/LANG_www/agc_de/manager_send.php index b833285d..0c58bba1 100644 --- a/LANG_www/agc_de/manager_send.php +++ b/LANG_www/agc_de/manager_send.php @@ -610,7 +610,7 @@ if ($ACTION=="RedirectXtraCX") if ($WeBRooTWritablE > 0) { $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); fclose($fp); } } diff --git a/LANG_www/agc_de/vdc_db_query.php b/LANG_www/agc_de/vdc_db_query.php index d046f0bd..5842ccbd 100644 --- a/LANG_www/agc_de/vdc_db_query.php +++ b/LANG_www/agc_de/vdc_db_query.php @@ -128,10 +128,12 @@ # 70313-1052 - Allow pound signs(hash) in comments to pass through # 70319-1544 - Added agent disable update customer data function # 70322-1545 - Added sipsak display ability +# 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns +# 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records # -$version = '2.0.55'; -$build = '70322-1545'; +$version = '2.0.57'; +$build = '70424-1100'; require("dbconnect.php"); @@ -881,12 +883,12 @@ if ($stage == "end") { if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; } else { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_log table $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; } $rslt=mysql_query($stmt, $link); @@ -902,6 +904,24 @@ if ($stage == "end") { $length_in_sec = 0; } + if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + { + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log + $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $start_epoch =$row[0]; + $length_in_sec = ($StarTtime - $start_epoch); + } + else + { + $length_in_sec = 0; + } + } } else {$length_in_sec = ($StarTtime - $start_epoch);} @@ -1059,11 +1079,12 @@ if ($stage == "end") } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1124,7 +1145,7 @@ if ($stage == "end") mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1447,6 +1468,15 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[1]; $dialed_label =$row[2]; } + else + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); + fclose($fp); + } + } $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/agc_el/manager_send.php b/LANG_www/agc_el/manager_send.php index 760ad109..6e0cb014 100644 --- a/LANG_www/agc_el/manager_send.php +++ b/LANG_www/agc_el/manager_send.php @@ -610,7 +610,7 @@ if ($ACTION=="RedirectXtraCX") if ($WeBRooTWritablE > 0) { $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); fclose($fp); } } diff --git a/LANG_www/agc_el/vdc_db_query.php b/LANG_www/agc_el/vdc_db_query.php index 4713aa7d..337b396b 100644 --- a/LANG_www/agc_el/vdc_db_query.php +++ b/LANG_www/agc_el/vdc_db_query.php @@ -128,10 +128,12 @@ # 70313-1052 - Allow pound signs(hash) in comments to pass through # 70319-1544 - Added agent disable update customer data function # 70322-1545 - Added sipsak display ability +# 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns +# 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records # -$version = '2.0.55'; -$build = '70322-1545'; +$version = '2.0.57'; +$build = '70424-1100'; require("dbconnect.php"); @@ -881,12 +883,12 @@ if ($stage == "end") { if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; } else { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_log table $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; } $rslt=mysql_query($stmt, $link); @@ -902,6 +904,24 @@ if ($stage == "end") { $length_in_sec = 0; } + if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + { + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log + $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $start_epoch =$row[0]; + $length_in_sec = ($StarTtime - $start_epoch); + } + else + { + $length_in_sec = 0; + } + } } else {$length_in_sec = ($StarTtime - $start_epoch);} @@ -1059,11 +1079,12 @@ if ($stage == "end") } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1124,7 +1145,7 @@ if ($stage == "end") mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1447,6 +1468,15 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[1]; $dialed_label =$row[2]; } + else + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); + fclose($fp); + } + } $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/agc_en/manager_send.php b/LANG_www/agc_en/manager_send.php index 10aa003d..a82cc03f 100644 --- a/LANG_www/agc_en/manager_send.php +++ b/LANG_www/agc_en/manager_send.php @@ -610,7 +610,7 @@ if ($ACTION=="RedirectXtraCX") if ($WeBRooTWritablE > 0) { $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); fclose($fp); } } diff --git a/LANG_www/agc_en/vdc_db_query.php b/LANG_www/agc_en/vdc_db_query.php index 801dff0d..7d75cb1a 100644 --- a/LANG_www/agc_en/vdc_db_query.php +++ b/LANG_www/agc_en/vdc_db_query.php @@ -128,10 +128,12 @@ # 70313-1052 - Allow pound signs(hash) in comments to pass through # 70319-1544 - Added agent disable update customer data function # 70322-1545 - Added sipsak display ability +# 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns +# 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records # -$version = '2.0.55'; -$build = '70322-1545'; +$version = '2.0.57'; +$build = '70424-1100'; require("dbconnect.php"); @@ -881,12 +883,12 @@ if ($stage == "end") { if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; } else { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_log table $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; } $rslt=mysql_query($stmt, $link); @@ -902,6 +904,24 @@ if ($stage == "end") { $length_in_sec = 0; } + if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + { + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log + $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $start_epoch =$row[0]; + $length_in_sec = ($StarTtime - $start_epoch); + } + else + { + $length_in_sec = 0; + } + } } else {$length_in_sec = ($StarTtime - $start_epoch);} @@ -1059,11 +1079,12 @@ if ($stage == "end") } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1124,7 +1145,7 @@ if ($stage == "end") mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1447,6 +1468,15 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[1]; $dialed_label =$row[2]; } + else + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); + fclose($fp); + } + } $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/agc_es/manager_send.php b/LANG_www/agc_es/manager_send.php index b8154a10..e28853d3 100644 --- a/LANG_www/agc_es/manager_send.php +++ b/LANG_www/agc_es/manager_send.php @@ -610,7 +610,7 @@ if ($ACTION=="RedirectXtraCX") if ($WeBRooTWritablE > 0) { $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); fclose($fp); } } diff --git a/LANG_www/agc_es/vdc_db_query.php b/LANG_www/agc_es/vdc_db_query.php index 87210adc..62acf94f 100644 --- a/LANG_www/agc_es/vdc_db_query.php +++ b/LANG_www/agc_es/vdc_db_query.php @@ -128,10 +128,12 @@ # 70313-1052 - Allow pound signs(hash) in comments to pass through # 70319-1544 - Added agent disable update customer data function # 70322-1545 - Added sipsak display ability +# 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns +# 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records # -$version = '2.0.55'; -$build = '70322-1545'; +$version = '2.0.57'; +$build = '70424-1100'; require("dbconnect.php"); @@ -881,12 +883,12 @@ if ($stage == "end") { if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; } else { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_log table $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; } $rslt=mysql_query($stmt, $link); @@ -902,6 +904,24 @@ if ($stage == "end") { $length_in_sec = 0; } + if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + { + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log + $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $start_epoch =$row[0]; + $length_in_sec = ($StarTtime - $start_epoch); + } + else + { + $length_in_sec = 0; + } + } } else {$length_in_sec = ($StarTtime - $start_epoch);} @@ -1059,11 +1079,12 @@ if ($stage == "end") } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1124,7 +1145,7 @@ if ($stage == "end") mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1447,6 +1468,15 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[1]; $dialed_label =$row[2]; } + else + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); + fclose($fp); + } + } $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/agc_fr/manager_send.php b/LANG_www/agc_fr/manager_send.php index 71146e7b..ef7c84b0 100644 --- a/LANG_www/agc_fr/manager_send.php +++ b/LANG_www/agc_fr/manager_send.php @@ -610,7 +610,7 @@ if ($ACTION=="RedirectXtraCX") if ($WeBRooTWritablE > 0) { $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); fclose($fp); } } diff --git a/LANG_www/agc_fr/vdc_db_query.php b/LANG_www/agc_fr/vdc_db_query.php index c03ea7d5..efb05a18 100644 --- a/LANG_www/agc_fr/vdc_db_query.php +++ b/LANG_www/agc_fr/vdc_db_query.php @@ -128,10 +128,12 @@ # 70313-1052 - Allow pound signs(hash) in comments to pass through # 70319-1544 - Added agent disable update customer data function # 70322-1545 - Added sipsak display ability +# 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns +# 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records # -$version = '2.0.55'; -$build = '70322-1545'; +$version = '2.0.57'; +$build = '70424-1100'; require("dbconnect.php"); @@ -881,12 +883,12 @@ if ($stage == "end") { if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; } else { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_log table $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; } $rslt=mysql_query($stmt, $link); @@ -902,6 +904,24 @@ if ($stage == "end") { $length_in_sec = 0; } + if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + { + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log + $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $start_epoch =$row[0]; + $length_in_sec = ($StarTtime - $start_epoch); + } + else + { + $length_in_sec = 0; + } + } } else {$length_in_sec = ($StarTtime - $start_epoch);} @@ -1059,11 +1079,12 @@ if ($stage == "end") } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1124,7 +1145,7 @@ if ($stage == "end") mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1447,6 +1468,15 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[1]; $dialed_label =$row[2]; } + else + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); + fclose($fp); + } + } $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/agc_it/manager_send.php b/LANG_www/agc_it/manager_send.php index 97dfd192..b690dcf2 100644 --- a/LANG_www/agc_it/manager_send.php +++ b/LANG_www/agc_it/manager_send.php @@ -610,7 +610,7 @@ if ($ACTION=="RedirectXtraCX") if ($WeBRooTWritablE > 0) { $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); fclose($fp); } } diff --git a/LANG_www/agc_it/vdc_db_query.php b/LANG_www/agc_it/vdc_db_query.php index 75ac5887..94664276 100644 --- a/LANG_www/agc_it/vdc_db_query.php +++ b/LANG_www/agc_it/vdc_db_query.php @@ -128,10 +128,12 @@ # 70313-1052 - Allow pound signs(hash) in comments to pass through # 70319-1544 - Added agent disable update customer data function # 70322-1545 - Added sipsak display ability +# 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns +# 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records # -$version = '2.0.55'; -$build = '70322-1545'; +$version = '2.0.57'; +$build = '70424-1100'; require("dbconnect.php"); @@ -881,12 +883,12 @@ if ($stage == "end") { if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; } else { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_log table $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; } $rslt=mysql_query($stmt, $link); @@ -902,6 +904,24 @@ if ($stage == "end") { $length_in_sec = 0; } + if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + { + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log + $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $start_epoch =$row[0]; + $length_in_sec = ($StarTtime - $start_epoch); + } + else + { + $length_in_sec = 0; + } + } } else {$length_in_sec = ($StarTtime - $start_epoch);} @@ -1059,11 +1079,12 @@ if ($stage == "end") } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1124,7 +1145,7 @@ if ($stage == "end") mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1447,6 +1468,15 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[1]; $dialed_label =$row[2]; } + else + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); + fclose($fp); + } + } $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/agc_pl/manager_send.php b/LANG_www/agc_pl/manager_send.php index 503a3315..0a46adf8 100644 --- a/LANG_www/agc_pl/manager_send.php +++ b/LANG_www/agc_pl/manager_send.php @@ -610,7 +610,7 @@ if ($ACTION=="RedirectXtraCX") if ($WeBRooTWritablE > 0) { $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); fclose($fp); } } diff --git a/LANG_www/agc_pl/vdc_db_query.php b/LANG_www/agc_pl/vdc_db_query.php index fcf7fb68..2dfe7949 100644 --- a/LANG_www/agc_pl/vdc_db_query.php +++ b/LANG_www/agc_pl/vdc_db_query.php @@ -128,10 +128,12 @@ # 70313-1052 - Allow pound signs(hash) in comments to pass through # 70319-1544 - Added agent disable update customer data function # 70322-1545 - Added sipsak display ability +# 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns +# 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records # -$version = '2.0.55'; -$build = '70322-1545'; +$version = '2.0.57'; +$build = '70424-1100'; require("dbconnect.php"); @@ -881,12 +883,12 @@ if ($stage == "end") { if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; } else { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_log table $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; } $rslt=mysql_query($stmt, $link); @@ -902,6 +904,24 @@ if ($stage == "end") { $length_in_sec = 0; } + if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + { + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log + $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $start_epoch =$row[0]; + $length_in_sec = ($StarTtime - $start_epoch); + } + else + { + $length_in_sec = 0; + } + } } else {$length_in_sec = ($StarTtime - $start_epoch);} @@ -1059,11 +1079,12 @@ if ($stage == "end") } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1124,7 +1145,7 @@ if ($stage == "end") mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1447,6 +1468,15 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[1]; $dialed_label =$row[2]; } + else + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); + fclose($fp); + } + } $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/agc_pt/manager_send.php b/LANG_www/agc_pt/manager_send.php index c4e0e5e8..5a254944 100644 --- a/LANG_www/agc_pt/manager_send.php +++ b/LANG_www/agc_pt/manager_send.php @@ -610,7 +610,7 @@ if ($ACTION=="RedirectXtraCX") if ($WeBRooTWritablE > 0) { $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); + fwrite ($fp, "$NOW_TIME|RDCXC|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|\n"); fclose($fp); } } diff --git a/LANG_www/agc_pt/vdc_db_query.php b/LANG_www/agc_pt/vdc_db_query.php index b758fd0e..03796a35 100644 --- a/LANG_www/agc_pt/vdc_db_query.php +++ b/LANG_www/agc_pt/vdc_db_query.php @@ -128,10 +128,12 @@ # 70313-1052 - Allow pound signs(hash) in comments to pass through # 70319-1544 - Added agent disable update customer data function # 70322-1545 - Added sipsak display ability +# 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns +# 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records # -$version = '2.0.55'; -$build = '70322-1545'; +$version = '2.0.57'; +$build = '70424-1100'; require("dbconnect.php"); @@ -881,12 +883,12 @@ if ($stage == "end") { if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; } else { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation + ##### look for the start epoch in the vicidial_log table $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; } $rslt=mysql_query($stmt, $link); @@ -902,6 +904,24 @@ if ($stage == "end") { $length_in_sec = 0; } + if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + { + ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log + $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $VM_mancall_ct = mysql_num_rows($rslt); + if ($VM_mancall_ct > 0) + { + $row=mysql_fetch_row($rslt); + $start_epoch =$row[0]; + $length_in_sec = ($StarTtime - $start_epoch); + } + else + { + $length_in_sec = 0; + } + } } else {$length_in_sec = ($StarTtime - $start_epoch);} @@ -1059,11 +1079,12 @@ if ($stage == "end") } ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1124,7 +1145,7 @@ if ($stage == "end") mysql_close($linkB); } - $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id';"; + $stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1447,6 +1468,15 @@ if ($ACTION == 'VDADcheckINCOMING') $dialed_number =$row[1]; $dialed_label =$row[2]; } + else + { + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|\n"); + fclose($fp); + } + } $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/vicidial/AST_VDADstats.php b/LANG_www/vicidial/AST_VDADstats.php index b26e245f..f747843b 100644 --- a/LANG_www/vicidial/AST_VDADstats.php +++ b/LANG_www/vicidial/AST_VDADstats.php @@ -281,6 +281,10 @@ echo "+-------------------------------+------------+\n"; ############################## ######### USER STATS +if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $campaign_id)) + {$vicidial_log = 'vicidial_closer_log';} +else + {$vicidial_log = 'vicidial_log';} $TOTagents=0; $TOTcalls=0; $TOTtime=0; @@ -292,7 +296,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| AGENT | CALLS | TIME M | AVRG M |\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 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;"; +$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 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and $vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and $vicidial_log.user=vicidial_users.user group by $vicidial_log.user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/vicidial/AST_server_performance.php b/LANG_www/vicidial/AST_server_performance.php index 8a3b6529..b5c39ba5 100644 --- a/LANG_www/vicidial/AST_server_performance.php +++ b/LANG_www/vicidial/AST_server_performance.php @@ -1,12 +1,14 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # CHANGES # # 60619-1732 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page +# 70417-1106 - Changed time frame to be definable per time range on a single day +# - Fixed vertical scaling issues # require("dbconnect.php"); @@ -16,10 +18,12 @@ $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["begin_query_time"])) {$begin_query_time=$_GET["begin_query_time"];} + elseif (isset($_POST["begin_query_time"])) {$begin_query_time=$_POST["begin_query_time"];} +if (isset($_GET["end_query_time"])) {$end_query_time=$_GET["end_query_time"];} + elseif (isset($_POST["end_query_time"])) {$end_query_time=$_POST["end_query_time"];} if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["shift"])) {$shift=$_GET["shift"];} - elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -51,6 +55,8 @@ $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($begin_query_time)) {$begin_query_time = '09:00:00';} +if (!isset($end_query_time)) {$end_query_time = '15:30:00';} if (!isset($group)) {$group = '';} $stmt="select server_ip from servers;"; @@ -81,8 +87,10 @@ while ($i < $servers_to_print) echo "\n"; echo "VICIDIAL: Server Performance\n"; echo "
\n"; -echo "\n"; -echo "   \n"; +echo "Time: \n"; +echo "to \n"; +echo "Server: \n"; else {echo "\n";} $o++; } -echo "\n"; -echo "\n"; +echo " \n"; echo "\n"; echo "             REPORTS \n"; echo "
\n\n"; @@ -105,46 +109,35 @@ echo "
\n";
 if (!$group)
 {
 echo "\n";
-echo "PLEASE SELECT A SERVER AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
+echo "PLEASE SELECT A SERVER, DATE AND TIME RANGE ABOVE AND CLICK SUBMIT\n";
 }
 
 else
 {
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:30:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:55:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:30:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:30:00";   
-	$time_END = "23:55:00";
-	}
+
+$query_date_BEGIN = "$query_date $begin_query_time";   
+$query_date_END = "$query_date $end_query_time";
+$time_BEGIN = "$begin_query_time";   
+$time_END = "$end_query_time";
 
 echo "VICIDIAL: Server Performance                             $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- TOTALS, PEAKS and AVERAGES\n";
 
-$stmt="select sysload from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by sysload desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$HIGHload =	sprintf("%10s", $row[0]);
-$HIGHmulti = intval($HIGHload / 100);
-#$HIGHmulti = ($HIGHload / 100);
-
-$stmt="select AVG(sysload),AVG(channels_total) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
+$stmt="select AVG(sysload),AVG(channels_total),MAX(sysload),MAX(channels_total),MAX(processes) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
 $AVGload =	sprintf("%10s", $row[0]);
 $AVGchannels =	sprintf("%10s", $row[1]);
+$HIGHload =	$row[2];
+	$HIGHmulti = intval($HIGHload / 100);
+$HIGHchannels =	$row[3];
+$HIGHprocesses =$row[4];
+if ($row[2] > $row[3]) {$HIGHlimit = $row[2];}
+else {$HIGHlimit = $row[3];}
+if ($HIGHlimit < $row[4]) {$HIGHlimit = $row[4];}
 
 $stmt="select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
 $rslt=mysql_query($stmt, $link);
@@ -154,26 +147,18 @@ $AVGcpuUSER =	sprintf("%10s", $row[0]);
 $AVGcpuSYSTEM =	sprintf("%10s", $row[1]);
 $AVGcpuIDLE =	sprintf("%10s", $row[2]);
 
-$stmt="select usedram from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by usedram desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$USEDram =	sprintf("%10s", $row[0]);
-
-$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$OFFHOOKtime =	sprintf("%10s", $row[1]);
+#	$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
+#	$rslt=mysql_query($stmt, $link);
+#	if ($DB) {echo "$stmt\n";}
+#	$row=mysql_fetch_row($rslt);
+#	$TOTALcalls =	sprintf("%10s", $row[0]);
+#	$OFFHOOKtime =	sprintf("%10s", $row[1]);
 
 
 echo "Total Calls in/out on this server:        $TOTALcalls\n";
 echo "Total Off-Hook time on this server (min): $OFFHOOKtime\n";
-echo "Average channels in use for server:       $AVGchannels\n";
-echo "Average load for server:                  $AVGload\n";
-echo "Peak load for server:                     $HIGHload\n";
-#echo "Peak used memory for server (in MB):      $USEDram\n";
+echo "Average/Peak channels in use for server:  $AVGchannels / $HIGHchannels\n";
+echo "Average/Peak load for server:             $AVGload / $HIGHload\n";
 echo "Average USER process cpu percentage:      $AVGcpuUSER %\n";
 echo "Average SYSTEM process cpu percentage:    $AVGcpuSYSTEM %\n";
 echo "Average IDLE process cpu percentage:      $AVGcpuIDLE %\n";
@@ -214,7 +199,17 @@ fclose($DATfp);
 
 $rows_to_max = ($rows_to_print + 100);
 
+print "rows: $i\n";
 
+$time_scale_abb = '5 minutes';
+$time_scale_tick = '1 minute';
+if ($i > 1000) {$time_scale_abb = '10 minutes';   $time_scale_tick = '2 minutes';}
+if ($i > 2000) {$time_scale_abb = '20 minutes';   $time_scale_tick = '4 minutes';}
+if ($i > 3000) {$time_scale_abb = '30 minutes';   $time_scale_tick = '5 minutes';}
+if ($i > 4000) {$time_scale_abb = '40 minutes';   $time_scale_tick = '10 minutes';}
+if ($i > 5000) {$time_scale_abb = '60 minutes';   $time_scale_tick = '15 minutes';}
+if ($i > 6000) {$time_scale_abb = '90 minutes';   $time_scale_tick = '15 minutes';}
+if ($i > 7000) {$time_scale_abb = '120 minutes';   $time_scale_tick = '30 minutes';}
 
 $HTMcontent  = '';
 $HTMcontent .= "#proc page\n";
@@ -232,11 +227,11 @@ $HTMcontent .= "titledetails: size=14  align=C\n";
 $HTMcontent .= "rectangle: 1 1 14 7\n";
 $HTMcontent .= "xscaletype: time hh:mm:ss\n";
 $HTMcontent .= "xrange: $time_BEGIN $time_END\n";
-$HTMcontent .= "yrange: 0 $HIGHload\n";
+$HTMcontent .= "yrange: 0 $HIGHlimit\n";
 $HTMcontent .= "\n";
 $HTMcontent .= "#proc xaxis\n";
-$HTMcontent .= "stubs: inc 30 minutes\n";
-$HTMcontent .= "minorticinc: 5 minutes\n";
+$HTMcontent .= "stubs: inc $time_scale_abb\n";
+$HTMcontent .= "minorticinc: $time_scale_tick\n";
 $HTMcontent .= "stubformat: hh:mm:ssa\n";
 $HTMcontent .= "\n";
 $HTMcontent .= "#proc yaxis\n";
diff --git a/LANG_www/vicidial/admin_modify_lead.php b/LANG_www/vicidial/admin_modify_lead.php
index fd51a12b..9a658ec3 100644
--- a/LANG_www/vicidial/admin_modify_lead.php
+++ b/LANG_www/vicidial/admin_modify_lead.php
@@ -108,6 +108,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 # 61130-1639 - Added recording_log lookup and list for this lead_id
 # 61201-1136 - Added recording_log user(TSR) display and link
 # 70305-1133 - Changed to default CHECKED modify logs upon status change
+# 70424-1128 - Added campaign-specific statuses, reformatted recordings list
 #
 
 $STARTtime = date("U");
@@ -274,6 +275,36 @@ else
 	if ($lead_count > 0)
 	{
 
+	$stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;";
+	$rslt=mysql_query($stmt, $link);
+	$logs_to_print = mysql_num_rows($rslt);
+
+	$u=0;
+	$call_log = '';
+	$log_campaign = '';
+	while ($logs_to_print > $u) 
+		{
+		$row=mysql_fetch_row($rslt);
+		if (strlen($log_campaign)<1) {$log_campaign = $row[3];}
+		if (eregi("1$|3$|5$|7$|9$", $u))
+			{$bgcolor='bgcolor="#B9CBFD"';} 
+		else
+			{$bgcolor='bgcolor="#9BB9FB"';}
+
+			$u++;
+			$call_log .= "";
+			$call_log .= "$u";
+			$call_log .= "$row[4]";
+			$call_log .= " $row[7]\n";
+			$call_log .= " $row[8]\n";
+			$call_log .= " $row[11] \n";
+			$call_log .= " $row[3] \n";
+			$call_log .= " $row[2] \n";
+			$call_log .= " $row[1] \n";
+
+		}
+
+
 		$stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'";
 		$rslt=mysql_query($stmt, $link);
 		if ($DB) {echo "$stmt\n";}
@@ -349,15 +380,32 @@ else
 				while ($statuses_to_print > $o) 
 				{
 					$rowx=mysql_fetch_row($rslt);
-					if ($dispo == "$rowx[0]")
+					if ( (strlen($dispo) ==  strlen($rowx[0])) and (eregi($dispo,$rowx[0])) )
 						{$statuses_list .= "\n"; $DS++;}
 					else
 						{$statuses_list .= "\n";}
 					$o++;
 				}
+
+				$stmt="SELECT * from vicidial_campaign_statuses where selectable='Y' and campaign_id='$log_campaign' order by status";
+				$rslt=mysql_query($stmt, $link);
+				$CAMPstatuses_to_print = mysql_num_rows($rslt);
+
+				$o=0;
+				while ($CAMPstatuses_to_print > $o) 
+				{
+					$rowx=mysql_fetch_row($rslt);
+					if ( (strlen($dispo) ==  strlen($rowx[0])) and (eregi($dispo,$rowx[0])) )
+						{$statuses_list .= "\n"; $DS++;}
+					else
+						{$statuses_list .= "\n";}
+					$o++;
+				}
+
+
 				if ($DS < 1) {$statuses_list .= "\n";}
 			echo "$statuses_list";
-			echo "\n";
+			echo " (with $log_campaign statuses)\n";
 
 
 		echo "Modify agent and vicidial logs \n";
@@ -433,38 +481,19 @@ echo "CALLS TO THIS LEAD:\n";
 echo "\n";
 echo "\n";
 
-	$stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;";
-	$rslt=mysql_query($stmt, $link);
-	$logs_to_print = mysql_num_rows($rslt);
 
-	$u=0;
-	while ($logs_to_print > $u) 
-		{
-		$row=mysql_fetch_row($rslt);
-		if (eregi("1$|3$|5$|7$|9$", $u))
-			{$bgcolor='bgcolor="#B9CBFD"';} 
-		else
-			{$bgcolor='bgcolor="#9BB9FB"';}
+echo "$call_log\n";
+
+
 
-			$u++;
-			echo "";
-			echo "";
-			echo "";
-			echo "\n";
-			echo "\n";
-			echo "\n";
-			echo "\n";
-			echo "\n";
-			echo "\n";
 
-		}
 
 
 echo "
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
\n"; echo "

\n"; echo "RECORDINGS FOR THIS LEAD:\n"; -echo "\n"; +echo "
\n"; echo "\n"; $stmt="select * from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; @@ -484,10 +513,10 @@ echo ""; echo ""; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo ""; echo "\n"; diff --git a/LANG_www/vicidial/listloader.php b/LANG_www/vicidial/listloader.php index 272d94a7..b6e8ae5e 100644 --- a/LANG_www/vicidial/listloader.php +++ b/LANG_www/vicidial/listloader.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell,Joe Johnson LICENSE: GPLv2 # # AST Web GUI lead loader from formatted file # @@ -16,12 +16,13 @@ # 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1046 - added postal code GMT lookup and duplicate check options # 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. # $version = '2.0.3'; -$build = '70205-1703'; +$build = '770417-1059'; header ("Content-type: text/html; charset=utf-8"); @@ -260,6 +261,8 @@ if ($leadfile and filesize($LF_path)<=8388608) { $called_since_last_reset='N'; $phone_list .= "$phone_number$US$list_id|"; + if (strlen($phone_code)<1) {$phone_code = '1';} + $postalgmt_found=0; if ( (eregi("POSTAL",$postalgmt)) && (strlen($postal_code)>4) ) { @@ -872,8 +875,6 @@ if ($leadfile and filesize($LF_path)<=8388608) { $AC_processed++; } - - if (strlen($phone_code)<1) {$phone_code = '1';} if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; diff --git a/LANG_www/vicidial/listloader.pl b/LANG_www/vicidial/listloader.pl index f93b4520..f8164666 100644 --- a/LANG_www/vicidial/listloader.pl +++ b/LANG_www/vicidial/listloader.pl @@ -16,6 +16,7 @@ # 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1215 - added postal code GMT lookup and duplicate check options # 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # ### begin parsing run-time options ### @@ -248,6 +249,8 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { { $phone_list .= "$phone_number$US$list_id|"; $postalgmt_found=0; + if (length($phone_code)<1) {$phone_code = '1';} + if ( ($postalgmt > 0) && (length($postal_code)>4) ) { if ($phone_code =~ /^1$/) @@ -435,7 +438,6 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $AC_processed++; } - if (length($phone_code)<1) {$phone_code = '1';} if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; diff --git a/LANG_www/vicidial/listloader_super.pl b/LANG_www/vicidial/listloader_super.pl index bbf353ce..adf138ee 100644 --- a/LANG_www/vicidial/listloader_super.pl +++ b/LANG_www/vicidial/listloader_super.pl @@ -15,6 +15,7 @@ # 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1207 - added postal code GMT lookup and duplicate check options # 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # ### begin parsing run-time options ### @@ -250,6 +251,8 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { { $phone_list .= "$phone_number$US$list_id|"; $postalgmt_found=0; + if (length($phone_code)<1) {$phone_code = '1';} + else {print "PHONE_CODE|$phone_code|\n";} if ( ($postalgmt > 0) && (length($postal_code)>4) ) { if ($phone_code =~ /^1$/) @@ -437,7 +440,6 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $AC_processed++; } - if (length($phone_code)<1) {$phone_code = '1';} if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; diff --git a/LANG_www/vicidial/new_listloader_superL.php b/LANG_www/vicidial/new_listloader_superL.php index deecb128..5473ce6b 100644 --- a/LANG_www/vicidial/new_listloader_superL.php +++ b/LANG_www/vicidial/new_listloader_superL.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell,Joe Johnson LICENSE: GPLv2 # # AST GUI lead loader from formatted file # @@ -17,11 +17,12 @@ # 60906-1100 - added filter of non-digits in alt_phone field # 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '2.0.2'; -$build = '61128-1149'; +$version = '2.0.3'; +$build = '70417-1059'; require("dbconnect.php"); @@ -417,6 +418,7 @@ function ParseFileName() { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -551,6 +553,7 @@ function ParseFileName() { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -702,6 +705,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -853,6 +857,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; diff --git a/LANG_www/vicidial_de/AST_VDADstats.php b/LANG_www/vicidial_de/AST_VDADstats.php index 52374695..9c3adca8 100644 --- a/LANG_www/vicidial_de/AST_VDADstats.php +++ b/LANG_www/vicidial_de/AST_VDADstats.php @@ -281,6 +281,10 @@ echo "+-------------------------------+------------+\n"; ############################## ######### USER STATS +if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $campaign_id)) + {$vicidial_log = 'vicidial_closer_log';} +else + {$vicidial_log = 'vicidial_log';} $TOTagents=0; $TOTcalls=0; $TOTtime=0; @@ -292,7 +296,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| MITTEL | CALLS | TIME M | AVRG M |\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 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;"; +$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 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and $vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and $vicidial_log.user=vicidial_users.user group by $vicidial_log.user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/vicidial_de/AST_agent_performance.php b/LANG_www/vicidial_de/AST_agent_performance.php index 7947c17f..3915fd31 100644 --- a/LANG_www/vicidial_de/AST_agent_performance.php +++ b/LANG_www/vicidial_de/AST_agent_performance.php @@ -7,6 +7,7 @@ # # 60619-1711 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page +# 70201-1203 - Added non_latin UTF8 output code, widened USER ID to 8 chars # require("dbconnect.php"); @@ -28,8 +29,9 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} $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;"; + $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]; @@ -49,6 +51,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} $stmt="select campaign_id from vicidial_campaigns;"; +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -91,7 +94,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; -echo "           ÄNDERN Sie | REPORTS \n"; +echo "           ÄNDERN Sie | REPORTS \n"; echo "\n\n"; echo "
\n";
@@ -126,11 +129,12 @@ echo "VICIDIAL: Agent Performance                             $NOW_TIME\n";
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- AGENTS Details -------------\n\n";
 
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+echo "| USER NAME       | ID       | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
 
 $stmt="select count(*) as calls,sum(length_in_sec) as talk,full_name,vicidial_users.user,avg(length_in_sec) from vicidial_users,vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and vicidial_users.user=vicidial_log.user and campaign_id='" . mysql_real_escape_string($group) . "' group by full_name order by calls desc limit 1000;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $rows_to_print = mysql_num_rows($rslt);
@@ -141,8 +145,25 @@ while ($i < $rows_to_print)
 	$TOTcalls=($TOTcalls + $row[0]);
 	$TOTtotTALK=($TOTtotTALK + $row[1]);
 	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
+
+	if ($non_latin < 1)
+	{
+   	 $full_name[$i]=	sprintf("%-15s", $row[2]); 
+	 while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
+
+	 $user[$i] =		sprintf("%-6s", $row[3]);
+        while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);}
+       }
+	else
+	{	
+        $full_name[$i]=	sprintf("%-45s", $row[2]); 
+	 while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');}
+
+ 	 $user[$i] =		sprintf("%-18s", $row[3]);
+	 while(mb_strlen($user[$i],'utf-8')>6) {$user[$i] = mb_substr("$user[$i]", 0, -1,'utf-8');}
+	}
+
+	$user[$i] =		sprintf("%-8s", $row[3]);
 	$USERtotTALK =	$row[1];
 	$USERavgTALK =	$row[4];
 
@@ -173,6 +194,10 @@ while($k < $i)
 	{
 	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; 
 	$stmt="select count(*),status from vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
+	if ($non_latin > 0)
+	{
+	$rslt=mysql_query("SET NAMES 'UTF8'");
+	}
 	$rslt=mysql_query($stmt, $link);
 	if ($DB) {echo "$stmt\n";}
 	$rows_to_print = mysql_num_rows($rslt);
@@ -217,9 +242,9 @@ while($k < $i)
 	$TOT_NI = sprintf("%-5s", $TOT_NI);
 	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
 
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+echo "|  TOTALS                    | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
 
 echo "\n";
 
diff --git a/LANG_www/vicidial_de/AST_agent_performance_detail.php b/LANG_www/vicidial_de/AST_agent_performance_detail.php
index 02a7c24a..658dcba3 100644
--- a/LANG_www/vicidial_de/AST_agent_performance_detail.php
+++ b/LANG_www/vicidial_de/AST_agent_performance_detail.php
@@ -7,6 +7,8 @@
 #
 # 60619-1712 - Added variable filtering to eliminate SQL injection attack threat
 #            - Added required user/pass to gain access to this page
+# 70118-1705 - Added user_group filtering option
+# 70201-1207 - Added non_latin UTF8 output code, widened USER ID to 8 chars
 #
 
 require("dbconnect.php");
@@ -15,21 +17,26 @@ $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"];}
+	elseif (isset($_POST["query_date"]))	{$query_date=$_POST["query_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["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
+	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
 if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
-	elseif (isset($_POST["SUBMIT"]))		{$SUBMIT=$_POST["SUBMIT"];}
+	elseif (isset($_POST["SUBMIT"]))	{$SUBMIT=$_POST["SUBMIT"];}
+
+if (strlen($shift)<2) {$shift='ALL';}
 
 $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;";
+	$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];
@@ -49,6 +56,7 @@ if (!isset($group)) {$group = '';}
 if (!isset($query_date)) {$query_date = $NOW_DATE;}
 
 $stmt="select campaign_id from vicidial_campaigns;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $campaigns_to_print = mysql_num_rows($rslt);
@@ -59,6 +67,18 @@ while ($i < $campaigns_to_print)
 	$groups[$i] =$row[0];
 	$i++;
 	}
+$stmt="select user_group from vicidial_user_groups;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+$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++;
+	}
 ?>
 
 
@@ -86,12 +106,25 @@ echo "\n";
+echo "\n";
 echo "\n";
 echo "\n";
-echo "           ÄNDERN Sie | REPORTS \n";
+echo "           ÄNDERN Sie | REPORTS \n";
 echo "\n\n";
 
 echo "
\n";
@@ -101,7 +134,7 @@ if (!$group)
 {
 echo "\n";
 echo "PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
+echo " NOTE: stats taken from shift specified\n";
 }
 
 else
@@ -120,17 +153,28 @@ if ($shift == 'PM')
 	$time_BEGIN = "15:15:00";   
 	$time_END = "23:15:00";
 	}
+if ($shift == 'ALL') 
+	{
+	$query_date_BEGIN = "$query_date 00:00:00";   
+	$query_date_END = "$query_date 23:59:59";
+	$time_BEGIN = "00:00:00";   
+	$time_END = "23:59:59";
+	}
+
+if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
+else {$ugSQL='';}
 
 echo "VICIDIAL: Agent Performance Detail                        $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- AGENTS Details -------------\n\n";
 
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TIME   | PAUSE  | PAUSAVG| WAIT   | WAITAVG| TALK   | TALKAVG| DISPO  | DISPAVG| A    | B    | DC   | DNC  | N    | NI   | CB   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
+echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
+echo "| USER NAME       | ID       | CALLS  | TIME   | PAUSE  | PAUSAVG| WAIT   | WAITAVG| TALK   | TALKAVG| DISPO  | DISPAVG| A    | B    | DC   | DNC  | N    | NI   | CB   | SALE |\n";
+echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
 
-$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 group by full_name order by calls desc limit 1000;";
+$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 $ugSQL group by full_name order by calls desc limit 1000;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $rows_to_print = mysql_num_rows($rslt);
@@ -145,8 +189,25 @@ while ($i < $rows_to_print)
 	$TOTtotPAUSE=($TOTtotPAUSE + $row[5]);
 	$TOTtotDISPO=($TOTtotDISPO + $row[9]);
 	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
+
+	if ($non_latin < 1)
+	{
+   	 $full_name[$i]=	sprintf("%-15s", $row[2]); 
+	 while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
+
+	 $user[$i] =		sprintf("%-6s", $row[3]);
+        while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);}
+       }
+	else
+	{	
+        $full_name[$i]=	sprintf("%-45s", $row[2]); 
+	 while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');}
+
+ 	 $user[$i] =		sprintf("%-18s", $row[3]);
+	 while(mb_strlen($user[$i],'utf-8')>6) {$user[$i] = mb_substr("$user[$i]", 0, -1,'utf-8');}
+	}
+
+	$user[$i] =		sprintf("%-8s", $row[3]);
 	$USERtime =	($row[1] + $row[5] + $row[7] + $row[9]);
 	$USERtotTALK =	$row[1];
 	$USERavgTALK =	$row[4];
@@ -255,6 +316,7 @@ while($k < $i)
 	{
 	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; $ctCB[$k]="0   "; 
 	$stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
+	if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 	$rslt=mysql_query($stmt, $link);
 	if ($DB) {echo "$stmt\n";}
 	$rows_to_print = mysql_num_rows($rslt);
@@ -390,10 +452,11 @@ while($k < $i)
 	$TOT_NI = sprintf("%-5s", $TOT_NI);
 	$TOT_CB = sprintf("%-5s", $TOT_CB);
 	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
+	$TOT_AGENTS = sprintf("%-4s", $k);
 
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n";
-echo "+--------------------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
+echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\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 | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n";
+echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
 
 echo "\n";
 
diff --git a/LANG_www/vicidial_de/AST_server_performance.php b/LANG_www/vicidial_de/AST_server_performance.php
index 399fe619..e7f63add 100644
--- a/LANG_www/vicidial_de/AST_server_performance.php
+++ b/LANG_www/vicidial_de/AST_server_performance.php
@@ -1,12 +1,14 @@
     LICENSE: GPLv2
+# Copyright (C) 2007  Matt Florell     LICENSE: GPLv2
 #
 # CHANGES
 #
 # 60619-1732 - Added variable filtering to eliminate SQL injection attack threat
 #            - Added required user/pass to gain access to this page
+# 70417-1106 - Changed time frame to be definable per time range on a single day
+#            - Fixed vertical scaling issues
 #
 
 require("dbconnect.php");
@@ -16,10 +18,12 @@ $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["begin_query_time"]))			{$begin_query_time=$_GET["begin_query_time"];}
+	elseif (isset($_POST["begin_query_time"]))	{$begin_query_time=$_POST["begin_query_time"];}
+if (isset($_GET["end_query_time"]))				{$end_query_time=$_GET["end_query_time"];}
+	elseif (isset($_POST["end_query_time"]))	{$end_query_time=$_POST["end_query_time"];}
 if (isset($_GET["group"]))				{$group=$_GET["group"];}
 	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["shift"]))				{$shift=$_GET["shift"];}
-	elseif (isset($_POST["shift"]))		{$shift=$_POST["shift"];}
 if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
 	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
 if (isset($_GET["SUBMIT"]))				{$SUBMIT=$_GET["SUBMIT"];}
@@ -51,6 +55,8 @@ $NOW_TIME = date("Y-m-d H:i:s");
 $STARTtime = date("U");
 
 if (!isset($query_date)) {$query_date = $NOW_DATE;}
+if (!isset($begin_query_time)) {$begin_query_time = '09:00:00';}
+if (!isset($end_query_time)) {$end_query_time = '15:30:00';}
 if (!isset($group)) {$group = '';}
 
 $stmt="select server_ip from servers;";
@@ -81,8 +87,10 @@ while ($i < $servers_to_print)
 echo "\n";
 echo "VICIDIAL: Server Performance\n";
 echo "
\n"; -echo "\n"; -echo "   \n"; +echo "Time: \n"; +echo "to \n"; +echo "Server: \n"; else {echo "\n";} $o++; } -echo "\n"; -echo "\n"; +echo " \n"; echo "\n"; echo "             REPORTS \n"; echo "\n\n"; @@ -105,46 +109,35 @@ echo "
\n";
 if (!$group)
 {
 echo "\n";
-echo "PLEASE SELECT A BEDIENERAND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
+echo "PLEASE SELECT A SERVER, DATE AND TIME RANGE ABOVE AND CLICK SUBMIT\n";
 }
 
 else
 {
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:30:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:55:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:30:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:30:00";   
-	$time_END = "23:55:00";
-	}
+
+$query_date_BEGIN = "$query_date $begin_query_time";   
+$query_date_END = "$query_date $end_query_time";
+$time_BEGIN = "$begin_query_time";   
+$time_END = "$end_query_time";
 
 echo "VICIDIAL: Server Performance                             $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- TOTALS, PEAKS and AVERAGES\n";
 
-$stmt="select sysload from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by sysload desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$HIGHload =	sprintf("%10s", $row[0]);
-$HIGHmulti = intval($HIGHload / 100);
-#$HIGHmulti = ($HIGHload / 100);
-
-$stmt="select AVG(sysload),AVG(channels_total) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
+$stmt="select AVG(sysload),AVG(channels_total),MAX(sysload),MAX(channels_total),MAX(processes) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
 $AVGload =	sprintf("%10s", $row[0]);
 $AVGchannels =	sprintf("%10s", $row[1]);
+$HIGHload =	$row[2];
+	$HIGHmulti = intval($HIGHload / 100);
+$HIGHchannels =	$row[3];
+$HIGHprocesses =$row[4];
+if ($row[2] > $row[3]) {$HIGHlimit = $row[2];}
+else {$HIGHlimit = $row[3];}
+if ($HIGHlimit < $row[4]) {$HIGHlimit = $row[4];}
 
 $stmt="select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
 $rslt=mysql_query($stmt, $link);
@@ -154,26 +147,18 @@ $AVGcpuUSER =	sprintf("%10s", $row[0]);
 $AVGcpuSYSTEM =	sprintf("%10s", $row[1]);
 $AVGcpuIDLE =	sprintf("%10s", $row[2]);
 
-$stmt="select usedram from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by usedram desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$USEDram =	sprintf("%10s", $row[0]);
-
-$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$OFFHOOKtime =	sprintf("%10s", $row[1]);
+#	$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
+#	$rslt=mysql_query($stmt, $link);
+#	if ($DB) {echo "$stmt\n";}
+#	$row=mysql_fetch_row($rslt);
+#	$TOTALcalls =	sprintf("%10s", $row[0]);
+#	$OFFHOOKtime =	sprintf("%10s", $row[1]);
 
 
 echo "Total Calls in/out on this server:        $TOTALcalls\n";
 echo "Total Off-Hook time on this server (min): $OFFHOOKtime\n";
-echo "Average channels in use for server:       $AVGchannels\n";
-echo "Average load for server:                  $AVGload\n";
-echo "Peak load for server:                     $HIGHload\n";
-#echo "Peak used memory for server (in MB):      $USEDram\n";
+echo "Average/Peak channels in use for server:  $AVGchannels / $HIGHchannels\n";
+echo "Average/Peak load for server:             $AVGload / $HIGHload\n";
 echo "Average USER process cpu percentage:      $AVGcpuUSER %\n";
 echo "Average SYSTEM process cpu percentage:    $AVGcpuSYSTEM %\n";
 echo "Average IDLE process cpu percentage:      $AVGcpuIDLE %\n";
@@ -214,7 +199,17 @@ fclose($DATfp);
 
 $rows_to_max = ($rows_to_print + 100);
 
+print "rows: $i\n";
 
+$time_scale_abb = '5 minutes';
+$time_scale_tick = '1 minute';
+if ($i > 1000) {$time_scale_abb = '10 minutes';   $time_scale_tick = '2 minutes';}
+if ($i > 2000) {$time_scale_abb = '20 minutes';   $time_scale_tick = '4 minutes';}
+if ($i > 3000) {$time_scale_abb = '30 minutes';   $time_scale_tick = '5 minutes';}
+if ($i > 4000) {$time_scale_abb = '40 minutes';   $time_scale_tick = '10 minutes';}
+if ($i > 5000) {$time_scale_abb = '60 minutes';   $time_scale_tick = '15 minutes';}
+if ($i > 6000) {$time_scale_abb = '90 minutes';   $time_scale_tick = '15 minutes';}
+if ($i > 7000) {$time_scale_abb = '120 minutes';   $time_scale_tick = '30 minutes';}
 
 $HTMcontent  = '';
 $HTMcontent .= "#proc page\n";
@@ -232,11 +227,11 @@ $HTMcontent .= "titledetails: size=14  align=C\n";
 $HTMcontent .= "rectangle: 1 1 14 7\n";
 $HTMcontent .= "xscaletype: time hh:mm:ss\n";
 $HTMcontent .= "xrange: $time_BEGIN $time_END\n";
-$HTMcontent .= "yrange: 0 $HIGHload\n";
+$HTMcontent .= "yrange: 0 $HIGHlimit\n";
 $HTMcontent .= "\n";
 $HTMcontent .= "#proc xaxis\n";
-$HTMcontent .= "stubs: inc 30 minutes\n";
-$HTMcontent .= "minorticinc: 5 minutes\n";
+$HTMcontent .= "stubs: inc $time_scale_abb\n";
+$HTMcontent .= "minorticinc: $time_scale_tick\n";
 $HTMcontent .= "stubformat: hh:mm:ssa\n";
 $HTMcontent .= "\n";
 $HTMcontent .= "#proc yaxis\n";
diff --git a/LANG_www/vicidial_de/admin_modify_lead.php b/LANG_www/vicidial_de/admin_modify_lead.php
index 9c53c9e7..5205537f 100644
--- a/LANG_www/vicidial_de/admin_modify_lead.php
+++ b/LANG_www/vicidial_de/admin_modify_lead.php
@@ -107,6 +107,8 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 # 60619-1539 - Added variable filtering to eliminate SQL injection attack threat
 # 61130-1639 - Added recording_log lookup and list for this lead_id
 # 61201-1136 - Added recording_log user(TSR) display and link
+# 70305-1133 - Changed to default CHECKED modify logs upon status change
+# 70424-1128 - Added campaign-specific statuses, reformatted recordings list
 #
 
 $STARTtime = date("U");
@@ -273,6 +275,36 @@ else
 	if ($lead_count > 0)
 	{
 
+	$stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;";
+	$rslt=mysql_query($stmt, $link);
+	$logs_to_print = mysql_num_rows($rslt);
+
+	$u=0;
+	$call_log = '';
+	$log_campaign = '';
+	while ($logs_to_print > $u) 
+		{
+		$row=mysql_fetch_row($rslt);
+		if (strlen($log_campaign)<1) {$log_campaign = $row[3];}
+		if (eregi("1$|3$|5$|7$|9$", $u))
+			{$bgcolor='bgcolor="#B9CBFD"';} 
+		else
+			{$bgcolor='bgcolor="#9BB9FB"';}
+
+			$u++;
+			$call_log .= "
"; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + + } + + $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -348,15 +380,32 @@ else while ($statuses_to_print > $o) { $rowx=mysql_fetch_row($rslt); - if ($dispo == "$rowx[0]") + if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) {$statuses_list .= "\n"; $DS++;} else {$statuses_list .= "\n";} $o++; } + + $stmt="SELECT * from vicidial_campaign_statuses where selectable='Y' and campaign_id='$log_campaign' order by status"; + $rslt=mysql_query($stmt, $link); + $CAMPstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($CAMPstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + if ($DS < 1) {$statuses_list .= "\n";} echo "$statuses_list"; - echo "\n"; + echo " (with $log_campaign statuses)\n"; echo "\n"; @@ -432,38 +481,19 @@ echo "ANRUFE ZU DIESEM LEITUNG:\n"; echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
# LEAD"; echo "$u $row[12] $row[4] $row[4] $row[8] $row[0] $row[10] $row[0]   $row[10] $row[11] $row[13]
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
Modify agent and vicidial logs
\n"; echo "\n"; - $stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - $u=0; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} +echo "$call_log\n"; + + - $u++; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } echo "
# DATE/TIME LENGTH STATUS TSR KAMPAGNE LIST LEAD
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
\n"; echo "

\n"; echo "RECORDINGS FOR THIS LEAD:\n"; -echo "\n"; +echo "
\n"; echo "\n"; $stmt="select * from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; @@ -483,10 +513,10 @@ echo ""; echo ""; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo ""; echo "\n"; diff --git a/LANG_www/vicidial_de/listloader.php b/LANG_www/vicidial_de/listloader.php index 5552d889..5fee38ac 100644 --- a/LANG_www/vicidial_de/listloader.php +++ b/LANG_www/vicidial_de/listloader.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell,Joe Johnson LICENSE: GPLv2 # # AST Web GUI lead loader from formatted file # @@ -15,12 +15,14 @@ # 60906-1059 - added filter of non-digits in alt_phone field # 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1046 - added postal code GMT lookup and duplicate check options +# 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. # -$version = '2.0.2'; -$build = '61128-1046'; +$version = '2.0.3'; +$build = '770417-1059'; header ("Content-type: text/html; charset=utf-8"); @@ -259,6 +261,8 @@ if ($leadfile and filesize($LF_path)<=8388608) { $called_since_last_reset='N'; $phone_list .= "$phone_number$US$list_id|"; + if (strlen($phone_code)<1) {$phone_code = '1';} + $postalgmt_found=0; if ( (eregi("POSTAL",$postalgmt)) && (strlen($postal_code)>4) ) { @@ -871,7 +875,6 @@ if ($leadfile and filesize($LF_path)<=8388608) { $AC_processed++; } - if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; diff --git a/LANG_www/vicidial_de/listloader.pl b/LANG_www/vicidial_de/listloader.pl index b15bfbb8..f8164666 100644 --- a/LANG_www/vicidial_de/listloader.pl +++ b/LANG_www/vicidial_de/listloader.pl @@ -15,6 +15,8 @@ # 60906-1058 - added filter of non-digits in alt_phone field # 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1215 - added postal code GMT lookup and duplicate check options +# 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # ### begin parsing run-time options ### @@ -247,6 +249,8 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { { $phone_list .= "$phone_number$US$list_id|"; $postalgmt_found=0; + if (length($phone_code)<1) {$phone_code = '1';} + if ( ($postalgmt > 0) && (length($postal_code)>4) ) { if ($phone_code =~ /^1$/) @@ -454,7 +458,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } $total++; if ($total%100==0) { - print ""; + print ""; sleep(1); # flush(); } diff --git a/LANG_www/vicidial_de/listloader_super.pl b/LANG_www/vicidial_de/listloader_super.pl index 704e06b7..adf138ee 100644 --- a/LANG_www/vicidial_de/listloader_super.pl +++ b/LANG_www/vicidial_de/listloader_super.pl @@ -14,6 +14,8 @@ # 60906-1056 - added filter of non-digits in alt_phone field # 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1207 - added postal code GMT lookup and duplicate check options +# 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # ### begin parsing run-time options ### @@ -249,6 +251,8 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { { $phone_list .= "$phone_number$US$list_id|"; $postalgmt_found=0; + if (length($phone_code)<1) {$phone_code = '1';} + else {print "PHONE_CODE|$phone_code|\n";} if ( ($postalgmt > 0) && (length($postal_code)>4) ) { if ($phone_code =~ /^1$/) @@ -456,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } $total++; if ($total%100==0) { - print ""; + print ""; sleep(1); # flush(); } diff --git a/LANG_www/vicidial_de/new_listloader_superL.php b/LANG_www/vicidial_de/new_listloader_superL.php index e3ac5b64..52b1546c 100644 --- a/LANG_www/vicidial_de/new_listloader_superL.php +++ b/LANG_www/vicidial_de/new_listloader_superL.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell,Joe Johnson LICENSE: GPLv2 # # AST GUI lead loader from formatted file # @@ -17,11 +17,12 @@ # 60906-1100 - added filter of non-digits in alt_phone field # 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '2.0.2'; -$build = '61128-1149'; +$version = '2.0.3'; +$build = '70417-1059'; require("dbconnect.php"); @@ -417,6 +418,7 @@ function ParseFileName() { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -551,6 +553,7 @@ function ParseFileName() { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -702,6 +705,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -853,6 +857,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; diff --git a/LANG_www/vicidial_el/AST_VDADstats.php b/LANG_www/vicidial_el/AST_VDADstats.php index 6ccf69b1..9daaeed9 100644 --- a/LANG_www/vicidial_el/AST_VDADstats.php +++ b/LANG_www/vicidial_el/AST_VDADstats.php @@ -281,6 +281,10 @@ echo "+-------------------------------+------------+\n"; ############################## ######### USER STATS +if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $campaign_id)) + {$vicidial_log = 'vicidial_closer_log';} +else + {$vicidial_log = 'vicidial_log';} $TOTagents=0; $TOTcalls=0; $TOTtime=0; @@ -292,7 +296,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| ΧΕΙΡΙΣΤΗΣ | CALLS | TIME M | AVRG M |\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 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;"; +$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 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and $vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and $vicidial_log.user=vicidial_users.user group by $vicidial_log.user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/vicidial_el/AST_agent_performance.php b/LANG_www/vicidial_el/AST_agent_performance.php index 5ddd508c..0d3690c9 100644 --- a/LANG_www/vicidial_el/AST_agent_performance.php +++ b/LANG_www/vicidial_el/AST_agent_performance.php @@ -7,6 +7,7 @@ # # 60619-1711 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page +# 70201-1203 - Added non_latin UTF8 output code, widened USER ID to 8 chars # require("dbconnect.php"); @@ -28,8 +29,9 @@ if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET[" $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;"; + $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]; @@ -49,6 +51,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} $stmt="select campaign_id from vicidial_campaigns;"; +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -91,7 +94,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; -echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; +echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; echo "\n\n"; echo "
\n";
@@ -126,11 +129,12 @@ echo "VICIDIAL: Agent Performance                             $NOW_TIME\n";
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- AGENTS Details -------------\n\n";
 
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+echo "| USER NAME       | ID       | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
 
 $stmt="select count(*) as calls,sum(length_in_sec) as talk,full_name,vicidial_users.user,avg(length_in_sec) from vicidial_users,vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and vicidial_users.user=vicidial_log.user and campaign_id='" . mysql_real_escape_string($group) . "' group by full_name order by calls desc limit 1000;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $rows_to_print = mysql_num_rows($rslt);
@@ -141,8 +145,25 @@ while ($i < $rows_to_print)
 	$TOTcalls=($TOTcalls + $row[0]);
 	$TOTtotTALK=($TOTtotTALK + $row[1]);
 	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
+
+	if ($non_latin < 1)
+	{
+   	 $full_name[$i]=	sprintf("%-15s", $row[2]); 
+	 while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
+
+	 $user[$i] =		sprintf("%-6s", $row[3]);
+        while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);}
+       }
+	else
+	{	
+        $full_name[$i]=	sprintf("%-45s", $row[2]); 
+	 while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');}
+
+ 	 $user[$i] =		sprintf("%-18s", $row[3]);
+	 while(mb_strlen($user[$i],'utf-8')>6) {$user[$i] = mb_substr("$user[$i]", 0, -1,'utf-8');}
+	}
+
+	$user[$i] =		sprintf("%-8s", $row[3]);
 	$USERtotTALK =	$row[1];
 	$USERavgTALK =	$row[4];
 
@@ -173,6 +194,10 @@ while($k < $i)
 	{
 	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; 
 	$stmt="select count(*),status from vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
+	if ($non_latin > 0)
+	{
+	$rslt=mysql_query("SET NAMES 'UTF8'");
+	}
 	$rslt=mysql_query($stmt, $link);
 	if ($DB) {echo "$stmt\n";}
 	$rows_to_print = mysql_num_rows($rslt);
@@ -217,9 +242,9 @@ while($k < $i)
 	$TOT_NI = sprintf("%-5s", $TOT_NI);
 	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
 
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+echo "|  TOTALS                    | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
 
 echo "\n";
 
diff --git a/LANG_www/vicidial_el/AST_agent_performance_detail.php b/LANG_www/vicidial_el/AST_agent_performance_detail.php
index b342c85f..8021fdae 100644
--- a/LANG_www/vicidial_el/AST_agent_performance_detail.php
+++ b/LANG_www/vicidial_el/AST_agent_performance_detail.php
@@ -7,6 +7,8 @@
 #
 # 60619-1712 - Added variable filtering to eliminate SQL injection attack threat
 #            - Added required user/pass to gain access to this page
+# 70118-1705 - Added user_group filtering option
+# 70201-1207 - Added non_latin UTF8 output code, widened USER ID to 8 chars
 #
 
 require("dbconnect.php");
@@ -15,21 +17,26 @@ $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"];}
+	elseif (isset($_POST["query_date"]))	{$query_date=$_POST["query_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["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
+	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
 if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"]))				{$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];}
-	elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"]))		{$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];}
+	elseif (isset($_POST["ΕΠΙΒΕΒΑΙΩΣΗ"]))	{$ΕΠΙΒΕΒΑΙΩΣΗ=$_POST["ΕΠΙΒΕΒΑΙΩΣΗ"];}
+
+if (strlen($shift)<2) {$shift='ALL';}
 
 $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;";
+	$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];
@@ -49,6 +56,7 @@ if (!isset($group)) {$group = '';}
 if (!isset($query_date)) {$query_date = $NOW_DATE;}
 
 $stmt="select campaign_id from vicidial_campaigns;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $campaigns_to_print = mysql_num_rows($rslt);
@@ -59,6 +67,18 @@ while ($i < $campaigns_to_print)
 	$groups[$i] =$row[0];
 	$i++;
 	}
+$stmt="select user_group from vicidial_user_groups;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+$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++;
+	}
 ?>
 
 
@@ -86,12 +106,25 @@ echo "\n";
+echo "\n";
 echo "\n";
 echo "\n";
-echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n";
+echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n";
 echo "\n\n";
 
 echo "
\n";
@@ -101,7 +134,7 @@ if (!$group)
 {
 echo "\n";
 echo "PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
+echo " NOTE: stats taken from shift specified\n";
 }
 
 else
@@ -120,17 +153,28 @@ if ($shift == 'PM')
 	$time_BEGIN = "15:15:00";   
 	$time_END = "23:15:00";
 	}
+if ($shift == 'ALL') 
+	{
+	$query_date_BEGIN = "$query_date 00:00:00";   
+	$query_date_END = "$query_date 23:59:59";
+	$time_BEGIN = "00:00:00";   
+	$time_END = "23:59:59";
+	}
+
+if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
+else {$ugSQL='';}
 
 echo "VICIDIAL: Agent Performance Detail                        $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- AGENTS Details -------------\n\n";
 
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TIME   | PAUSE  | PAUSAVG| WAIT   | WAITAVG| TALK   | TALKAVG| DISPO  | DISPAVG| A    | B    | DC   | DNC  | N    | NI   | CB   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
+echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
+echo "| USER NAME       | ID       | CALLS  | TIME   | PAUSE  | PAUSAVG| WAIT   | WAITAVG| TALK   | TALKAVG| DISPO  | DISPAVG| A    | B    | DC   | DNC  | N    | NI   | CB   | SALE |\n";
+echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
 
-$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 group by full_name order by calls desc limit 1000;";
+$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 $ugSQL group by full_name order by calls desc limit 1000;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $rows_to_print = mysql_num_rows($rslt);
@@ -145,8 +189,25 @@ while ($i < $rows_to_print)
 	$TOTtotPAUSE=($TOTtotPAUSE + $row[5]);
 	$TOTtotDISPO=($TOTtotDISPO + $row[9]);
 	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
+
+	if ($non_latin < 1)
+	{
+   	 $full_name[$i]=	sprintf("%-15s", $row[2]); 
+	 while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
+
+	 $user[$i] =		sprintf("%-6s", $row[3]);
+        while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);}
+       }
+	else
+	{	
+        $full_name[$i]=	sprintf("%-45s", $row[2]); 
+	 while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');}
+
+ 	 $user[$i] =		sprintf("%-18s", $row[3]);
+	 while(mb_strlen($user[$i],'utf-8')>6) {$user[$i] = mb_substr("$user[$i]", 0, -1,'utf-8');}
+	}
+
+	$user[$i] =		sprintf("%-8s", $row[3]);
 	$USERtime =	($row[1] + $row[5] + $row[7] + $row[9]);
 	$USERtotTALK =	$row[1];
 	$USERavgTALK =	$row[4];
@@ -255,6 +316,7 @@ while($k < $i)
 	{
 	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; $ctCB[$k]="0   "; 
 	$stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
+	if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 	$rslt=mysql_query($stmt, $link);
 	if ($DB) {echo "$stmt\n";}
 	$rows_to_print = mysql_num_rows($rslt);
@@ -390,10 +452,11 @@ while($k < $i)
 	$TOT_NI = sprintf("%-5s", $TOT_NI);
 	$TOT_CB = sprintf("%-5s", $TOT_CB);
 	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
+	$TOT_AGENTS = sprintf("%-4s", $k);
 
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n";
-echo "+--------------------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
+echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\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 | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n";
+echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
 
 echo "\n";
 
diff --git a/LANG_www/vicidial_el/AST_server_performance.php b/LANG_www/vicidial_el/AST_server_performance.php
index d055cf2e..c23212c1 100644
--- a/LANG_www/vicidial_el/AST_server_performance.php
+++ b/LANG_www/vicidial_el/AST_server_performance.php
@@ -1,12 +1,14 @@
     LICENSE: GPLv2
+# Copyright (C) 2007  Matt Florell     LICENSE: GPLv2
 #
 # CHANGES
 #
 # 60619-1732 - Added variable filtering to eliminate SQL injection attack threat
 #            - Added required user/pass to gain access to this page
+# 70417-1106 - Changed time frame to be definable per time range on a single day
+#            - Fixed vertical scaling issues
 #
 
 require("dbconnect.php");
@@ -16,10 +18,12 @@ $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["begin_query_time"]))			{$begin_query_time=$_GET["begin_query_time"];}
+	elseif (isset($_POST["begin_query_time"]))	{$begin_query_time=$_POST["begin_query_time"];}
+if (isset($_GET["end_query_time"]))				{$end_query_time=$_GET["end_query_time"];}
+	elseif (isset($_POST["end_query_time"]))	{$end_query_time=$_POST["end_query_time"];}
 if (isset($_GET["group"]))				{$group=$_GET["group"];}
 	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["shift"]))				{$shift=$_GET["shift"];}
-	elseif (isset($_POST["shift"]))		{$shift=$_POST["shift"];}
 if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
 	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
 if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"]))				{$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];}
@@ -51,6 +55,8 @@ $NOW_TIME = date("Y-m-d H:i:s");
 $STARTtime = date("U");
 
 if (!isset($query_date)) {$query_date = $NOW_DATE;}
+if (!isset($begin_query_time)) {$begin_query_time = '09:00:00';}
+if (!isset($end_query_time)) {$end_query_time = '15:30:00';}
 if (!isset($group)) {$group = '';}
 
 $stmt="select server_ip from servers;";
@@ -81,8 +87,10 @@ while ($i < $servers_to_print)
 echo "\n";
 echo "VICIDIAL: Server Performance\n";
 echo "
\n"; -echo "\n"; -echo "   \n"; +echo "Time: \n"; +echo "to \n"; +echo "Server: \n"; else {echo "\n";} $o++; } -echo "\n"; -echo "\n"; +echo " \n"; echo "\n"; echo "             ΑΝΑΦΟΡΕΣ \n"; echo "\n\n"; @@ -105,46 +109,35 @@ echo "
\n";
 if (!$group)
 {
 echo "\n";
-echo "PLEASE SELECT A ΔΙΑΚΟΜΙΣΤΗΣ AND DATE-TIME ABOVE AND CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
+echo "PLEASE SELECT A SERVER, DATE AND TIME RANGE ABOVE AND CLICK ΕΠΙΒΕΒΑΙΩΣΗ\n";
 }
 
 else
 {
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:30:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:55:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:30:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:30:00";   
-	$time_END = "23:55:00";
-	}
+
+$query_date_BEGIN = "$query_date $begin_query_time";   
+$query_date_END = "$query_date $end_query_time";
+$time_BEGIN = "$begin_query_time";   
+$time_END = "$end_query_time";
 
 echo "VICIDIAL: Server Performance                             $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- TOTALS, PEAKS and AVERAGES\n";
 
-$stmt="select sysload from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by sysload desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$HIGHload =	sprintf("%10s", $row[0]);
-$HIGHmulti = intval($HIGHload / 100);
-#$HIGHmulti = ($HIGHload / 100);
-
-$stmt="select AVG(sysload),AVG(channels_total) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
+$stmt="select AVG(sysload),AVG(channels_total),MAX(sysload),MAX(channels_total),MAX(processes) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
 $AVGload =	sprintf("%10s", $row[0]);
 $AVGchannels =	sprintf("%10s", $row[1]);
+$HIGHload =	$row[2];
+	$HIGHmulti = intval($HIGHload / 100);
+$HIGHchannels =	$row[3];
+$HIGHprocesses =$row[4];
+if ($row[2] > $row[3]) {$HIGHlimit = $row[2];}
+else {$HIGHlimit = $row[3];}
+if ($HIGHlimit < $row[4]) {$HIGHlimit = $row[4];}
 
 $stmt="select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
 $rslt=mysql_query($stmt, $link);
@@ -154,26 +147,18 @@ $AVGcpuUSER =	sprintf("%10s", $row[0]);
 $AVGcpuSYSTEM =	sprintf("%10s", $row[1]);
 $AVGcpuIDLE =	sprintf("%10s", $row[2]);
 
-$stmt="select usedram from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by usedram desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$USEDram =	sprintf("%10s", $row[0]);
-
-$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$OFFHOOKtime =	sprintf("%10s", $row[1]);
+#	$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
+#	$rslt=mysql_query($stmt, $link);
+#	if ($DB) {echo "$stmt\n";}
+#	$row=mysql_fetch_row($rslt);
+#	$TOTALcalls =	sprintf("%10s", $row[0]);
+#	$OFFHOOKtime =	sprintf("%10s", $row[1]);
 
 
 echo "Total Calls in/out on this server:        $TOTALcalls\n";
 echo "Total Off-Hook time on this server (min): $OFFHOOKtime\n";
-echo "Average channels in use for server:       $AVGchannels\n";
-echo "Average load for server:                  $AVGload\n";
-echo "Peak load for server:                     $HIGHload\n";
-#echo "Peak used memory for server (in MB):      $USEDram\n";
+echo "Average/Peak channels in use for server:  $AVGchannels / $HIGHchannels\n";
+echo "Average/Peak load for server:             $AVGload / $HIGHload\n";
 echo "Average USER process cpu percentage:      $AVGcpuUSER %\n";
 echo "Average SYSTEM process cpu percentage:    $AVGcpuSYSTEM %\n";
 echo "Average IDLE process cpu percentage:      $AVGcpuIDLE %\n";
@@ -214,7 +199,17 @@ fclose($DATfp);
 
 $rows_to_max = ($rows_to_print + 100);
 
+print "rows: $i\n";
 
+$time_scale_abb = '5 minutes';
+$time_scale_tick = '1 minute';
+if ($i > 1000) {$time_scale_abb = '10 minutes';   $time_scale_tick = '2 minutes';}
+if ($i > 2000) {$time_scale_abb = '20 minutes';   $time_scale_tick = '4 minutes';}
+if ($i > 3000) {$time_scale_abb = '30 minutes';   $time_scale_tick = '5 minutes';}
+if ($i > 4000) {$time_scale_abb = '40 minutes';   $time_scale_tick = '10 minutes';}
+if ($i > 5000) {$time_scale_abb = '60 minutes';   $time_scale_tick = '15 minutes';}
+if ($i > 6000) {$time_scale_abb = '90 minutes';   $time_scale_tick = '15 minutes';}
+if ($i > 7000) {$time_scale_abb = '120 minutes';   $time_scale_tick = '30 minutes';}
 
 $HTMcontent  = '';
 $HTMcontent .= "#proc page\n";
@@ -232,11 +227,11 @@ $HTMcontent .= "titledetails: size=14  align=C\n";
 $HTMcontent .= "rectangle: 1 1 14 7\n";
 $HTMcontent .= "xscaletype: time hh:mm:ss\n";
 $HTMcontent .= "xrange: $time_BEGIN $time_END\n";
-$HTMcontent .= "yrange: 0 $HIGHload\n";
+$HTMcontent .= "yrange: 0 $HIGHlimit\n";
 $HTMcontent .= "\n";
 $HTMcontent .= "#proc xaxis\n";
-$HTMcontent .= "stubs: inc 30 minutes\n";
-$HTMcontent .= "minorticinc: 5 minutes\n";
+$HTMcontent .= "stubs: inc $time_scale_abb\n";
+$HTMcontent .= "minorticinc: $time_scale_tick\n";
 $HTMcontent .= "stubformat: hh:mm:ssa\n";
 $HTMcontent .= "\n";
 $HTMcontent .= "#proc yaxis\n";
diff --git a/LANG_www/vicidial_el/admin_modify_lead.php b/LANG_www/vicidial_el/admin_modify_lead.php
index 151b8118..a6ea5b19 100644
--- a/LANG_www/vicidial_el/admin_modify_lead.php
+++ b/LANG_www/vicidial_el/admin_modify_lead.php
@@ -107,6 +107,8 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 # 60619-1539 - Added variable filtering to eliminate SQL injection attack threat
 # 61130-1639 - Added recording_log lookup and list for this lead_id
 # 61201-1136 - Added recording_log user(TSR) display and link
+# 70305-1133 - Changed to default CHECKED modify logs upon status change
+# 70424-1128 - Added campaign-specific statuses, reformatted recordings list
 #
 
 $STARTtime = date("U");
@@ -273,6 +275,36 @@ else
 	if ($lead_count > 0)
 	{
 
+	$stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;";
+	$rslt=mysql_query($stmt, $link);
+	$logs_to_print = mysql_num_rows($rslt);
+
+	$u=0;
+	$call_log = '';
+	$log_campaign = '';
+	while ($logs_to_print > $u) 
+		{
+		$row=mysql_fetch_row($rslt);
+		if (strlen($log_campaign)<1) {$log_campaign = $row[3];}
+		if (eregi("1$|3$|5$|7$|9$", $u))
+			{$bgcolor='bgcolor="#B9CBFD"';} 
+		else
+			{$bgcolor='bgcolor="#9BB9FB"';}
+
+			$u++;
+			$call_log .= "
"; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + + } + + $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -348,15 +380,32 @@ else while ($statuses_to_print > $o) { $rowx=mysql_fetch_row($rslt); - if ($dispo == "$rowx[0]") + if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) {$statuses_list .= "\n"; $DS++;} else {$statuses_list .= "\n";} $o++; } + + $stmt="SELECT * from vicidial_campaign_statuses where selectable='Y' and campaign_id='$log_campaign' order by status"; + $rslt=mysql_query($stmt, $link); + $CAMPstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($CAMPstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + if ($DS < 1) {$statuses_list .= "\n";} echo "$statuses_list"; - echo "\n"; + echo " (with $log_campaign statuses)\n"; echo "\n"; @@ -432,38 +481,19 @@ echo "Κλήσεις για αυτόν τον οδηγό:\n"; echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
# LEAD"; echo "$u $row[12] $row[4] $row[4] $row[8] $row[0] $row[10] $row[0]   $row[10] $row[11] $row[13]
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
Modify agent and vicidial logs
\n"; echo "\n"; - $stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - $u=0; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} +echo "$call_log\n"; + + - $u++; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } echo "
# DATE/TIME LENGTH STATUS TSRΕΚΣΤΡΑΤΕΙΑ LIST LEAD
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
\n"; echo "

\n"; echo "RECORDINGS FOR THIS LEAD:\n"; -echo "\n"; +echo "
\n"; echo "\n"; $stmt="select * from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; @@ -483,10 +513,10 @@ echo ""; echo ""; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo ""; echo "\n"; diff --git a/LANG_www/vicidial_el/listloader.php b/LANG_www/vicidial_el/listloader.php index 1d9d3f75..234b2be7 100644 --- a/LANG_www/vicidial_el/listloader.php +++ b/LANG_www/vicidial_el/listloader.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell,Joe Johnson LICENSE: GPLv2 # # AST Web GUI lead loader from formatted file # @@ -15,12 +15,14 @@ # 60906-1059 - added filter of non-digits in alt_phone field # 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1046 - added postal code GMT lookup and duplicate check options +# 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. # -$version = '2.0.2'; -$build = '61128-1046'; +$version = '2.0.3'; +$build = '770417-1059'; header ("Content-type: text/html; charset=utf-8"); @@ -259,6 +261,8 @@ if ($leadfile and filesize($LF_path)<=8388608) { $called_since_last_reset='N'; $phone_list .= "$phone_number$US$list_id|"; + if (strlen($phone_code)<1) {$phone_code = '1';} + $postalgmt_found=0; if ( (eregi("POSTAL",$postalgmt)) && (strlen($postal_code)>4) ) { @@ -871,7 +875,6 @@ if ($leadfile and filesize($LF_path)<=8388608) { $AC_processed++; } - if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; diff --git a/LANG_www/vicidial_el/listloader.pl b/LANG_www/vicidial_el/listloader.pl index b15bfbb8..f8164666 100644 --- a/LANG_www/vicidial_el/listloader.pl +++ b/LANG_www/vicidial_el/listloader.pl @@ -15,6 +15,8 @@ # 60906-1058 - added filter of non-digits in alt_phone field # 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1215 - added postal code GMT lookup and duplicate check options +# 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # ### begin parsing run-time options ### @@ -247,6 +249,8 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { { $phone_list .= "$phone_number$US$list_id|"; $postalgmt_found=0; + if (length($phone_code)<1) {$phone_code = '1';} + if ( ($postalgmt > 0) && (length($postal_code)>4) ) { if ($phone_code =~ /^1$/) @@ -454,7 +458,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } $total++; if ($total%100==0) { - print ""; + print ""; sleep(1); # flush(); } diff --git a/LANG_www/vicidial_el/listloader_super.pl b/LANG_www/vicidial_el/listloader_super.pl index 704e06b7..adf138ee 100644 --- a/LANG_www/vicidial_el/listloader_super.pl +++ b/LANG_www/vicidial_el/listloader_super.pl @@ -14,6 +14,8 @@ # 60906-1056 - added filter of non-digits in alt_phone field # 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1207 - added postal code GMT lookup and duplicate check options +# 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # ### begin parsing run-time options ### @@ -249,6 +251,8 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { { $phone_list .= "$phone_number$US$list_id|"; $postalgmt_found=0; + if (length($phone_code)<1) {$phone_code = '1';} + else {print "PHONE_CODE|$phone_code|\n";} if ( ($postalgmt > 0) && (length($postal_code)>4) ) { if ($phone_code =~ /^1$/) @@ -456,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } $total++; if ($total%100==0) { - print ""; + print ""; sleep(1); # flush(); } diff --git a/LANG_www/vicidial_el/new_listloader_superL.php b/LANG_www/vicidial_el/new_listloader_superL.php index 7ad3229f..6b5d16eb 100644 --- a/LANG_www/vicidial_el/new_listloader_superL.php +++ b/LANG_www/vicidial_el/new_listloader_superL.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell,Joe Johnson LICENSE: GPLv2 # # AST GUI lead loader from formatted file # @@ -17,11 +17,12 @@ # 60906-1100 - added filter of non-digits in alt_phone field # 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '2.0.2'; -$build = '61128-1149'; +$version = '2.0.3'; +$build = '70417-1059'; require("dbconnect.php"); @@ -417,6 +418,7 @@ function ParseFileName() { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -551,6 +553,7 @@ function ParseFileName() { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -702,6 +705,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -853,6 +857,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; diff --git a/LANG_www/vicidial_en/AST_VDADstats.php b/LANG_www/vicidial_en/AST_VDADstats.php index b26e245f..f747843b 100644 --- a/LANG_www/vicidial_en/AST_VDADstats.php +++ b/LANG_www/vicidial_en/AST_VDADstats.php @@ -281,6 +281,10 @@ echo "+-------------------------------+------------+\n"; ############################## ######### USER STATS +if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $campaign_id)) + {$vicidial_log = 'vicidial_closer_log';} +else + {$vicidial_log = 'vicidial_log';} $TOTagents=0; $TOTcalls=0; $TOTtime=0; @@ -292,7 +296,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| AGENT | CALLS | TIME M | AVRG M |\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 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;"; +$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 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and $vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and $vicidial_log.user=vicidial_users.user group by $vicidial_log.user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/vicidial_en/AST_server_performance.php b/LANG_www/vicidial_en/AST_server_performance.php index 8a3b6529..b5c39ba5 100644 --- a/LANG_www/vicidial_en/AST_server_performance.php +++ b/LANG_www/vicidial_en/AST_server_performance.php @@ -1,12 +1,14 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # CHANGES # # 60619-1732 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page +# 70417-1106 - Changed time frame to be definable per time range on a single day +# - Fixed vertical scaling issues # require("dbconnect.php"); @@ -16,10 +18,12 @@ $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["begin_query_time"])) {$begin_query_time=$_GET["begin_query_time"];} + elseif (isset($_POST["begin_query_time"])) {$begin_query_time=$_POST["begin_query_time"];} +if (isset($_GET["end_query_time"])) {$end_query_time=$_GET["end_query_time"];} + elseif (isset($_POST["end_query_time"])) {$end_query_time=$_POST["end_query_time"];} if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["shift"])) {$shift=$_GET["shift"];} - elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -51,6 +55,8 @@ $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); if (!isset($query_date)) {$query_date = $NOW_DATE;} +if (!isset($begin_query_time)) {$begin_query_time = '09:00:00';} +if (!isset($end_query_time)) {$end_query_time = '15:30:00';} if (!isset($group)) {$group = '';} $stmt="select server_ip from servers;"; @@ -81,8 +87,10 @@ while ($i < $servers_to_print) echo "\n"; echo "VICIDIAL: Server Performance\n"; echo "
\n"; -echo "\n"; -echo "   \n"; +echo "Time: \n"; +echo "to \n"; +echo "Server: \n"; else {echo "\n";} $o++; } -echo "\n"; -echo "\n"; +echo " \n"; echo "\n"; echo "             REPORTS \n"; echo "\n\n"; @@ -105,46 +109,35 @@ echo "
\n";
 if (!$group)
 {
 echo "\n";
-echo "PLEASE SELECT A SERVER AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
+echo "PLEASE SELECT A SERVER, DATE AND TIME RANGE ABOVE AND CLICK SUBMIT\n";
 }
 
 else
 {
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:30:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:55:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:30:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:30:00";   
-	$time_END = "23:55:00";
-	}
+
+$query_date_BEGIN = "$query_date $begin_query_time";   
+$query_date_END = "$query_date $end_query_time";
+$time_BEGIN = "$begin_query_time";   
+$time_END = "$end_query_time";
 
 echo "VICIDIAL: Server Performance                             $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- TOTALS, PEAKS and AVERAGES\n";
 
-$stmt="select sysload from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by sysload desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$HIGHload =	sprintf("%10s", $row[0]);
-$HIGHmulti = intval($HIGHload / 100);
-#$HIGHmulti = ($HIGHload / 100);
-
-$stmt="select AVG(sysload),AVG(channels_total) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
+$stmt="select AVG(sysload),AVG(channels_total),MAX(sysload),MAX(channels_total),MAX(processes) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
 $AVGload =	sprintf("%10s", $row[0]);
 $AVGchannels =	sprintf("%10s", $row[1]);
+$HIGHload =	$row[2];
+	$HIGHmulti = intval($HIGHload / 100);
+$HIGHchannels =	$row[3];
+$HIGHprocesses =$row[4];
+if ($row[2] > $row[3]) {$HIGHlimit = $row[2];}
+else {$HIGHlimit = $row[3];}
+if ($HIGHlimit < $row[4]) {$HIGHlimit = $row[4];}
 
 $stmt="select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
 $rslt=mysql_query($stmt, $link);
@@ -154,26 +147,18 @@ $AVGcpuUSER =	sprintf("%10s", $row[0]);
 $AVGcpuSYSTEM =	sprintf("%10s", $row[1]);
 $AVGcpuIDLE =	sprintf("%10s", $row[2]);
 
-$stmt="select usedram from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by usedram desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$USEDram =	sprintf("%10s", $row[0]);
-
-$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$OFFHOOKtime =	sprintf("%10s", $row[1]);
+#	$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
+#	$rslt=mysql_query($stmt, $link);
+#	if ($DB) {echo "$stmt\n";}
+#	$row=mysql_fetch_row($rslt);
+#	$TOTALcalls =	sprintf("%10s", $row[0]);
+#	$OFFHOOKtime =	sprintf("%10s", $row[1]);
 
 
 echo "Total Calls in/out on this server:        $TOTALcalls\n";
 echo "Total Off-Hook time on this server (min): $OFFHOOKtime\n";
-echo "Average channels in use for server:       $AVGchannels\n";
-echo "Average load for server:                  $AVGload\n";
-echo "Peak load for server:                     $HIGHload\n";
-#echo "Peak used memory for server (in MB):      $USEDram\n";
+echo "Average/Peak channels in use for server:  $AVGchannels / $HIGHchannels\n";
+echo "Average/Peak load for server:             $AVGload / $HIGHload\n";
 echo "Average USER process cpu percentage:      $AVGcpuUSER %\n";
 echo "Average SYSTEM process cpu percentage:    $AVGcpuSYSTEM %\n";
 echo "Average IDLE process cpu percentage:      $AVGcpuIDLE %\n";
@@ -214,7 +199,17 @@ fclose($DATfp);
 
 $rows_to_max = ($rows_to_print + 100);
 
+print "rows: $i\n";
 
+$time_scale_abb = '5 minutes';
+$time_scale_tick = '1 minute';
+if ($i > 1000) {$time_scale_abb = '10 minutes';   $time_scale_tick = '2 minutes';}
+if ($i > 2000) {$time_scale_abb = '20 minutes';   $time_scale_tick = '4 minutes';}
+if ($i > 3000) {$time_scale_abb = '30 minutes';   $time_scale_tick = '5 minutes';}
+if ($i > 4000) {$time_scale_abb = '40 minutes';   $time_scale_tick = '10 minutes';}
+if ($i > 5000) {$time_scale_abb = '60 minutes';   $time_scale_tick = '15 minutes';}
+if ($i > 6000) {$time_scale_abb = '90 minutes';   $time_scale_tick = '15 minutes';}
+if ($i > 7000) {$time_scale_abb = '120 minutes';   $time_scale_tick = '30 minutes';}
 
 $HTMcontent  = '';
 $HTMcontent .= "#proc page\n";
@@ -232,11 +227,11 @@ $HTMcontent .= "titledetails: size=14  align=C\n";
 $HTMcontent .= "rectangle: 1 1 14 7\n";
 $HTMcontent .= "xscaletype: time hh:mm:ss\n";
 $HTMcontent .= "xrange: $time_BEGIN $time_END\n";
-$HTMcontent .= "yrange: 0 $HIGHload\n";
+$HTMcontent .= "yrange: 0 $HIGHlimit\n";
 $HTMcontent .= "\n";
 $HTMcontent .= "#proc xaxis\n";
-$HTMcontent .= "stubs: inc 30 minutes\n";
-$HTMcontent .= "minorticinc: 5 minutes\n";
+$HTMcontent .= "stubs: inc $time_scale_abb\n";
+$HTMcontent .= "minorticinc: $time_scale_tick\n";
 $HTMcontent .= "stubformat: hh:mm:ssa\n";
 $HTMcontent .= "\n";
 $HTMcontent .= "#proc yaxis\n";
diff --git a/LANG_www/vicidial_en/admin_modify_lead.php b/LANG_www/vicidial_en/admin_modify_lead.php
index fd51a12b..9a658ec3 100644
--- a/LANG_www/vicidial_en/admin_modify_lead.php
+++ b/LANG_www/vicidial_en/admin_modify_lead.php
@@ -108,6 +108,7 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 # 61130-1639 - Added recording_log lookup and list for this lead_id
 # 61201-1136 - Added recording_log user(TSR) display and link
 # 70305-1133 - Changed to default CHECKED modify logs upon status change
+# 70424-1128 - Added campaign-specific statuses, reformatted recordings list
 #
 
 $STARTtime = date("U");
@@ -274,6 +275,36 @@ else
 	if ($lead_count > 0)
 	{
 
+	$stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;";
+	$rslt=mysql_query($stmt, $link);
+	$logs_to_print = mysql_num_rows($rslt);
+
+	$u=0;
+	$call_log = '';
+	$log_campaign = '';
+	while ($logs_to_print > $u) 
+		{
+		$row=mysql_fetch_row($rslt);
+		if (strlen($log_campaign)<1) {$log_campaign = $row[3];}
+		if (eregi("1$|3$|5$|7$|9$", $u))
+			{$bgcolor='bgcolor="#B9CBFD"';} 
+		else
+			{$bgcolor='bgcolor="#9BB9FB"';}
+
+			$u++;
+			$call_log .= "
"; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + + } + + $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -349,15 +380,32 @@ else while ($statuses_to_print > $o) { $rowx=mysql_fetch_row($rslt); - if ($dispo == "$rowx[0]") + if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) {$statuses_list .= "\n"; $DS++;} else {$statuses_list .= "\n";} $o++; } + + $stmt="SELECT * from vicidial_campaign_statuses where selectable='Y' and campaign_id='$log_campaign' order by status"; + $rslt=mysql_query($stmt, $link); + $CAMPstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($CAMPstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + if ($DS < 1) {$statuses_list .= "\n";} echo "$statuses_list"; - echo "\n"; + echo " (with $log_campaign statuses)\n"; echo "\n"; @@ -433,38 +481,19 @@ echo "CALLS TO THIS LEAD:\n"; echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
# LEAD"; echo "$u $row[12] $row[4] $row[4] $row[8] $row[0] $row[10] $row[0]   $row[10] $row[11] $row[13]
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
Modify agent and vicidial logs
\n"; echo "\n"; - $stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - $u=0; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} +echo "$call_log\n"; + + - $u++; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } echo "
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
\n"; echo "

\n"; echo "RECORDINGS FOR THIS LEAD:\n"; -echo "\n"; +echo "
\n"; echo "\n"; $stmt="select * from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; @@ -484,10 +513,10 @@ echo ""; echo ""; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo ""; echo "\n"; diff --git a/LANG_www/vicidial_en/listloader.php b/LANG_www/vicidial_en/listloader.php index 272d94a7..b6e8ae5e 100644 --- a/LANG_www/vicidial_en/listloader.php +++ b/LANG_www/vicidial_en/listloader.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell,Joe Johnson LICENSE: GPLv2 # # AST Web GUI lead loader from formatted file # @@ -16,12 +16,13 @@ # 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1046 - added postal code GMT lookup and duplicate check options # 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. # $version = '2.0.3'; -$build = '70205-1703'; +$build = '770417-1059'; header ("Content-type: text/html; charset=utf-8"); @@ -260,6 +261,8 @@ if ($leadfile and filesize($LF_path)<=8388608) { $called_since_last_reset='N'; $phone_list .= "$phone_number$US$list_id|"; + if (strlen($phone_code)<1) {$phone_code = '1';} + $postalgmt_found=0; if ( (eregi("POSTAL",$postalgmt)) && (strlen($postal_code)>4) ) { @@ -872,8 +875,6 @@ if ($leadfile and filesize($LF_path)<=8388608) { $AC_processed++; } - - if (strlen($phone_code)<1) {$phone_code = '1';} if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; diff --git a/LANG_www/vicidial_en/listloader.pl b/LANG_www/vicidial_en/listloader.pl index f93b4520..f8164666 100644 --- a/LANG_www/vicidial_en/listloader.pl +++ b/LANG_www/vicidial_en/listloader.pl @@ -16,6 +16,7 @@ # 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1215 - added postal code GMT lookup and duplicate check options # 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # ### begin parsing run-time options ### @@ -248,6 +249,8 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { { $phone_list .= "$phone_number$US$list_id|"; $postalgmt_found=0; + if (length($phone_code)<1) {$phone_code = '1';} + if ( ($postalgmt > 0) && (length($postal_code)>4) ) { if ($phone_code =~ /^1$/) @@ -435,7 +438,6 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $AC_processed++; } - if (length($phone_code)<1) {$phone_code = '1';} if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; diff --git a/LANG_www/vicidial_en/listloader_super.pl b/LANG_www/vicidial_en/listloader_super.pl index bbf353ce..adf138ee 100644 --- a/LANG_www/vicidial_en/listloader_super.pl +++ b/LANG_www/vicidial_en/listloader_super.pl @@ -15,6 +15,7 @@ # 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1207 - added postal code GMT lookup and duplicate check options # 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # ### begin parsing run-time options ### @@ -250,6 +251,8 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { { $phone_list .= "$phone_number$US$list_id|"; $postalgmt_found=0; + if (length($phone_code)<1) {$phone_code = '1';} + else {print "PHONE_CODE|$phone_code|\n";} if ( ($postalgmt > 0) && (length($postal_code)>4) ) { if ($phone_code =~ /^1$/) @@ -437,7 +440,6 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $AC_processed++; } - if (length($phone_code)<1) {$phone_code = '1';} if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; diff --git a/LANG_www/vicidial_en/new_listloader_superL.php b/LANG_www/vicidial_en/new_listloader_superL.php index deecb128..5473ce6b 100644 --- a/LANG_www/vicidial_en/new_listloader_superL.php +++ b/LANG_www/vicidial_en/new_listloader_superL.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell,Joe Johnson LICENSE: GPLv2 # # AST GUI lead loader from formatted file # @@ -17,11 +17,12 @@ # 60906-1100 - added filter of non-digits in alt_phone field # 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '2.0.2'; -$build = '61128-1149'; +$version = '2.0.3'; +$build = '70417-1059'; require("dbconnect.php"); @@ -417,6 +418,7 @@ function ParseFileName() { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -551,6 +553,7 @@ function ParseFileName() { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -702,6 +705,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -853,6 +857,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; diff --git a/LANG_www/vicidial_es/AST_VDADstats.php b/LANG_www/vicidial_es/AST_VDADstats.php index c4c493ed..916fe2a5 100644 --- a/LANG_www/vicidial_es/AST_VDADstats.php +++ b/LANG_www/vicidial_es/AST_VDADstats.php @@ -281,6 +281,10 @@ echo "+-------------------------------+------------+\n"; ############################## ######### USER STATS +if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $campaign_id)) + {$vicidial_log = 'vicidial_closer_log';} +else + {$vicidial_log = 'vicidial_log';} $TOTagents=0; $TOTcalls=0; $TOTtime=0; @@ -292,7 +296,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| AGENTE | CALLS | TIME M | AVRG M |\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 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;"; +$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 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and $vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and $vicidial_log.user=vicidial_users.user group by $vicidial_log.user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} diff --git a/LANG_www/vicidial_es/AST_agent_performance.php b/LANG_www/vicidial_es/AST_agent_performance.php index 5c58d6f8..220a5be5 100644 --- a/LANG_www/vicidial_es/AST_agent_performance.php +++ b/LANG_www/vicidial_es/AST_agent_performance.php @@ -7,6 +7,7 @@ # # 60619-1711 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page +# 70201-1203 - Added non_latin UTF8 output code, widened USER ID to 8 chars # require("dbconnect.php"); @@ -28,8 +29,9 @@ if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} $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;"; + $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]; @@ -49,6 +51,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} $stmt="select campaign_id from vicidial_campaigns;"; +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -91,7 +94,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; -echo "           MODIFICAR | INFORMES \n"; +echo "           MODIFICAR | INFORMES \n"; echo "\n\n"; echo "
\n";
@@ -126,11 +129,12 @@ echo "VICIDIAL: Agent Performance                             $NOW_TIME\n";
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- AGENTS Details -------------\n\n";
 
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+echo "| USER NAME       | ID       | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
 
 $stmt="select count(*) as calls,sum(length_in_sec) as talk,full_name,vicidial_users.user,avg(length_in_sec) from vicidial_users,vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and vicidial_users.user=vicidial_log.user and campaign_id='" . mysql_real_escape_string($group) . "' group by full_name order by calls desc limit 1000;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $rows_to_print = mysql_num_rows($rslt);
@@ -141,8 +145,25 @@ while ($i < $rows_to_print)
 	$TOTcalls=($TOTcalls + $row[0]);
 	$TOTtotTALK=($TOTtotTALK + $row[1]);
 	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
+
+	if ($non_latin < 1)
+	{
+   	 $full_name[$i]=	sprintf("%-15s", $row[2]); 
+	 while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
+
+	 $user[$i] =		sprintf("%-6s", $row[3]);
+        while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);}
+       }
+	else
+	{	
+        $full_name[$i]=	sprintf("%-45s", $row[2]); 
+	 while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');}
+
+ 	 $user[$i] =		sprintf("%-18s", $row[3]);
+	 while(mb_strlen($user[$i],'utf-8')>6) {$user[$i] = mb_substr("$user[$i]", 0, -1,'utf-8');}
+	}
+
+	$user[$i] =		sprintf("%-8s", $row[3]);
 	$USERtotTALK =	$row[1];
 	$USERavgTALK =	$row[4];
 
@@ -173,6 +194,10 @@ while($k < $i)
 	{
 	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; 
 	$stmt="select count(*),status from vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
+	if ($non_latin > 0)
+	{
+	$rslt=mysql_query("SET NAMES 'UTF8'");
+	}
 	$rslt=mysql_query($stmt, $link);
 	if ($DB) {echo "$stmt\n";}
 	$rows_to_print = mysql_num_rows($rslt);
@@ -217,9 +242,9 @@ while($k < $i)
 	$TOT_NI = sprintf("%-5s", $TOT_NI);
 	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
 
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
-echo "+-----------------+--------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
+echo "|  TOTALS                    | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
+echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
 
 echo "\n";
 
diff --git a/LANG_www/vicidial_es/AST_agent_performance_detail.php b/LANG_www/vicidial_es/AST_agent_performance_detail.php
index 45a7f5f8..a5e8988a 100644
--- a/LANG_www/vicidial_es/AST_agent_performance_detail.php
+++ b/LANG_www/vicidial_es/AST_agent_performance_detail.php
@@ -7,6 +7,8 @@
 #
 # 60619-1712 - Added variable filtering to eliminate SQL injection attack threat
 #            - Added required user/pass to gain access to this page
+# 70118-1705 - Added user_group filtering option
+# 70201-1207 - Added non_latin UTF8 output code, widened USER ID to 8 chars
 #
 
 require("dbconnect.php");
@@ -15,21 +17,26 @@ $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"];}
+	elseif (isset($_POST["query_date"]))	{$query_date=$_POST["query_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["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
+	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
 if (isset($_GET["ENVIAR"]))				{$ENVIAR=$_GET["ENVIAR"];}
-	elseif (isset($_POST["ENVIAR"]))		{$ENVIAR=$_POST["ENVIAR"];}
+	elseif (isset($_POST["ENVIAR"]))	{$ENVIAR=$_POST["ENVIAR"];}
+
+if (strlen($shift)<2) {$shift='ALL';}
 
 $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;";
+	$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];
@@ -49,6 +56,7 @@ if (!isset($group)) {$group = '';}
 if (!isset($query_date)) {$query_date = $NOW_DATE;}
 
 $stmt="select campaign_id from vicidial_campaigns;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $campaigns_to_print = mysql_num_rows($rslt);
@@ -59,6 +67,18 @@ while ($i < $campaigns_to_print)
 	$groups[$i] =$row[0];
 	$i++;
 	}
+$stmt="select user_group from vicidial_user_groups;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
+$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++;
+	}
 ?>
 
 
@@ -86,12 +106,25 @@ echo "\n";
+echo "\n";
 echo "\n";
 echo "\n";
-echo "           MODIFICAR | INFORMES \n";
+echo "           MODIFICAR | INFORMES \n";
 echo "\n\n";
 
 echo "
\n";
@@ -101,7 +134,7 @@ if (!$group)
 {
 echo "\n";
 echo "PLEASE SELECT A CAMPAIGN AND DATE-TIME ABOVE AND CLICK ENVIAR\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
+echo " NOTE: stats taken from shift specified\n";
 }
 
 else
@@ -120,17 +153,28 @@ if ($shift == 'PM')
 	$time_BEGIN = "15:15:00";   
 	$time_END = "23:15:00";
 	}
+if ($shift == 'ALL') 
+	{
+	$query_date_BEGIN = "$query_date 00:00:00";   
+	$query_date_END = "$query_date 23:59:59";
+	$time_BEGIN = "00:00:00";   
+	$time_END = "23:59:59";
+	}
+
+if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";}
+else {$ugSQL='';}
 
 echo "VICIDIAL: Agent Performance Detail                        $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- AGENTS Details -------------\n\n";
 
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID     | CALLS  | TIME   | PAUSE  | PAUSAVG| WAIT   | WAITAVG| TALK   | TALKAVG| DISPO  | DISPAVG| A    | B    | DC   | DNC  | N    | NI   | CB   | SALE |\n";
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
+echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
+echo "| USER NAME       | ID       | CALLS  | TIME   | PAUSE  | PAUSAVG| WAIT   | WAITAVG| TALK   | TALKAVG| DISPO  | DISPAVG| A    | B    | DC   | DNC  | N    | NI   | CB   | SALE |\n";
+echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
 
-$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 group by full_name order by calls desc limit 1000;";
+$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 $ugSQL group by full_name order by calls desc limit 1000;";
+if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $rows_to_print = mysql_num_rows($rslt);
@@ -145,8 +189,25 @@ while ($i < $rows_to_print)
 	$TOTtotPAUSE=($TOTtotPAUSE + $row[5]);
 	$TOTtotDISPO=($TOTtotDISPO + $row[9]);
 	$calls[$i] =	sprintf("%-6s", $row[0]);
-	$full_name[$i]=	sprintf("%-15s", $row[2]); while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-	$user[$i] =		sprintf("%-6s", $row[3]);
+
+	if ($non_latin < 1)
+	{
+   	 $full_name[$i]=	sprintf("%-15s", $row[2]); 
+	 while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
+
+	 $user[$i] =		sprintf("%-6s", $row[3]);
+        while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);}
+       }
+	else
+	{	
+        $full_name[$i]=	sprintf("%-45s", $row[2]); 
+	 while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');}
+
+ 	 $user[$i] =		sprintf("%-18s", $row[3]);
+	 while(mb_strlen($user[$i],'utf-8')>6) {$user[$i] = mb_substr("$user[$i]", 0, -1,'utf-8');}
+	}
+
+	$user[$i] =		sprintf("%-8s", $row[3]);
 	$USERtime =	($row[1] + $row[5] + $row[7] + $row[9]);
 	$USERtotTALK =	$row[1];
 	$USERavgTALK =	$row[4];
@@ -255,6 +316,7 @@ while($k < $i)
 	{
 	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; $ctCB[$k]="0   "; 
 	$stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
+	if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 	$rslt=mysql_query($stmt, $link);
 	if ($DB) {echo "$stmt\n";}
 	$rows_to_print = mysql_num_rows($rslt);
@@ -390,10 +452,11 @@ while($k < $i)
 	$TOT_NI = sprintf("%-5s", $TOT_NI);
 	$TOT_CB = sprintf("%-5s", $TOT_CB);
 	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
+	$TOT_AGENTS = sprintf("%-4s", $k);
 
-echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                  | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n";
-echo "+--------------------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
+echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\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 | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n";
+echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n";
 
 echo "\n";
 
diff --git a/LANG_www/vicidial_es/AST_server_performance.php b/LANG_www/vicidial_es/AST_server_performance.php
index 88d1d9bf..5d0e286a 100644
--- a/LANG_www/vicidial_es/AST_server_performance.php
+++ b/LANG_www/vicidial_es/AST_server_performance.php
@@ -1,12 +1,14 @@
     LICENSE: GPLv2
+# Copyright (C) 2007  Matt Florell     LICENSE: GPLv2
 #
 # CHANGES
 #
 # 60619-1732 - Added variable filtering to eliminate SQL injection attack threat
 #            - Added required user/pass to gain access to this page
+# 70417-1106 - Changed time frame to be definable per time range on a single day
+#            - Fixed vertical scaling issues
 #
 
 require("dbconnect.php");
@@ -16,10 +18,12 @@ $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["begin_query_time"]))			{$begin_query_time=$_GET["begin_query_time"];}
+	elseif (isset($_POST["begin_query_time"]))	{$begin_query_time=$_POST["begin_query_time"];}
+if (isset($_GET["end_query_time"]))				{$end_query_time=$_GET["end_query_time"];}
+	elseif (isset($_POST["end_query_time"]))	{$end_query_time=$_POST["end_query_time"];}
 if (isset($_GET["group"]))				{$group=$_GET["group"];}
 	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
-if (isset($_GET["shift"]))				{$shift=$_GET["shift"];}
-	elseif (isset($_POST["shift"]))		{$shift=$_POST["shift"];}
 if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
 	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
 if (isset($_GET["ENVIAR"]))				{$ENVIAR=$_GET["ENVIAR"];}
@@ -51,6 +55,8 @@ $NOW_TIME = date("Y-m-d H:i:s");
 $STARTtime = date("U");
 
 if (!isset($query_date)) {$query_date = $NOW_DATE;}
+if (!isset($begin_query_time)) {$begin_query_time = '09:00:00';}
+if (!isset($end_query_time)) {$end_query_time = '15:30:00';}
 if (!isset($group)) {$group = '';}
 
 $stmt="select server_ip from servers;";
@@ -81,8 +87,10 @@ while ($i < $servers_to_print)
 echo "\n";
 echo "VICIDIAL: Server Performance\n";
 echo "
\n"; -echo "\n"; -echo "   \n"; +echo "Time: \n"; +echo "to \n"; +echo "Server: \n"; else {echo "\n";} $o++; } -echo "\n"; -echo "\n"; +echo " \n"; echo "\n"; echo "             INFORMES \n"; echo "\n\n"; @@ -105,46 +109,35 @@ echo "
\n";
 if (!$group)
 {
 echo "\n";
-echo "PLEASE SELECT A SERVIDOR AND DATE-TIME ABOVE AND CLICK ENVIAR\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
+echo "PLEASE SELECT A SERVER, DATE AND TIME RANGE ABOVE AND CLICK ENVIAR\n";
 }
 
 else
 {
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:30:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:55:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:30:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:30:00";   
-	$time_END = "23:55:00";
-	}
+
+$query_date_BEGIN = "$query_date $begin_query_time";   
+$query_date_END = "$query_date $end_query_time";
+$time_BEGIN = "$begin_query_time";   
+$time_END = "$end_query_time";
 
 echo "VICIDIAL: Server Performance                             $NOW_TIME\n";
 
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- TOTALS, PEAKS and AVERAGES\n";
 
-$stmt="select sysload from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by sysload desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$HIGHload =	sprintf("%10s", $row[0]);
-$HIGHmulti = intval($HIGHload / 100);
-#$HIGHmulti = ($HIGHload / 100);
-
-$stmt="select AVG(sysload),AVG(channels_total) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
+$stmt="select AVG(sysload),AVG(channels_total),MAX(sysload),MAX(channels_total),MAX(processes) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
 $AVGload =	sprintf("%10s", $row[0]);
 $AVGchannels =	sprintf("%10s", $row[1]);
+$HIGHload =	$row[2];
+	$HIGHmulti = intval($HIGHload / 100);
+$HIGHchannels =	$row[3];
+$HIGHprocesses =$row[4];
+if ($row[2] > $row[3]) {$HIGHlimit = $row[2];}
+else {$HIGHlimit = $row[3];}
+if ($HIGHlimit < $row[4]) {$HIGHlimit = $row[4];}
 
 $stmt="select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
 $rslt=mysql_query($stmt, $link);
@@ -154,26 +147,18 @@ $AVGcpuUSER =	sprintf("%10s", $row[0]);
 $AVGcpuSYSTEM =	sprintf("%10s", $row[1]);
 $AVGcpuIDLE =	sprintf("%10s", $row[2]);
 
-$stmt="select usedram from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "' order by usedram desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$USEDram =	sprintf("%10s", $row[0]);
-
-$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$OFFHOOKtime =	sprintf("%10s", $row[1]);
+#	$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
+#	$rslt=mysql_query($stmt, $link);
+#	if ($DB) {echo "$stmt\n";}
+#	$row=mysql_fetch_row($rslt);
+#	$TOTALcalls =	sprintf("%10s", $row[0]);
+#	$OFFHOOKtime =	sprintf("%10s", $row[1]);
 
 
 echo "Total Calls in/out on this server:        $TOTALcalls\n";
 echo "Total Off-Hook time on this server (min): $OFFHOOKtime\n";
-echo "Average channels in use for server:       $AVGchannels\n";
-echo "Average load for server:                  $AVGload\n";
-echo "Peak load for server:                     $HIGHload\n";
-#echo "Peak used memory for server (in MB):      $USEDram\n";
+echo "Average/Peak channels in use for server:  $AVGchannels / $HIGHchannels\n";
+echo "Average/Peak load for server:             $AVGload / $HIGHload\n";
 echo "Average USER process cpu percentage:      $AVGcpuUSER %\n";
 echo "Average SYSTEM process cpu percentage:    $AVGcpuSYSTEM %\n";
 echo "Average IDLE process cpu percentage:      $AVGcpuIDLE %\n";
@@ -214,7 +199,17 @@ fclose($DATfp);
 
 $rows_to_max = ($rows_to_print + 100);
 
+print "rows: $i\n";
 
+$time_scale_abb = '5 minutes';
+$time_scale_tick = '1 minute';
+if ($i > 1000) {$time_scale_abb = '10 minutes';   $time_scale_tick = '2 minutes';}
+if ($i > 2000) {$time_scale_abb = '20 minutes';   $time_scale_tick = '4 minutes';}
+if ($i > 3000) {$time_scale_abb = '30 minutes';   $time_scale_tick = '5 minutes';}
+if ($i > 4000) {$time_scale_abb = '40 minutes';   $time_scale_tick = '10 minutes';}
+if ($i > 5000) {$time_scale_abb = '60 minutes';   $time_scale_tick = '15 minutes';}
+if ($i > 6000) {$time_scale_abb = '90 minutes';   $time_scale_tick = '15 minutes';}
+if ($i > 7000) {$time_scale_abb = '120 minutes';   $time_scale_tick = '30 minutes';}
 
 $HTMcontent  = '';
 $HTMcontent .= "#proc page\n";
@@ -232,11 +227,11 @@ $HTMcontent .= "titledetails: size=14  align=C\n";
 $HTMcontent .= "rectangle: 1 1 14 7\n";
 $HTMcontent .= "xscaletype: time hh:mm:ss\n";
 $HTMcontent .= "xrange: $time_BEGIN $time_END\n";
-$HTMcontent .= "yrange: 0 $HIGHload\n";
+$HTMcontent .= "yrange: 0 $HIGHlimit\n";
 $HTMcontent .= "\n";
 $HTMcontent .= "#proc xaxis\n";
-$HTMcontent .= "stubs: inc 30 minutes\n";
-$HTMcontent .= "minorticinc: 5 minutes\n";
+$HTMcontent .= "stubs: inc $time_scale_abb\n";
+$HTMcontent .= "minorticinc: $time_scale_tick\n";
 $HTMcontent .= "stubformat: hh:mm:ssa\n";
 $HTMcontent .= "\n";
 $HTMcontent .= "#proc yaxis\n";
diff --git a/LANG_www/vicidial_es/admin_modify_lead.php b/LANG_www/vicidial_es/admin_modify_lead.php
index 0c17426a..f0d7077b 100644
--- a/LANG_www/vicidial_es/admin_modify_lead.php
+++ b/LANG_www/vicidial_es/admin_modify_lead.php
@@ -107,6 +107,8 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 # 60619-1539 - Added variable filtering to eliminate SQL injection attack threat
 # 61130-1639 - Added recording_log lookup and list for this lead_id
 # 61201-1136 - Added recording_log user(TSR) display and link
+# 70305-1133 - Changed to default CHECKED modify logs upon status change
+# 70424-1128 - Added campaign-specific statuses, reformatted recordings list
 #
 
 $STARTtime = date("U");
@@ -273,6 +275,36 @@ else
 	if ($lead_count > 0)
 	{
 
+	$stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;";
+	$rslt=mysql_query($stmt, $link);
+	$logs_to_print = mysql_num_rows($rslt);
+
+	$u=0;
+	$call_log = '';
+	$log_campaign = '';
+	while ($logs_to_print > $u) 
+		{
+		$row=mysql_fetch_row($rslt);
+		if (strlen($log_campaign)<1) {$log_campaign = $row[3];}
+		if (eregi("1$|3$|5$|7$|9$", $u))
+			{$bgcolor='bgcolor="#B9CBFD"';} 
+		else
+			{$bgcolor='bgcolor="#9BB9FB"';}
+
+			$u++;
+			$call_log .= "
"; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + + } + + $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -348,15 +380,32 @@ else while ($statuses_to_print > $o) { $rowx=mysql_fetch_row($rslt); - if ($dispo == "$rowx[0]") + if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) {$statuses_list .= "\n"; $DS++;} else {$statuses_list .= "\n";} $o++; } + + $stmt="SELECT * from vicidial_campaign_statuses where selectable='Y' and campaign_id='$log_campaign' order by status"; + $rslt=mysql_query($stmt, $link); + $CAMPstatuses_to_print = mysql_num_rows($rslt); + + $o=0; + while ($CAMPstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) ) + {$statuses_list .= "\n"; $DS++;} + else + {$statuses_list .= "\n";} + $o++; + } + + if ($DS < 1) {$statuses_list .= "\n";} echo "$statuses_list"; - echo "\n"; + echo " (with $log_campaign statuses)\n"; echo "\n"; @@ -432,38 +481,19 @@ echo "LLAMADAS A ESTE LEAD:\n"; echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
# LEAD"; echo "$u $row[12] $row[4] $row[4] $row[8] $row[0] $row[10] $row[0]   $row[10] $row[11] $row[13]
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
Modify agent and vicidial logs
\n"; echo "\n"; - $stmt="select * from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - $u=0; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} +echo "$call_log\n"; + + - $u++; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } echo "
# DATE/TIME LENGTH STATUS TSR CAMPAÑA LIST LEAD
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
\n"; echo "

\n"; echo "RECORDINGS FOR THIS LEAD:\n"; -echo "\n"; +echo "
\n"; echo "\n"; $stmt="select * from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; @@ -483,10 +513,10 @@ echo ""; echo ""; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo ""; echo "\n"; diff --git a/LANG_www/vicidial_es/listloader.php b/LANG_www/vicidial_es/listloader.php index 6fce7641..801ca169 100644 --- a/LANG_www/vicidial_es/listloader.php +++ b/LANG_www/vicidial_es/listloader.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell,Joe Johnson LICENSE: GPLv2 # # AST Web GUI lead loader from formatted file # @@ -15,12 +15,14 @@ # 60906-1059 - added filter of non-digits in alt_phone field # 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1046 - added postal code GMT lookup and duplicate check options +# 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. # -$version = '2.0.2'; -$build = '61128-1046'; +$version = '2.0.3'; +$build = '770417-1059'; header ("Content-type: text/html; charset=utf-8"); @@ -259,6 +261,8 @@ if ($leadfile and filesize($LF_path)<=8388608) { $called_since_last_reset='N'; $phone_list .= "$phone_number$US$list_id|"; + if (strlen($phone_code)<1) {$phone_code = '1';} + $postalgmt_found=0; if ( (eregi("POSTAL",$postalgmt)) && (strlen($postal_code)>4) ) { @@ -871,7 +875,6 @@ if ($leadfile and filesize($LF_path)<=8388608) { $AC_processed++; } - if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### $stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0);"; diff --git a/LANG_www/vicidial_es/listloader.pl b/LANG_www/vicidial_es/listloader.pl index b15bfbb8..f8164666 100644 --- a/LANG_www/vicidial_es/listloader.pl +++ b/LANG_www/vicidial_es/listloader.pl @@ -15,6 +15,8 @@ # 60906-1058 - added filter of non-digits in alt_phone field # 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1215 - added postal code GMT lookup and duplicate check options +# 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # ### begin parsing run-time options ### @@ -247,6 +249,8 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { { $phone_list .= "$phone_number$US$list_id|"; $postalgmt_found=0; + if (length($phone_code)<1) {$phone_code = '1';} + if ( ($postalgmt > 0) && (length($postal_code)>4) ) { if ($phone_code =~ /^1$/) @@ -454,7 +458,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } $total++; if ($total%100==0) { - print ""; + print ""; sleep(1); # flush(); } diff --git a/LANG_www/vicidial_es/listloader_super.pl b/LANG_www/vicidial_es/listloader_super.pl index 704e06b7..adf138ee 100644 --- a/LANG_www/vicidial_es/listloader_super.pl +++ b/LANG_www/vicidial_es/listloader_super.pl @@ -14,6 +14,8 @@ # 60906-1056 - added filter of non-digits in alt_phone field # 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1207 - added postal code GMT lookup and duplicate check options +# 70205-1703 - Defaulted phone_code to 1 if not populated +# 70417-1059 - Fixed default phone_code bug # ### begin parsing run-time options ### @@ -249,6 +251,8 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { { $phone_list .= "$phone_number$US$list_id|"; $postalgmt_found=0; + if (length($phone_code)<1) {$phone_code = '1';} + else {print "PHONE_CODE|$phone_code|\n";} if ( ($postalgmt > 0) && (length($postal_code)>4) ) { if ($phone_code =~ /^1$/) @@ -456,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } $total++; if ($total%100==0) { - print ""; + print ""; sleep(1); # flush(); } diff --git a/LANG_www/vicidial_es/new_listloader_superL.php b/LANG_www/vicidial_es/new_listloader_superL.php index 6d355b87..f8d3d983 100644 --- a/LANG_www/vicidial_es/new_listloader_superL.php +++ b/LANG_www/vicidial_es/new_listloader_superL.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell,Joe Johnson LICENSE: GPLv2 # # AST GUI lead loader from formatted file # @@ -17,11 +17,12 @@ # 60906-1100 - added filter of non-digits in alt_phone field # 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme # 61128-1149 - added postal code GMT lookup and duplicate check options +# 70417-1059 - Fixed default phone_code bug # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '2.0.2'; -$build = '61128-1149'; +$version = '2.0.3'; +$build = '70417-1059'; require("dbconnect.php"); @@ -417,6 +418,7 @@ function ParseFileName() { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -551,6 +553,7 @@ function ParseFileName() { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -702,6 +705,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|"; @@ -853,6 +857,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { + if (strlen($phone_code)<1) {$phone_code = '1';} $US='_'; $phone_list .= "$phone_number$US$list_id|";
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
# LEAD"; echo "$u $row[12] $row[4] $row[4] $row[8] $row[0] $row[10] $row[0]   $row[10] $row[11] $row[13]