Added Agent Lead Search feature

Added display of lead searches in user stats page
Fixed rare performance bug in real time report

git-svn-id: svn://192.168.202.10@1603 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2011-02-18 20:53:57 +00:00
parent 15e6a4be4d
commit 05222d16b6
11 changed files with 1101 additions and 255 deletions
+5
View File
@@ -464,6 +464,11 @@ OTHER CHANGES:
109. Added the add-a-new-lead link to the admin interface
110. Added ability for an agent to search for a lead in the agent interface
while paused. This feature can be enabled per campaign and per user.
Searches can optionally be restricted to campaign lists or only one
list. All search queries are logged.
+106 -2
View File
@@ -20,7 +20,7 @@
# Based on perl scripts in ViciDial from Matt Florell and post:
# http://www.vicidial.org/VICIDIALforum/viewtopic.php?p=22506&sid=ca5347cffa6f6382f56ce3db9fb3d068#22506
#
# Copyright (C) 2010 I. Taushanov, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2011 I. Taushanov, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 90615-1701 - First version
@@ -28,6 +28,7 @@
# 100103-2052 - Formatting fixes, name change, added initial table counts and added archive tables to official SQL files
# 100109-1018 - Added vicidial_carrier_log archiving
# 100328-1008 - Added --months CLI option
# 110218-1200 - Added notes and search log archiving
#
### begin parsing run-time options ###
@@ -97,7 +98,8 @@ $del_time = "$year-$mon-$mday 01:00:00";
if (!$Q) {print "\n\n-- ADMIN_archive_log_tables.pl --\n\n";}
if (!$Q) {print "This program is designed to put all records from call_log, vicidial_log,\n";}
if (!$Q) {print "server_performance, vicidial_agent_log and vicidial_carrier_log in relevant\n";}
if (!$Q) {print "server_performance, vicidial_agent_log, vicidial_carrier_log, \n";}
if (!$Q) {print "vicidial_call_notes and vicidial_lead_search_log in relevant\n";}
if (!$Q) {print "_archive tables and delete records in original tables older than\n";}
if (!$Q) {print "$CLImonths months ( $del_time ) from current date \n\n";}
@@ -382,6 +384,108 @@ if (!$T)
}
##### vicidial_call_notes
$stmtA = "SELECT count(*) from vicidial_call_notes;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$vicidial_call_notes_count = $aryA[0];
}
$sthA->finish();
$stmtA = "SELECT count(*) from vicidial_call_notes_archive;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$vicidial_call_notes_archive_count = $aryA[0];
}
$sthA->finish();
if (!$Q) {print "\nProcessing vicidial_call_notes table... ($vicidial_call_notes_count|$vicidial_call_notes_archive_count)\n";}
$stmtA = "INSERT IGNORE INTO vicidial_call_notes_archive SELECT * from vicidial_call_notes;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows = $sthA->rows;
if (!$Q) {print "$sthArows rows inserted into vicidial_call_notes_archive table \n";}
$rv = $sthA->err();
if (!$rv)
{
$stmtA = "DELETE FROM vicidial_call_notes WHERE call_date < '$del_time';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows = $sthA->rows;
if (!$Q) {print "$sthArows rows deleted from vicidial_call_notes table \n";}
$stmtA = "optimize table vicidial_call_notes;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$stmtA = "optimize table vicidial_call_notes_archive;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
}
##### vicidial_lead_search_log
$stmtA = "SELECT count(*) from vicidial_lead_search_log;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$vicidial_lead_search_log_count = $aryA[0];
}
$sthA->finish();
$stmtA = "SELECT count(*) from vicidial_lead_search_log_archive;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$vicidial_lead_search_log_archive_count = $aryA[0];
}
$sthA->finish();
if (!$Q) {print "\nProcessing vicidial_lead_search_log table... ($vicidial_lead_search_log_count|$vicidial_lead_search_log_archive_count)\n";}
$stmtA = "INSERT IGNORE INTO vicidial_lead_search_log_archive SELECT * from vicidial_lead_search_log;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows = $sthA->rows;
if (!$Q) {print "$sthArows rows inserted into vicidial_lead_search_log_archive table \n";}
$rv = $sthA->err();
if (!$rv)
{
$stmtA = "DELETE FROM vicidial_lead_search_log WHERE event_date < '$del_time';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows = $sthA->rows;
if (!$Q) {print "$sthArows rows deleted from vicidial_lead_search_log table \n";}
$stmtA = "optimize table vicidial_lead_search_log;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$stmtA = "optimize table vicidial_lead_search_log_archive;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
}
#$dbhA->disconnect();
#print "$del_time\n\n";
@@ -564,7 +564,8 @@ callcard_admin ENUM('1','0') default '0',
agent_choose_blended ENUM('0','1') default '1',
realtime_block_user_info ENUM('0','1') default '0',
custom_fields_modify ENUM('0','1') default '0',
force_change_password ENUM('Y','N') default 'N'
force_change_password ENUM('Y','N') default 'N',
agent_lead_search_override ENUM('NOT_ACTIVE','ENABLED','DISABLED') default 'NOT_ACTIVE'
);
CREATE UNIQUE INDEX user ON vicidial_users (user);
@@ -785,7 +786,9 @@ display_leads_count ENUM('Y','N') default 'N',
lead_order_randomize ENUM('Y','N') default 'N',
lead_order_secondary ENUM('LEAD_ASCEND','LEAD_DESCEND','CALLTIME_ASCEND','CALLTIME_DESCEND') default 'LEAD_ASCEND',
per_call_notes ENUM('ENABLED','DISABLED') default 'DISABLED',
my_callback_option ENUM('CHECKED','UNCHECKED') default 'UNCHECKED'
my_callback_option ENUM('CHECKED','UNCHECKED') default 'UNCHECKED',
agent_lead_search ENUM('ENABLED','DISABLED') default 'DISABLED',
agent_lead_search_method ENUM('SYSTEM','CAMPAIGNLISTS','CAMPLISTS_ALL','LIST') default 'CAMPLISTS_ALL'
);
CREATE TABLE vicidial_lists (
@@ -2276,6 +2279,18 @@ external_dial VARCHAR(100) default '',
index (user)
);
CREATE TABLE vicidial_lead_search_log (
search_log_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
user VARCHAR(20) NOT NULL,
event_date DATETIME NOT NULL,
source VARCHAR(10) default '',
search_query TEXT,
results INT(9) UNSIGNED default '0',
seconds MEDIUMINT(7) UNSIGNED default '0',
index (user),
index (event_date)
);
ALTER TABLE vicidial_campaign_server_stats ENGINE=MEMORY;
@@ -2422,7 +2437,10 @@ CREATE TABLE vicidial_carrier_log_archive LIKE vicidial_carrier_log;
CREATE TABLE vicidial_call_notes_archive LIKE vicidial_call_notes;
ALTER TABLE vicidial_call_notes_archive MODIFY notesid INT(9) UNSIGNED NOT NULL;
UPDATE system_settings SET db_schema_version='1260',db_schema_update_date=NOW();
CREATE TABLE vicidial_lead_search_log_archive LIKE vicidial_lead_search_log;
ALTER TABLE vicidial_lead_search_log_archive MODIFY search_log_id INT(9) UNSIGNED NOT NULL;
UPDATE system_settings SET db_schema_version='1261',db_schema_update_date=NOW();
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
+23
View File
@@ -663,3 +663,26 @@ ALTER TABLE vicidial_campaigns ADD per_call_notes ENUM('ENABLED','DISABLED') def
ALTER TABLE vicidial_campaigns ADD my_callback_option ENUM('CHECKED','UNCHECKED') default 'UNCHECKED';
UPDATE system_settings SET db_schema_version='1260',db_schema_update_date=NOW();
ALTER TABLE vicidial_campaigns ADD agent_lead_search ENUM('ENABLED','DISABLED') default 'DISABLED';
ALTER TABLE vicidial_campaigns MODIFY agent_lead_search_method ENUM('SYSTEM','CAMPAIGNLISTS','CAMPLISTS_ALL','LIST') default 'CAMPLISTS_ALL';
ALTER TABLE vicidial_users ADD agent_lead_search_override ENUM('NOT_ACTIVE','ENABLED','DISABLED') default 'NOT_ACTIVE';
CREATE TABLE vicidial_lead_search_log (
search_log_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
user VARCHAR(20) NOT NULL,
event_date DATETIME NOT NULL,
source VARCHAR(10) default '',
search_query TEXT,
results INT(9) UNSIGNED default '0',
seconds MEDIUMINT(7) UNSIGNED default '0',
index (user),
index (event_date)
);
CREATE TABLE vicidial_lead_search_log_archive LIKE vicidial_lead_search_log;
ALTER TABLE vicidial_lead_search_log_archive MODIFY search_log_id INT(9) UNSIGNED NOT NULL;
UPDATE system_settings SET db_schema_version='1261',db_schema_update_date=NOW();
@@ -514,6 +514,13 @@ If List Order Randomize is enabled, this option will be ignored||
ERROR: Lead not added, please go back and look at what you entered||
Lead has been added||
Add A New Lead||
Agent Lead Search Override||
This setting will override whatever the campaign has set for Agent Lead Search. NOT_ACTIVE will use the campaign setting. ENABLED will allow lead searching and DISABLED will not allow lead searching. Default is NOT_ACTIVE||
Agent Lead Search||
Setting this option to ENABLED will allow agents to search for leads and view lead information while paused in the agent interface. Also, if the Agent User Group is allowed to view Call Logs then the agent will be able to view past call notes for any lead that they are viewing information on. Default is DISABLED||
Agent Lead Search Method||
If Agent Lead Search is enabled, this setting defines where the agent will be allowed to search for leads. SYSTEM will search the entire system, CAMPAIGNLISTS will search inside all of the active lists within the campaign, CAMPLISTS_ALL will search inside all of the active and inactive lists within the campaign, LIST will search only within the Manual Dial List ID as defined in the campaign. Default is CAMPLISTS_ALL||
LEAD SEARCHES FOR THIS TIME PERIOD||
AST_LISTS_campaign_stats.php
@@ -542,6 +549,20 @@ view notes||
CALL NOTES LOG||
Close Call Notes||
CALL LOG FOR THIS LEAD||
SEARCH FOR A LEAD||
SEARCH RESULTS||
YOU MUST BE PAUSED TO SEARCH FOR A LEAD||
Notes: when doing a search for a lead, the phone number, lead ID or||
are the best fields to use||
Using the other fields may be slower. Lead searching does not allow for wildcard or partial search terms||
Lead search requests are all logged in the system||
Main Phone Number||
Alternate Phone Number||
Address3 Phone Number||
No results found||
Results Found:||
No calls found||
reset form||
############################################################ MANAGER Manual
+554 -193
View File
@@ -272,12 +272,13 @@
# 110212-2103 - Added support for custom scheduled callback statuses
# 110214-2320 - Added support for lead_order_secondary option
# 110215-1125 - Added support for call_notes
# 110218-1519 - Added support for agent lead search
#
$version = '2.4-177';
$build = '110215-1125';
$version = '2.4-178';
$build = '110218-1519';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=365;
$mysql_log_count=385;
$one_mysql_log=0;
require("dbconnect.php");
@@ -470,6 +471,8 @@ if (isset($_GET["CallBackLeadStatus"])) {$CallBackLeadStatus=$_GET["CallBackL
elseif (isset($_POST["CallBackLeadStatus"])) {$CallBackLeadStatus=$_POST["CallBackLeadStatus"];}
if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];}
elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];}
if (isset($_GET["search"])) {$search=$_GET["search"];}
elseif (isset($_POST["search"])) {$search=$_POST["search"];}
header ("Content-type: text/html; charset=utf-8");
@@ -1144,7 +1147,9 @@ if ($ACTION == 'manDiaLnextCaLL')
{
$MT[0]='';
$row=''; $rowx='';
$override_dial_number='';
$channel_live=1;
$lead_id = ereg_replace("[^0-9]","",$lead_id);
if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) )
{
$channel_live=0;
@@ -1195,6 +1200,15 @@ if ($ACTION == 'manDiaLnextCaLL')
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00016',$user,$server_ip,$session_name,$one_mysql_log);}
}
### check if this is a specific lead call, if it is, skip the grabbing of a new lead
elseif (strlen($lead_id)>0)
{
$affected_rows=1;
$CBleadIDset=1;
if (strlen($phone_number) > 5)
{$override_dial_number = $phone_number;}
}
else
{
if (strlen($phone_number)>3)
@@ -1997,6 +2011,13 @@ if ($ACTION == 'manDiaLnextCaLL')
$called_count++;
if ( (strlen($agent_dialed_type) < 3) or (strlen($agent_dialed_number) < 6) )
{
$agent_dialed_number = $phone_number;
if (strlen($agent_dialed_type) < 3)
{$agent_dialed_type = 'MAIN';}
}
##### check if system is set to generate logfile for transfers
$stmt="SELECT enable_agc_xfer_log FROM system_settings;";
$rslt=mysql_query($stmt, $link);
@@ -2020,7 +2041,7 @@ if ($ACTION == 'manDiaLnextCaLL')
# DATETIME|campaign|lead_id|phone_number|user|type
# 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M
$fp = fopen ("./xfer_log.txt", "a");
fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M|$MqueryCID||$province\n");
fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$agent_dialed_number|$user|M|$MqueryCID||$province\n");
fclose($fp);
}
@@ -2033,7 +2054,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$stmt="SELECT count(*) FROM vicidial_statuses where status='$dispo' and scheduled_callback='Y';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00366',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$cb_record_ct = mysql_num_rows($rslt);
if ($cb_record_ct > 0)
@@ -2045,7 +2066,7 @@ if ($ACTION == 'manDiaLnextCaLL')
{
$stmt="SELECT count(*) FROM vicidial_campaign_statuses where status='$dispo' and scheduled_callback='Y';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00367',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$cb_record_ct = mysql_num_rows($rslt);
if ($cb_record_ct > 0)
@@ -2197,9 +2218,9 @@ if ($ACTION == 'manDiaLnextCaLL')
### whether to omit phone_code or not
if (eregi('Y',$omit_phone_code))
{$Ndialstring = "$Local_out_prefix$phone_number";}
{$Ndialstring = "$Local_out_prefix$agent_dialed_number";}
else
{$Ndialstring = "$Local_out_prefix$phone_code$phone_number";}
{$Ndialstring = "$Local_out_prefix$phone_code$agent_dialed_number";}
if ( ($usegroupalias > 0) and (strlen($account)>1) )
{
@@ -2217,7 +2238,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00033',$user,$server_ip,$session_name,$one_mysql_log);}
$stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$phone_number','$NOW_TIME','OUT')";
$stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$agent_dialed_number','$NOW_TIME','OUT')";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00034',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -2279,7 +2300,7 @@ if ($ACTION == 'manDiaLnextCaLL')
if ($agent_dialed_number > 0)
{
$stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')";
$stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$agent_dialed_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00191',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -2317,7 +2338,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$affected_rows = mysql_affected_rows($linkB);
# CALLOUTBOUND (formerly ENTERQUEUE)
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='CALLOUTBOUND',data2='$phone_number',serverid='$queuemetrics_log_id';";
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='CALLOUTBOUND',data2='$agent_dialed_number',serverid='$queuemetrics_log_id';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00039',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -2485,8 +2506,8 @@ if ($ACTION == 'manDiaLnextCaLL')
$LeaD_InfO .= $CBcallback_time . "\n";
$LeaD_InfO .= $CBuser . "\n";
$LeaD_InfO .= $CBcomments . "\n";
$LeaD_InfO .= $phone_number . "\n";
$LeaD_InfO .= "MAIN\n";
$LeaD_InfO .= $agent_dialed_number . "\n";
$LeaD_InfO .= $agent_dialed_type . "\n";
$LeaD_InfO .= $source_id . "\n";
$LeaD_InfO .= $rank . "\n";
$LeaD_InfO .= $owner . "\n";
@@ -4355,7 +4376,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$stmt="SELECT count(*) FROM vicidial_statuses where status='$dispo' and scheduled_callback='Y';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00368',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$cb_record_ct = mysql_num_rows($rslt);
if ($cb_record_ct > 0)
@@ -4367,7 +4388,7 @@ if ($ACTION == 'VDADcheckINCOMING')
{
$stmt="SELECT count(*) FROM vicidial_campaign_statuses where status='$dispo' and scheduled_callback='Y';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00369',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$cb_record_ct = mysql_num_rows($rslt);
if ($cb_record_ct > 0)
@@ -5073,7 +5094,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$stmt="SELECT count(*) FROM vicidial_statuses where status='$dispo' and scheduled_callback='Y';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00370',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$cb_record_ct = mysql_num_rows($rslt);
if ($cb_record_ct > 0)
@@ -5085,7 +5106,7 @@ if ($ACTION == 'VDADcheckINCOMING')
{
$stmt="SELECT count(*) FROM vicidial_campaign_statuses where status='$dispo' and scheduled_callback='Y';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00371',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$cb_record_ct = mysql_num_rows($rslt);
if ($cb_record_ct > 0)
@@ -5965,7 +5986,7 @@ if ($ACTION == 'updateDISPO')
$stmt = "SELECT campaign_id,closecallid from vicidial_closer_log where uniqueid='$uniqueid' and user='$user' order by call_date desc limit 1;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00372',$user,$server_ip,$session_name,$one_mysql_log);}
$VDCL_cn_ct = mysql_num_rows($rslt);
if ($VDCL_cn_ct > 0)
{
@@ -5980,7 +6001,7 @@ if ($ACTION == 'updateDISPO')
$stmt="INSERT INTO vicidial_call_notes set lead_id='$lead_id',vicidial_id='$vicidial_id',call_date='$NOW_TIME',call_notes='" . mysql_real_escape_string($call_notes) . "';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00373',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysql_affected_rows($link);
$notesid = mysql_insert_id($link);
}
@@ -7923,7 +7944,7 @@ if ($ACTION == 'CALLLOGview')
echo "<td align=right><font size=2> $ALLalt_dial[$i] </td>\n";
echo "<td align=right><font size=2> $ALLhangup_reason[$i] </td>\n";
echo "<td align=right><font size=2> <a href=\"#\" onclick=\"VieWLeaDInfO($ALLlead_id[$i]);return false;\">INFO</A> </td>\n";
echo "<td align=right><font size=2> <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG','$ALLphone_code[$i]','$ALLphone_number[$i]');return false;\">DIAL</A> </td>\n";
echo "<td align=right><font size=2> <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG','$ALLphone_code[$i]','$ALLphone_number[$i]','$ALLlead_id[$i]');return false;\">DIAL</A> </td>\n";
echo "</tr>\n";
}
@@ -7934,6 +7955,286 @@ if ($ACTION == 'CALLLOGview')
}
################################################################################
### SEARCHRESULTSview - display search results for lead search
################################################################################
if ($ACTION == 'SEARCHRESULTSview')
{
if (strlen($stage) < 3)
{$stage = '670';}
$stmt="select agent_lead_search_method,manual_dial_list_id from vicidial_campaigns where campaign_id='$campaign';";
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00374',$user,$server_ip,$session_name,$one_mysql_log);}
$rslt=mysql_query($stmt, $link);
$camps_to_print = mysql_num_rows($rslt);
if ($camps_to_print > 0)
{
$row=mysql_fetch_row($rslt);
$agent_lead_search_method = $row[0];
$manual_dial_list_id = $row[1];
$searchSQL='';
$searchmethodSQL='';
$lead_id=ereg_replace("[^0-9]","",$lead_id);
$vendor_lead_code = ereg_replace("'|\"|\\\\|;","",$vendor_lead_code);
$last_name = ereg_replace("'|\"|\\\\|;","",$last_name);
$first_name = ereg_replace("'|\"|\\\\|;","",$first_name);
$city = ereg_replace("'|\"|\\\\|;","",$city);
$state = ereg_replace("'|\"|\\\\|;","",$state);
$postal_code = ereg_replace("'|\"|\\\\|;","",$postal_code);
if (strlen($lead_id) > 0)
{
### lead ID entered, search by this
$searchSQL = "lead_id='$lead_id'";
}
elseif (strlen($vendor_lead_code) > 0)
{
### vendor ID entered, search by this
$searchSQL = "vendor_lead_code='$vendor_lead_code'";
}
elseif ( (strlen($phone_number) >= 6) and (strlen($search) > 2) )
{
### phone number entered, search by this
if (preg_match('/MAIN/',$search))
{$searchSQL = "phone_number='$phone_number'";}
if (preg_match('/ALT/',$search))
{
if (strlen($searchSQL) > 10)
{$searchSQL .= " or ";}
$searchSQL .= "alt_phone='$phone_number'";
}
if (preg_match('/ADDR3/',$search))
{
if (strlen($searchSQL) > 10)
{$searchSQL .= " or ";}
$searchSQL .= "address3='$phone_number'";
}
}
elseif (strlen($last_name) > 0)
{
### last name entered, search by this and other fields
$searchSQL = "last_name='$last_name'";
if (strlen($first_name) > 0)
{
if (strlen($searchSQL) > 10)
{$searchSQL .= " and ";}
$searchSQL .= "first_name='$first_name'";
}
if (strlen($city) > 0)
{
if (strlen($searchSQL) > 10)
{$searchSQL .= " and ";}
$searchSQL .= "city='$city'";
}
if (strlen($state) > 0)
{
if (strlen($searchSQL) > 10)
{$searchSQL .= " and ";}
$searchSQL .= "state='$state'";
}
if (strlen($postal_code) > 0)
{
if (strlen($searchSQL) > 10)
{$searchSQL .= " and ";}
$searchSQL .= "postal_code='$postal_code'";
}
}
else
{
echo "ERROR: You must enter in search terms, one of these must be populated: lead ID, vendor ID, phone number, last name\n";
echo "<BR><BR>";
echo "<a href=\"#\" onclick=\"hideDiv('SearcHResultSDisplaYBox');return false;\">Go Back</a>";
echo "</CENTER>";
exit;
}
### limit results to specified search method
# 'SYSTEM','CAMPAIGNLISTS','CAMPLISTS_ALL','LIST'
if ($agent_lead_search_method == 'SYSTEM')
{$searchmethodSQL='';}
if ($agent_lead_search_method == 'LIST')
{$searchmethodSQL=" and list_id='$manual_dial_list_id'";}
if ($agent_lead_search_method == 'CAMPLISTS_ALL')
{
$stmt="SELECT list_id from vicidial_lists where campaign_id='$campaign';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00375',$user,$server_ip,$session_name,$one_mysql_log);}
$lists_to_parse = mysql_num_rows($rslt);
$camp_lists='';
$o=0;
while ($lists_to_parse > $o)
{
$rowx=mysql_fetch_row($rslt);
$camp_lists .= "'$rowx[0]',";
$o++;
}
$camp_lists = eregi_replace(".$","",$camp_lists);
$searchmethodSQL=" and list_id IN($camp_lists)";
}
if ($agent_lead_search_method == 'CAMPAIGNLISTS')
{
$stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign' and active='Y';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00376',$user,$server_ip,$session_name,$one_mysql_log);}
$lists_to_parse = mysql_num_rows($rslt);
$camp_lists='';
$o=0;
while ($lists_to_parse > $o)
{
$rowx=mysql_fetch_row($rslt);
$camp_lists .= "'$rowx[0]',";
$o++;
}
$camp_lists = eregi_replace(".$","",$camp_lists);
$searchmethodSQL=" and list_id IN($camp_lists)";
}
##### BEGIN search queries and output #####
$stmt="select count(*) from vicidial_list where $searchSQL $searchmethodSQL;";
### LOG INSERTION Search Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmtL="INSERT INTO vicidial_lead_search_log set event_date='$NOW_TIME', user='$user', source='agent', results='0', search_query=\"$SQL_log\";";
if ($DB) {echo "|$stmtL|\n";}
$rslt=mysql_query($stmtL, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00377',$user,$server_ip,$session_name,$one_mysql_log);}
$search_log_id = mysql_insert_id($link);
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00378',$user,$server_ip,$session_name,$one_mysql_log);}
$counts_to_print = mysql_num_rows($rslt);
if ($counts_to_print > 0)
{
$row=mysql_fetch_row($rslt);
$search_result_count = $row[0];
$end_process_time = date("U");
$search_seconds = ($end_process_time - $StarTtime);
$stmtL="UPDATE vicidial_lead_search_log set results='$search_result_count',seconds='$search_seconds' where search_log_id='$search_log_id';";
if ($DB) {echo "|$stmtL|\n";}
$rslt=mysql_query($stmtL, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00379',$user,$server_ip,$session_name,$one_mysql_log);}
echo "<CENTER>\n";
echo "<font style=\"font-size:14px;font-family:sans-serif;\"><B>";
echo "Results Found: $search_result_count";
echo "</B></font>\n";
echo "<BR>\n";
echo "<TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0 WIDTH=$stage>";
echo "<TR>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:10px;font-family:sans-serif;\"><B> &nbsp; # &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; NAME &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; PHONE &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; STATUS &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; LAST CALL &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; CITY &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; STATE &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; ZIP &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; INFO &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; DIAL &nbsp; </font></TD>";
echo "</TR>";
if ($search_result_count)
{
$stmt="select first_name,last_name,phone_code,phone_number,status,last_local_call_time,lead_id,city,state,postal_code from vicidial_list where $searchSQL $searchmethodSQL order by last_local_call_time desc limit 1000;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00380',$user,$server_ip,$session_name,$one_mysql_log);}
$out_logs_to_print = mysql_num_rows($rslt);
if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";}
$g=0;
$u=0;
while ($out_logs_to_print > $u)
{
$row=mysql_fetch_row($rslt);
$ALLsort[$g] = "$row[0]-----$g";
$ALLname[$g] = "$row[0] $row[1]";
$ALLphone_code[$g] = $row[2];
$ALLphone_number[$g] = $row[3];
$ALLstatus[$g] = $row[4];
$ALLcall_date[$g] = $row[5];
$ALLlead_id[$g] = $row[6];
$ALLcity[$g] = $row[7];
$ALLstate[$g] = $row[8];
$ALLpostal_code[$g] = $row[9];
$g++;
$u++;
}
if ($g < 1)
{echo "<tr bgcolor=white><td colspan=10 align=center>No results found</td></tr>";}
$u=0;
while ($g > $u)
{
$sort_split = explode("-----",$ALLsort[$u]);
$i = $sort_split[1];
if (eregi("1$|3$|5$|7$|9$", $u))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
$u++;
echo "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td align=right><font size=2>$ALLname[$i] </td>\n";
echo "<td align=right><font size=2> $ALLphone_code[$i] $ALLphone_number[$i] </td>\n";
echo "<td align=right><font size=2> $ALLstatus[$i] </td>\n";
echo "<td align=right><font size=2> $ALLcall_date[$i] </td>\n";
echo "<td align=right><font size=2> $ALLcity[$i] </td>\n";
echo "<td align=right><font size=2> $ALLstate[$i]</td>\n";
echo "<td align=right><font size=2> $ALLpostal_code[$i] </td>\n";
echo "<td align=right><font size=2> <a href=\"#\" onclick=\"VieWLeaDInfO($ALLlead_id[$i]);return false;\">INFO</A> </td>\n";
echo "<td align=right><font size=2> <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('LEADSEARCH','$ALLphone_code[$i]','$ALLphone_number[$i]','$ALLlead_id[$i]');return false;\">DIAL</A> </td>\n";
echo "</tr>\n";
}
$end_process_time = date("U");
$search_seconds = ($end_process_time - $StarTtime);
$stmtL="UPDATE vicidial_lead_search_log set seconds='$search_seconds' where search_log_id='$search_log_id';";
if ($DB) {echo "|$stmtL|\n";}
$rslt=mysql_query($stmtL, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00381',$user,$server_ip,$session_name,$one_mysql_log);}
}
else
{echo "<tr bgcolor=white><td colspan=10 align=center>No results found</td></tr>";}
echo "</TABLE>";
echo "<BR>";
echo "<a href=\"#\" onclick=\"hideDiv('SearcHResultSDisplaYBox');return false;\">Go Back</a>";
echo "</CENTER>";
}
else
{
echo "ERROR: There was a problem with your search terms\n";
echo "<BR><BR>";
echo "<a href=\"#\" onclick=\"hideDiv('SearcHResultSDisplaYBox');return false;\">Go Back</a>";
echo "</CENTER>";
exit;
}
##### END search queries and output #####
}
else
{
echo "ERROR: Campaign not found\n";
echo "<BR><BR>";
echo "<a href=\"#\" onclick=\"hideDiv('SearcHResultSDisplaYBox');return false;\">Go Back</a>";
echo "</CENTER>";
exit;
}
}
################################################################################
### LEADINFOview - display the information for a lead
################################################################################
@@ -7996,7 +8297,7 @@ if ($ACTION == 'LEADINFOview')
$info_to_print = mysql_num_rows($rslt);
if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";}
if ($info_to_print > 0)
if ($info_to_print > 0)
{
$row=mysql_fetch_row($rslt);
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Status: &nbsp; </td><td ALIGN=left><font size=2>$row[0]</td></tr>";
@@ -8005,7 +8306,7 @@ if ($ACTION == 'LEADINFOview')
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Timezone: &nbsp; </td><td ALIGN=left><font size=2>$row[3]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Called Since Last Reset: &nbsp; </td><td ALIGN=left><font size=2>$row[4]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_phone_code: &nbsp; </td><td ALIGN=left><font size=2>$row[5]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_phone_number: &nbsp; </td><td ALIGN=left><font size=2>$row[6] - &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG',$row[5], $row[6]);return false;\">DIAL</A></td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_phone_number: &nbsp; </td><td ALIGN=left><font size=2>$row[6] - &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG',$row[5], $row[6], $lead_id);return false;\">DIAL</A></td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_title: &nbsp; </td><td ALIGN=left><font size=2>$row[7]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_first_name: &nbsp; </td><td ALIGN=left><font size=2>$row[8]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_middle_initial: &nbsp; </td><td ALIGN=left><font size=2>$row[9]</td></tr>";
@@ -8019,7 +8320,7 @@ if ($ACTION == 'LEADINFOview')
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_postal_code: &nbsp; </td><td ALIGN=left><font size=2>$row[17]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>Country: &nbsp; </td><td ALIGN=left><font size=2>$row[18]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_gender: &nbsp; </td><td ALIGN=left><font size=2>$row[19]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_alt_phone: &nbsp; </td><td ALIGN=left><font size=2>$row[20] - &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG',$row[5], $row[20]);return false;\">DIAL</A></td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_alt_phone: &nbsp; </td><td ALIGN=left><font size=2>$row[20] - &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"#\" onclick=\"NeWManuaLDiaLCalL('CALLLOG',$row[5], $row[20], $lead_id, 'ALT');return false;\">DIAL</A></td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_email: &nbsp; </td><td ALIGN=left><font size=2>$row[21]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_security_phrase: &nbsp; </td><td ALIGN=left><font size=2>$row[22]</td></tr>";
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$label_comments: &nbsp; </td><td ALIGN=left><font size=2>$row[23]</td></tr>";
@@ -8028,6 +8329,64 @@ if ($ACTION == 'LEADINFOview')
# echo "<tr bgcolor=white><td ALIGN=right><font size=2>Rank: &nbsp; </td><td ALIGN=left><font size=2>$row[26]</td></tr>";
# echo "<tr bgcolor=white><td ALIGN=right><font size=2>Owner: &nbsp; </td><td ALIGN=left><font size=2>$row[27]</td></tr>";
# echo "<tr bgcolor=white><td ALIGN=right><font size=2>Entry List ID: &nbsp; </td><td ALIGN=left><font size=2>$row[28]</td></tr>";
$entry_list_id = $row[28];
$CFoutput='';
$stmt="SHOW TABLES LIKE \"custom_$entry_list_id\";";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00382',$user,$server_ip,$session_name,$one_mysql_log);}
$tablecount_to_print = mysql_num_rows($rslt);
if ($tablecount_to_print > 0)
{
$stmt="SELECT count(*) from custom_$entry_list_id where lead_id='$lead_id';";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00383',$user,$server_ip,$session_name,$one_mysql_log);}
$fieldscount_to_print = mysql_num_rows($rslt);
if ($fieldscount_to_print > 0)
{
$rowx=mysql_fetch_row($rslt);
$custom_records_count = $rowx[0];
$select_SQL='';
$stmt="SHOW COLUMNS FROM custom_$entry_list_id where Field != 'lead_id';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00384',$user,$server_ip,$session_name,$one_mysql_log);}
$fields_to_print = mysql_num_rows($rslt);
$select_SQL='';
$o=0;
while ($fields_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$select_SQL .= "$rowx[0],";
$A_field_name[$o] = $rowx[0];
$o++;
}
$select_SQL = preg_replace("/.$/",'',$select_SQL);
if (strlen($select_SQL) > 0)
{
$stmt="SELECT $select_SQL FROM custom_$entry_list_id where lead_id='$lead_id' LIMIT 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00385',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$list_lead_ct = mysql_num_rows($rslt);
if ($list_lead_ct > 0)
{
$row=mysql_fetch_row($rslt);
$o=0;
while ($fields_to_print > $o)
{
$A_field_value = trim("$row[$o]");
echo "<tr bgcolor=white><td ALIGN=right><font size=2>$A_field_name[$o]: &nbsp; </td><td ALIGN=left><font size=2>$A_field_value</td></tr>";
$o++;
}
}
}
}
}
}
echo "</TABLE>";
@@ -8107,6 +8466,178 @@ if ($ACTION == 'LEADINFOview')
$in_logs_to_print = mysql_num_rows($rslt);
if ($format=='debug') {echo "|$in_logs_to_print|$stmt|";}
$u=0;
while ($in_logs_to_print > $u)
{
$row=mysql_fetch_row($rslt);
$ALLsort[$g] = "$row[0]-----$g";
$ALLstart_epoch[$g] = $row[0];
$ALLcall_date[$g] = $row[1];
$ALLcampaign_id[$g] = $row[2];
$ALLlength_in_sec[$g] = ($row[3] - $row[9]);
if ($ALLlength_in_sec[$g] < 0) {$ALLlength_in_sec[$g]=0;}
$ALLstatus[$g] = $row[4];
$ALLphone_code[$g] = $row[5];
$ALLphone_number[$g] = $row[6];
$ALLlead_id[$g] = $row[7];
$ALLhangup_reason[$g] = $row[8];
$ALLuniqueid[$g] = $row[10];
$ALLclosecallid[$g] = $row[11];
$ALLuser[$g] = $row[12];
$ALLalt_dial[$g] = "MAIN";
$ALLin_out[$g] = "IN";
$stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='$ALLlead_id[$g]' and vicidial_id='$ALLclosecallid[$g]';";
$rsltA=mysql_query($stmtA, $link);
$in_notes_to_print = mysql_num_rows($rslt);
if ($in_notes_to_print > 0)
{
$rowA=mysql_fetch_row($rsltA);
$Allcall_notes[$g] = $rowA[0];
if (strlen($Allcall_notes[$g]) > 0)
{$Allcall_notes[$g] = "<b>NOTES: </b> $Allcall_notes[$g]";}
}
$stmtA="SELECT full_name FROM vicidial_users WHERE user='$ALLuser[$g]';";
$rsltA=mysql_query($stmtA, $link);
$users_to_print = mysql_num_rows($rslt);
if ($users_to_print > 0)
{
$rowA=mysql_fetch_row($rsltA);
$ALLuser[$g] .= " - $rowA[0]";
}
$Allcounter[$g] = $g;
$g++;
$u++;
}
if ($g > 0)
{sort($ALLsort, SORT_NUMERIC);}
else
{echo "<tr bgcolor=white><td colspan=11 align=center>No calls found</td></tr>";}
$u=0;
while ($g > $u)
{
$sort_split = explode("-----",$ALLsort[$u]);
$i = $sort_split[1];
if (eregi("1$|3$|5$|7$|9$", $u))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
$u++;
echo "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td align=right><font size=2>$ALLcall_date[$i]</td>";
echo "<td align=right><font size=2> $ALLuser[$i]</td>\n";
echo "<td align=right><font size=2> $ALLlength_in_sec[$i]</td>\n";
echo "<td align=right><font size=2> $ALLstatus[$i]</td>\n";
echo "<td align=right><font size=2> $ALLphone_code[$i] $ALLphone_number[$i] </td>\n";
echo "<td align=right><font size=2> $ALLcampaign_id[$i] </td>\n";
echo "<td align=right><font size=2> $ALLin_out[$i] </td>\n";
echo "<td align=right><font size=2> $ALLalt_dial[$i] </td>\n";
echo "<td align=right><font size=2> $ALLhangup_reason[$i] </td>\n";
echo "</TR><TR>";
echo "<td></td>";
echo "<TD $bgcolor COLSPAN=9><font style=\"font-size:11px;font-family:sans-serif;\"> $Allcall_notes[$i] </font></TD>";
echo "</tr>\n";
}
echo "</TABLE>";
echo "<BR>";
echo "<a href=\"#\" onclick=\"hideDiv('LeaDInfOBox');return false;\">Close Info Box</a>";
echo "</CENTER>";
}
}
################################################################################
### CALLNOTESview - display all notes for a specific lead
################################################################################
if ($ACTION == 'CALLNOTESview')
{
if (strlen($stage) < 3)
{$stage = '670';}
echo "<CENTER>\n";
echo "<TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0 WIDTH=$stage>";
echo "<TR>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:10px;font-family:sans-serif;\"><B> &nbsp; # &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; DATE/TIME &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; AGENT &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; LENGTH &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; STATUS &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; PHONE &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; CAMPAIGN &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; IN/OUT &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; ALT &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; HANGUP &nbsp; </font></TD>";
# echo "</TR><TR>";
# echo "<TD BGCOLOR=\"#CCCCCC\" COLSPAN=9><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; FULL NAME &nbsp; </font></TD>";
echo "</TR>";
if (strlen($lead_id) > 0)
{
$stmt="select start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,alt_dial,comments,uniqueid,user from vicidial_log where lead_id='$lead_id' order by call_date desc limit 10000;";
$rslt=mysql_query($stmt, $link);
$out_logs_to_print = mysql_num_rows($rslt);
if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";}
$g=0;
$u=0;
while ($out_logs_to_print > $u)
{
$row=mysql_fetch_row($rslt);
$ALLsort[$g] = "$row[0]-----$g";
$ALLstart_epoch[$g] = $row[0];
$ALLcall_date[$g] = $row[1];
$ALLcampaign_id[$g] = $row[2];
$ALLlength_in_sec[$g] = $row[3];
$ALLstatus[$g] = $row[4];
$ALLphone_code[$g] = $row[5];
$ALLphone_number[$g] = $row[6];
$ALLlead_id[$g] = $row[7];
$ALLhangup_reason[$g] = $row[8];
$ALLalt_dial[$g] = $row[9];
$ALLuniqueid[$g] = $row[11];
$ALLuser[$g] = $row[12];
$ALLin_out[$g] = "OUT-AUTO";
if ($row[10] == 'MANUAL') {$ALLin_out[$g] = "OUT-MANUAL";}
$stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='$ALLlead_id[$g]' and vicidial_id='$ALLuniqueid[$g]';";
$rsltA=mysql_query($stmtA, $link);
$out_notes_to_print = mysql_num_rows($rslt);
if ($out_notes_to_print > 0)
{
$rowA=mysql_fetch_row($rsltA);
$Allcall_notes[$g] = $rowA[0];
if (strlen($Allcall_notes[$g]) > 0)
{$Allcall_notes[$g] = "<b>NOTES: </b> $Allcall_notes[$g]";}
}
$stmtA="SELECT full_name FROM vicidial_users WHERE user='$ALLuser[$g]';";
$rsltA=mysql_query($stmtA, $link);
$users_to_print = mysql_num_rows($rslt);
if ($users_to_print > 0)
{
$rowA=mysql_fetch_row($rsltA);
$ALLuser[$g] .= " - $rowA[0]";
}
$Allcounter[$g] = $g;
$g++;
$u++;
}
$stmt="select start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,queue_seconds,uniqueid,closecallid,user from vicidial_closer_log where lead_id='$lead_id' order by call_date desc limit 10000;";
$rslt=mysql_query($stmt, $link);
$in_logs_to_print = mysql_num_rows($rslt);
if ($format=='debug') {echo "|$in_logs_to_print|$stmt|";}
$u=0;
while ($in_logs_to_print > $u)
{
@@ -8186,176 +8717,6 @@ if ($ACTION == 'LEADINFOview')
echo "<TD $bgcolor COLSPAN=9><font style=\"font-size:11px;font-family:sans-serif;\"> $Allcall_notes[$i] </font></TD>";
echo "</tr>\n";
}
echo "</TABLE>";
echo "<BR>";
echo "<a href=\"#\" onclick=\"hideDiv('LeaDInfOBox');return false;\">Close Info Box</a>";
echo "</CENTER>";
}
}
################################################################################
### CALLNOTESview - display all notes for a specific lead
################################################################################
if ($ACTION == 'CALLNOTESview')
{
if (strlen($stage) < 3)
{$stage = '670';}
echo "<CENTER>\n";
echo "<TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0 WIDTH=$stage>";
echo "<TR>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:10px;font-family:sans-serif;\"><B> &nbsp; # &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; DATE/TIME &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; AGENT &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; LENGTH &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; STATUS &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; PHONE &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; CAMPAIGN &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; IN/OUT &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; ALT &nbsp; </font></TD>";
echo "<TD BGCOLOR=\"#CCCCCC\"><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; HANGUP &nbsp; </font></TD>";
# echo "</TR><TR>";
# echo "<TD BGCOLOR=\"#CCCCCC\" COLSPAN=9><font style=\"font-size:11px;font-family:sans-serif;\"><B> &nbsp; FULL NAME &nbsp; </font></TD>";
echo "</TR>";
$stmt="select start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,alt_dial,comments,uniqueid,user from vicidial_log where lead_id='$lead_id' order by call_date desc limit 10000;";
$rslt=mysql_query($stmt, $link);
$out_logs_to_print = mysql_num_rows($rslt);
if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";}
$g=0;
$u=0;
while ($out_logs_to_print > $u)
{
$row=mysql_fetch_row($rslt);
$ALLsort[$g] = "$row[0]-----$g";
$ALLstart_epoch[$g] = $row[0];
$ALLcall_date[$g] = $row[1];
$ALLcampaign_id[$g] = $row[2];
$ALLlength_in_sec[$g] = $row[3];
$ALLstatus[$g] = $row[4];
$ALLphone_code[$g] = $row[5];
$ALLphone_number[$g] = $row[6];
$ALLlead_id[$g] = $row[7];
$ALLhangup_reason[$g] = $row[8];
$ALLalt_dial[$g] = $row[9];
$ALLuniqueid[$g] = $row[11];
$ALLuser[$g] = $row[12];
$ALLin_out[$g] = "OUT-AUTO";
if ($row[10] == 'MANUAL') {$ALLin_out[$g] = "OUT-MANUAL";}
$stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='$ALLlead_id[$g]' and vicidial_id='$ALLuniqueid[$g]';";
$rsltA=mysql_query($stmtA, $link);
$out_notes_to_print = mysql_num_rows($rslt);
if ($out_notes_to_print > 0)
{
$rowA=mysql_fetch_row($rsltA);
$Allcall_notes[$g] = $rowA[0];
if (strlen($Allcall_notes[$g]) > 0)
{$Allcall_notes[$g] = "<b>NOTES: </b> $Allcall_notes[$g]";}
}
$stmtA="SELECT full_name FROM vicidial_users WHERE user='$ALLuser[$g]';";
$rsltA=mysql_query($stmtA, $link);
$users_to_print = mysql_num_rows($rslt);
if ($users_to_print > 0)
{
$rowA=mysql_fetch_row($rsltA);
$ALLuser[$g] .= " - $rowA[0]";
}
$Allcounter[$g] = $g;
$g++;
$u++;
}
$stmt="select start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,queue_seconds,uniqueid,closecallid,user from vicidial_closer_log where lead_id='$lead_id' order by call_date desc limit 10000;";
$rslt=mysql_query($stmt, $link);
$in_logs_to_print = mysql_num_rows($rslt);
if ($format=='debug') {echo "|$in_logs_to_print|$stmt|";}
$u=0;
while ($in_logs_to_print > $u)
{
$row=mysql_fetch_row($rslt);
$ALLsort[$g] = "$row[0]-----$g";
$ALLstart_epoch[$g] = $row[0];
$ALLcall_date[$g] = $row[1];
$ALLcampaign_id[$g] = $row[2];
$ALLlength_in_sec[$g] = ($row[3] - $row[9]);
if ($ALLlength_in_sec[$g] < 0) {$ALLlength_in_sec[$g]=0;}
$ALLstatus[$g] = $row[4];
$ALLphone_code[$g] = $row[5];
$ALLphone_number[$g] = $row[6];
$ALLlead_id[$g] = $row[7];
$ALLhangup_reason[$g] = $row[8];
$ALLuniqueid[$g] = $row[10];
$ALLclosecallid[$g] = $row[11];
$ALLuser[$g] = $row[12];
$ALLalt_dial[$g] = "MAIN";
$ALLin_out[$g] = "IN";
$stmtA="SELECT call_notes FROM vicidial_call_notes WHERE lead_id='$ALLlead_id[$g]' and vicidial_id='$ALLclosecallid[$g]';";
$rsltA=mysql_query($stmtA, $link);
$in_notes_to_print = mysql_num_rows($rslt);
if ($in_notes_to_print > 0)
{
$rowA=mysql_fetch_row($rsltA);
$Allcall_notes[$g] = $rowA[0];
if (strlen($Allcall_notes[$g]) > 0)
{$Allcall_notes[$g] = "<b>NOTES: </b> $Allcall_notes[$g]";}
}
$stmtA="SELECT full_name FROM vicidial_users WHERE user='$ALLuser[$g]';";
$rsltA=mysql_query($stmtA, $link);
$users_to_print = mysql_num_rows($rslt);
if ($users_to_print > 0)
{
$rowA=mysql_fetch_row($rsltA);
$ALLuser[$g] .= " - $rowA[0]";
}
$Allcounter[$g] = $g;
$g++;
$u++;
}
if ($g > 0)
{sort($ALLsort, SORT_NUMERIC);}
else
{echo "<tr bgcolor=white><td colspan=11 align=center>No calls on this day</td></tr>";}
$u=0;
while ($g > $u)
{
$sort_split = explode("-----",$ALLsort[$u]);
$i = $sort_split[1];
if (eregi("1$|3$|5$|7$|9$", $u))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
$u++;
echo "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td align=right><font size=2>$ALLcall_date[$i]</td>";
echo "<td align=right><font size=2> $ALLuser[$i]</td>\n";
echo "<td align=right><font size=2> $ALLlength_in_sec[$i]</td>\n";
echo "<td align=right><font size=2> $ALLstatus[$i]</td>\n";
echo "<td align=right><font size=2> $ALLphone_code[$i] $ALLphone_number[$i] </td>\n";
echo "<td align=right><font size=2> $ALLcampaign_id[$i] </td>\n";
echo "<td align=right><font size=2> $ALLin_out[$i] </td>\n";
echo "<td align=right><font size=2> $ALLalt_dial[$i] </td>\n";
echo "<td align=right><font size=2> $ALLhangup_reason[$i] </td>\n";
echo "</TR><TR>";
echo "<td></td>";
echo "<TD $bgcolor COLSPAN=9><font style=\"font-size:11px;font-family:sans-serif;\"> $Allcall_notes[$i] </font></TD>";
echo "</tr>\n";
}
echo "</TABLE>";
+268 -43
View File
@@ -334,10 +334,11 @@
# 110208-1202 - Made scheduled callbacks notice move when on script/form tabs
# 110212-2206 - Added scheduled callback custom statuses compatibility
# 110215-1412 - Added my_callback_option and per_call_notes options
# 110218-1522 - Added agent_lead_search feature
#
$version = '2.4-311';
$build = '110215-1412';
$version = '2.4-312';
$build = '110218-1522';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=69;
$one_mysql_log=0;
@@ -972,7 +973,7 @@ else
$login=strtoupper($VD_login);
$password=strtoupper($VD_pass);
##### grab the full name of the agent
$stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,agent_call_log_view_override,agent_choose_blended from vicidial_users where user='$VD_login' and pass='$VD_pass'";
$stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,agent_call_log_view_override,agent_choose_blended,agent_lead_search_override from vicidial_users where user='$VD_login' and pass='$VD_pass'";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
@@ -1002,6 +1003,7 @@ else
$VU_custom_five = $row[23];
$VU_agent_call_log_view_override = $row[24];
$VU_agent_choose_blended = $row[25];
$VU_agent_lead_search_override = $row[26];
if ( ($VU_alert_enabled > 0) and ($VU_allow_alerts > 0) ) {$VU_alert_enabled = 'ON';}
@@ -1308,7 +1310,7 @@ else
$HKstatusnames = substr("$HKstatusnames", 0, -1);
##### grab the campaign settings
$stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias,quick_transfer_button,prepopulate_transfer_preset,view_calls_in_queue,view_calls_in_queue_launch,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,manual_preview_dial,api_manual_dial,manual_dial_call_time_check,my_callback_option,per_call_notes FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
$stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias,quick_transfer_button,prepopulate_transfer_preset,view_calls_in_queue,view_calls_in_queue_launch,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,manual_preview_dial,api_manual_dial,manual_dial_call_time_check,my_callback_option,per_call_notes,agent_lead_search,agent_lead_search_method FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -1399,8 +1401,11 @@ else
$manual_dial_call_time_check = $row[83];
$my_callback_option = $row[84];
$per_call_notes = $row[85];
$agent_lead_search = $row[86];
$agent_lead_search_method = $row[87];
if ( ($VU_agent_lead_search_override == 'ENABLED') or ($VU_agent_lead_search_override == 'DISABLED') )
{$agent_lead_search = $VU_agent_lead_search_override;}
$AllowManualQueueCalls=1;
$AllowManualQueueCallsChoice=0;
if ($api_manual_dial == 'QUEUE')
@@ -1408,7 +1413,6 @@ else
$AllowManualQueueCalls=0;
$AllowManualQueueCallsChoice=1;
}
if ($manual_preview_dial == 'DISABLED')
{$manual_dial_preview = 0;}
if ($manual_dial_override == 'ALLOW_ALL')
@@ -3229,6 +3233,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var CBlinkCONTENT='';
var my_callback_option='<?php echo $my_callback_option ?>';
var per_call_notes='<?php echo $per_call_notes ?>';
var agent_lead_search='<?php echo $agent_lead_search ?>';
var agent_lead_search_method='<?php echo $agent_lead_search_method ?>';
var DiaLControl_auto_HTML = "<img src=\"./images/vdc_LB_pause_OFF.gif\" border=\"0\" alt=\" Pause \" /><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><img src=\"./images/vdc_LB_resume.gif\" border=\"0\" alt=\"Resume\" /></a>";
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><img src=\"./images/vdc_LB_pause.gif\" border=\"0\" alt=\" Pause \" /></a><img src=\"./images/vdc_LB_resume_OFF.gif\" border=\"0\" alt=\"Resume\" />";
var DiaLControl_auto_HTML_OFF = "<img src=\"./images/vdc_LB_pause_OFF.gif\" border=\"0\" alt=\" Pause \" /><img src=\"./images/vdc_LB_resume_OFF.gif\" border=\"0\" alt=\"Resume\" />";
@@ -5237,7 +5243,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
// ################################################################################
// Open page to enter details for a new manual dial lead
function NeWManuaLDiaLCalL(TVfast,TVphone_code,TVphone_number)
function NeWManuaLDiaLCalL(TVfast,TVphone_code,TVphone_number,TVlead_id,TVtype)
{
if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) )
{
@@ -5254,9 +5260,23 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
if (TVfast=='CALLLOG')
{
hideDiv('CalLLoGDisplaYBox');
hideDiv('SearcHForMDisplaYBox');
hideDiv('SearcHResultSDisplaYBox');
hideDiv('LeaDInfOBox');
document.vicidial_form.MDDiaLCodE.value = TVphone_code;
document.vicidial_form.MDPhonENumbeR.value = TVphone_number;
document.vicidial_form.MDLeadID.value = TVlead_id;
document.vicidial_form.MDType.value = TVtype;
}
if (TVfast=='LEADSEARCH')
{
hideDiv('SearcHForMDisplaYBox');
hideDiv('SearcHResultSDisplaYBox');
hideDiv('LeaDInfOBox');
document.vicidial_form.MDDiaLCodE.value = TVphone_code;
document.vicidial_form.MDPhonENumbeR.value = TVphone_number;
document.vicidial_form.MDLeadID.value = TVlead_id;
document.vicidial_form.MDType.value = TVtype;
}
if (agent_allow_group_alias == 'Y')
{
@@ -5264,6 +5284,15 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
document.getElementById("ManuaLDiaLGrouP").innerHTML = "<a href=\"#\" onclick=\"GroupAliasSelectContent_create('0');\"><font size=\"1\" face=\"Arial,Helvetica\">Click Here to Choose a Group Alias</font></a>";
}
showDiv('NeWManuaLDiaLBox');
document.vicidial_form.search_phone_number.value='';
document.vicidial_form.search_lead_id.value='';
document.vicidial_form.search_vendor_lead_code.value='';
document.vicidial_form.search_first_name.value='';
document.vicidial_form.search_last_name.value='';
document.vicidial_form.search_city.value='';
document.vicidial_form.search_state.value='';
document.vicidial_form.search_postal_code.value='';
}
}
}
@@ -5279,6 +5308,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
var sending_group_alias = 0;
var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value;
var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value;
var MDLeadIDform = document.vicidial_form.MDLeadID.value;
var MDTypeform = document.vicidial_form.MDType.value;
var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value;
var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value;
var MDLookuPLeaD = 'new';
@@ -5320,11 +5351,13 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
if (active_group_alias.length > 1)
{var sending_group_alias = 1;}
ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias);
ManualDialNext("",MDLeadIDform,MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias,MDTypeform);
}
document.vicidial_form.MDPhonENumbeR.value = '';
document.vicidial_form.MDDiaLOverridE.value = '';
document.vicidial_form.MDLeadID.value = '';
document.vicidial_form.MDType.value = '';
}
// ################################################################################
@@ -5803,7 +5836,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
// ################################################################################
// Send the Manual Dial Next Number request
function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias)
function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias,mdtype)
{
inOUT = 'OUT';
all_record = 'NO';
@@ -5844,6 +5877,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
var man_status = "Waiting for Ring...";
}
if ( (mdtype == 'ALT') || (mdtype == 'ADDR3') )
{
agent_dialed_type = mdtype;
agent_dialed_number = mdnPhonENumbeR;
}
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
@@ -6004,8 +6042,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
timer_action_seconds = campaign_timer_action_seconds;
timer_action_destination = campaign_timer_action_destination;
lead_dial_number = document.vicidial_form.phone_number.value;
var dispnum = document.vicidial_form.phone_number.value;
lead_dial_number = dialed_number;
var dispnum = dialed_number;
var status_display_number = phone_number_format(dispnum);
document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + status_display_number + " UID: " + MDnextCID + " &nbsp; " + man_status;
@@ -7912,6 +7950,21 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
}
}
// ################################################################################
// Open lead search form panel
function OpeNSearcHForMDisplaYBox()
{
if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) )
{
alert("YOU MUST BE PAUSED TO SEARCH FOR A LEAD");
}
else
{
HidEGenDerPulldown();
showDiv('SearcHForMDisplaYBox');
WaitingForNextStep=1;
}
}
// ################################################################################
// Generate the Presets Chooser span content
@@ -8230,6 +8283,18 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
APIManualDialQueue_last=0;
document.vicidial_form.FORM_LOADED.value = '0';
CallBackLeadStatus = '';
document.vicidial_form.search_phone_number.value='';
document.vicidial_form.search_lead_id.value='';
document.vicidial_form.search_vendor_lead_code.value='';
document.vicidial_form.search_first_name.value='';
document.vicidial_form.search_last_name.value='';
document.vicidial_form.search_city.value='';
document.vicidial_form.search_state.value='';
document.vicidial_form.search_postal_code.value='';
document.vicidial_form.MDPhonENumbeR.value = '';
document.vicidial_form.MDDiaLOverridE.value = '';
document.vicidial_form.MDLeadID.value = '';
document.vicidial_form.MDType.value = '';
if (manual_dial_in_progress==1)
{
@@ -10196,6 +10261,94 @@ function phone_number_format(formatphone) {
// ################################################################################
// Gather and display lead search data
function LeadSearchSubmit()
{
if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) )
{
alert("YOU MUST BE PAUSED TO SEARCH FOR A LEAD");
}
else
{
showDiv('SearcHResultSDisplaYBox');
document.getElementById('SearcHResultSSpan').innerHTML = "Searching...\n";
var phone_search_fields = '';
if (document.vicidial_form.search_main_phone.checked==true)
{phone_search_fields = phone_search_fields + "MAIN_";}
if (document.vicidial_form.search_alt_phone.checked==true)
{phone_search_fields = phone_search_fields + "ALT_";}
if (document.vicidial_form.search_addr3_phone.checked==true)
{phone_search_fields = phone_search_fields + "ADDR3_";}
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
{
xmlhttp = new XMLHttpRequest();
}
if (xmlhttp)
{
LSview_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=SEARCHRESULTSview&format=text&user=" + user + "&pass=" + pass + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&phone_number=" + document.vicidial_form.search_phone_number.value + "&lead_id=" + document.vicidial_form.search_lead_id.value + "&vendor_lead_code=" + document.vicidial_form.search_vendor_lead_code.value + "&first_name=" + document.vicidial_form.search_first_name.value + "&last_name=" + document.vicidial_form.search_last_name.value + "&city=" + document.vicidial_form.search_city.value + "&state=" + document.vicidial_form.search_state.value + "&postal_code=" + document.vicidial_form.search_postal_code.value + "&search=" + phone_search_fields + "&campaign=" + campaign + "&stage=<?php echo $HCwidth ?>";
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(LSview_query);
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
// alert(xmlhttp.responseText);
document.getElementById('SearcHResultSSpan').innerHTML = xmlhttp.responseText + "\n";
}
}
delete xmlhttp;
}
}
}
// ################################################################################
// Reset lead search form
function LeadSearchReset()
{
document.vicidial_form.search_phone_number.value='';
document.vicidial_form.search_lead_id.value='';
document.vicidial_form.search_vendor_lead_code.value='';
document.vicidial_form.search_first_name.value='';
document.vicidial_form.search_last_name.value='';
document.vicidial_form.search_city.value='';
document.vicidial_form.search_state.value='';
document.vicidial_form.search_postal_code.value='';
}
// ################################################################################
// Hide manual dial form
function ManualDialHide()
{
hideDiv('NeWManuaLDiaLBox');
document.vicidial_form.MDPhonENumbeR.value = '';
document.vicidial_form.MDDiaLOverridE.value = '';
document.vicidial_form.MDLeadID.value = '';
document.vicidial_form.MDType.value = '';
}
// ################################################################################
// Refresh the lead notes display
function VieWNotesLoG(logframe)
@@ -10641,6 +10794,8 @@ else
hideDiv('TimerSpan');
hideDiv('CalLLoGDisplaYBox');
hideDiv('CalLNotesDisplaYBox');
hideDiv('SearcHForMDisplaYBox');
hideDiv('SearcHResultSDisplaYBox');
hideDiv('LeaDInfOBox');
hideDiv('agentdirectlink');
hideDiv('blind_monitor_notice_span');
@@ -11691,7 +11846,12 @@ $zi=2;
<td align="right"></td>
<td align="left"><font class="body_text">&nbsp; Customer Time: <span name="custdatetime" id="custdatetime" class="log_title"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; &nbsp; Channel: <span name="callchannel" id="callchannel" class="cust_form"> </span></font></td>
</tr><tr>
<td colspan="2" align="center"> Customer Information: <span id="CusTInfOSpaN"></span></td>
<td colspan="2" align="center"> Customer Information: <span id="CusTInfOSpaN"></span> &nbsp; &nbsp; &nbsp; &nbsp;
<?php
if ($agent_lead_search == 'ENABLED')
{echo "<font class=\"body_text\"><a href=\"#\" onclick=\"OpeNSearcHForMDisplaYBox();return false;\">LEAD SEARCH</a></font>";}
?>
</td>
</tr><tr>
<td align="left" colspan="2">
@@ -12359,6 +12519,8 @@ Available Agents Transfer: <span id="AgentXferViewSelect"></span></center></font
<td align="right"><font class="body_text"> Phone Number: </font></td>
<td align="left"><font class="body_text">
<input type="text" size="14" maxlength="18" name="MDPhonENumbeR" id="MDPhonENumbeR" class="cust_form" value="" />&nbsp; (digits only)</font>
<input type="hidden" name="MDLeadID" id="MDLeadID" value="" />
<input type="hidden" name="MDType" id="MDLeadID" value="" />
</td>
</tr><tr>
<td align="right"><font class="body_text"> Search Existing Leads: </font></td>
@@ -12380,7 +12542,7 @@ Available Agents Transfer: <span id="AgentXferViewSelect"></span></center></font
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<a href="#" onclick="NeWManuaLDiaLCalLSubmiT('PREVIEW');return false;">Preview Call</a>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<a href="#" onclick="hideDiv('NeWManuaLDiaLBox');return false;">Go Back</a>
<a href="#" onclick="ManualDialHide();return false;">Go Back</a>
</td></tr></table>
</span>
@@ -12432,78 +12594,141 @@ Available Agents Transfer: <span id="AgentXferViewSelect"></span></center></font
</span>
<span style="position:absolute;left:0px;top:0px;z-index:<?php $zi++; echo $zi ?>;" id="CalLLoGDisplaYBox">
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> AGENT CALL LOG:<br />
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> &nbsp; &nbsp; &nbsp; AGENT CALL LOG: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="#" onclick="hideDiv('CalLLoGDisplaYBox');return false;">close [X]</a><br />
<?php
if ($webphone_location == 'bar')
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
?>
<div class="scroll_calllog" id="CallLogSpan"> Call log List </div>
<br /><br /> &nbsp;
</td></tr></table>
<br /><br /> &nbsp;
</td></tr></table>
</span>
<span style="position:absolute;left:0px;top:0px;z-index:<?php $zi++; echo $zi ?>;" id="SearcHForMDisplaYBox">
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> &nbsp; &nbsp; &nbsp; SEARCH FOR A LEAD: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="#" onclick="hideDiv('SearcHForMDisplaYBox');return false;">close [X]</a><br />
<?php
if ($webphone_location == 'bar')
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
?>
<br /><br />
Notes: when doing a search for a lead, the phone number, lead ID or <?php echo $label_vendor_lead_code ?> are the best fields to use. <br />Using the other fields may be slower. Lead searching does not allow for wildcard or partial search terms. <br />Lead search requests are all logged in the system.
<br /><br />
<center>
<table border="0">
<tr>
<td align="right"> Phone Number: </td><td align="left"><input type="text" size="18" maxlength="20" name="search_phone_number" id="search_phone_number"></td>
</tr>
<tr>
<td align="right"> Phone Number Fields: </td>
<td align="left">
<input type="checkbox" name="search_main_phone" id="search_main_phone" size="1" value="0" checked /> Main Phone Number
<input type="checkbox" name="search_alt_phone" id="search_alt_phone" size="1" value="0" /> Alternate Phone Number
<input type="checkbox" name="search_addr3_phone" id="search_addr3_phone" size="1" value="0" /> Address3 Phone Number
</td>
</tr>
<tr>
<td align="right"> Lead ID: </td><td align="left"><input type="text" size="11" maxlength="10" name="search_lead_id" id="search_lead_id"></td>
</tr>
<tr>
<td align="right"> <?php echo $label_vendor_lead_code ?>: </td><td align="left"><input type="text" size="18" maxlength="20" name="search_vendor_lead_code" id="search_vendor_lead_code"></td>
</tr>
<tr>
<td align="right"> <?php echo $label_first_name ?>: </td><td align="left"><input type="text" size="18" maxlength="20" name="search_first_name" id="search_first_name"></td>
</tr>
<tr>
<td align="right"> <?php echo $label_last_name ?>: </td><td align="left"><input type="text" size="18" maxlength="20" name="search_last_name" id="search_last_name"></td>
</tr>
<tr>
<td align="right"> <?php echo $label_city ?>: </td><td align="left"><input type="text" size="18" maxlength="20" name="search_city" id="search_city"></td>
</tr>
<tr>
<td align="right"> <?php echo $label_state ?>: </td><td align="left"><input type="text" size="18" maxlength="20" name="search_state" id="search_state"></td>
</tr>
<tr>
<td align="right"> <?php echo $label_postal_code ?>: </td><td align="left"><input type="text" size="10" maxlength="10" name="search_postal_code" id="search_postal_code"></td>
</tr>
<tr>
<td align="center" colspan="2"><br /> <a href="#" onclick="LeadSearchSubmit();return false;">SUBMIT SEARCH</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="#" onclick="LeadSearchReset();return false;">reset form</a></td>
</tr>
</table>
<br /><br /> &nbsp;
</td></tr></table>
</span>
<span style="position:absolute;left:0px;top:0px;z-index:<?php $zi++; echo $zi ?>;" id="SearcHResultSDisplaYBox">
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> &nbsp; &nbsp; &nbsp; SEARCH RESULTS: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="#" onclick="hideDiv('SearcHResultSDisplaYBox');return false;">close [X]</a><br />
<?php
if ($webphone_location == 'bar')
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
?>
<div class="scroll_calllog" id="SearcHResultSSpan"> Search Results </div>
<br /><br /> &nbsp;
</td></tr></table>
</span>
<span style="position:absolute;left:0px;top:0px;z-index:<?php $zi++; echo $zi ?>;" id="CalLNotesDisplaYBox">
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> CALL NOTES LOG:<br />
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> &nbsp; &nbsp; &nbsp; CALL NOTES LOG: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="#" onclick="hideDiv('CalLNotesDisplaYBox');return false;">close [X]</a><br />
<?php
if ($webphone_location == 'bar')
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
?>
<div class="scroll_calllog" id="CallNotesSpan"> Call Notes List </div>
<br /><br /> &nbsp;
</td></tr></table>
<br /><br /> &nbsp;
</td></tr></table>
</span>
<span style="position:absolute;left:0px;top:0px;z-index:<?php $zi++; echo $zi ?>;" id="LeaDInfOBox">
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> Customer Information:<br />
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> &nbsp; &nbsp; &nbsp; Customer Information: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="#" onclick="hideDiv('LeaDInfOBox');return false;">close [X]</a>
<br />
<?php
if ($webphone_location == 'bar')
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
?>
<span id="LeaDInfOSpan"> Lead Info </span>
<br /><br /> &nbsp;
</td></tr></table>
<br /><br /> &nbsp;
</td></tr></table>
</span>
<span style="position:absolute;left:0px;top:0px;z-index:<?php $zi++; echo $zi ?>;" id="PauseCodeSelectBox">
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> SELECT A PAUSE CODE :<br />
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> SELECT A PAUSE CODE :<br />
<?php
if ($webphone_location == 'bar')
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
?>
<span id="PauseCodeSelectContent"> Pause Code Selection </span>
<input type="hidden" name="PauseCodeSelection" />
<br /><br /> &nbsp;
</td></tr></table>
<input type="hidden" name="PauseCodeSelection" />
<br /><br /> &nbsp;
</td></tr></table>
</span>
<span style="position:absolute;left:<?php echo $PBwidth ?>px;top:40px;z-index:<?php $zi++; echo $zi ?>;" id="PresetsSelectBox">
<table border="0" bgcolor="#9999FF" width="400px" height="<?php echo $HTheight ?>px"><tr><td align="center" valign="top"> SELECT A PRESET :<br />
<table border="0" bgcolor="#9999FF" width="400px" height="<?php echo $HTheight ?>px"><tr><td align="center" valign="top"> SELECT A PRESET :<br />
<?php
if ($webphone_location == 'bar')
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
?>
<span id="PresetsSelectBoxContent"> Presets Selection </span>
<input type="hidden" name="PresetSelection" />
</td></tr></table>
<input type="hidden" name="PresetSelection" />
</td></tr></table>
</span>
<span style="position:absolute;left:0px;top:0px;z-index:<?php $zi++; echo $zi ?>;" id="GroupAliasSelectBox">
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> SELECT A GROUP ALIAS :<br />
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> SELECT A GROUP ALIAS :<br />
<?php
if ($webphone_location == 'bar')
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
?>
<span id="GroupAliasSelectContent"> Group Alias Selection </span>
<input type="hidden" name="GroupAliasSelection" />
<br /><br /> &nbsp;
</td></tr></table>
<input type="hidden" name="GroupAliasSelection" />
<br /><br /> &nbsp;
</td></tr></table>
</span>
<span style="position:absolute;left:0px;top:0px;z-index:<?php $zi++; echo $zi ?>;" id="blind_monitor_alert_span">
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> ALERT :<br />
<b><font color="red" size="5"> &nbsp; &nbsp; <span id="blind_monitor_alert_span_contents"></span></b></font>
<br /><br /> <a href="#" onclick="hideDiv('blind_monitor_alert_span');return false;">Go Back</a>
</td></tr></table>
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> ALERT :<br />
<b><font color="red" size="5"> &nbsp; &nbsp; <span id="blind_monitor_alert_span_contents"></span></b></font>
<br /><br /> <a href="#" onclick="hideDiv('blind_monitor_alert_span');return false;">Go Back</a>
</td></tr></table>
</span>
@@ -71,10 +71,11 @@
# 101024-0832 - Added Agent time stats option and agents-in-dispo counter
# 101109-1448 - Added Auto Hopper Level display (MikeC)
# 101216-1358 - Added functions to work with new realtime_report.php script
# 110218-1037 - Fixed query that was causing load spikes on systems with millions of log entries
#
$version = '2.4-62';
$build = '101216-1358';
$version = '2.4-63';
$build = '110218-1037';
header ("Content-type: text/html; charset=utf-8");
@@ -2475,7 +2476,8 @@ $calls_to_list = mysql_num_rows($rslt);
{
if (!ereg("N",$agent_pause_codes_active))
{
$stmtC="select sub_status from vicidial_agent_log where user='$Luser' order by agent_log_id desc limit 1;";
$twentyfour_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-24,date("i"),date("s"),date("m"),date("d"),date("Y")));
$stmtC="select sub_status from vicidial_agent_log where event_time > \"$twentyfour_hours_ago\" and user='$Luser' order by agent_log_id desc limit 1;";
$rsltC=mysql_query($stmtC,$link);
$rowC=mysql_fetch_row($rsltC);
$pausecode = sprintf("%-6s", $rowC[0]);
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
<?php
# admin_search_lead.php version 2.4
#
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# AST GUI database administration search for lead info
# admin_modify_lead.php
@@ -24,6 +24,7 @@
# 100224-1621 - Added first/last name search and changed format of the page
# 100405-1331 - Added log search ability
# 100622-0928 - Added field labels
# 110218-1237 - Added vicidial_lead_search_log logging
#
require("dbconnect.php");
@@ -556,6 +557,16 @@ else
echo "\n\n$stmt\n\n";
}
### LOG INSERTION Search Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmtL="INSERT INTO vicidial_lead_search_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', source='admin', results='0', search_query=\"$SQL_log\";";
if ($DB) {echo "|$stmtL|\n";}
$rslt=mysql_query($stmtL, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
$search_log_id = mysql_insert_id($link);
$rslt=mysql_query("$stmt", $link);
$results_to_print = mysql_num_rows($rslt);
if ( ($results_to_print < 1) and ($results_to_printX < 1) )
@@ -619,6 +630,13 @@ else
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$end_process_time = date("U");
$search_seconds = ($end_process_time - $STARTtime);
$stmtL="UPDATE vicidial_lead_search_log set results='$o', seconds='$search_seconds' where search_log_id='$search_log_id';";
if ($DB) {echo "|$stmtL|\n";}
$rslt=mysql_query($stmtL, $link);
}
##### END Lead search #####
+40 -1
View File
@@ -1,7 +1,7 @@
<?php
# user_stats.php
#
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -28,6 +28,7 @@
# 100802-2347 - Added User Group Allowed Reports option validation
# 100908-1205 - Added customer 3way hangup flags to user calls display
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
# 110218-1523 - Added searches display
#
header ("Content-type: text/html; charset=utf-8");
@@ -919,6 +920,44 @@ if ($did < 1)
echo "</TABLE><BR><BR>\n";
}
if ($did < 1)
{
##### vicidial lead searches for this time period #####
echo "<B>LEAD SEARCHES FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
echo "<tr><td><font size=1># </td><td NOWRAP><font size=2>DATE/TIME &nbsp; </td><td align=left NOWRAP><font size=2> TYPE &nbsp; </td><td align=left NOWRAP><font size=2> RESULTS &nbsp; </td><td align=left NOWRAP><font size=2> SEC &nbsp; </td><td align=right NOWRAP><font size=2> QUERY</td></tr>\n";
$stmt="select event_date,source,results,seconds,search_query from vicidial_lead_search_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 10000;";
$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"';}
$row[4] = preg_replace('/select count\(\*\) from vicidial_list where/','',$row[4]);
$row[4] = preg_replace('/SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,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,called_count,last_local_call_time,rank,owner from vicidial_list where /','',$row[4]);
while (strlen($row[4]) > 100)
{$row[4] = preg_replace("/.$/",'',$row[4]);}
$u++;
echo "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td><font size=2>$row[0]</td>";
echo "<td align=center><font size=2> $row[1] </td>\n";
echo "<td align=right><font size=2> $row[2] </td>\n";
echo "<td align=right><font size=2> $row[3] </td>\n";
echo "<td align=right><font size=2> $row[4] </td></tr>\n";
}
echo "</TABLE><BR><BR>\n";
}
$ENDtime = date("U");