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

File: [Development] / p2rx-programs / include / dsp_states.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: +7 -3 lines
Added code to account for P2Rx server being down

<!--- 	Name:  dsp_states.cfm
    	Purpose: This file will get the list of states.
		Date created: 05/01/2006 
       	Dependancy: PageAction
					URL - for CFHTTP
					region - Number of region
					list - Abbr for each state
		Variables: 	ABBR - Abbreviation of state
					StateName - Name of the state
		Date changed: 
					05/01/2006     	Prabin Kanel	Created file
					05/12/2006		Prabin Kanel	Documentation
					06/14/2006		Terry Huss		Added lines 20-24 in case P2Rx server is down
--->

 <cfif #PageAction# NEQ "">
 <cftry>
	<cfoutput>
		<cfhttp method="GET" url="http://www.p2rx.org/webservices/p2rx/getStates.cfm?format=WDDX&region=#region#" resolveurl="no"></cfoutput>
		<!---<cfoutput>#cfhttp.statuscode#</cfoutput>--->
		<cfif #cfhttp.statuscode# EQ "404 Not Found">
		<cfoutput>
		<cfhttp method="GET" url="http://wrrc.p2pays.org/webservices/p2rx/getStates.cfm?format=WDDX&region=#region#" resolveurl="no">			</cfoutput></cfif>
						<cfwddx action="WDDX2CFML" input="#cfhttp.fileContent#" output="strOutput">
				<P>
				<CFSET intNumberOfTerms = ArrayLen(strOutput.List)>
				<CFLOOP from="1" to="#intNumberOfTerms#" index="intCounter">
				<cfoutput>
					<cfset meta_keywords = Meta_keywords & "#strOutput.List[intCounter].STATE# , ">
						<a href="index.cfm?pageAction=searchByState&List=#strOutput.List[intCounter].ABBR#&Format=WDDX&region=#region#">#replacelist(strOutput.List[intCounter].STATE,good_chars,Bad_chars)# </a>
				&nbsp;&nbsp;|
				</cfoutput>
				</cfloop>
			<cfoutput>
				<a href="index.cfm?pageAction=searchByState&List=All&Format=WDDX&region=#region#">ALL Programs</a> &nbsp;&nbsp;|
			</cfoutput>
			<cfoutput><a name="Header"><HR></a></cfoutput>
		 <cfcatch type="Any">
			The state data was not provided. The administrator has been notified.
		</cfcatch>
 </cftry>
 <CFELSE>
 
  <cftry>
	<cfoutput>
		<cfhttp method="GET" url="http://www.p2rx.org/webservices/p2rx/getStates.cfm?format=WDDX&region=#region#" resolveurl="no"></cfoutput>
		<!---<cfoutput>#cfhttp.statuscode#</cfoutput>--->
		<cfif #cfhttp.statuscode# EQ "404 Not Found">
		<cfoutput>
		<cfhttp method="GET" url="http://wrrc.p2pays.org/webservices/p2rx/getStates.cfm?format=WDDX&region=#region#" resolveurl="no">			</cfoutput></cfif>
			<cfwddx action="WDDX2CFML" input="#cfhttp.fileContent#" output="strOutput">
				<P>
				<CFSET intNumberOfTerms = ArrayLen(strOutput.List)>
				<TABLE cellpadding="2" style="font-size:1.0em">
				<CFLOOP from="1" to="#intNumberOfTerms#" index="intCounter">
				<cfif not (#intCounter#-1) mod 2 or #intCounter# eq	1>
					<Tr>
				</cfif>
				<cfoutput>
					<cfset meta_keywords = Meta_keywords & "#strOutput.List[intCounter].STATE# , ">
					<TD align="left">
							<a href="index.cfm?pageAction=searchByState&List=#strOutput.List[intCounter].ABBR#&Format=WDDX&region=#region#">#replacelist(strOutput.List[intCounter].STATE,good_chars,Bad_chars)# </a>
					</TD>	
				</cfoutput> 
				 <cfif not #intCounter# mod 2 or #intCounter# eq #intNumberOfTerms#></Tr></cfif>
				</cfloop>
			<TR><TD colspan="2">
			<cfoutput>
				<a href="index.cfm?pageAction=searchByState&List=All&Format=WDDX&region=#region#">ALL Programs</a> 
			</cfoutput>
			<cfoutput><a name="Header"><HR></a></cfoutput></TD>	</TR>
			</TABLE>
		 <cfcatch type="Any">
			The state data was not provided. The administrator has been notified.
		</cfcatch>
 </cftry>
 </cfif>

CVS Admin
Powered by
ViewCVS 1.0-dev