Added no_update option to the update_lead function

Fixed issue with Estimated Hold Time Optioins
Added instructions for eaccelerator PHP control app

git-svn-id: svn://192.168.202.10@1484 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2010-07-23 19:06:19 +00:00
parent be550f6d07
commit b5640771c6
5 changed files with 386 additions and 319 deletions
+23 -19
View File
@@ -611,6 +611,7 @@ while ($sthArows > $cbc)
$no_delay_call_route = $aryA[29];
if ($hold_time_option =~ /DROP_ACTION/)
{$hold_time_option = $drop_action;}
$hold_time_option_SETTING = $hold_time_option;
$play_welcome_message = $aryA[30];
$no_agent_no_queue = $aryA[31];
$no_agent_action = $aryA[32];
@@ -629,6 +630,7 @@ while ($sthArows > $cbc)
$hold_time_third_option = $aryA[45];
$wait_hold_option_priority = $aryA[46];
$wait_time_option = $aryA[47];
$wait_time_option_SETTING = $wait_time_option;
$wait_time_second_option = $aryA[48];
$wait_time_third_option = $aryA[49];
$wait_time_option_seconds = $aryA[50];
@@ -907,7 +909,7 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) )
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02019'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- AH VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
if ($AGILOG) {$agi_string = "-- AH action: |$$after_hours_action|$after_hours_exten|$after_hours_message_filename|$after_hours_voicemail|"; &agi_output;}
if ($AGILOG) {$agi_string = "-- AH action: |$after_hours_action|$after_hours_exten|$after_hours_message_filename|$after_hours_voicemail|"; &agi_output;}
if ($after_hours_action =~ /EXTENSION|VOICEMAIL|IN_GROUP/)
{
@@ -2869,7 +2871,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
$moh_delay=1;
if ($play_place_in_line =~ /Y/i) {$start_place_in_line=1; $moh_delay=2;}
if ($play_estimate_hold_time =~ /Y/i) {$start_hold_estimate=1; $moh_delay=2;}
if ($hold_time_option !~ /NONE/) {$start_hold_estimate=1; $moh_delay=2;}
if ($hold_time_option_SETTING !~ /NONE/) {$start_hold_estimate=1; $moh_delay=2;}
if ($drop_timer >= 2) {$drop_timer = ($drop_timer + 5);} # add prompt play time to total queue time
if ($wait_time_option !~ /NONE/) {$wait_in_queue=1; $moh_delay=2;}
}
@@ -3036,8 +3038,9 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
$last_wait_run++;
### BEGIN wait time option press-123 options ###
if ( ($wait_time_option !~ /NONE/ ) && ($drop_timer > $wait_time_option_seconds) && ( ( ($wait_in_queue < 2) && ($last_wait_run > 5) ) || ($wait_prompt_runs < 1) ) )
if ( ($wait_time_option_SETTING !~ /NONE/ ) && ($drop_timer > $wait_time_option_seconds) && ( ( ($wait_in_queue < 2) && ($last_wait_run > 5) ) || ($wait_prompt_runs < 1) ) )
{
$pin='';
$wait_prompt_runs++;
$wait_in_queue=0; # exits wait loop
$DROPexten = '';
@@ -3054,7 +3057,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
# - PRESS_CID_CALLBACK
# - PRESS_INGROUP
if ($wait_time_option =~ /PRESS_/)
if ($wait_time_option_SETTING =~ /PRESS_/)
{
$now_date_epoch = time();
$HTO_no_block_SQL = '';
@@ -3122,12 +3125,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
if ($pin =~ /1/)
{
if ($wait_time_option =~ /PRESS_STAY/) {$wait_time_option = 'STAY_IN_QUEUE'; $wait_in_queue = 2; $DROPexten='';}
if ($wait_time_option =~ /PRESS_VMAIL/) {$wait_time_option = 'VOICEMAIL'; $HT_status='QVMAIL';}
if ($wait_time_option =~ /PRESS_EXTEN/) {$wait_time_option = 'EXTENSION'; $HT_status='WAITTO';}
if ($wait_time_option =~ /PRESS_CALLMENU/) {$wait_time_option = 'CALL_MENU'; $HT_status='WAITTO';}
if ($wait_time_option =~ /PRESS_CID_CALLBACK/) {$wait_time_option = 'CALLERID_CALLBACK'; $HT_status='WAITTO';}
if ($wait_time_option =~ /PRESS_INGROUP/) {$wait_time_option = 'IN_GROUP'; $HT_status='WAITTO';}
if ($wait_time_option_SETTING =~ /PRESS_STAY/) {$wait_time_option = 'STAY_IN_QUEUE'; $wait_in_queue = 2; $DROPexten='';}
if ($wait_time_option_SETTING =~ /PRESS_VMAIL/) {$wait_time_option = 'VOICEMAIL'; $HT_status='QVMAIL';}
if ($wait_time_option_SETTING =~ /PRESS_EXTEN/) {$wait_time_option = 'EXTENSION'; $HT_status='WAITTO';}
if ($wait_time_option_SETTING =~ /PRESS_CALLMENU/) {$wait_time_option = 'CALL_MENU'; $HT_status='WAITTO';}
if ($wait_time_option_SETTING =~ /PRESS_CID_CALLBACK/) {$wait_time_option = 'CALLERID_CALLBACK'; $HT_status='WAITTO';}
if ($wait_time_option_SETTING =~ /PRESS_INGROUP/) {$wait_time_option = 'IN_GROUP'; $HT_status='WAITTO';}
}
if ($pin =~ /2/)
{
@@ -3407,7 +3410,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
else
{
##### check if hold_time_option is set to leave Queue
if ( ($hold_time_option !~ /NONE/ ) && ($holdtime_estimate_sec_diff > $hold_time_option_seconds) && ($wait_in_queue < 2) )
if ( ($hold_time_option_SETTING !~ /NONE/ ) && ($holdtime_estimate_sec_diff > $hold_time_option_seconds) && ($wait_in_queue < 2) )
{
if ($drop_timer < $hold_time_option_minimum)
{
@@ -3415,6 +3418,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
}
else
{
$pin='';
$wait_in_queue=0; # exits wait loop
$DROPexten = '';
$exitwithkey=0;
@@ -3436,7 +3440,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
# - PRESS_INGROUP
### BEGIN hold time option press-123 options ###
if ($hold_time_option =~ /PRESS_/)
if ($hold_time_option_SETTING =~ /PRESS_/)
{
$now_date_epoch = time();
$HTO_no_block_SQL = '';
@@ -3504,12 +3508,12 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
if ($pin =~ /1/)
{
if ($hold_time_option =~ /PRESS_STAY/) {$hold_time_option = 'STAY_IN_QUEUE'; $wait_in_queue = 2; $DROPexten='';}
if ($hold_time_option =~ /PRESS_VMAIL/) {$hold_time_option = 'VOICEMAIL'; $HT_status='QVMAIL';}
if ($hold_time_option =~ /PRESS_EXTEN/) {$hold_time_option = 'EXTENSION'; $HT_status='WAITTO';}
if ($hold_time_option =~ /PRESS_CALLMENU/) {$hold_time_option = 'CALL_MENU'; $HT_status='WAITTO';}
if ($hold_time_option =~ /PRESS_CID_CALLBACK/) {$hold_time_option = 'CALLERID_CALLBACK'; $HT_status='WAITTO';}
if ($hold_time_option =~ /PRESS_INGROUP/) {$hold_time_option = 'IN_GROUP'; $HT_status='WAITTO';}
if ($hold_time_option_SETTING =~ /PRESS_STAY/) {$hold_time_option = 'STAY_IN_QUEUE'; $wait_in_queue = 2; $DROPexten='';}
if ($hold_time_option_SETTING =~ /PRESS_VMAIL/) {$hold_time_option = 'VOICEMAIL'; $HT_status='QVMAIL';}
if ($hold_time_option_SETTING =~ /PRESS_EXTEN/) {$hold_time_option = 'EXTENSION'; $HT_status='WAITTO';}
if ($hold_time_option_SETTING =~ /PRESS_CALLMENU/) {$hold_time_option = 'CALL_MENU'; $HT_status='WAITTO';}
if ($hold_time_option_SETTING =~ /PRESS_CID_CALLBACK/) {$hold_time_option = 'CALLERID_CALLBACK'; $HT_status='WAITTO';}
if ($hold_time_option_SETTING =~ /PRESS_INGROUP/) {$hold_time_option = 'IN_GROUP'; $HT_status='WAITTO';}
}
if ($pin =~ /2/)
{
@@ -3564,6 +3568,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
{
$DROPexten='';
$wait_in_queue = 2; #continue waiting on hold
if ($AGILOG) {$agi_string = "HOLD TIME OPTION NOTHING PRESSED $pin: $hold_time_option|$HT_status"; &agi_output;}
}
}
### END hold time option press 1 options ###
@@ -3673,7 +3678,6 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
{
$wait_in_queue = 2; #continue waiting
}
}
if ($AGILOG) {$agi_string = "-- VDCL HOLD TIME OPT: |$hold_time_option|$DROPexten|$wait_in_queue|"; &agi_output;}
+8
View File
@@ -39,6 +39,8 @@ Changes:
100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA)
100704-1148 - Added custom fields inserts to the add_lead function
100718-0245 - Added update_lead function to update existing leads
100723-1333 - Added no_update option to the update_lead function
@@ -331,6 +333,8 @@ records - number of records to update if more than 1 found (defaults to '1'[mos
custom_fields - Y or N, default is N. Defines whether the API will accept custom field data when updating leads in the vicidial_list table
For custom fields to be updated, just add the field label as a variable to the URL string
For example, if the field_label is "favorite_color" you would add "&favorite_color=blue"
no_update - Y or N, Setting this to Y will not perform any updates, but will instead only tell
you if a lead exists that matches the search criteria, default is N.
EDITABLE FIELDS-
user_field - 1-20 characters, this updates the 'user' field in the vicidial_list table
@@ -378,6 +382,8 @@ http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&functio
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_lead&search_location=LIST&search_method=VENDOR_LEAD_CODE_PHONE_NUMBER&insert_if_not_found=Y&phone_number=9999000029&phone_code=1&list_id=999&first_name=Bob&last_name=Wilson&city=Chicago&custom_fields=Y&favorite_color=red&user_field=1008&list_id_field=107&status=OLD
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_lead&lead_id=27&no_update=Y
Example responses:
SUCCESS: update_lead LEAD HAS BEEN UPDATED - 6666|193716
NOTICE: update_lead CUSTOM FIELDS VALUES UPDATED - 7275551111|1234|101
@@ -388,6 +394,8 @@ NOTICE: update_lead CUSTOM FIELDS NOT UPDATED, NO FIELDS DEFINED - 7275551111|12
NOTICE: update_lead NO MATCHES FOUND IN THE SYSTEM - 6666|4567|897654327|7275551212
SUCCESS: update_lead LEAD HAS BEEN ADDED - 7275551111|6666|999|193716|-4
NOTICE: update_lead LEADS FOUND IN THE SYSTEM - 6666|4567|897654327|7275551212
ERROR: update_lead INVALID DATA FOR LEAD INSERTION - 6666|||
ERROR: update_lead NO MATCHES FOUND IN THE SYSTEM - 6666|||
ERROR: update_lead NO VALID SEARCH METHOD - 6666|SYSTEM|||
@@ -621,3 +621,17 @@ useradd -g ftpgroup -d /dev/null -s /etc ftpuser
make install-strip
pure-pw useradd cron -u ftpuser -d /home/cron
/usr/local/sbin/pure-ftpd &
NOTE: there is now a utility available to manage eaccelerator from a web interface:
#> cd /usr/src/eaccelerator-0.9.5.3
#> cp control.php /srv/www/htdocs/eaccelerator_control.php
#> cd /srv/www/htdocs/
#> vim eaccelerator_control.php
Edit the following two lines:
$user = "username";
$pw = "password";
#> vim /etc/php5/conf.d/eaccelerator.ini
Add the following line:
eaccelerator.allowed_admin_path = "/srv/www/htdocs/"
+14
View File
@@ -775,6 +775,20 @@ installation on another machine)
- php -v
NOTE: there is now a utility available to manage eaccelerator from a web interface:
#> cd /usr/src/eaccelerator-0.9.5.3
#> cp control.php /srv/www/htdocs/eaccelerator_control.php
#> cd /srv/www/htdocs/
#> vim eaccelerator_control.php
Edit the following two lines:
$user = "username";
$pw = "password";
#> vim /etc/php5/conf.d/eaccelerator.ini
Add the following line:
eaccelerator.allowed_admin_path = "/srv/www/htdocs/"
balance is a load-balancing application for Linux that will allow you to spread
+327 -300
View File
@@ -34,10 +34,11 @@
# 100704-1148 - Added custom fields inserts to the add_lead function
# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any
# 100718-0245 - Added update_lead function to update existing leads
# 100723-1333 - Added no_update option to the update_lead function
#
$version = '2.4-20';
$build = '100718-0245';
$version = '2.4-21';
$build = '100723-1333';
require("dbconnect.php");
@@ -150,6 +151,8 @@ if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];}
elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];}
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
if (isset($_GET["no_update"])) {$no_update=$_GET["no_update"];}
elseif (isset($_POST["no_update"])) {$no_update=$_POST["no_update"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -238,6 +241,7 @@ if ($non_latin < 1)
$user_field = ereg_replace("[^-_0-9a-zA-Z]","",$user_field);
$list_id_field = ereg_replace("[^0-9]","",$list_id_field);
$lead_id = ereg_replace("[^0-9]","",$lead_id);
$no_update = ereg_replace("[^A-Z]","",$no_update);
}
else
{
@@ -1841,322 +1845,353 @@ if ($function == 'update_lead')
}
### END searching ###
if ($search_found > 0)
if ($no_update=='Y')
{
$VL_update_SQL='';
##### BEGIN update lead information in the system #####
if (strlen($user_field)>0) {$VL_update_SQL .= "user='$user_field',";}
if (strlen($list_id_field)>0) {$VL_update_SQL .= "list_id='$list_id_field',";}
if (strlen($status)>0) {$VL_update_SQL .= "status='$status',";}
if (strlen($vendor_lead_code)>0) {$VL_update_SQL .= "vendor_lead_code='$vendor_lead_code',";}
if (strlen($source_id)>0) {$VL_update_SQL .= "source_id='$source_id',";}
if (strlen($gmt_offset_now)>0) {$VL_update_SQL .= "gmt_offset_now='$gmt_offset_now',";}
if (strlen($title)>0) {$VL_update_SQL .= "title='$title',";}
if (strlen($first_name)>0) {$VL_update_SQL .= "first_name='$first_name',";}
if (strlen($middle_initial)>0) {$VL_update_SQL .= "middle_initial='$middle_initial',";}
if (strlen($last_name)>0) {$VL_update_SQL .= "last_name='$last_name',";}
if (strlen($address1)>0) {$VL_update_SQL .= "address1='$address1',";}
if (strlen($address2)>0) {$VL_update_SQL .= "address2='$address2',";}
if (strlen($address3)>0) {$VL_update_SQL .= "address3='$address3',";}
if (strlen($city)>0) {$VL_update_SQL .= "city='$city',";}
if (strlen($state)>0) {$VL_update_SQL .= "state='$state',";}
if (strlen($province)>0) {$VL_update_SQL .= "province='$province',";}
if (strlen($postal_code)>0) {$VL_update_SQL .= "postal_code='$postal_code',";}
if (strlen($country_code)>0) {$VL_update_SQL .= "country_code='$country_code',";}
if (strlen($gender)>0) {$VL_update_SQL .= "gender='$gender',";}
if (strlen($date_of_birth)>0) {$VL_update_SQL .= "date_of_birth='$date_of_birth',";}
if (strlen($alt_phone)>0) {$VL_update_SQL .= "alt_phone='$alt_phone',";}
if (strlen($email)>0) {$VL_update_SQL .= "email='$email',";}
if (strlen($security_phrase)>0) {$VL_update_SQL .= "security_phrase='$security_phrase',";}
if (strlen($comments)>0) {$VL_update_SQL .= "comments='$comments',";}
if (strlen($rank)>0) {$VL_update_SQL .= "rank='$rank',";}
if (strlen($owner)>0) {$VL_update_SQL .= "owner='$owner',";}
$VL_update_SQL = preg_replace("/,$/","",$VL_update_SQL);
$VL_update_SQL = preg_replace("/'--BLANK--'/","''",$VL_update_SQL);
$VL_update_SQL = preg_replace("/\n/","!N",$VL_update_SQL);
$n=0;
while ($search_found > $n)
if ($search_found > 0)
{
$VLaffected_rows=0;
$CFaffected_rows=0;
if (strlen($VL_update_SQL)>6)
{
$stmt = "UPDATE vicidial_list SET $VL_update_SQL where lead_id='$search_lead_id[$n]';";
if ($DB>0) {echo "DEBUG: update_lead query - $stmt\n";}
$rslt=mysql_query($stmt, $link);
$VLaffected_rows = mysql_affected_rows($link);
$result = 'SUCCESS';
$result_reason = "update_lead LEAD HAS BEEN UPDATED";
echo "$result: $result_reason - $user|$search_lead_id[$n]\n";
$data = "$phone_number|$list_id|$lead_id|$gmt_offset";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
##### BEGIN custom fields update query build #####
if ($custom_fields=='Y')
{
$lead_custom_list = $search_lead_list[$n];
if ($search_entry_list[$n] > 99) {$lead_custom_list = $search_entry_list[$n];}
$update_sent=0;
$CFoutput='';
$stmt="SHOW TABLES LIKE \"custom_$lead_custom_list\";";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
$tablecount_to_print = mysql_num_rows($rslt);
if ($tablecount_to_print > 0)
{
$update_SQL='';
$VL_update_SQL='';
$stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$lead_custom_list' order by field_rank,field_order,field_label;";
$rslt=mysql_query($stmt, $link);
$fields_to_print = mysql_num_rows($rslt);
$fields_list='';
$o=0;
while ($fields_to_print > $o)
{
$new_field_value='';
$form_field_value='';
$rowx=mysql_fetch_row($rslt);
$A_field_id[$o] = $rowx[0];
$A_field_label[$o] = $rowx[1];
$A_field_name[$o] = $rowx[2];
$A_field_type[$o] = $rowx[6];
$A_field_size[$o] = $rowx[8];
$A_field_max[$o] = $rowx[9];
$A_field_required[$o] = $rowx[12];
$A_field_value[$o] = '';
$field_name_id = $A_field_label[$o];
if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];}
elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];}
$A_field_value[$o] = $form_field_value;
if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') )
{
$A_field_value[$o]='----IGNORE----';
}
else
{
if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
{
$update_SQL .= "$A_field_label[$o]='$A_field_value[$o]',";
}
}
$o++;
}
$custom_update_count=0;
if (strlen($update_SQL)>3)
{
$custom_record_lead_count=0;
$stmt="SELECT count(*) from custom_$lead_custom_list where lead_id='$search_lead_id[$n]';";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
$fieldleadcount_to_print = mysql_num_rows($rslt);
if ($fieldleadcount_to_print > 0)
{
$rowx=mysql_fetch_row($rslt);
$custom_record_lead_count = $rowx[0];
}
$update_SQL = preg_replace("/,$/","",$update_SQL);
$custom_table_update_SQL = "INSERT INTO custom_$lead_custom_list SET lead_id='$search_lead_id[$n]',$update_SQL;";
if ($custom_record_lead_count > 0)
{$custom_table_update_SQL = "UPDATE custom_$lead_custom_list SET $update_SQL where lead_id='$search_lead_id[$n]';";}
$rslt=mysql_query($custom_table_update_SQL, $link);
$custom_update_count = mysql_affected_rows($link);
if ($DB) {echo "$custom_update_count|$custom_table_update_SQL\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$result = 'NOTICE';
$result_reason = "update_lead CUSTOM FIELDS VALUES UPDATED";
echo "$result: $result_reason - $phone_number|$search_lead_id[$n]|$search_lead_list[$n]|$search_entry_list[$n]|$lead_custom_list|$custom_update_count\n";
$data = "$phone_number|$lead_id|$list_id";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
$update_sent++;
}
if ($custom_update_count > 0)
{
$list_table_update_SQL = "UPDATE vicidial_list SET entry_list_id='$lead_custom_list' where lead_id='$search_lead_id[$n]';";
$rslt=mysql_query($list_table_update_SQL, $link);
$list_update_count = mysql_affected_rows($link);
if ($DB) {echo "$list_update_count|$list_table_update_SQL\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
}
}
else
{
$result = 'NOTICE';
$result_reason = "update_lead CUSTOM FIELDS NOT ADDED, NO CUSTOM FIELDS DEFINED FOR THIS LIST";
echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n";
$data = "$phone_number|$lead_id|$list_id";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
}
##### END custom fields update query build #####
$n++;
$result = 'NOTICE';
$result_reason = "update_lead LEADS FOUND IN THE SYSTEM";
$data = "$lead_id|$vendor_lead_code|$phone_number";
echo "$result: $result_reason: |$user|$data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
##### END update lead information in the system #####
else
{
$result = 'NOTICE';
$result_reason = "update_lead NO MATCHES FOUND IN THE SYSTEM";
$data = "$lead_id|$vendor_lead_code|$phone_number";
echo "$result: $result_reason: |$user|$data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
exit;
}
else
{
$result = 'ERROR';
if ($insert_if_not_found=='Y')
{$result = 'NOTICE';}
$result_reason = "update_lead NO MATCHES FOUND IN THE SYSTEM";
$data = "$lead_id|$vendor_lead_code|$phone_number";
echo "$result: $result_reason: |$user|$data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
if ($insert_if_not_found!='Y')
{exit;}
else
if ($search_found > 0)
{
if (strlen($list_id_field)>0) {$list_id=$list_id_field;}
##### BEGIN insert not-found lead into the system #####
if ( (strlen($phone_number)<6) or (strlen($phone_number)>18) or (strlen($phone_code)<1) or (strlen($list_id)<3) )
{
$result = 'ERROR';
$result_reason = "update_lead INVALID DATA FOR LEAD INSERTION";
$data = "$phone_number|$phone_code|$list_id|$insert_if_not_found";
echo "$result: $result_reason - $user|$data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit;
}
else
{
### get current gmt_offset of the phone_number
$gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code);
$VL_update_SQL='';
##### BEGIN update lead information in the system #####
if (strlen($user_field)>0) {$VL_update_SQL .= "user='$user_field',";}
if (strlen($list_id_field)>0) {$VL_update_SQL .= "list_id='$list_id_field',";}
if (strlen($status)>0) {$VL_update_SQL .= "status='$status',";}
if (strlen($vendor_lead_code)>0) {$VL_update_SQL .= "vendor_lead_code='$vendor_lead_code',";}
if (strlen($source_id)>0) {$VL_update_SQL .= "source_id='$source_id',";}
if (strlen($gmt_offset_now)>0) {$VL_update_SQL .= "gmt_offset_now='$gmt_offset_now',";}
if (strlen($title)>0) {$VL_update_SQL .= "title='$title',";}
if (strlen($first_name)>0) {$VL_update_SQL .= "first_name='$first_name',";}
if (strlen($middle_initial)>0) {$VL_update_SQL .= "middle_initial='$middle_initial',";}
if (strlen($last_name)>0) {$VL_update_SQL .= "last_name='$last_name',";}
if (strlen($address1)>0) {$VL_update_SQL .= "address1='$address1',";}
if (strlen($address2)>0) {$VL_update_SQL .= "address2='$address2',";}
if (strlen($address3)>0) {$VL_update_SQL .= "address3='$address3',";}
if (strlen($city)>0) {$VL_update_SQL .= "city='$city',";}
if (strlen($state)>0) {$VL_update_SQL .= "state='$state',";}
if (strlen($province)>0) {$VL_update_SQL .= "province='$province',";}
if (strlen($postal_code)>0) {$VL_update_SQL .= "postal_code='$postal_code',";}
if (strlen($country_code)>0) {$VL_update_SQL .= "country_code='$country_code',";}
if (strlen($gender)>0) {$VL_update_SQL .= "gender='$gender',";}
if (strlen($date_of_birth)>0) {$VL_update_SQL .= "date_of_birth='$date_of_birth',";}
if (strlen($alt_phone)>0) {$VL_update_SQL .= "alt_phone='$alt_phone',";}
if (strlen($email)>0) {$VL_update_SQL .= "email='$email',";}
if (strlen($security_phrase)>0) {$VL_update_SQL .= "security_phrase='$security_phrase',";}
if (strlen($comments)>0) {$VL_update_SQL .= "comments='$comments',";}
if (strlen($rank)>0) {$VL_update_SQL .= "rank='$rank',";}
if (strlen($owner)>0) {$VL_update_SQL .= "owner='$owner',";}
$VL_update_SQL = preg_replace("/,$/","",$VL_update_SQL);
$VL_update_SQL = preg_replace("/'--BLANK--'/","''",$VL_update_SQL);
$VL_update_SQL = preg_replace("/\n/","!N",$VL_update_SQL);
if (strlen($status)<1)
{$status='NEW';}
### insert a new lead in the system with this phone number
$stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='$status',user='$user',vendor_lead_code='$vendor_lead_code',source_id='$source_id',gmt_offset_now='$gmt_offset',title='$title',first_name='$first_name',middle_initial='$middle_initial',last_name='$last_name',address1='$address1',address2='$address2',address3='$address3',city='$city',state='$state',province='$province',postal_code='$postal_code',country_code='$country_code',gender='$gender',date_of_birth='$date_of_birth',alt_phone='$alt_phone',email='$email',security_phrase='$security_phrase',comments='$comments',called_since_last_reset='N',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',rank='$rank',owner='$owner',entry_list_id='0';";
if ($DB>0) {echo "DEBUG: update_lead query - $stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
if ($affected_rows > 0)
$n=0;
while ($search_found > $n)
{
$VLaffected_rows=0;
$CFaffected_rows=0;
if (strlen($VL_update_SQL)>6)
{
$lead_id = mysql_insert_id($link);
$stmt = "UPDATE vicidial_list SET $VL_update_SQL where lead_id='$search_lead_id[$n]';";
if ($DB>0) {echo "DEBUG: update_lead query - $stmt\n";}
$rslt=mysql_query($stmt, $link);
$VLaffected_rows = mysql_affected_rows($link);
$result = 'SUCCESS';
$result_reason = "update_lead LEAD HAS BEEN ADDED";
echo "$result: $result_reason - $phone_number|$list_id|$lead_id|$gmt_offset|$user\n";
$result_reason = "update_lead LEAD HAS BEEN UPDATED";
echo "$result: $result_reason - $user|$search_lead_id[$n]\n";
$data = "$phone_number|$list_id|$lead_id|$gmt_offset";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
if (strlen($multi_alt_phones) > 5)
}
##### BEGIN custom fields update query build #####
if ($custom_fields=='Y')
{
$lead_custom_list = $search_lead_list[$n];
if ($search_entry_list[$n] > 99) {$lead_custom_list = $search_entry_list[$n];}
$update_sent=0;
$CFoutput='';
$stmt="SHOW TABLES LIKE \"custom_$lead_custom_list\";";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
$tablecount_to_print = mysql_num_rows($rslt);
if ($tablecount_to_print > 0)
{
$map=$MT; $ALTm_phone_code=$MT; $ALTm_phone_number=$MT; $ALTm_phone_note=$MT;
$map = explode('!', $multi_alt_phones);
$map_count = count($map);
if ($DB>0) {echo "DEBUG: update_lead multi-al-entry - $a|$map_count|$multi_alt_phones\n";}
$g++;
$r=0; $s=0; $inserted_alt_phones=0;
while ($r < $map_count)
$update_SQL='';
$VL_update_SQL='';
$stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$lead_custom_list' order by field_rank,field_order,field_label;";
$rslt=mysql_query($stmt, $link);
$fields_to_print = mysql_num_rows($rslt);
$fields_list='';
$o=0;
while ($fields_to_print > $o)
{
$s++;
$ncn=$MT;
$ncn = explode('_', $map[$r]);
print "$ncn[0]|$ncn[1]|$ncn[2]";
$new_field_value='';
$form_field_value='';
$rowx=mysql_fetch_row($rslt);
$A_field_id[$o] = $rowx[0];
$A_field_label[$o] = $rowx[1];
$A_field_name[$o] = $rowx[2];
$A_field_type[$o] = $rowx[6];
$A_field_size[$o] = $rowx[8];
$A_field_max[$o] = $rowx[9];
$A_field_required[$o] = $rowx[12];
$A_field_value[$o] = '';
$field_name_id = $A_field_label[$o];
if (strlen($forcephonecode) > 0)
{$ALTm_phone_code[$r] = $forcephonecode;}
if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];}
elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];}
$A_field_value[$o] = $form_field_value;
if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') )
{
$A_field_value[$o]='----IGNORE----';
}
else
{$ALTm_phone_code[$r] = $ncn[1];}
if (strlen($ALTm_phone_code[$r]) < 1)
{$ALTm_phone_code[$r]='1';}
$ALTm_phone_number[$r] = $ncn[0];
$ALTm_phone_note[$r] = $ncn[2];
$stmt = "INSERT INTO vicidial_list_alt_phones (lead_id,phone_code,phone_number,alt_phone_note,alt_phone_count) values('$lead_id','$ALTm_phone_code[$r]','$ALTm_phone_number[$r]','$ALTm_phone_note[$r]','$s');";
if ($DB>0) {echo "DEBUG: update_lead query - $stmt\n";}
$rslt=mysql_query($stmt, $link);
$Zaffected_rows = mysql_affected_rows($link);
$inserted_alt_phones = ($inserted_alt_phones + $Zaffected_rows);
$r++;
{
if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
{
$update_SQL .= "$A_field_label[$o]='$A_field_value[$o]',";
}
}
$o++;
}
$result = 'NOTICE';
$result_reason = "update_lead MULTI-ALT-PHONE NUMBERS LOADED";
echo "$result: $result_reason - $inserted_alt_phones|$lead_id|$user\n";
$data = "$inserted_alt_phones|$lead_id";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
### BEGIN custom fields insert section ###
if ($custom_fields == 'Y')
{
if ($custom_fields_enabled > 0)
$custom_update_count=0;
if (strlen($update_SQL)>3)
{
$stmt="SHOW TABLES LIKE \"custom_$list_id\";";
$custom_record_lead_count=0;
$stmt="SELECT count(*) from custom_$lead_custom_list where lead_id='$search_lead_id[$n]';";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
$tablecount_to_print = mysql_num_rows($rslt);
if ($tablecount_to_print > 0)
$fieldleadcount_to_print = mysql_num_rows($rslt);
if ($fieldleadcount_to_print > 0)
{
$CFinsert_SQL='';
$stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;";
$rowx=mysql_fetch_row($rslt);
$custom_record_lead_count = $rowx[0];
}
$update_SQL = preg_replace("/,$/","",$update_SQL);
$custom_table_update_SQL = "INSERT INTO custom_$lead_custom_list SET lead_id='$search_lead_id[$n]',$update_SQL;";
if ($custom_record_lead_count > 0)
{$custom_table_update_SQL = "UPDATE custom_$lead_custom_list SET $update_SQL where lead_id='$search_lead_id[$n]';";}
$rslt=mysql_query($custom_table_update_SQL, $link);
$custom_update_count = mysql_affected_rows($link);
if ($DB) {echo "$custom_update_count|$custom_table_update_SQL\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$result = 'NOTICE';
$result_reason = "update_lead CUSTOM FIELDS VALUES UPDATED";
echo "$result: $result_reason - $phone_number|$search_lead_id[$n]|$search_lead_list[$n]|$search_entry_list[$n]|$lead_custom_list|$custom_update_count\n";
$data = "$phone_number|$lead_id|$list_id";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
$update_sent++;
}
if ($custom_update_count > 0)
{
$list_table_update_SQL = "UPDATE vicidial_list SET entry_list_id='$lead_custom_list' where lead_id='$search_lead_id[$n]';";
$rslt=mysql_query($list_table_update_SQL, $link);
$list_update_count = mysql_affected_rows($link);
if ($DB) {echo "$list_update_count|$list_table_update_SQL\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
}
}
else
{
$result = 'NOTICE';
$result_reason = "update_lead CUSTOM FIELDS NOT ADDED, NO CUSTOM FIELDS DEFINED FOR THIS LIST";
echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n";
$data = "$phone_number|$lead_id|$list_id";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
}
##### END custom fields update query build #####
$n++;
}
##### END update lead information in the system #####
}
else
{
$result = 'ERROR';
if ($insert_if_not_found=='Y')
{$result = 'NOTICE';}
$result_reason = "update_lead NO MATCHES FOUND IN THE SYSTEM";
$data = "$lead_id|$vendor_lead_code|$phone_number";
echo "$result: $result_reason: |$user|$data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
if ($insert_if_not_found!='Y')
{exit;}
else
{
if (strlen($list_id_field)>0) {$list_id=$list_id_field;}
##### BEGIN insert not-found lead into the system #####
if ( (strlen($phone_number)<6) or (strlen($phone_number)>18) or (strlen($phone_code)<1) or (strlen($list_id)<3) )
{
$result = 'ERROR';
$result_reason = "update_lead INVALID DATA FOR LEAD INSERTION";
$data = "$phone_number|$phone_code|$list_id|$insert_if_not_found";
echo "$result: $result_reason - $user|$data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit;
}
else
{
### get current gmt_offset of the phone_number
$gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code);
if (strlen($status)<1)
{$status='NEW';}
### insert a new lead in the system with this phone number
$stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='$status',user='$user',vendor_lead_code='$vendor_lead_code',source_id='$source_id',gmt_offset_now='$gmt_offset',title='$title',first_name='$first_name',middle_initial='$middle_initial',last_name='$last_name',address1='$address1',address2='$address2',address3='$address3',city='$city',state='$state',province='$province',postal_code='$postal_code',country_code='$country_code',gender='$gender',date_of_birth='$date_of_birth',alt_phone='$alt_phone',email='$email',security_phrase='$security_phrase',comments='$comments',called_since_last_reset='N',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',rank='$rank',owner='$owner',entry_list_id='0';";
if ($DB>0) {echo "DEBUG: update_lead query - $stmt\n";}
$rslt=mysql_query($stmt, $link);
$affected_rows = mysql_affected_rows($link);
if ($affected_rows > 0)
{
$lead_id = mysql_insert_id($link);
$result = 'SUCCESS';
$result_reason = "update_lead LEAD HAS BEEN ADDED";
echo "$result: $result_reason - $phone_number|$list_id|$lead_id|$gmt_offset|$user\n";
$data = "$phone_number|$list_id|$lead_id|$gmt_offset";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
if (strlen($multi_alt_phones) > 5)
{
$map=$MT; $ALTm_phone_code=$MT; $ALTm_phone_number=$MT; $ALTm_phone_note=$MT;
$map = explode('!', $multi_alt_phones);
$map_count = count($map);
if ($DB>0) {echo "DEBUG: update_lead multi-al-entry - $a|$map_count|$multi_alt_phones\n";}
$g++;
$r=0; $s=0; $inserted_alt_phones=0;
while ($r < $map_count)
{
$s++;
$ncn=$MT;
$ncn = explode('_', $map[$r]);
print "$ncn[0]|$ncn[1]|$ncn[2]";
if (strlen($forcephonecode) > 0)
{$ALTm_phone_code[$r] = $forcephonecode;}
else
{$ALTm_phone_code[$r] = $ncn[1];}
if (strlen($ALTm_phone_code[$r]) < 1)
{$ALTm_phone_code[$r]='1';}
$ALTm_phone_number[$r] = $ncn[0];
$ALTm_phone_note[$r] = $ncn[2];
$stmt = "INSERT INTO vicidial_list_alt_phones (lead_id,phone_code,phone_number,alt_phone_note,alt_phone_count) values('$lead_id','$ALTm_phone_code[$r]','$ALTm_phone_number[$r]','$ALTm_phone_note[$r]','$s');";
if ($DB>0) {echo "DEBUG: update_lead query - $stmt\n";}
$rslt=mysql_query($stmt, $link);
$fields_to_print = mysql_num_rows($rslt);
$fields_list='';
$o=0;
while ($fields_to_print > $o)
$Zaffected_rows = mysql_affected_rows($link);
$inserted_alt_phones = ($inserted_alt_phones + $Zaffected_rows);
$r++;
}
$result = 'NOTICE';
$result_reason = "update_lead MULTI-ALT-PHONE NUMBERS LOADED";
echo "$result: $result_reason - $inserted_alt_phones|$lead_id|$user\n";
$data = "$inserted_alt_phones|$lead_id";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
### BEGIN custom fields insert section ###
if ($custom_fields == 'Y')
{
if ($custom_fields_enabled > 0)
{
$stmt="SHOW TABLES LIKE \"custom_$list_id\";";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
$tablecount_to_print = mysql_num_rows($rslt);
if ($tablecount_to_print > 0)
{
$new_field_value='';
$form_field_value='';
$rowx=mysql_fetch_row($rslt);
$A_field_id[$o] = $rowx[0];
$A_field_label[$o] = $rowx[1];
$A_field_name[$o] = $rowx[2];
$A_field_type[$o] = $rowx[6];
$A_field_size[$o] = $rowx[8];
$A_field_max[$o] = $rowx[9];
$A_field_required[$o] = $rowx[12];
$A_field_value[$o] = '';
$field_name_id = $A_field_label[$o];
if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];}
elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];}
$A_field_value[$o] = $form_field_value;
if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') )
$CFinsert_SQL='';
$stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;";
$rslt=mysql_query($stmt, $link);
$fields_to_print = mysql_num_rows($rslt);
$fields_list='';
$o=0;
while ($fields_to_print > $o)
{
$A_field_value[$o]='----IGNORE----';
}
else
{
if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
$new_field_value='';
$form_field_value='';
$rowx=mysql_fetch_row($rslt);
$A_field_id[$o] = $rowx[0];
$A_field_label[$o] = $rowx[1];
$A_field_name[$o] = $rowx[2];
$A_field_type[$o] = $rowx[6];
$A_field_size[$o] = $rowx[8];
$A_field_max[$o] = $rowx[9];
$A_field_required[$o] = $rowx[12];
$A_field_value[$o] = '';
$field_name_id = $A_field_label[$o];
if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];}
elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];}
$A_field_value[$o] = $form_field_value;
if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') )
{
$CFinsert_SQL .= "$A_field_label[$o]='$A_field_value[$o]',";
$A_field_value[$o]='----IGNORE----';
}
else
{
if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
{
$CFinsert_SQL .= "$A_field_label[$o]='$A_field_value[$o]',";
}
}
$o++;
}
$o++;
}
if (strlen($CFinsert_SQL)>3)
{
$CFinsert_SQL = preg_replace("/,$/","",$CFinsert_SQL);
$custom_table_update_SQL = "INSERT INTO custom_$list_id SET lead_id='$lead_id',$CFinsert_SQL;";
$rslt=mysql_query($custom_table_update_SQL, $link);
$custom_insert_count = mysql_affected_rows($link);
if ($custom_insert_count > 0)
if (strlen($CFinsert_SQL)>3)
{
# Update vicidial_list entry to put list_id as entry_list_id
$vl_table_entry_update_SQL = "UPDATE vicidial_list SET entry_list_id='$list_id' where lead_id='$lead_id';";
$rslt=mysql_query($vl_table_entry_update_SQL, $link);
$vl_table_entry_update_count = mysql_affected_rows($link);
$CFinsert_SQL = preg_replace("/,$/","",$CFinsert_SQL);
$custom_table_update_SQL = "INSERT INTO custom_$list_id SET lead_id='$lead_id',$CFinsert_SQL;";
$rslt=mysql_query($custom_table_update_SQL, $link);
$custom_insert_count = mysql_affected_rows($link);
if ($custom_insert_count > 0)
{
# Update vicidial_list entry to put list_id as entry_list_id
$vl_table_entry_update_SQL = "UPDATE vicidial_list SET entry_list_id='$list_id' where lead_id='$lead_id';";
$rslt=mysql_query($vl_table_entry_update_SQL, $link);
$vl_table_entry_update_count = mysql_affected_rows($link);
$result = 'NOTICE';
$result_reason = "update_lead CUSTOM FIELDS VALUES ADDED";
echo "$result: $result_reason - $phone_number|$lead_id|$list_id|$vl_table_entry_update_count\n";
$data = "$phone_number|$lead_id|$list_id";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
$result = 'NOTICE';
$result_reason = "update_lead CUSTOM FIELDS VALUES ADDED";
echo "$result: $result_reason - $phone_number|$lead_id|$list_id|$vl_table_entry_update_count\n";
$data = "$phone_number|$lead_id|$list_id";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
else
{
$result = 'NOTICE';
$result_reason = "update_lead CUSTOM FIELDS NOT ADDED, NO FIELDS DEFINED";
echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n";
$data = "$phone_number|$lead_id|$list_id";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
}
else
{
@@ -2170,7 +2205,7 @@ if ($function == 'update_lead')
else
{
$result = 'NOTICE';
$result_reason = "update_lead CUSTOM FIELDS NOT ADDED, NO FIELDS DEFINED";
$result_reason = "update_lead CUSTOM FIELDS NOT ADDED, NO CUSTOM FIELDS DEFINED FOR THIS LIST";
echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n";
$data = "$phone_number|$lead_id|$list_id";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
@@ -2179,25 +2214,17 @@ if ($function == 'update_lead')
else
{
$result = 'NOTICE';
$result_reason = "update_lead CUSTOM FIELDS NOT ADDED, NO CUSTOM FIELDS DEFINED FOR THIS LIST";
echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n";
$data = "$phone_number|$lead_id|$list_id";
$result_reason = "update_lead CUSTOM FIELDS NOT ADDED, CUSTOM FIELDS DISABLED";
echo "$result: $result_reason - $phone_number|$lead_id|$custom_fields|$custom_fields_enabled\n";
$data = "$phone_number|$lead_id|$custom_fields|$custom_fields_enabled";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
}
else
{
$result = 'NOTICE';
$result_reason = "update_lead CUSTOM FIELDS NOT ADDED, CUSTOM FIELDS DISABLED";
echo "$result: $result_reason - $phone_number|$lead_id|$custom_fields|$custom_fields_enabled\n";
$data = "$phone_number|$lead_id|$custom_fields|$custom_fields_enabled";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
### END custom fields insert section ###
}
### END custom fields insert section ###
}
##### END insert not-found lead into the system #####
}
##### END insert not-found lead into the system #####
}
}
}