/*-----------------------------------------------------------------------------
	Name: A01_MPD_011_GenPg_Srch_MemNum.c
	Recorded By: Converted via tool
	Date of recording:
	Flow details:
	Build details:
	Modification History:
-----------------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ns_string.h"

void A01_MPD_011_GenPg_Srch_MemNum()
{
	ns_start_transaction("A01_AZ_026_MPD_MemSrch_SearchaddManually");
	
	//addDynaTraceHeader("NA=A01_AZ_026_MPD_MemSrch_SearchaddManually;PC=flow_19");
	ns_web_url("Mem_Search_Manually",
		"URL={P_URL}/aaa-app/flow?_flowId=quote-main-flow&_flowExecutionKey=e4s1&_windowId={C_windowID}", 
		"Method=POST", 
		//"HEADER=Faces-Request:partial/ajax",
		"HEADER=Origin:{P_URL}",
        	"HEADER=Content-Type:application/x-www-form-urlencoded",
		"HEADER=Referer: {P_URL}/aaa-app/flow?_flowId=quote-main-flow&_flowExecutionKey=e4s1&_windowId={C_windowID}", 
		"Snapshot=t23.inf", 
		ITEMDATA, 
		"Name=policyDataGatherForm:j_id__v_2_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_3_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_4_bls-input", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAFirstNamedInsured_fni", "Value={C_AAA1stNmdInsrd_03}",  
		"Name=policyDataGatherForm:j_id__v_5_bls-input", "Value=",  
		"Name=policyDataGatherForm:insuredInformation_titleCd", "Value=",  
		"Name=policyDataGatherForm:insuredInformation_firstName", "Value={P_MemFname}",  
		"Name=policyDataGatherForm:insuredInformation_middleName", "Value=",  
		"Name=policyDataGatherForm:insuredInformation_lastName", "Value={P_MemLname}",  
		"Name=policyDataGatherForm:insuredInformation_suffix", "Value=",  
		"Name=policyDataGatherForm:insuredInformation_legalIdentification", "Value=",  
		"Name=policyDataGatherForm:insuredInformation_dateOfBirthInputDate", "Value={P_MemDOB}",  
		"Name=policyDataGatherForm:insuredInformation_dateOfBirthInputCurrentDate", "Value={C_DOBInpCurrDate_03}",  
		"Name=policyDataGatherForm:insuredInformation_insuredBaseDtInputDate", "Value={C_InsrdBaseDate_03}",  
		"Name=policyDataGatherForm:insuredInformation_insuredBaseDtInputCurrentDate", "Value={C_InsuredInputCurrentDate_03}",  
		"Name=policyDataGatherForm:insuredInformation_primaryAddress_address_postalCode", "Value={P_AddressValidation_Final_03}",  
		"Name=policyDataGatherForm:insuredInformation_primaryAddress_address_addressLine1", "Value={C_AddressLine1_03}",  
		"Name=policyDataGatherForm:insuredInformation_primaryAddress_address_addressLine2", "Value=",  
		"Name=policyDataGatherForm:insuredInformation_primaryAddress_address_city", "Value={C_City_03}",  
		"Name=policyDataGatherForm:insuredInformation_primaryAddress_address_stateProvCd", "Value=AZ",  
		"Name=policyDataGatherForm:insuredInformation_priorAddress_address_stateProvCd", "Value=",  
		"Name=policyDataGatherForm:insuredInformation_differentAddressInd", "Value=false",  
		"Name=policyDataGatherForm:insuredInformation_secondaryAddress_address_stateProvCd", "Value=AZ",  
		"Name=policyDataGatherForm:insuredInformation_residentTypeCd", "Value=",  
		"Name=policyDataGatherForm:primaryAddressStandartized", "Value=true",  
		"Name=policyDataGatherForm:secondaryAddressStandartized", "Value=",  
		"Name=policyDataGatherForm:j_id__v_6_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_7_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_8_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_9_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_10_bls-input", "Value=",  
		"Name=policyDataGatherForm:sedit_ExistingPolicies_existingMembershipCd", "Value=Yes",  
		"Name=policyDataGatherForm:sedit_ExistingPolicies_overrideTypeCd", "Value=Term",  
		"Name=policyDataGatherForm:sedit_ExistingPolicies_membershipNumber", "Value=",  
		"Name=policyDataGatherForm:searchMPD", "Value=Search and Add Manually",  
		"Name=policyDataGatherForm:j_id__v_11_bls-input", "Value=",  
		"Name=policyDataGatherForm:contactInformation_phoneNum1", "Value=",  
		"Name=policyDataGatherForm:contactInformation_phoneNum2", "Value=",  
		"Name=policyDataGatherForm:contactInformation_phoneNum3", "Value=",  
		"Name=policyDataGatherForm:contactInformation_preferredPhone", "Value=",  
		"Name=policyDataGatherForm:contactInformation_email", "Value=",  
		"Name=policyDataGatherForm:j_id__v_12_bls-input", "Value=",  
		"Name=policyDataGatherForm:currentCarrierInformation_overridePrefilledCarrier", "Value=false",  
		"Name=policyDataGatherForm:currentCarrierInformation_continuousMonthsInsured", "Value=false",  
		"Name=policyDataGatherForm:currentCarrierInformation_agentEnteredCarrier", "Value=",  
		"Name=policyDataGatherForm:currentCarrierInformation_enteredPriorBILimits", "Value=",  
		"Name=policyDataGatherForm:j_id__v_13_bls-input", "Value=",  
		"Name=policyDataGatherForm:PolicyComponentIdHolder", "Value=Policy",  
		"Name=policyDataGatherForm:j_id__v_14_bls-input", "Value=",  
		"Name=policyDataGatherForm:sedit_Policy_imported", "Value=NEW",  
		"Name=policyDataGatherForm:sedit_Policy_aaaProgramCode", "Value=NewRenPAS",  
		"Name=policyDataGatherForm:sedit_Policy_policyDetail_typeOfPolicyCd", "Value=STD",  
		"Name=policyDataGatherForm:sedit_Policy_contractTerm_effectiveInputDate", "Value={C_InsrdBaseDate_03}",  
		"Name=policyDataGatherForm:sedit_Policy_contractTerm_effectiveInputCurrentDate", "Value={C_InsuredInputCurrentDate_03}",  
		"Name=policyDataGatherForm:sedit_Policy_contractDisplay", "Value=12",  
		"Name=policyDataGatherForm:sedit_Policy_contractTerm_expirationInputCurrentDate", "Value={C_InsuredExpCurrentDate_03}",  
		"Name=policyDataGatherForm:sedit_Policy_adverselyImpacted", "Value=",  
		"Name=policyDataGatherForm:j_id__v_15_bls-input", "Value=",  
		"Name=policyDataGatherForm:asdOverrideInfo_overrideAsdLevel", "Value=false",  
		"Name=policyDataGatherForm:asdOverrideInfo_asdOverrideLevel", "Value=",  
		"Name=policyDataGatherForm:j_id__v_16_bls-input", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_officeType", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_agencyCd", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_salesChannelType", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_agencyLocation", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_agentType", "Value=AGENT",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_agentCd", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_everEnrolledInEvalue", "Value=false",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_commissionTypeCd", "Value=NB",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_authorizedBy", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_tollNumberCd", "Value=",  
		"Name=policyDataGatherForm:j_id__v_17_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_18_bls-input", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAPolicyInfo_leadSourceCd", "Value=",  
		"Name=policyDataGatherForm:j_id__v_19_bls-input", "Value=",  
		"Name=policyDataGatherForm:printingInfo_suppressPrint", "Value=PD",  
		"Name=policyDataGatherForm:j_id__v_20_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_21_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_22_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_23_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_24_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_25_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_26_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_27_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_28_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_29_bls-input", "Value=",  
		"Name=policyDataGatherForm:currentPFElmentFocus", "Value=",  
		"Name=policyDataGatherForm:rulesValidationSubmit", "Value=true",  
		"Name=policyDataGatherForm:focusFirstInputElement", "Value=",  
		"Name=policyDataGatherForm:focusFirstInputForInstance", "Value=",  
		"Name=policyDataGatherForm:instanceToEliminate", "Value=",  
		"Name=policyDataGatherForm:focusControlAfterPopupClose", "Value=",  
		"Name=policyDataGatherForm_SUBMIT", "Value=1",  
		"Name=javax.faces.ViewState", "Value={C_VSPrefillPage_03}",  
		ITEMDATA_END
		);
	
	ns_end_transaction("A01_AZ_026_MPD_MemSrch_SearchaddManually",NS_AUTO_STATUS);
	
	//ns_page_think_time(think_time);
	//srch by membership number
	//web_reg_save_param("C_SelChkboxID","LB=type=\"checkbox\" name=\"autoOtherPolicySearchForm:elasticSearchResponseTable:","RB=:customerSelected\" value=\"true\"","Ord=1", LAST);
	
	
	
	ns_start_transaction("A01_AZ_027_MPD_MemSrch_SearchwithMemNum");
	

	//addDynaTraceHeader("NA=A01_AZ_027_MPD_MemSrch_SearchwithMemNum;PC=flow_35");
	ns_web_url("Mem_Search",
		"URL={P_URL}/aaa-app/flow?_flowId=quote-main-flow&_flowExecutionKey=e4s1&_windowId={C_windowID}", 
		"Method=POST", 
		//"HEADER=Faces-Request:partial/ajax",
		"HEADER=Origin:{P_URL}",
        	"HEADER=Content-Type:application/x-www-form-urlencoded",
		"HEADER=Referer: {P_URL}/aaa-app/flow?_flowId=quote-main-flow&_flowExecutionKey=e4s1&_windowId={C_windowID}", 
		"Snapshot=t39.inf", 
		ITEMDATA, 
		"Name=autoOtherPolicySearchForm:searchById", "Value=customer",  
		"Name=autoOtherPolicySearchForm:orderFirstName", "Value={P_MemFname}",  
		"Name=autoOtherPolicySearchForm:orderLastName", "Value={P_MemLname}",  
		"Name=autoOtherPolicySearchForm:orderDobInputDate", "Value=",  
		"Name=autoOtherPolicySearchForm:orderDobInputCurrentDate", "Value={C_InsuredInputCurrentDate_03}",  
		"Name=autoOtherPolicySearchForm:orderZipCode", "Value=",  
		"Name=autoOtherPolicySearchForm:orderAddressLine1", "Value=",  
		"Name=autoOtherPolicySearchForm:orderCity", "Value=",  
		"Name=autoOtherPolicySearchForm:riskStateDropdown", "Value=",  
		"Name=autoOtherPolicySearchForm:orderMembershipNumber", "Value={P_MemMemNum}",  
		"Name=autoOtherPolicySearchForm:orderPhoneNumber", "Value=",  
		"Name=autoOtherPolicySearchForm:orderEmailAddress", "Value=",  
		"Name=autoOtherPolicySearchForm:cmdButtonSearch", "Value=Search",  
		"Name=autoOtherPolicySearchForm:hideSearch", "Value=false",  
		"Name=autoOtherPolicySearchForm:enableAddSelected", "Value=false",  
		"Name=autoOtherPolicySearchForm_SUBMIT", "Value=1",  
		"Name=javax.faces.ViewState", "Value={C_VSPrefillPage_03}",  
		ITEMDATA_END
		);

	//lr_end_transaction("A01_AZ_027_MPD_MemSrch_SearchwithMemNum",LR_AUTO);
	
	if(atoi(ns_eval_string("{SearchSucceeded}"))>0){
		
			ns_end_transaction("A01_AZ_027_MPD_MemSrch_SearchwithMemNum", NS_SUCCESS_STATUS);
		
			printf( " User: [%s] has Successfully Searched and retrieved ",ns_eval_string("{P_Username}"));
			printf( " Other AAA OWned Policy: [%s]",ns_eval_string("{P_MemPolNum}"));
			printf( " for Customer with First Name: [%s] & ",ns_eval_string("{P_MemFname}"));
			printf( " Last Name: [%s] on ",ns_eval_string("{P_MemLname}"));
			printf( " URL: [%s] ",ns_eval_string("{P_URL}"));
			printf( " for Search By MembershipNumber: [%s]",ns_eval_string("{P_MemMemNum}"));

							
	}else{
		ns_end_transaction("A01_AZ_027_MPD_MemSrch_SearchwithMemNum", NS_SUCCESS_STATUS);
		
			printf( " User: [%s] has failed to retrieving ",ns_eval_string("{P_Username}"));
			printf( " Other AAA OWned Policy: [%s]",ns_eval_string("{P_MemPolNum}"));
			printf( " for Customer with First Name: [%s] & ",ns_eval_string("{P_MemFname}"));
			printf( " Last Name: [%s] on ",ns_eval_string("{P_MemLname}"));
			printf( " URL: [%s] ",ns_eval_string("{P_URL}"));
			printf( " for Search By MembershipNumber: [%s]",ns_eval_string("{P_MemMemNum}"));

							ns_exit_session();
	}

}
