Added lead_search Non-Agent API function
git-svn-id: svn://192.168.202.10@3533 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2021-09-17
|
||||
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2021-10-27
|
||||
|
||||
This document describes the functions of an API(Application Programming
|
||||
Interface) for all functions NOT directly relating to the VICIDIAL Agent screen.
|
||||
@@ -45,6 +45,7 @@ lead_field_info - pulls the value of one field of a lead
|
||||
lead_callback_info - outputs scheduled callback data for a specific lead
|
||||
lead_all_info - outputs all lead data for a lead(optionally including custom fields)
|
||||
lead_status_search - displays all field values of all leads that match the status and call date in request
|
||||
lead_search - searches for leads in the vicidial_list table by phone numbers
|
||||
ccc_lead_info - outputs lead data for cross-cluster-communication call
|
||||
server_refresh - forces a conf file refresh on all telco servers in the cluster
|
||||
check_phone_number - allows you to check if a phone number is valid and dialable
|
||||
@@ -830,6 +831,46 @@ test_custom_field => new value
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
lead_search - searches for leads in the vicidial_list table by phone numbers
|
||||
|
||||
NOTE: api user for this function must have user_level set to 7 or higher and "view reports" enabled and modify_leads set to 1-5
|
||||
|
||||
REQUIRED FIELDS-
|
||||
phone_number - 6-19 digits(multiple separated by a comma ',', for example: 3125551212,9055551212,4075551212)
|
||||
source - description of what originated the API call (maximum 20 characters)
|
||||
|
||||
SETTINGS FIELDS-
|
||||
records - number of records to display in results if more than 1 found (defaults to '1000'[most recently inserted leads displayed first])
|
||||
|
||||
SETTINGS FIELDS-
|
||||
header - include a header(YES) or not(NO). This is optional, default is not to include a header
|
||||
|
||||
NOTES-
|
||||
- If no results are found for any of the searched phone numbers, then an error will be displayed
|
||||
- If there are any matches found, every phone number searched for will have one line in the output, detailed below
|
||||
- If more than 1 matching lead is found for a phone number, then the matching lead_ids will be separated by a dash '-'
|
||||
|
||||
Example URL strings for API calls:
|
||||
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=lead_search&phone_number=9998885112,9998887112,9998886112,4075551212
|
||||
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=lead_search&phone_number=9998885112,9055551212,9998886112,4075551212&header=YES
|
||||
|
||||
Example responses:
|
||||
ERROR: lead_search USER DOES NOT HAVE PERMISSION TO SEARCH FOR LEADS - 6666|0
|
||||
ERROR: lead_search NO VALID SEARCH METHOD - ||||
|
||||
ERROR: lead_search NO MATCHES FOUND IN THE SYSTEM - ||||
|
||||
|
||||
A SUCCESS response will not show "SUCCESS", but instead will just print the results in the following format:
|
||||
search_key|records_found|lead_ids
|
||||
9998885112|4|1949076-1946517-1943958-1941399
|
||||
9998887112|8|1946941-1946940-1946939-1946875-1946805-1946656-1946655-1944382
|
||||
9998886112|1|1946891
|
||||
4075551212|0|
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ccc_lead_info - outputs lead data for cross-cluster-communication call
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ $UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summa
|
||||
|
||||
$Vtables = 'NONE,log_noanswer,did_agent_log,contact_information';
|
||||
|
||||
$APIfunctions = 'ALL_FUNCTIONS add_group_alias add_lead add_list add_phone add_phone_alias add_user agent_ingroup_info agent_stats_export agent_status audio_playback blind_monitor call_agent callid_info change_ingroups check_phone_number copy_user did_log_export external_add_lead external_dial external_hangup external_pause external_status in_group_status logout moh_list park_call pause_code preview_dial_action ra_call_control recording recording_lookup send_dtmf server_refresh set_timer_action sounds_list st_get_agent_active_lead st_login_log transfer_conference update_fields update_lead batch_update_lead update_list list_info list_custom_fields update_log_entry update_phone update_phone_alias update_user user_group_status vm_list webphone_url webserver logged_in_agents update_campaign add_did update_did lead_field_info lead_all_info phone_number_log switch_lead ccc_lead_info lead_status_search call_status_stats calls_in_queue_count force_fronter_leave_3way force_fronter_audio_stop update_cid_group_entry add_dnc_phone add_fpg_phone';
|
||||
$APIfunctions = 'ALL_FUNCTIONS add_group_alias add_lead add_list add_phone add_phone_alias add_user agent_ingroup_info agent_stats_export agent_status audio_playback blind_monitor call_agent callid_info change_ingroups check_phone_number copy_user did_log_export external_add_lead external_dial external_hangup external_pause external_status in_group_status logout moh_list park_call pause_code preview_dial_action ra_call_control recording recording_lookup send_dtmf server_refresh set_timer_action sounds_list st_get_agent_active_lead st_login_log transfer_conference update_fields update_lead batch_update_lead update_list list_info list_custom_fields update_log_entry update_phone update_phone_alias update_user user_group_status vm_list webphone_url webserver logged_in_agents update_campaign add_did update_did lead_field_info lead_all_info phone_number_log switch_lead ccc_lead_info lead_status_search lead_search call_status_stats calls_in_queue_count force_fronter_leave_3way force_fronter_audio_stop update_cid_group_entry add_dnc_phone add_fpg_phone';
|
||||
|
||||
$browser_alert_sounds_list = 'bark_dog,beep_double,beep_five,beep_up,bell_double,bell_school,bird,blaster1,blaster2,buzz1,buzz2,cash_register,chat_alert,click_single,click_double,click_quiet,close_encounter,confirmation,ding,droplet,droplet_double,elephant,email_alert,hold_tone,horn_bike,horn_car,horn_car_triple,horn_clown,horn_double,horn_train,meow_cat,scream_wilhelm,silence_quick,siren,slide_down,slide_up,swish,teleport1,teleport2,ticking_two,ticking_four,ticking_six,whip,whistle_up,whistle_two,whistle_three,whoosh,xylophone1,xylophone2,xylophone3,xylophone4';
|
||||
|
||||
@@ -5719,12 +5719,13 @@ if ($SSscript_remove_js > 0)
|
||||
# 210911-1958 - Added populate_lead_owner in-group option
|
||||
# 210920-2159 - Added batch_update_lead API function
|
||||
# 211012-0934 - Added incall_tally_threshold_seconds campaign feature
|
||||
# 211027-1031 - Added lead_search Non-Agent API function
|
||||
#
|
||||
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time
|
||||
|
||||
$admin_version = '2.14-831a';
|
||||
$build = '211012-0934';
|
||||
$admin_version = '2.14-832a';
|
||||
$build = '211027-1031';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
|
||||
@@ -184,10 +184,11 @@
|
||||
# 210812-2640 - Added update of live agent records for ingroup_rank/ingroup_grade in the update_user function
|
||||
# 210823-0918 - Fix for security issue
|
||||
# 210917-1615 - Added batch_update_lead function
|
||||
# 211027-0845 - Added lead_search function
|
||||
#
|
||||
|
||||
$version = '2.14-161';
|
||||
$build = '210917-1615';
|
||||
$version = '2.14-162';
|
||||
$build = '211027-0845';
|
||||
$php_script='non_agent_api.php';
|
||||
$api_url_log = 0;
|
||||
|
||||
@@ -940,6 +941,9 @@ else
|
||||
$source = preg_replace('/[^-_0-9\p{L}]/u',"",$source);
|
||||
$source_user = preg_replace('/[^-_0-9\p{L}]/u',"",$source_user);
|
||||
$menu_id = preg_replace('/[^-_0-9\p{L}]/u','',$menu_id);
|
||||
$phone_number = preg_replace('/[^\,0-9]/','',$phone_number);
|
||||
$vendor_lead_code = preg_replace('/;|#/','',$vendor_lead_code);
|
||||
$vendor_lead_code = preg_replace('/\+/',' ',$vendor_lead_code);
|
||||
}
|
||||
$list_id = preg_replace('/[^-_0-9a-zA-Z]/','',$list_id);
|
||||
$list_id_field = preg_replace('/[^0-9]/','',$list_id_field);
|
||||
@@ -1126,7 +1130,7 @@ $LOGuser_group = $row[2];
|
||||
$VUselected_language = $row[3];
|
||||
$VUdelete_inbound_dids = $row[4];
|
||||
|
||||
if ( ($api_list_restrict > 0) and ( ($function == 'add_lead') or ($function == 'update_lead') or ($function == 'batch_update_lead') or ($function == 'update_list') or ($function == 'list_info') or ($function == 'list_custom_fields') ) )
|
||||
if ( ($api_list_restrict > 0) and ( ($function == 'add_lead') or ($function == 'update_lead') or ($function == 'batch_update_lead') or ($function == 'update_list') or ($function == 'list_info') or ($function == 'list_custom_fields') or ($function == 'lead_search') ) )
|
||||
{
|
||||
$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$LOGuser_group';";
|
||||
if ($DB>0) {echo "|$stmt|\n";}
|
||||
@@ -11818,17 +11822,6 @@ if ($function == 'lead_all_info')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
### lead_status_search - displays all field values of all leads that match the status and call date in request
|
||||
################################################################################
|
||||
@@ -12220,6 +12213,336 @@ if ($function == 'lead_status_search')
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
### lead_search - searches for a lead in the vicidial_list table
|
||||
################################################################################
|
||||
if ($function == 'lead_search')
|
||||
{
|
||||
$list_id = preg_replace('/[^0-9]/','',$list_id);
|
||||
if(strlen($source)<2)
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "Invalid Source";
|
||||
echo "$result: $result_reason - $source\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
echo "ERROR: Invalid Source: |$source|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (!preg_match("/ $function /",$api_allowed_functions)) and (!preg_match("/ALL_FUNCTIONS/",$api_allowed_functions)) )
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "auth USER DOES NOT HAVE PERMISSION TO USE THIS FUNCTION";
|
||||
echo "$result: $result_reason: |$user|$function|\n";
|
||||
$data = "$allowed_user";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$user' and vdc_agent_api_access='1' and modify_leads IN('1','2','3','4','5') and user_level > 7 and active='Y';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$modify_leads=$row[0];
|
||||
|
||||
if ($modify_leads < 1)
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "lead_search USER DOES NOT HAVE PERMISSION TO SEARCH FOR LEADS";
|
||||
echo "$result: $result_reason: |$user|$modify_leads|\n";
|
||||
$data = "$modify_leads";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$search_SQL='';
|
||||
$lead_id_SQL='';
|
||||
$vendor_lead_code_SQL='';
|
||||
$phone_number_SQL='';
|
||||
$find_lead_id=0;
|
||||
$find_vendor_lead_code=0;
|
||||
$find_phone_number=0;
|
||||
$find_lead_idARY=array();
|
||||
$find_vendor_lead_codeARY=array();
|
||||
$find_phone_numberARY=array();
|
||||
$find_vendor_lead_codeARYx=array();
|
||||
$find_phone_numberARYx=array();
|
||||
if ( (strlen($search_location)<4) or ($list_id < 99) or (strlen($list_id)<3) )
|
||||
{$search_location='SYSTEM';}
|
||||
if (strlen($search_method)<6)
|
||||
{$search_method='PHONE_NUMBER';}
|
||||
if (strlen($records)<1)
|
||||
{$records='1000';}
|
||||
if (strlen($force_entry_list_id) > 1)
|
||||
{$entry_list_id = $force_entry_list_id;}
|
||||
if ( (preg_match("/LEAD_ID/",$search_method)) and (strlen($lead_id)>0) )
|
||||
{
|
||||
$find_lead_id=1;
|
||||
$lead_id_SQL = "lead_id IN($lead_ids)";
|
||||
$find_lead_idARY = explode(',',$lead_ids);
|
||||
}
|
||||
if ( (preg_match("/VENDOR_LEAD_CODE/",$search_method)) and (strlen($vendor_lead_code)>0) )
|
||||
{
|
||||
$find_vendor_lead_code=1;
|
||||
$vendor_lead_code_SQL='';
|
||||
$find_vendor_lead_codeARY = explode(',',$vendor_lead_code);
|
||||
$VLC_count = count($find_vendor_lead_codeARY);
|
||||
if ($VLC_count > 0)
|
||||
{
|
||||
$tc=0;
|
||||
$pc=0;
|
||||
while ($tc < $VLC_count)
|
||||
{
|
||||
if (strlen($find_vendor_lead_codeARY[$tc]) > 0)
|
||||
{
|
||||
if ($pc > 0) {$vendor_lead_code_SQL .= ",";}
|
||||
$vendor_lead_code_SQL .= "'$find_vendor_lead_codeARY[$tc]'";
|
||||
$find_vendor_lead_codeARYx[$pc] = $find_vendor_lead_codeARY[$tc];
|
||||
$pc++;
|
||||
}
|
||||
$tc++;
|
||||
}
|
||||
if (strlen($vendor_lead_code_SQL) > 2)
|
||||
{$vendor_lead_code_SQL = "vendor_lead_code IN($vendor_lead_code_SQL)";}
|
||||
}
|
||||
}
|
||||
if ( (preg_match("/PHONE_NUMBER/",$search_method)) and (strlen($phone_number)>5) )
|
||||
{
|
||||
$find_phone_number=1;
|
||||
$phone_number_SQL='';
|
||||
$find_phone_numberARY = explode(',',$phone_number);
|
||||
$PN_count = count($find_phone_numberARY);
|
||||
if ($PN_count > 0)
|
||||
{
|
||||
$tc=0;
|
||||
$pc=0;
|
||||
while ($tc < $PN_count)
|
||||
{
|
||||
if ( (strlen($find_phone_numberARY[$tc]) > 5) and (strlen($find_phone_numberARY[$tc])<19) )
|
||||
{
|
||||
if ($pc > 0) {$phone_number_SQL .= ",";}
|
||||
$phone_number_SQL .= "'$find_phone_numberARY[$tc]'";
|
||||
$find_phone_numberARYx[$pc] = $find_phone_numberARY[$tc];
|
||||
$pc++;
|
||||
}
|
||||
$tc++;
|
||||
}
|
||||
if (strlen($phone_number_SQL) > 2)
|
||||
{$phone_number_SQL = "phone_number IN($phone_number_SQL)";}
|
||||
}
|
||||
}
|
||||
if ( ($find_lead_id<1) and ($find_vendor_lead_code<1) and ($find_phone_number<1) )
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "lead_search NO VALID SEARCH METHOD";
|
||||
$data = "$search_method|$lead_id($find_lead_id)|$vendor_lead_code($find_vendor_lead_code)|$phone_number($find_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
|
||||
{
|
||||
if ( ($api_list_restrict > 0) and ($list_id >= 99) )
|
||||
{
|
||||
if (!preg_match("/ $list_id /",$allowed_lists))
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "lead_search NOT AN ALLOWED LIST ID";
|
||||
$data = "$phone_number|$list_id";
|
||||
echo "$result: $result_reason - $data\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match("/CAMPAIGN/i",$search_location)) # find lists within campaign
|
||||
{
|
||||
$stmt="SELECT campaign_id from vicidial_lists where list_id='$list_id';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$ci_recs = mysqli_num_rows($rslt);
|
||||
if ($ci_recs > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$search_camp = $row[0];
|
||||
|
||||
$stmt="select list_id from vicidial_lists where campaign_id='$search_camp';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$li_recs = mysqli_num_rows($rslt);
|
||||
if ($li_recs > 0)
|
||||
{
|
||||
$L=0;
|
||||
while ($li_recs > $L)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$search_lists .= "'$row[0]',";
|
||||
$L++;
|
||||
}
|
||||
$search_lists = preg_replace('/,$/i', '',$search_lists);
|
||||
$search_SQL = "and list_id IN($search_lists)";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (preg_match("/LIST/i",$search_location)) # search check within list
|
||||
{
|
||||
$search_SQL = "and list_id='$list_id'";
|
||||
}
|
||||
|
||||
$search_found=0;
|
||||
$search_key=array();
|
||||
$search_lead_id=array();
|
||||
$search_lead_list=array();
|
||||
$search_entry_list=array();
|
||||
$search_phone_number=array();
|
||||
$search_phone_code=array();
|
||||
if ($find_lead_id > 0) # search for the lead_id
|
||||
{
|
||||
$stmt="SELECT lead_id,list_id,entry_list_id,phone_number,phone_code from vicidial_list where $lead_id_SQL $search_SQL order by lead_id desc limit $records;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$pc_recs = mysqli_num_rows($rslt);
|
||||
if ($DB>0) {echo "DEBUG: Checking for lead_id - $lead_id|$pc_recs|$stmt|\n";}
|
||||
$n=0;
|
||||
while ($pc_recs > $n)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$search_key[$search_found] = $row[0];
|
||||
$search_lead_id[$search_found] = $row[0];
|
||||
$search_lead_list[$search_found] = $row[1];
|
||||
$search_entry_list[$search_found] = $row[2];
|
||||
$search_phone_number[$search_found] = $row[3];
|
||||
$search_phone_code[$search_found] = $row[4];
|
||||
if (strlen($force_entry_list_id) > 1)
|
||||
{$search_entry_list[$search_found] = $force_entry_list_id;}
|
||||
$n++;
|
||||
$search_found++;
|
||||
}
|
||||
}
|
||||
if ( ($find_vendor_lead_code > 0) and ($search_found < 1) ) # search for the vendor_lead_code
|
||||
{
|
||||
$stmt="SELECT lead_id,list_id,entry_list_id,phone_number,phone_code,vendor_lead_code from vicidial_list where $vendor_lead_code_SQL $search_SQL order by lead_id desc limit $records;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$pc_recs = mysqli_num_rows($rslt);
|
||||
if ($DB>0) {echo "DEBUG: Checking for vendor_lead_code - $vendor_lead_code|$pc_recs|$stmt|\n";}
|
||||
$n=0;
|
||||
while ($pc_recs > $n)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$search_key[$search_found] = $row[5];
|
||||
$search_lead_id[$search_found] = $row[0];
|
||||
$search_lead_list[$search_found] = $row[1];
|
||||
$search_entry_list[$search_found] = $row[2];
|
||||
$search_phone_number[$search_found] = $row[3];
|
||||
$search_phone_code[$search_found] = $row[4];
|
||||
if (strlen($force_entry_list_id) > 1)
|
||||
{$search_entry_list[$search_found] = $force_entry_list_id;}
|
||||
$n++;
|
||||
$search_found++;
|
||||
}
|
||||
}
|
||||
if ( ($find_phone_number > 0) and ($search_found < 1) ) # search for the phone_number
|
||||
{
|
||||
$stmt="SELECT lead_id,list_id,entry_list_id,phone_number,phone_code from vicidial_list where $phone_number_SQL $search_SQL order by lead_id desc limit $records;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$pc_recs = mysqli_num_rows($rslt);
|
||||
if ($DB>0) {echo "DEBUG: Checking for phone_number - $phone_number|$pc_recs|$stmt|\n";}
|
||||
$n=0;
|
||||
while ($pc_recs > $n)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$search_key[$search_found] = $row[3];
|
||||
$search_lead_id[$search_found] = $row[0];
|
||||
$search_lead_list[$search_found] = $row[1];
|
||||
$search_entry_list[$search_found] = $row[2];
|
||||
$search_phone_number[$search_found] = $row[3];
|
||||
$search_phone_code[$search_found] = $row[4];
|
||||
if (strlen($force_entry_list_id) > 1)
|
||||
{$search_entry_list[$search_found] = $force_entry_list_id;}
|
||||
$n++;
|
||||
$search_found++;
|
||||
}
|
||||
}
|
||||
### END searching ###
|
||||
|
||||
if ($search_found > 0)
|
||||
{
|
||||
$output='';
|
||||
if ($header == 'YES')
|
||||
{
|
||||
$output .= 'search_key' . $DL . 'records_found' . $DL . 'lead_ids' . "\n";
|
||||
}
|
||||
$PH_search = count($find_phone_numberARYx);
|
||||
$SK_count = count($search_key);
|
||||
if ($DB > 0) {echo "Results found, preparing output: |$search_found|$PH_search|$SK_count|\n";}
|
||||
$tc=0;
|
||||
while ($tc < $PH_search)
|
||||
{
|
||||
$rc=0;
|
||||
$temp_match=0;
|
||||
$temp_lead_ids='';
|
||||
while ($rc < $SK_count)
|
||||
{
|
||||
if ($find_phone_numberARYx[$tc] == $search_key[$rc])
|
||||
{
|
||||
$temp_match++;
|
||||
if ($temp_match > 1) {$temp_lead_ids .= "-";}
|
||||
$temp_lead_ids .= "$search_lead_id[$rc]";
|
||||
}
|
||||
$rc++;
|
||||
}
|
||||
$output .= "$find_phone_numberARYx[$tc]|$temp_match|$temp_lead_ids\n";
|
||||
$tc++;
|
||||
}
|
||||
|
||||
$PH_search = count($find_vendor_lead_codeARYx);
|
||||
$SK_count = count($search_key);
|
||||
$tc=0;
|
||||
while ($tc < $PH_search)
|
||||
{
|
||||
$rc=0;
|
||||
$temp_match=0;
|
||||
$temp_lead_ids='';
|
||||
while ($rc < $SK_count)
|
||||
{
|
||||
if ($find_vendor_lead_codeARYx[$tc] == $search_key[$rc])
|
||||
{
|
||||
$temp_match++;
|
||||
if ($temp_match > 1) {$temp_lead_ids .= "-";}
|
||||
$temp_lead_ids .= "$search_lead_id[$rc]";
|
||||
}
|
||||
$rc++;
|
||||
}
|
||||
$output .= "$find_vendor_lead_codeARYx[$tc]|$temp_match|$temp_lead_ids\n";
|
||||
$tc++;
|
||||
}
|
||||
|
||||
$result = 'SUCCESS';
|
||||
$result_reason = "lead_search LEADS FOUND IN THE SYSTEM";
|
||||
$data = "$lead_id|$vendor_lead_code|$phone_number|$search_found";
|
||||
echo "$output";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = 'ERROR';
|
||||
$result_reason = "lead_search 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
################################################################################
|
||||
### END lead_search
|
||||
################################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
### update_log_entry - updates the status of a log entry
|
||||
################################################################################
|
||||
|
||||
Reference in New Issue
Block a user