updated LANG_www builds

git-svn-id: svn://192.168.202.10@603 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2007-04-27 16:20:39 +00:00
parent 5536fea566
commit f3bfea2f6a
61 changed files with 1383 additions and 608 deletions
+1 -1
View File
@@ -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);
}
}
+36 -6
View File
@@ -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";}
@@ -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);
}
}
+36 -6
View File
@@ -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";}
@@ -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);
}
}
+36 -6
View File
@@ -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";}
@@ -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);
}
}
+36 -6
View File
@@ -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";}
@@ -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);
}
}
+36 -6
View File
@@ -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";}
@@ -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);
}
}
+36 -6
View File
@@ -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";}
@@ -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);
}
}
+36 -6
View File
@@ -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";}
@@ -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);
}
}
+36 -6
View File
@@ -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";}
@@ -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);
}
}
+36 -6
View File
@@ -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";}
@@ -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);
}
}
+36 -6
View File
@@ -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";}
@@ -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";}
@@ -1,12 +1,14 @@
<?
# AST_server_performance.php
#
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell <vicidial@gmail.com> 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 "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo "<TITLE>VICIDIAL: Server Performance</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n";
echo "<SELECT SIZE=1 NAME=group>\n";
echo "Date: <INPUT TYPE=TEXT NAME=query_date SIZE=12 MAXLENGTH=10 VALUE=\"$query_date\"> &nbsp; \n";
echo "Time: <INPUT TYPE=TEXT NAME=begin_query_time SIZE=10 MAXLENGTH=8 VALUE=\"$begin_query_time\"> \n";
echo "to <INPUT TYPE=TEXT NAME=end_query_time SIZE=10 MAXLENGTH=8 VALUE=\"$end_query_time\"> \n";
echo "Server: <SELECT SIZE=1 NAME=group>\n";
$o=0;
while ($servers_to_print > $o)
{
@@ -90,11 +98,7 @@ echo "<SELECT SIZE=1 NAME=group>\n";
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
$o++;
}
echo "</SELECT>\n";
echo "<SELECT SIZE=1 NAME=shift>\n";
echo "<option selected value=\"AM\">AM</option>\n";
echo "<option value=\"PM\">PM</option>\n";
echo "</SELECT>\n";
echo "</SELECT> \n";
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
echo "</FORM>\n\n";
@@ -105,46 +109,35 @@ echo "<PRE><FONT SIZE=2>\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";
@@ -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 .= "<tr $bgcolor>";
$call_log .= "<td><font size=1>$u</td>";
$call_log .= "<td><font size=2>$row[4]</td>";
$call_log .= "<td align=left><font size=2> $row[7]</td>\n";
$call_log .= "<td align=left><font size=2> $row[8]</td>\n";
$call_log .= "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
$call_log .= "<td align=right><font size=2> $row[3] </td>\n";
$call_log .= "<td align=right><font size=2> $row[2] </td>\n";
$call_log .= "<td align=right><font size=2> $row[1] </td></tr>\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 .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\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 .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
$o++;
}
if ($DS < 1) {$statuses_list .= "<option SELECTED value=\"$dispo\">$dispo</option>\n";}
echo "$statuses_list";
echo "</select></td></tr>\n";
echo "</select> <i>(with $log_campaign statuses)</i></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=left>Modify agent and vicidial logs </td><td align=left><input type=checkbox name=modify_logs value=\"1\" CHECKED></td></tr>\n";
@@ -433,38 +481,19 @@ echo "<B>CALLS TO THIS LEAD:</B>\n";
echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n";
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> TSR</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td></tr>\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 "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td><font size=2>$row[4]</td>";
echo "<td align=left><font size=2> $row[7]</td>\n";
echo "<td align=left><font size=2> $row[8]</td>\n";
echo "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
echo "<td align=right><font size=2> $row[3] </td>\n";
echo "<td align=right><font size=2> $row[2] </td>\n";
echo "<td align=right><font size=2> $row[1] </td></tr>\n";
}
echo "</TABLE></center>\n";
echo "<BR><BR>\n";
echo "<B>RECORDINGS FOR THIS LEAD:</B>\n";
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
echo "<TABLE width=750 cellspacing=1 cellpadding=1>\n";
echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2> &nbsp; RECID</td><td align=center><font size=2>FILENAME</td><td align=left><font size=2>LOCATION</td><td align=left><font size=2>TSR</td></tr>\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 "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon
echo "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td align=left><font size=2> $row[12] </td>";
echo "<td align=left><font size=2> $row[4] </td>\n";
echo "<td align=left><font size=1> $row[4] </td>\n";
echo "<td align=left><font size=2> $row[8] </td>\n";
echo "<td align=left><font size=2> $row[0] </td>\n";
echo "<td align=center><font size=2> $row[10] </td>\n";
echo "<td align=left><font size=2> $row[0] &nbsp;</td>\n";
echo "<td align=center><font size=1> $row[10] </td>\n";
echo "<td align=left><font size=2> $row[11] </td>\n";
echo "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[13]\" target=\"_blank\">$row[13]</A> </td>";
echo "</tr>\n";
@@ -1,7 +1,7 @@
<?
# listloader.php
#
# Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> 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);";
@@ -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);";
@@ -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);";
@@ -1,7 +1,7 @@
<?
# new_listloader_superL.php
#
# Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> 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|";
@@ -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";}
@@ -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 "<option selected value=\"AM\">AM</option>\n";
echo "<option value=\"PM\">PM</option>\n";
echo "</SELECT>\n";
echo "<INPUT TYPE=Submit NAME=SUBMIT VALUE=SUBMIT>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">ÄNDERN Sie</a> | <a href=\"./server_stats.php\">REPORTS</a> </FONT>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">ÄNDERN Sie</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
echo "</FORM>\n\n";
echo "<PRE><FONT SIZE=2>\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";
@@ -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++;
}
?>
<HTML>
@@ -86,12 +106,25 @@ echo "<SELECT SIZE=1 NAME=group>\n";
$o++;
}
echo "</SELECT>\n";
echo "<SELECT SIZE=1 NAME=user_group>\n";
echo "<option value=\"\">-- ALL BENUTZER-GRUPPEN --</option>\n";
$o=0;
while ($user_groups_to_print > $o)
{
if ($user_groups[$o] == $user_group) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
else {echo "<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
$o++;
}
echo "</SELECT>\n";
echo "<SELECT SIZE=1 NAME=shift>\n";
echo "<option selected value=\"AM\">AM</option>\n";
echo "<option selected value=\"$shift\">$shift</option>\n";
echo "<option value=\"\">--</option>\n";
echo "<option value=\"AM\">AM</option>\n";
echo "<option value=\"PM\">PM</option>\n";
echo "<option value=\"ALL\">ALL</option>\n";
echo "</SELECT>\n";
echo "<INPUT TYPE=Submit NAME=SUBMIT VALUE=SUBMIT>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">ÄNDERN Sie</a> | <a href=\"./server_stats.php\">REPORTS</a> </FONT>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">ÄNDERN Sie</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
echo "</FORM>\n\n";
echo "<PRE><FONT SIZE=2>\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";
@@ -1,12 +1,14 @@
<?
# AST_server_performance.php
#
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell <vicidial@gmail.com> 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 "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo "<TITLE>VICIDIAL: Server Performance</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n";
echo "<SELECT SIZE=1 NAME=group>\n";
echo "Date: <INPUT TYPE=TEXT NAME=query_date SIZE=12 MAXLENGTH=10 VALUE=\"$query_date\"> &nbsp; \n";
echo "Time: <INPUT TYPE=TEXT NAME=begin_query_time SIZE=10 MAXLENGTH=8 VALUE=\"$begin_query_time\"> \n";
echo "to <INPUT TYPE=TEXT NAME=end_query_time SIZE=10 MAXLENGTH=8 VALUE=\"$end_query_time\"> \n";
echo "Server: <SELECT SIZE=1 NAME=group>\n";
$o=0;
while ($servers_to_print > $o)
{
@@ -90,11 +98,7 @@ echo "<SELECT SIZE=1 NAME=group>\n";
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
$o++;
}
echo "</SELECT>\n";
echo "<SELECT SIZE=1 NAME=shift>\n";
echo "<option selected value=\"AM\">AM</option>\n";
echo "<option value=\"PM\">PM</option>\n";
echo "</SELECT>\n";
echo "</SELECT> \n";
echo "<INPUT TYPE=Submit NAME=SUBMIT VALUE=SUBMIT>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
echo "</FORM>\n\n";
@@ -105,46 +109,35 @@ echo "<PRE><FONT SIZE=2>\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";
@@ -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 .= "<tr $bgcolor>";
$call_log .= "<td><font size=1>$u</td>";
$call_log .= "<td><font size=2>$row[4]</td>";
$call_log .= "<td align=left><font size=2> $row[7]</td>\n";
$call_log .= "<td align=left><font size=2> $row[8]</td>\n";
$call_log .= "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
$call_log .= "<td align=right><font size=2> $row[3] </td>\n";
$call_log .= "<td align=right><font size=2> $row[2] </td>\n";
$call_log .= "<td align=right><font size=2> $row[1] </td></tr>\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 .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\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 .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
$o++;
}
if ($DS < 1) {$statuses_list .= "<option SELECTED value=\"$dispo\">$dispo</option>\n";}
echo "$statuses_list";
echo "</select></td></tr>\n";
echo "</select> <i>(with $log_campaign statuses)</i></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=left>Modify agent and vicidial logs </td><td align=left><input type=checkbox name=modify_logs value=\"1\" CHECKED></td></tr>\n";
@@ -432,38 +481,19 @@ echo "<B>ANRUFE ZU DIESEM LEITUNG:</B>\n";
echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n";
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> TSR</td><td align=right><font size=2> KAMPAGNE</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td></tr>\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 "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td><font size=2>$row[4]</td>";
echo "<td align=left><font size=2> $row[7]</td>\n";
echo "<td align=left><font size=2> $row[8]</td>\n";
echo "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
echo "<td align=right><font size=2> $row[3] </td>\n";
echo "<td align=right><font size=2> $row[2] </td>\n";
echo "<td align=right><font size=2> $row[1] </td></tr>\n";
}
echo "</TABLE></center>\n";
echo "<BR><BR>\n";
echo "<B>RECORDINGS FOR THIS LEAD:</B>\n";
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
echo "<TABLE width=750 cellspacing=1 cellpadding=1>\n";
echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2> &nbsp; RECID</td><td align=center><font size=2>FILENAME</td><td align=left><font size=2>LOCATION</td><td align=left><font size=2>TSR</td></tr>\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 "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon
echo "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td align=left><font size=2> $row[12] </td>";
echo "<td align=left><font size=2> $row[4] </td>\n";
echo "<td align=left><font size=1> $row[4] </td>\n";
echo "<td align=left><font size=2> $row[8] </td>\n";
echo "<td align=left><font size=2> $row[0] </td>\n";
echo "<td align=center><font size=2> $row[10] </td>\n";
echo "<td align=left><font size=2> $row[0] &nbsp;</td>\n";
echo "<td align=center><font size=1> $row[10] </td>\n";
echo "<td align=left><font size=2> $row[11] </td>\n";
echo "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[13]\" target=\"_blank\">$row[13]</A> </td>";
echo "</tr>\n";
@@ -1,7 +1,7 @@
<?
# listloader.php
#
# Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> 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);";
@@ -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 "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total)</script>";
print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total, $dup_lead, $postalgmt_found)</script>";
sleep(1);
# flush();
}
@@ -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 "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total)</script>";
print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total, $dup_lead, $postalgmt_found)</script>";
sleep(1);
# flush();
}
@@ -1,7 +1,7 @@
<?
# new_listloader_superL.php
#
# Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> 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|";
@@ -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";}
@@ -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 "<option selected value=\"AM\">AM</option>\n";
echo "<option value=\"PM\">PM</option>\n";
echo "</SELECT>\n";
echo "<INPUT TYPE=Submit NAME=ΕΠΙΒΕΒΑΙΩΣΗ VALUE=ΥΠΟΒΑΛΛΩ>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">ΤΡΟΠΟΠΟΙΗΣΗ</a> | <a href=\"./server_stats.php\">ΑΝΑΦΟΡΕΣ</a> </FONT>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">ΤΡΟΠΟΠΟΙΗΣΗ</a> | <a href=\"./admin.php?ADD=999999\">ΑΝΑΦΟΡΕΣ</a> </FONT>\n";
echo "</FORM>\n\n";
echo "<PRE><FONT SIZE=2>\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";
@@ -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++;
}
?>
<HTML>
@@ -86,12 +106,25 @@ echo "<SELECT SIZE=1 NAME=group>\n";
$o++;
}
echo "</SELECT>\n";
echo "<SELECT SIZE=1 NAME=user_group>\n";
echo "<option value=\"\">-- ALL ΟΜΑΔΕΣ ΧΡΗΣΤΗ --</option>\n";
$o=0;
while ($user_groups_to_print > $o)
{
if ($user_groups[$o] == $user_group) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
else {echo "<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
$o++;
}
echo "</SELECT>\n";
echo "<SELECT SIZE=1 NAME=shift>\n";
echo "<option selected value=\"AM\">AM</option>\n";
echo "<option selected value=\"$shift\">$shift</option>\n";
echo "<option value=\"\">--</option>\n";
echo "<option value=\"AM\">AM</option>\n";
echo "<option value=\"PM\">PM</option>\n";
echo "<option value=\"ALL\">ALL</option>\n";
echo "</SELECT>\n";
echo "<INPUT TYPE=Submit NAME=ΕΠΙΒΕΒΑΙΩΣΗ VALUE=ΥΠΟΒΑΛΛΩ>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">ΤΡΟΠΟΠΟΙΗΣΗ</a> | <a href=\"./server_stats.php\">ΑΝΑΦΟΡΕΣ</a> </FONT>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">ΤΡΟΠΟΠΟΙΗΣΗ</a> | <a href=\"./admin.php?ADD=999999\">ΑΝΑΦΟΡΕΣ</a> </FONT>\n";
echo "</FORM>\n\n";
echo "<PRE><FONT SIZE=2>\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";
@@ -1,12 +1,14 @@
<?
# AST_server_performance.php
#
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell <vicidial@gmail.com> 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 "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo "<TITLE>VICIDIAL: Server Performance</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n";
echo "<SELECT SIZE=1 NAME=group>\n";
echo "Date: <INPUT TYPE=TEXT NAME=query_date SIZE=12 MAXLENGTH=10 VALUE=\"$query_date\"> &nbsp; \n";
echo "Time: <INPUT TYPE=TEXT NAME=begin_query_time SIZE=10 MAXLENGTH=8 VALUE=\"$begin_query_time\"> \n";
echo "to <INPUT TYPE=TEXT NAME=end_query_time SIZE=10 MAXLENGTH=8 VALUE=\"$end_query_time\"> \n";
echo "Server: <SELECT SIZE=1 NAME=group>\n";
$o=0;
while ($servers_to_print > $o)
{
@@ -90,11 +98,7 @@ echo "<SELECT SIZE=1 NAME=group>\n";
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
$o++;
}
echo "</SELECT>\n";
echo "<SELECT SIZE=1 NAME=shift>\n";
echo "<option selected value=\"AM\">AM</option>\n";
echo "<option value=\"PM\">PM</option>\n";
echo "</SELECT>\n";
echo "</SELECT> \n";
echo "<INPUT TYPE=Submit NAME=ΕΠΙΒΕΒΑΙΩΣΗ VALUE=ΥΠΟΒΑΛΛΩ>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=999999\">ΑΝΑΦΟΡΕΣ</a> </FONT>\n";
echo "</FORM>\n\n";
@@ -105,46 +109,35 @@ echo "<PRE><FONT SIZE=2>\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";
@@ -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 .= "<tr $bgcolor>";
$call_log .= "<td><font size=1>$u</td>";
$call_log .= "<td><font size=2>$row[4]</td>";
$call_log .= "<td align=left><font size=2> $row[7]</td>\n";
$call_log .= "<td align=left><font size=2> $row[8]</td>\n";
$call_log .= "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
$call_log .= "<td align=right><font size=2> $row[3] </td>\n";
$call_log .= "<td align=right><font size=2> $row[2] </td>\n";
$call_log .= "<td align=right><font size=2> $row[1] </td></tr>\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 .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\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 .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
$o++;
}
if ($DS < 1) {$statuses_list .= "<option SELECTED value=\"$dispo\">$dispo</option>\n";}
echo "$statuses_list";
echo "</select></td></tr>\n";
echo "</select> <i>(with $log_campaign statuses)</i></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=left>Modify agent and vicidial logs </td><td align=left><input type=checkbox name=modify_logs value=\"1\" CHECKED></td></tr>\n";
@@ -432,38 +481,19 @@ echo "<B>Κλήσεις για αυτόν τον οδηγό:</B>\n";
echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n";
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> TSR</td><td align=right><font size=2>ΕΚΣΤΡΑΤΕΙΑ</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td></tr>\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 "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td><font size=2>$row[4]</td>";
echo "<td align=left><font size=2> $row[7]</td>\n";
echo "<td align=left><font size=2> $row[8]</td>\n";
echo "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
echo "<td align=right><font size=2> $row[3] </td>\n";
echo "<td align=right><font size=2> $row[2] </td>\n";
echo "<td align=right><font size=2> $row[1] </td></tr>\n";
}
echo "</TABLE></center>\n";
echo "<BR><BR>\n";
echo "<B>RECORDINGS FOR THIS LEAD:</B>\n";
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
echo "<TABLE width=750 cellspacing=1 cellpadding=1>\n";
echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2> &nbsp; RECID</td><td align=center><font size=2>FILENAME</td><td align=left><font size=2>LOCATION</td><td align=left><font size=2>TSR</td></tr>\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 "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon
echo "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td align=left><font size=2> $row[12] </td>";
echo "<td align=left><font size=2> $row[4] </td>\n";
echo "<td align=left><font size=1> $row[4] </td>\n";
echo "<td align=left><font size=2> $row[8] </td>\n";
echo "<td align=left><font size=2> $row[0] </td>\n";
echo "<td align=center><font size=2> $row[10] </td>\n";
echo "<td align=left><font size=2> $row[0] &nbsp;</td>\n";
echo "<td align=center><font size=1> $row[10] </td>\n";
echo "<td align=left><font size=2> $row[11] </td>\n";
echo "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[13]\" target=\"_blank\">$row[13]</A> </td>";
echo "</tr>\n";
@@ -1,7 +1,7 @@
<?
# listloader.php
#
# Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> 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);";
@@ -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 "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total)</script>";
print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total, $dup_lead, $postalgmt_found)</script>";
sleep(1);
# flush();
}
@@ -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 "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total)</script>";
print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total, $dup_lead, $postalgmt_found)</script>";
sleep(1);
# flush();
}
@@ -1,7 +1,7 @@
<?
# new_listloader_superL.php
#
# Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> 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|";
@@ -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";}
@@ -1,12 +1,14 @@
<?
# AST_server_performance.php
#
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell <vicidial@gmail.com> 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 "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo "<TITLE>VICIDIAL: Server Performance</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n";
echo "<SELECT SIZE=1 NAME=group>\n";
echo "Date: <INPUT TYPE=TEXT NAME=query_date SIZE=12 MAXLENGTH=10 VALUE=\"$query_date\"> &nbsp; \n";
echo "Time: <INPUT TYPE=TEXT NAME=begin_query_time SIZE=10 MAXLENGTH=8 VALUE=\"$begin_query_time\"> \n";
echo "to <INPUT TYPE=TEXT NAME=end_query_time SIZE=10 MAXLENGTH=8 VALUE=\"$end_query_time\"> \n";
echo "Server: <SELECT SIZE=1 NAME=group>\n";
$o=0;
while ($servers_to_print > $o)
{
@@ -90,11 +98,7 @@ echo "<SELECT SIZE=1 NAME=group>\n";
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
$o++;
}
echo "</SELECT>\n";
echo "<SELECT SIZE=1 NAME=shift>\n";
echo "<option selected value=\"AM\">AM</option>\n";
echo "<option value=\"PM\">PM</option>\n";
echo "</SELECT>\n";
echo "</SELECT> \n";
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
echo "</FORM>\n\n";
@@ -105,46 +109,35 @@ echo "<PRE><FONT SIZE=2>\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";
@@ -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 .= "<tr $bgcolor>";
$call_log .= "<td><font size=1>$u</td>";
$call_log .= "<td><font size=2>$row[4]</td>";
$call_log .= "<td align=left><font size=2> $row[7]</td>\n";
$call_log .= "<td align=left><font size=2> $row[8]</td>\n";
$call_log .= "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
$call_log .= "<td align=right><font size=2> $row[3] </td>\n";
$call_log .= "<td align=right><font size=2> $row[2] </td>\n";
$call_log .= "<td align=right><font size=2> $row[1] </td></tr>\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 .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\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 .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
$o++;
}
if ($DS < 1) {$statuses_list .= "<option SELECTED value=\"$dispo\">$dispo</option>\n";}
echo "$statuses_list";
echo "</select></td></tr>\n";
echo "</select> <i>(with $log_campaign statuses)</i></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=left>Modify agent and vicidial logs </td><td align=left><input type=checkbox name=modify_logs value=\"1\" CHECKED></td></tr>\n";
@@ -433,38 +481,19 @@ echo "<B>CALLS TO THIS LEAD:</B>\n";
echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n";
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> TSR</td><td align=right><font size=2> CAMPAIGN</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td></tr>\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 "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td><font size=2>$row[4]</td>";
echo "<td align=left><font size=2> $row[7]</td>\n";
echo "<td align=left><font size=2> $row[8]</td>\n";
echo "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
echo "<td align=right><font size=2> $row[3] </td>\n";
echo "<td align=right><font size=2> $row[2] </td>\n";
echo "<td align=right><font size=2> $row[1] </td></tr>\n";
}
echo "</TABLE></center>\n";
echo "<BR><BR>\n";
echo "<B>RECORDINGS FOR THIS LEAD:</B>\n";
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
echo "<TABLE width=750 cellspacing=1 cellpadding=1>\n";
echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2> &nbsp; RECID</td><td align=center><font size=2>FILENAME</td><td align=left><font size=2>LOCATION</td><td align=left><font size=2>TSR</td></tr>\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 "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon
echo "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td align=left><font size=2> $row[12] </td>";
echo "<td align=left><font size=2> $row[4] </td>\n";
echo "<td align=left><font size=1> $row[4] </td>\n";
echo "<td align=left><font size=2> $row[8] </td>\n";
echo "<td align=left><font size=2> $row[0] </td>\n";
echo "<td align=center><font size=2> $row[10] </td>\n";
echo "<td align=left><font size=2> $row[0] &nbsp;</td>\n";
echo "<td align=center><font size=1> $row[10] </td>\n";
echo "<td align=left><font size=2> $row[11] </td>\n";
echo "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[13]\" target=\"_blank\">$row[13]</A> </td>";
echo "</tr>\n";
@@ -1,7 +1,7 @@
<?
# listloader.php
#
# Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> 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);";
@@ -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);";
@@ -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);";
@@ -1,7 +1,7 @@
<?
# new_listloader_superL.php
#
# Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> 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|";
@@ -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";}
@@ -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 "<option selected value=\"AM\">AM</option>\n";
echo "<option value=\"PM\">PM</option>\n";
echo "</SELECT>\n";
echo "<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFICAR</a> | <a href=\"./server_stats.php\">INFORMES</a> </FONT>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFICAR</a> | <a href=\"./admin.php?ADD=999999\">INFORMES</a> </FONT>\n";
echo "</FORM>\n\n";
echo "<PRE><FONT SIZE=2>\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";
@@ -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++;
}
?>
<HTML>
@@ -86,12 +106,25 @@ echo "<SELECT SIZE=1 NAME=group>\n";
$o++;
}
echo "</SELECT>\n";
echo "<SELECT SIZE=1 NAME=user_group>\n";
echo "<option value=\"\">-- ALL GRUPOS DE USUARIO --</option>\n";
$o=0;
while ($user_groups_to_print > $o)
{
if ($user_groups[$o] == $user_group) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
else {echo "<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
$o++;
}
echo "</SELECT>\n";
echo "<SELECT SIZE=1 NAME=shift>\n";
echo "<option selected value=\"AM\">AM</option>\n";
echo "<option selected value=\"$shift\">$shift</option>\n";
echo "<option value=\"\">--</option>\n";
echo "<option value=\"AM\">AM</option>\n";
echo "<option value=\"PM\">PM</option>\n";
echo "<option value=\"ALL\">ALL</option>\n";
echo "</SELECT>\n";
echo "<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFICAR</a> | <a href=\"./server_stats.php\">INFORMES</a> </FONT>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFICAR</a> | <a href=\"./admin.php?ADD=999999\">INFORMES</a> </FONT>\n";
echo "</FORM>\n\n";
echo "<PRE><FONT SIZE=2>\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";
@@ -1,12 +1,14 @@
<?
# AST_server_performance.php
#
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell <vicidial@gmail.com> 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 "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo "<TITLE>VICIDIAL: Server Performance</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date\">\n";
echo "<SELECT SIZE=1 NAME=group>\n";
echo "Date: <INPUT TYPE=TEXT NAME=query_date SIZE=12 MAXLENGTH=10 VALUE=\"$query_date\"> &nbsp; \n";
echo "Time: <INPUT TYPE=TEXT NAME=begin_query_time SIZE=10 MAXLENGTH=8 VALUE=\"$begin_query_time\"> \n";
echo "to <INPUT TYPE=TEXT NAME=end_query_time SIZE=10 MAXLENGTH=8 VALUE=\"$end_query_time\"> \n";
echo "Server: <SELECT SIZE=1 NAME=group>\n";
$o=0;
while ($servers_to_print > $o)
{
@@ -90,11 +98,7 @@ echo "<SELECT SIZE=1 NAME=group>\n";
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
$o++;
}
echo "</SELECT>\n";
echo "<SELECT SIZE=1 NAME=shift>\n";
echo "<option selected value=\"AM\">AM</option>\n";
echo "<option value=\"PM\">PM</option>\n";
echo "</SELECT>\n";
echo "</SELECT> \n";
echo "<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=999999\">INFORMES</a> </FONT>\n";
echo "</FORM>\n\n";
@@ -105,46 +109,35 @@ echo "<PRE><FONT SIZE=2>\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";
@@ -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 .= "<tr $bgcolor>";
$call_log .= "<td><font size=1>$u</td>";
$call_log .= "<td><font size=2>$row[4]</td>";
$call_log .= "<td align=left><font size=2> $row[7]</td>\n";
$call_log .= "<td align=left><font size=2> $row[8]</td>\n";
$call_log .= "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
$call_log .= "<td align=right><font size=2> $row[3] </td>\n";
$call_log .= "<td align=right><font size=2> $row[2] </td>\n";
$call_log .= "<td align=right><font size=2> $row[1] </td></tr>\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 .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\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 .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
$o++;
}
if ($DS < 1) {$statuses_list .= "<option SELECTED value=\"$dispo\">$dispo</option>\n";}
echo "$statuses_list";
echo "</select></td></tr>\n";
echo "</select> <i>(with $log_campaign statuses)</i></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=left>Modify agent and vicidial logs </td><td align=left><input type=checkbox name=modify_logs value=\"1\" CHECKED></td></tr>\n";
@@ -432,38 +481,19 @@ echo "<B>LLAMADAS A ESTE LEAD:</B>\n";
echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n";
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> TSR</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td></tr>\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 "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td><font size=2>$row[4]</td>";
echo "<td align=left><font size=2> $row[7]</td>\n";
echo "<td align=left><font size=2> $row[8]</td>\n";
echo "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[11]\" target=\"_blank\">$row[11]</A> </td>\n";
echo "<td align=right><font size=2> $row[3] </td>\n";
echo "<td align=right><font size=2> $row[2] </td>\n";
echo "<td align=right><font size=2> $row[1] </td></tr>\n";
}
echo "</TABLE></center>\n";
echo "<BR><BR>\n";
echo "<B>RECORDINGS FOR THIS LEAD:</B>\n";
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
echo "<TABLE width=750 cellspacing=1 cellpadding=1>\n";
echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><font size=2>DATE/TIME </td><td align=left><font size=2>SECONDS </td><td align=left><font size=2> &nbsp; RECID</td><td align=center><font size=2>FILENAME</td><td align=left><font size=2>LOCATION</td><td align=left><font size=2>TSR</td></tr>\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 "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon
echo "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td align=left><font size=2> $row[12] </td>";
echo "<td align=left><font size=2> $row[4] </td>\n";
echo "<td align=left><font size=1> $row[4] </td>\n";
echo "<td align=left><font size=2> $row[8] </td>\n";
echo "<td align=left><font size=2> $row[0] </td>\n";
echo "<td align=center><font size=2> $row[10] </td>\n";
echo "<td align=left><font size=2> $row[0] &nbsp;</td>\n";
echo "<td align=center><font size=1> $row[10] </td>\n";
echo "<td align=left><font size=2> $row[11] </td>\n";
echo "<td align=left><font size=2> <A HREF=\"user_stats.php?user=$row[13]\" target=\"_blank\">$row[13]</A> </td>";
echo "</tr>\n";
@@ -1,7 +1,7 @@
<?
# listloader.php
#
# Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> 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);";
@@ -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 "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total)</script>";
print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total, $dup_lead, $postalgmt_found)</script>";
sleep(1);
# flush();
}
@@ -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 "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total)</script>";
print "<script language='JavaScript1.2'>ShowProgress($good, $bad, $total, $dup_lead, $postalgmt_found)</script>";
sleep(1);
# flush();
}
@@ -1,7 +1,7 @@
<?
# new_listloader_superL.php
#
# Copyright (C) 2006 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: GPLv2
# Copyright (C) 2007 Matt Florell,Joe Johnson <vicidial@gmail.com> 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|";