|
|
|
|
File: [Development] / p2rx-programs / include / dsp_searchByProgramType.cfm
(download)
Revision: 1.2, Wed Jun 14 18:47:18 2006 UTC (3 years, 5 months ago) by nbisbee Branch: MAIN CVS Tags: HEAD Changes since 1.1: +6 -0 lines Added code to account for P2Rx server being down |
<!--- Name: dsp_searchByProgramType.cfm
Purpose: This file will get the list of organizations associated with particulare
programtype and display it for the user.
Date created: 05/01/2006
Dependancy: PageAction
URL - for CFHTTP
region - Number of region
ProgramTypeID - Unique identifier for each programtype
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 22-24 in case P2Rx server is down
--->
<CFSETTING enablecfoutputonly="Yes">
<CFTRY>
<cfhttp method="GET" url="http://www.p2rx.org/webservices/p2rx/searchByProgramType.cfm?format=#format#&ProgramTypeID=#ProgramTypeID#®ion=#region#" resolveurl="no">
<!---<cfoutput>#cfhttp.statuscode#</cfoutput>--->
<cfif #cfhttp.statuscode# EQ "404 Not Found">
<cfoutput>
<cfhttp method="GET" url= "http://wrrc.p2pays.org/webservices/p2rx/searchByProgramType.cfm?format=#format#&ProgramTypeID=#ProgramTypeID#®ion=#region#" resolveurl="no"></cfoutput>
</cfif>
<cfwddx action="WDDX2CFML" input="#cfhttp.fileContent#" output="strOutput">
<CFSET intNumberOfTerms = ArrayLen(strOutput.List)>
<cfset title= "Pollution Prevention Agencies and Programs in " & #strOutput.List[1].PROGRAMTYPE#>
<cfoutput>
<p><b>#intNumberOfTerms# records are returned for #strOutput.List[1].PROGRAMTYPE#.</b>
</cfoutput>
<p>
<CFLOOP from="1" to="#intNumberOfTerms#" index="intCounter">
<cfoutput>
<p> <a href="index.cfm?pageAction=showDetail®ion=#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 program type 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 |