Michael Gillespie
11/21/2022, 9:32 PM<cffunction name="hotsearch" access="remote" returntype="array">
<cfargument name="crit" type="string" required="yes">
<cfset var rs=structnew()>
<cfset var ra = arraynew(1)>
<cfset ra[1]="NOT FOUND">
<cfquery name="getinfo" datasource="#variables.dsn#" maxrows="50">
select cust_id,fname,lname,mycompany,company,webmail
from vwSearchCustomer
where
(webmail like <cfqueryparam cfsqltype="cf_sql_varchar" value="%#arguments.crit#%">
or lname like <cfqueryparam cfsqltype="cf_sql_varchar" value="%#arguments.crit#%">
or mycompany like <cfqueryparam cfsqltype="cf_sql_varchar" value="%#arguments.crit#%">
or company like <cfqueryparam cfsqltype="cf_sql_varchar" value="%#arguments.crit#%">
)
group by 1
order by lname,fname,mycompany
</cfquery>
<cfif getinfo.recordcount gt 0><cfset ra[1]="OK"></cfif>
<cfoutput query="getInfo">
<cfset rs=structnew()>
<cfset rs.PERSON=getInfo.cust_id>
<cfset rs.PERSONNAME=getinfo.fname&" "&getinfo.lname>
<cfif len(trim(getinfo.mycompany)) eq 0>
<cfset rs.COMPANY=getinfo.company>
<cfelse>
<cfset rs.COMPANY=getinfo.mycompany>
</cfif>
<cfset rs.E=lcase(getinfo.webmail)>
<cfset arrayappend(ra,rs)>
</cfoutput>
<cfreturn ra>
</cffunction>websolete
11/21/2022, 9:35 PMMichael Gillespie
11/21/2022, 9:36 PMwebsolete
11/21/2022, 9:37 PMMichael Gillespie
11/21/2022, 9:37 PMwebsolete
11/21/2022, 9:38 PMMichael Gillespie
11/21/2022, 9:43 PMwebsolete
11/21/2022, 9:44 PMwebsolete
11/21/2022, 9:44 PMMichael Gillespie
11/21/2022, 9:44 PMMichael Gillespie
11/21/2022, 9:45 PMwebsolete
11/21/2022, 9:45 PMMichael Gillespie
11/21/2022, 9:46 PMMichael Gillespie
11/21/2022, 9:47 PMwebsolete
11/21/2022, 9:48 PM<cfset rs.PERSON = getinfo.cust_id & " ">websolete
11/21/2022, 9:48 PMMichael Gillespie
11/21/2022, 9:49 PMMichael Gillespie
11/21/2022, 9:50 PMMichael Gillespie
11/21/2022, 9:51 PMMichael Gillespie
11/21/2022, 9:52 PMwebsolete
11/21/2022, 9:52 PMwebsolete
11/21/2022, 9:52 PMwebsolete
11/21/2022, 9:53 PMMichael Gillespie
11/21/2022, 9:53 PMwebsolete
11/21/2022, 9:54 PMwebsolete
11/21/2022, 9:54 PMMichael Gillespie
11/21/2022, 9:54 PMwebsolete
11/21/2022, 9:55 PMMichael Gillespie
11/21/2022, 9:57 PMMichael Gillespie
11/21/2022, 9:57 PMMichael Gillespie
11/21/2022, 9:58 PMMichael Gillespie
11/21/2022, 9:59 PMcfvonner
11/21/2022, 10:00 PMwebsolete
11/21/2022, 10:03 PMcfvonner
11/21/2022, 10:03 PMMichael Gillespie
11/21/2022, 10:07 PM