Created
October 13, 2018 13:45
-
-
Save JonasEriksson/9d56b8613ba2b80f69d0feaf7110b054 to your computer and use it in GitHub Desktop.
Mura CMS - dspCountiesList from external DB (add to contentRenderer.cfc)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- dspCountiesList - JE added 20181013 ---> | |
<cffunction name="dspCountiesList" output="false"> | |
<cfargument name="returnInfo" required="no" default="codes"> | |
<cfquery name="getCounties" datasource="myresourcesimport" cachedwithin="#CreateTimeSpan(1, 0, 0, 0)#"> | |
Select * From temp_data_county | |
Order By Countyname | |
</cfquery> | |
<cfset Counties = ""> | |
<cfoutput> | |
<cfloop query="getCounties"> | |
<cfswitch expression="#arguments.returnInfo#"> | |
<cfcase value="codes"> | |
<cfset Counties = listappend(Counties,getCounties.Countycode,"^")> | |
</cfcase> | |
<cfcase value="names"> | |
<cfset Counties = listappend(Counties,"#getCounties.Countyname# (#getCounties.Countycode#)","^")> | |
</cfcase> | |
</cfswitch> | |
</cfloop> | |
</cfoutput> | |
<cfreturn Counties /> | |
</cffunction> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment