(file) Return to dsp_searchBystate.cfm CVS log (file) (dir) Up to [Development] / p2rx-programs / include

File: [Development] / p2rx-programs / include / dsp_searchBystate.cfm (download)
Revision: 1.3, Thu Jun 15 00:31:48 2006 UTC (3 years, 5 months ago) by nbisbee
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
Added code to account for P2Rx server being down

<!--- 	Name:  dsp_searchByState.cfm
    	Purpose: This file will get the list of organizations associated with particular
				state and display it for the user.
		Date created: 05/01/2006 
       	Dependancy: PageAction
					URL - for CFHTTP
					region - Number of region
					list - Abbr for each state
		Variables: 	OrganizationName - Name of the organization
					OrgID - Unique identifier for each organization
					Division - Division of each organization
		Date changed: 
					05/01/2006     	Prabin Kanel	Created file
					05/12/2006		Prabin Kanel	Documentation
					06/14/2006		Terry Huss		Added lines 24-26 in case P2Rx server is down
--->


<CFSETTING enablecfoutputonly="Yes">

<CFTRY>
	<cfif #URL.list# NEQ "All">
		<cfhttp method="GET" url="http://www.p2rx.org/webservices/p2rx/getStateByAbbr.cfm?list=#list#&format=#format#" resolveurl="no">
		<!---<cfoutput>#cfhttp.statuscode#</cfoutput>--->
			<cfif #cfhttp.statuscode# EQ "404 Not Found">
			<cfoutput>
		<cfhttp method="GET" url="http://wrrc.p2pays.org/webservices/p2rx/getStateByAbbr.cfm?list=#list#&format=#format#" resolveurl="no"></cfoutput></cfif>
		<cfwddx action="WDDX2CFML" input="#cfhttp.fileContent#" output="strOutput">
		<CFSET StateName = #strOutput.State#>
		<cfset title= "Pollution Prevention Agencies and Programs in " & #strOutput.State#>
	<CFELSE>
		<CFSET StateName = " ">
	</CFIF>
	<CFCATCH type="Any">
			<P>
				<strong>There is an error on getting browse by state data. The site administrator has been notified.<BR>
				If it is a connection failure error, please check back in few minutes.
				</strong>
			</P>
	</CFCATCH>	
	</CFTRY>
	
	<CFTRY>
		<cfhttp method="GET" url="http://www.p2rx.org/webservices/p2rx/searchByStateResult.cfm?list=#list#&format=#format#&region=#region#" resolveurl="no">
		<cfwddx action="WDDX2CFML" input="#cfhttp.fileContent#" output="strOutput">
		<CFSET intNumberOfTerms = ArrayLen(strOutput.List)>
			<cfoutput>
				<p><b style="background-color:##E9E9E9">#intNumberOfTerms# records are returned <cfif #URL.list# NEQ "All">for #StateName#</cfif>.</b>
			</cfoutput>
				<p>
				<CFLOOP from="1" to="#intNumberOfTerms#" index="intCounter">
				<cfoutput>
					<p>	<a href="index.cfm?pageAction=showDetail&region=#strOutput.List[intCounter].REGIONNUMBER#&orgid=#strOutput.List[intCounter].ORGID#&format=#format#" class="subheading">#replacelist(strOutput.List[intCounter].ORGANIZATIONNAME, good_chars, bad_chars)# #replacelist(strOutput.List[intCounter].DIVISION, good_chars, bad_chars)# </a></p>
				</cfoutput>
				</cfloop>
		<CFCATCH type="Any">
			<P>
				<strong>There is an error on getting browse by state data. The site administrator has been notified.<BR>
				If it is a connection failure error, please check back in few minutes.
				</strong>
			</P>
		</CFCATCH>
</CFTRY>
<CFSETTING enablecfoutputonly="No">

CVS Admin
Powered by
ViewCVS 1.0-dev