<?
if(!$_SESSION['template']['company']['hash']) {  // improves speed
	### DO THIS FIRST:
	require_once("/BANGK!/master_config.php");
	require_once($master_config_root_path . "shared/functions.shared");
	$active_user_session_timeout = "OFF"; // no session timeout on this page
	require_once($master_config_root_path . "shared/session.shared");
	
	
	### START SESSION VERIFICATION (ALWAYS LAST B4 REST OF PAGES):
	$verified_member = "no";
	$verified_business = "no";
	$verified_transaction = "no";
	$verified_banned = "no";
	$verified_acccess = "no";
	$secured_server = "no"; //force https
	include($_SESSION['template']['company']['file_path'] . "shared/start_verified_session.shared");
	#
	#
	#
	log_traffic_stats();
	
	$_XXXXX_display_session_footer = "TRUE";
} else {
	$_XXXXX_display_session_footer = "FALSE";
}

$incoming_vars = "";
$incoming_vars = array();
if($_POST) $incoming_vars = $_POST;
if(empty($incoming_vars)) $incoming_vars = $_GET;

logger3("

########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
########################################################################################
### NEW SESSION:  [" . $_SERVER['SCRIPT_NAME'] . "]
########################################################################################
########################################################################################

",$incoming_vars);



if(stristr($incoming_vars['action'],"singlepage_form")) {	
	
	$_XXXXX_whitelabel_business_account_hash = $incoming_vars['whitelabel_business_account_hash'];
	$_XXXXX_member_hash = $member_details->hash;
	$_XXXXX_business_url = $business_account_details->tsys_us_direct_business_website;
	
	$tmp_first_name = trim($member_details->firstname);
	$tmp_last_name = trim($member_details->lastname);
	
	if($tmp_first_name) $tmp_full_name = $tmp_first_name;
	if($tmp_last_name) $tmp_full_name = $tmp_last_name;
	if($tmp_first_name && $tmp_last_name) $tmp_full_name = $tmp_first_name . " " . $tmp_last_name;
	
	$_XXXXX_search_term_full_name = addslashes($tmp_full_name);
	$_XXXXX_business_type = trim($business_account_details->business_type);
	$_XXXXX_accountname = trim($business_account_details->accountname);
	
	$_XXXXX_datetime_created = datetime_v2();
	
	
	
} else if(!stristr($_XXXXX_action,"API")) { // multi_form
	
	/// if API then these are already set 
	
	$_XXXXX_whitelabel_business_account_hash = $_SESSION['member']['whitelabel_business_account_hash'];
	$_XXXXX_member_hash = $tmp_member_details['hash'];
	$_XXXXX_search_term_full_name = addslashes($tmp_member_details['firstname'] . " " . $tmp_member_details['lastname']);
	$_XXXXX_accountname = $tmp_account_details['accountname'];
	$_XXXXX_business_type = $tmp_account_details['business_type'];
	$_XXXXX_business_url = $incoming_vars['tsys_us_direct_business_website'];
	$_XXXXX_datetime_created = datetime_v2();


}





/// add an associate from a phone number

if(stristr($_XXXXX_action == "ADD_ASSOCIATE")) {
	
	/*
	
		$_XXXXX_whitelabel_business_account_hash
		$_XXXXX_member_hash
		$_XXXXX_associate_person_full_name
		$_XXXXX_associate_business_name
		$_XXXXX_associate_business_type
			
		
	*/

	$_XXXXX_whitelabel_business_account_hash = $_XXXXX_whitelabel_business_account_hash;
	$_XXXXX_member_hash = $_XXXXX_member_hash;
	$_XXXXX_search_term_full_name = $_XXXXX_associate_person_full_name;
	$_XXXXX_accountname = $_XXXXX_associate_business_name;
	$_XXXXX_business_type = $_XXXXX_associate_business_type;
	$_XXXXX_business_url = "";
	$_XXXXX_datetime_created = datetime_v2();
	
}












############################################################################
############################################################################
############################################################################
## DUE DILIGENCE:

### SET SPIDER; STATUS = "":
if(
	($_XXXXX_member_hash) 
	&& ($_XXXXX_whitelabel_business_account_hash)
	&& ($_XXXXX_business_url)
) {
	
	//logger3("tmp_account_details",$tmp_account_details);
	logger3("incoming_vars",$incoming_vars);
	
	$_XXXXX_search_results_id = "";
	$_XXXXX_hash = hash_me();
	$_XXXXX_whitelabel_business_account_hash = $_XXXXX_whitelabel_business_account_hash;
	$_XXXXX_member_hash = $_XXXXX_member_hash;
	$_XXXXX_api_service_name = "SPIDER";
	$_XXXXX_business_url = $_XXXXX_business_url;
	$_XXXXX_search_term = "";
	$_XXXXX_serialized_search_results = "";
	$_XXXXX_risk_score = NULL;
	$_XXXXX_status = "";
	$_XXXXX_datetime_created = $_XXXXX_datetime_created;
	$tmp_sql = "INSERT INTO `api_search_engine_results`
				(
					`search_results_id`
					, `hash`
					, `whitelabel_business_account_hash`
					, `member_hash`
					, `api_service_name`
					, `business_url`
					, `search_term`
					, `serialized_search_results`
					, `risk_score`
					, `status`
					, `datetime_created`
				) VALUES (
					'". $_XXXXX_search_results_id ."'
					,'". $_XXXXX_hash ."'
					,'". $_XXXXX_whitelabel_business_account_hash ."'
					,'". $_XXXXX_member_hash ."'
					,'". $_XXXXX_api_service_name ."'
					,'". $_XXXXX_business_url ."'
					,'". $_XXXXX_search_term ."'
					,'". $_XXXXX_serialized_search_results ."'
					,'". $_XXXXX_risk_score ."'
					,'". $_XXXXX_status ."'
					,'". $_XXXXX_datetime_created ."'
				)
				;";
	logger3("tmp_sql",$tmp_sql);
	//exit;
	
	$insert_results = insertTHECASHIER($tmp_sql,"intelitruth");
	logger3("insert_results",$insert_results);
}


	

### SET OFAC_CONSOLIDATED; STATUS = "":

if(
	($_XXXXX_member_hash) 
	&& ($_XXXXX_whitelabel_business_account_hash)
	&& (
		($_XXXXX_search_term_full_name)
		|| ($_XXXXX_accountname)
	)
) {
	

	$_XXXXX_search_results_id = "";
	$_XXXXX_hash = hash_me();
	$_XXXXX_whitelabel_business_account_hash = $_XXXXX_whitelabel_business_account_hash;
	$_XXXXX_member_hash = $_XXXXX_member_hash;
	$_XXXXX_api_service_name = "OFAC_CONSOLIDATED";
	$_XXXXX_business_url = "";
	$_XXXXX_search_term = ""; //addslashes($tmp_member_details['firstname'] . " " . $tmp_member_details['lastname']);
	$_XXXXX_serialized_search_results = "";
	$_XXXXX_risk_score = NULL;
	$_XXXXX_status = "";
	$_XXXXX_datetime_created = $_XXXXX_datetime_created;
	$tmp_sql = "INSERT INTO `api_search_engine_results`
				(
					`search_results_id`
					, `hash`
					, `whitelabel_business_account_hash`
					, `member_hash`
					, `api_service_name`
					, `business_url`
					, `search_term`
					, `serialized_search_results`
					, `risk_score`
					, `status`
					, `datetime_created`
				) VALUES (
					'". $_XXXXX_search_results_id ."'
					,'". $_XXXXX_hash ."'
					,'". $_XXXXX_whitelabel_business_account_hash ."'
					,'". $_XXXXX_member_hash ."'
					,'". $_XXXXX_api_service_name ."'
					,'". $_XXXXX_business_url ."'
					,'". $_XXXXX_search_term ."'
					,'". $_XXXXX_serialized_search_results ."'
					,'". $_XXXXX_risk_score ."'
					,'". $_XXXXX_status ."'
					,'". $_XXXXX_datetime_created ."'
				)
				;";
	logger3("tmp_sql",$tmp_sql);
	//exit;
	
	$insert_results = insertTHECASHIER($tmp_sql,"intelitruth");
	logger3("insert_results",$insert_results);
}	


### SET OFAC_SDN; STATUS = "":
if(
	($_XXXXX_member_hash) 
	&& ($_XXXXX_whitelabel_business_account_hash)
	&& (
		($_XXXXX_search_term_full_name)
		|| ($_XXXXX_accountname)
	)
) {
	
	$_XXXXX_search_results_id = "";
	$_XXXXX_hash = hash_me();
	$_XXXXX_whitelabel_business_account_hash = $_XXXXX_whitelabel_business_account_hash;
	$_XXXXX_member_hash = $_XXXXX_member_hash;
	$_XXXXX_api_service_name = "OFAC_SDN";
	$_XXXXX_business_url = "";
	$_XXXXX_search_term = ""; //addslashes($tmp_member_details['firstname'] . " " . $tmp_member_details['lastname']);
	$_XXXXX_serialized_search_results = "";
	$_XXXXX_risk_score = NULL;
	$_XXXXX_status = "";
	$_XXXXX_datetime_created = $_XXXXX_datetime_created;
	$tmp_sql = "INSERT INTO `api_search_engine_results`
				(
					`search_results_id`
					, `hash`
					, `whitelabel_business_account_hash`
					, `member_hash`
					, `api_service_name`
					, `business_url`
					, `search_term`
					, `serialized_search_results`
					, `risk_score`
					, `status`
					, `datetime_created`
				) VALUES (
					'". $_XXXXX_search_results_id ."'
					,'". $_XXXXX_hash ."'
					,'". $_XXXXX_whitelabel_business_account_hash ."'
					,'". $_XXXXX_member_hash ."'
					,'". $_XXXXX_api_service_name ."'
					,'". $_XXXXX_business_url ."'
					,'". $_XXXXX_search_term ."'
					,'". $_XXXXX_serialized_search_results ."'
					,'". $_XXXXX_risk_score ."'
					,'". $_XXXXX_status ."'
					,'". $_XXXXX_datetime_created ."'
				)
				;";
	logger3("tmp_sql",$tmp_sql);
	//exit;
	
	$insert_results = insertTHECASHIER($tmp_sql,"intelitruth");
	logger3("insert_results",$insert_results);
}	


### SET BING:MEMBER:NAME; STATUS = "":
if(
	($_XXXXX_member_hash) 
	&& ($_XXXXX_whitelabel_business_account_hash)
	&& ($_XXXXX_search_term_full_name)
) {
	
	$_XXXXX_search_results_id = "";
	$_XXXXX_hash = hash_me();
	$_XXXXX_whitelabel_business_account_hash = $_XXXXX_whitelabel_business_account_hash;
	$_XXXXX_member_hash = $_XXXXX_member_hash;
	$_XXXXX_api_service_name = "BING Search Engine API";
	$_XXXXX_business_url = "";
	$_XXXXX_search_term = $_XXXXX_search_term_full_name;
	$_XXXXX_serialized_search_results = "";
	$_XXXXX_risk_score = NULL;
	$_XXXXX_status = "";
	$_XXXXX_datetime_created = $_XXXXX_datetime_created;
	$tmp_sql = "INSERT INTO `api_search_engine_results`
				(
					`search_results_id`
					, `hash`
					, `whitelabel_business_account_hash`
					, `member_hash`
					, `api_service_name`
					, `business_url`
					, `search_term`
					, `serialized_search_results`
					, `risk_score`
					, `status`
					, `datetime_created`
				) VALUES (
					'". $_XXXXX_search_results_id ."'
					,'". $_XXXXX_hash ."'
					,'". $_XXXXX_whitelabel_business_account_hash ."'
					,'". $_XXXXX_member_hash ."'
					,'". $_XXXXX_api_service_name ."'
					,'". $_XXXXX_business_url ."'
					,'". $_XXXXX_search_term ."'
					,'". $_XXXXX_serialized_search_results ."'
					,'". $_XXXXX_risk_score ."'
					,'". $_XXXXX_status ."'
					,'". $_XXXXX_datetime_created ."'
				)
				;";
	logger3("tmp_sql",$tmp_sql);
	//exit;
	
	$insert_results = insertTHECASHIER($tmp_sql,"intelitruth");
	logger3("insert_results",$insert_results);
}



### SET BING:BUSINESS:NAME; STATUS = "":
if(
	($_XXXXX_member_hash) 
	&& ($_XXXXX_whitelabel_business_account_hash)
	&& ($_XXXXX_accountname)
) {
	
	$_XXXXX_search_results_id = "";
	$_XXXXX_hash = hash_me();
	$_XXXXX_whitelabel_business_account_hash = $_XXXXX_whitelabel_business_account_hash;
	$_XXXXX_member_hash = $_XXXXX_member_hash;
	$_XXXXX_api_service_name = "BING Search Engine API";
	$_XXXXX_business_url = "";
	
	$business_type = "";
	
	if(!stristr($_XXXXX_business_type,"SOLE")) {
		$business_type = " " . $_XXXXX_business_type;
	}
	
	$_XXXXX_search_term = addslashes($_XXXXX_accountname) . addslashes($business_type);
	$_XXXXX_serialized_search_results = "";
	$_XXXXX_risk_score = NULL;
	$_XXXXX_status = "";
	$_XXXXX_datetime_created = $_XXXXX_datetime_created;
	$tmp_sql = "INSERT INTO `api_search_engine_results`
				(
					`search_results_id`
					, `hash`
					, `whitelabel_business_account_hash`
					, `member_hash`
					, `api_service_name`
					, `business_url`
					, `search_term`
					, `serialized_search_results`
					, `risk_score`
					, `status`
					, `datetime_created`
				) VALUES (
					'". $_XXXXX_search_results_id ."'
					,'". $_XXXXX_hash ."'
					,'". $_XXXXX_whitelabel_business_account_hash ."'
					,'". $_XXXXX_member_hash ."'
					,'". $_XXXXX_api_service_name ."'
					,'". $_XXXXX_business_url ."'
					,'". $_XXXXX_search_term ."'
					,'". $_XXXXX_serialized_search_results ."'
					,'". $_XXXXX_risk_score ."'
					,'". $_XXXXX_status ."'
					,'". $_XXXXX_datetime_created ."'
				)
				;";
	logger3("tmp_sql",$tmp_sql);
	//exit;
	
	$insert_results = insertTHECASHIER($tmp_sql,"intelitruth");
	logger3("insert_results",$insert_results);
}








### SET SET IBM WATSON NEWS:MEMBER:NAME; STATUS = "":
if(
	($_XXXXX_member_hash) 
	&& ($_XXXXX_whitelabel_business_account_hash)
	&& ($_XXXXX_search_term_full_name)
) {
	
	$_XXXXX_search_results_id = "";
	$_XXXXX_hash = hash_me();
	$_XXXXX_whitelabel_business_account_hash = $_XXXXX_whitelabel_business_account_hash;
	$_XXXXX_member_hash = $_XXXXX_member_hash;
	$_XXXXX_api_service_name = "ibm_watson_news";
	$_XXXXX_business_url = "";
	$_XXXXX_search_term = $_XXXXX_search_term_full_name;
	$_XXXXX_serialized_search_results = "";
	$_XXXXX_risk_score = NULL;
	$_XXXXX_status = "";
	$_XXXXX_datetime_created = $_XXXXX_datetime_created;
	$tmp_sql = "INSERT INTO `api_search_engine_results`
				(
					`search_results_id`
					, `hash`
					, `whitelabel_business_account_hash`
					, `member_hash`
					, `api_service_name`
					, `business_url`
					, `search_term`
					, `serialized_search_results`
					, `risk_score`
					, `status`
					, `datetime_created`
				) VALUES (
					'". $_XXXXX_search_results_id ."'
					,'". $_XXXXX_hash ."'
					,'". $_XXXXX_whitelabel_business_account_hash ."'
					,'". $_XXXXX_member_hash ."'
					,'". $_XXXXX_api_service_name ."'
					,'". $_XXXXX_business_url ."'
					,'". $_XXXXX_search_term ."'
					,'". $_XXXXX_serialized_search_results ."'
					,'". $_XXXXX_risk_score ."'
					,'". $_XXXXX_status ."'
					,'". $_XXXXX_datetime_created ."'
				)
				;";
	logger3("tmp_sql",$tmp_sql);
	//exit;
	
	$insert_results = insertTHECASHIER($tmp_sql,"intelitruth");
	logger3("insert_results",$insert_results);
}





# ### SET IBM WATSON NEWS:BUSINESS:NAME; STATUS = "":
# if(
# 	($_XXXXX_member_hash) 
# 	&& ($_XXXXX_whitelabel_business_account_hash)
# 	&& ($_XXXXX_accountname)
# ) {
# 
# 	
# 	$_XXXXX_search_results_id = "";
# 	$_XXXXX_hash = hash_me();
# 	$_XXXXX_whitelabel_business_account_hash = $_XXXXX_whitelabel_business_account_hash;
# 	$_XXXXX_member_hash = $_XXXXX_member_hash;
# 	$_XXXXX_api_service_name = "ibm_watson_news";
# 	$_XXXXX_business_url = "";
# 	
# 	$business_type = "";
# 	
# 	if(!stristr($_XXXXX_business_type,"SOLE")) {
# 		$business_type = " " . $_XXXXX_business_type;
# 	}
# 	
# 	$_XXXXX_search_term = addslashes($_XXXXX_accountname) . addslashes($business_type);
# 	$_XXXXX_serialized_search_results = "";
# 	$_XXXXX_risk_score = NULL;
# 	$_XXXXX_status = "";
# 	$_XXXXX_datetime_created = $_XXXXX_datetime_created;
# 	$tmp_sql = "INSERT INTO `api_search_engine_results`
# 				(
# 					`search_results_id`
# 					, `hash`
# 					, `whitelabel_business_account_hash`
# 					, `member_hash`
# 					, `api_service_name`
# 					, `business_url`
# 					, `search_term`
# 					, `serialized_search_results`
# 					, `risk_score`
# 					, `status`
# 					, `datetime_created`
# 				) VALUES (
# 					'". $_XXXXX_search_results_id ."'
# 					,'". $_XXXXX_hash ."'
# 					,'". $_XXXXX_whitelabel_business_account_hash ."'
# 					,'". $_XXXXX_member_hash ."'
# 					,'". $_XXXXX_api_service_name ."'
# 					,'". $_XXXXX_business_url ."'
# 					,'". $_XXXXX_search_term ."'
# 					,'". $_XXXXX_serialized_search_results ."'
# 					,'". $_XXXXX_risk_score ."'
# 					,'". $_XXXXX_status ."'
# 					,'". $_XXXXX_datetime_created ."'
# 				)
# 				;";
# 	logger3("tmp_sql",$tmp_sql);
# 	//exit;
# 	
# 	$insert_results = insertTHECASHIER($tmp_sql,"intelitruth");
# 	logger3("insert_results",$insert_results);
# }













########################################################################################
########################################################################################
########################################################################################
### SET AML BASKET
########################################################################################
########################################################################################
########################################################################################

$_XXXXX_AML_scan_results_id = "";
$_XXXXX_hash = hash_me();
$_XXXXX_whitelabel_business_account_hash = $whitelabel_business_account_details['hash'];
$_XXXXX_member_hash = $member_hash;
$_XXXXX_business_account_hash = "";


$_XXXXX_search_term = $_XXXXX_firstname;
if($_XXXXX_middlename) $_XXXXX_search_term = $_XXXXX_search_term . " " . $_XXXXX_middlename;
if($_XXXXX_lastname) $_XXXXX_search_term = $_XXXXX_search_term . " " . $_XXXXX_lastname;


$_XXXXX_results_list_name = "";
$_XXXXX_results_list_text = "";
$_XXXXX_status = "";
$_XXXXX_process_stage = "";
$_XXXXX_risk_score = "0";
$_XXXXX_datetime_created = $master_datetime;

$tmp_sql = "INSERT INTO `AML_scan_results`
			(
				`AML_scan_results_id`
				, `hash`
				, `whitelabel_business_account_hash`
				, `member_hash`
				, `business_account_hash`
				, `search_term`
				, `results_list_name`
				, `results_list_text`
				, `status`
				, `process_stage`
				, `risk_score`
				, `datetime_created`
			) VALUES (
				'". $_XXXXX_AML_scan_results_id ."'
				, '". $_XXXXX_hash ."'
				, '". $_XXXXX_whitelabel_business_account_hash ."'
				, '". $_XXXXX_member_hash ."'
				, '". $_XXXXX_business_account_hash ."'
				, '". $_XXXXX_search_term ."'
				, '". $_XXXXX_results_list_name ."'
				, '". $_XXXXX_results_list_text ."'
				, '". $_XXXXX_status ."'
				, '". $_XXXXX_process_stage ."'
				, '". $_XXXXX_risk_score ."'
				, '". $_XXXXX_datetime_created . "'
			);
";
logger3("tmp_sql",$tmp_sql);
$insert_AML_scan_results = insertTHECASHIER($tmp_sql,"intelitruth");
logger3("insert_AML_scan_results",$insert_AML_scan_results);








########################################################################################
########################################################################################
########################################################################################
### SET GLOBAL KYC
########################################################################################
########################################################################################
########################################################################################


/*
### PERSONAL : NAME: AML

$_XXXXX_AML_scan_results_id = "";
$_XXXXX_hash = hash_me();
$_XXXXX_whitelabel_business_account_hash = $whitelabel_business_account_details['hash'];
$_XXXXX_member_hash = $member_hash;
$_XXXXX_business_account_hash = "";


$_XXXXX_search_term = $_XXXXX_firstname;
if($_XXXXX_middlename) $_XXXXX_search_term = $_XXXXX_search_term . " " . $_XXXXX_middlename;
if($_XXXXX_lastname) $_XXXXX_search_term = $_XXXXX_search_term . " " . $_XXXXX_lastname;


$_XXXXX_results_list_name = "";
$_XXXXX_results_list_text = "";
$_XXXXX_status = "";
$_XXXXX_process_stage = "";
$_XXXXX_risk_score = "0";
$_XXXXX_datetime_created = $master_datetime;

$tmp_sql = "INSERT INTO `AML_scan_results`
			(
				`AML_scan_results_id`
				, `hash`
				, `whitelabel_business_account_hash`
				, `member_hash`
				, `business_account_hash`
				, `search_term`
				, `results_list_name`
				, `results_list_text`
				, `status`
				, `process_stage`
				, `risk_score`
				, `datetime_created`
			) VALUES (
				'". $_XXXXX_AML_scan_results_id ."'
				, '". $_XXXXX_hash ."'
				, '". $_XXXXX_whitelabel_business_account_hash ."'
				, '". $_XXXXX_member_hash ."'
				, '". $_XXXXX_business_account_hash ."'
				, '". $_XXXXX_search_term ."'
				, '". $_XXXXX_results_list_name ."'
				, '". $_XXXXX_results_list_text ."'
				, '". $_XXXXX_status ."'
				, '". $_XXXXX_process_stage ."'
				, '". $_XXXXX_risk_score ."'
				, '". $_XXXXX_datetime_created . "'
			);
";
logger3("tmp_sql",$tmp_sql);
$insert_AML_scan_results = insertTHECASHIER($tmp_sql,"intelitruth");
logger3("insert_AML_scan_results",$insert_AML_scan_results);




### BUSINESS : NAME:

$_XXXXX_AML_scan_results_id = "";
$_XXXXX_hash = hash_me();
$_XXXXX_whitelabel_business_account_hash = $whitelabel_business_account_details['hash'];
$_XXXXX_member_hash = $member_hash;
$_XXXXX_business_account_hash = $business_account_hash;
$_XXXXX_search_term = $_XXXXX_accountname; // business account name
$_XXXXX_results_list_name = "";
$_XXXXX_results_list_text = "";
$_XXXXX_status = "";
$_XXXXX_process_stage = "";
$_XXXXX_risk_score = "0";
$_XXXXX_datetime_created = $master_datetime;

$tmp_sql = "INSERT INTO `AML_scan_results`
			(
				`AML_scan_results_id`
				, `hash`
				, `whitelabel_business_account_hash`
				, `member_hash`
				, `business_account_hash`
				, `search_term`
				, `results_list_name`
				, `results_list_text`
				, `status`
				, `process_stage`
				, `risk_score`
				, `datetime_created`
			) VALUES (
				'". $_XXXXX_AML_scan_results_id ."'
				, '". $_XXXXX_hash ."'
				, '". $_XXXXX_whitelabel_business_account_hash ."'
				, '". $_XXXXX_member_hash ."'
				, '". $_XXXXX_business_account_hash ."'
				, '". $_XXXXX_search_term ."'
				, '". $_XXXXX_results_list_name ."'
				, '". $_XXXXX_results_list_text ."'
				, '". $_XXXXX_status ."'
				, '". $_XXXXX_process_stage ."'
				, '". $_XXXXX_risk_score ."'
				, '". $_XXXXX_datetime_created . "'
			);
";
logger3("tmp_sql",$tmp_sql);
$insert_AML_scan_results = insertTHECASHIER($tmp_sql,"intelitruth");
logger3("insert_AML_scan_results",$insert_AML_scan_results);






*/





### PERSONAL : NAME:

$_XXXXX_search_results_id = "";
$_XXXXX_hash = hash_me();
$_XXXXX_whitelabel_business_account_hash = $whitelabel_business_account_details['hash'];
$_XXXXX_member_hash = $member_hash;
$_XXXXX_api_service_name = "BING Search Engine API";
$_XXXXX_business_url = "";


$_XXXXX_search_term = "";
$_XXXXX_search_term = $_XXXXX_firstname;
if($_XXXXX_middlename) $_XXXXX_search_term = $_XXXXX_search_term . " " . $_XXXXX_middlename;
if($_XXXXX_lastname) $_XXXXX_search_term = $_XXXXX_search_term . " " . $_XXXXX_lastname;


$_XXXXX_serialized_search_results = "";
$_XXXXX_search_results_text = "";
$_XXXXX_risk_score = "";
$_XXXXX_status = "";
$_XXXXX_datetime_created = $master_common_datetime;
				
				
$tmp_sql = "INSERT INTO `api_search_engine_results`
			(
				`search_results_id`
				, `hash`
				, `whitelabel_business_account_hash`
				, `member_hash`
				, `api_service_name`
				, `business_url`
				, `search_term`
				, `serialized_search_results`
				, `search_results_text`
				, `risk_score`
				, `status`
				, `datetime_created`
			) VALUES (
				
				'". $_XXXXX_search_results_id . "'
				, '". $_XXXXX_hash . "'
				, '". $_XXXXX_whitelabel_business_account_hash . "'
				, '". $_XXXXX_member_hash . "'
				, '". $_XXXXX_api_service_name . "'
				, '". $_XXXXX_business_url . "'
				, '". $_XXXXX_search_term . "'
				, '". $_XXXXX_serialized_search_results . "'
				, '". $_XXXXX_search_results_text . "'
				, '". $_XXXXX_risk_score . "'
				, '". $_XXXXX_status . "'
				, '". $_XXXXX_datetime_created . "'

			);";

$_XXXXX_search_term = trim($_XXXXX_search_term);
if($_XXXXX_search_term) {
	$insert_api_search_engine_results = insertTHECASHIER($tmp_sql,"intelitruth");
}





### BUSINESS : NAME:

$_XXXXX_search_results_id = "";
$_XXXXX_hash = hash_me();
$_XXXXX_whitelabel_business_account_hash = $whitelabel_business_account_details['hash'];
$_XXXXX_member_hash = $member_hash;
$_XXXXX_api_service_name = "BING Search Engine API";
$_XXXXX_business_url = "";


$_XXXXX_search_term = "";

if(!stristr($_XXXXX_accountname,"\\")) {
	$_XXXXX_accountname = addslashes($_XXXXX_accountname);
}
$_XXXXX_search_term = $_XXXXX_accountname; // business account name



$_XXXXX_serialized_search_results = "";
$_XXXXX_search_results_text = "";
$_XXXXX_risk_score = "";
$_XXXXX_status = "";
$_XXXXX_datetime_created = $master_common_datetime;
				
				
$tmp_sql = "INSERT INTO `api_search_engine_results`
			(
				`search_results_id`
				, `hash`
				, `whitelabel_business_account_hash`
				, `member_hash`
				, `api_service_name`
				, `business_url`
				, `search_term`
				, `serialized_search_results`
				, `search_results_text`
				, `risk_score`
				, `status`
				, `datetime_created`
			) VALUES (
				
				'". $_XXXXX_search_results_id . "'
				, '". $_XXXXX_hash . "'
				, '". $_XXXXX_whitelabel_business_account_hash . "'
				, '". $_XXXXX_member_hash . "'
				, '". $_XXXXX_api_service_name . "'
				, '". $_XXXXX_business_url . "'
				, '". $_XXXXX_search_term . "'
				, '". $_XXXXX_serialized_search_results . "'
				, '". $_XXXXX_search_results_text . "'
				, '". $_XXXXX_risk_score . "'
				, '". $_XXXXX_status . "'
				, '". $_XXXXX_datetime_created . "'

			);";

$_XXXXX_search_term = trim($_XXXXX_search_term);
if($_XXXXX_search_term) {
	$insert_api_search_engine_results = insertTHECASHIER($tmp_sql,"intelitruth");
}







########################################################################################
########################################################################################
########################################################################################
### SET NEGATIVE•NEWS
########################################################################################
########################################################################################
########################################################################################





### PERSONAL : NAME:

$_XXXXX_search_results_id = "";
$_XXXXX_hash = hash_me();
$_XXXXX_whitelabel_business_account_hash = $whitelabel_business_account_details['hash'];
$_XXXXX_member_hash = $member_hash;
$_XXXXX_api_service_name = "ibm_watson_news";
$_XXXXX_business_url = "";

$_XXXXX_search_term = "";
$_XXXXX_search_term = $_XXXXX_firstname;
if($_XXXXX_middlename) $_XXXXX_search_term = $_XXXXX_search_term . " " . $_XXXXX_middlename;
if($_XXXXX_lastname) $_XXXXX_search_term = $_XXXXX_search_term . " " . $_XXXXX_lastname;
if(!stristr($_XXXXX_search_term,"\\")) {
	$_XXXXX_search_term = addslashes($_XXXXX_search_term);
}



$_XXXXX_serialized_search_results = "";
$_XXXXX_search_results_text = "";
$_XXXXX_risk_score = "";
$_XXXXX_status = "";
$_XXXXX_datetime_created = $master_common_datetime;
				
				
$tmp_sql = "INSERT INTO `api_search_engine_results`
			(
				`search_results_id`
				, `hash`
				, `whitelabel_business_account_hash`
				, `member_hash`
				, `api_service_name`
				, `business_url`
				, `search_term`
				, `serialized_search_results`
				, `search_results_text`
				, `risk_score`
				, `status`
				, `datetime_created`
			) VALUES (
				
				'". $_XXXXX_search_results_id . "'
				, '". $_XXXXX_hash . "'
				, '". $_XXXXX_whitelabel_business_account_hash . "'
				, '". $_XXXXX_member_hash . "'
				, '". $_XXXXX_api_service_name . "'
				, '". $_XXXXX_business_url . "'
				, '". $_XXXXX_search_term . "'
				, '". $_XXXXX_serialized_search_results . "'
				, '". $_XXXXX_search_results_text . "'
				, '". $_XXXXX_risk_score . "'
				, '". $_XXXXX_status . "'
				, '". $_XXXXX_datetime_created . "'

			);";
$_XXXXX_search_term = trim($_XXXXX_search_term);
if($_XXXXX_search_term) {
	$insert_api_search_engine_results = insertTHECASHIER($tmp_sql,"intelitruth");
}






### BUSINESS : NAME:

$_XXXXX_search_results_id = "";
$_XXXXX_hash = hash_me();
$_XXXXX_whitelabel_business_account_hash = $whitelabel_business_account_details['hash'];
$_XXXXX_member_hash = $member_hash;
$_XXXXX_api_service_name = "ibm_watson_news";
$_XXXXX_business_url = "";


$_XXXXX_search_term = "";
$_XXXXX_search_term = $_XXXXX_accountname; // business account name
if(!stristr($_XXXXX_search_term,"\\")) {
	$_XXXXX_search_term = addslashes($_XXXXX_search_term);
}

$_XXXXX_serialized_search_results = "";
$_XXXXX_search_results_text = "";
$_XXXXX_risk_score = "";
$_XXXXX_status = "";
$_XXXXX_datetime_created = $master_common_datetime;
				
				
$tmp_sql = "INSERT INTO `api_search_engine_results`
			(
				`search_results_id`
				, `hash`
				, `whitelabel_business_account_hash`
				, `member_hash`
				, `api_service_name`
				, `business_url`
				, `search_term`
				, `serialized_search_results`
				, `search_results_text`
				, `risk_score`
				, `status`
				, `datetime_created`
			) VALUES (
				
				'". $_XXXXX_search_results_id . "'
				, '". $_XXXXX_hash . "'
				, '". $_XXXXX_whitelabel_business_account_hash . "'
				, '". $_XXXXX_member_hash . "'
				, '". $_XXXXX_api_service_name . "'
				, '". $_XXXXX_business_url . "'
				, '". $_XXXXX_search_term . "'
				, '". $_XXXXX_serialized_search_results . "'
				, '". $_XXXXX_search_results_text . "'
				, '". $_XXXXX_risk_score . "'
				, '". $_XXXXX_status . "'
				, '". $_XXXXX_datetime_created . "'

			);";

$_XXXXX_search_term = trim($_XXXXX_search_term);
if($_XXXXX_search_term) {
	$insert_api_search_engine_results = insertTHECASHIER($tmp_sql,"intelitruth");
}






########################################################################################
########################################################################################
########################################################################################
### SET INTELI•SPIDER
########################################################################################
########################################################################################
########################################################################################




### BUSINESS : NAME:

$_XXXXX_search_results_id = "";
$_XXXXX_hash = hash_me();
$_XXXXX_whitelabel_business_account_hash = $whitelabel_business_account_details['hash'];
$_XXXXX_member_hash = $member_hash;
$_XXXXX_api_service_name = "SPIDER";

$_XXXXX_business_url = $incoming_vars['business_url'];

$_XXXXX_search_term = "";
$_XXXXX_serialized_search_results = "";
$_XXXXX_search_results_text = "";
$_XXXXX_risk_score = "";
$_XXXXX_status = "";
$_XXXXX_datetime_created = $master_common_datetime;
				
				
$tmp_sql = "INSERT INTO `api_search_engine_results`
			(
				`search_results_id`
				, `hash`
				, `whitelabel_business_account_hash`
				, `member_hash`
				, `api_service_name`
				, `business_url`
				, `search_term`
				, `serialized_search_results`
				, `search_results_text`
				, `risk_score`
				, `status`
				, `datetime_created`
			) VALUES (
				
				'". $_XXXXX_search_results_id . "'
				, '". $_XXXXX_hash . "'
				, '". $_XXXXX_whitelabel_business_account_hash . "'
				, '". $_XXXXX_member_hash . "'
				, '". $_XXXXX_api_service_name . "'
				, '". $_XXXXX_business_url . "'
				, '". $_XXXXX_search_term . "'
				, '". $_XXXXX_serialized_search_results . "'
				, '". $_XXXXX_search_results_text . "'
				, '". $_XXXXX_risk_score . "'
				, '". $_XXXXX_status . "'
				, '". $_XXXXX_datetime_created . "'

			);";

$_XXXXX_business_url = trim($_XXXXX_business_url);
if($_XXXXX_business_url) {
	$insert_api_search_engine_results = insertTHECASHIER($tmp_sql,"intelitruth");
}



















### END: SESSIONS & STUFF.
#
#
#
if($_XXXXX_display_session_footer == "TRUE") {
	include($_SESSION['template']['company']['file_path'] . "shared/end_verified_session.shared");
}
?>