 		 '2008-11-05',
 		 'brandy'
 	);
-	
-	
-	
+
+
+
 	select substr('C124',0,1) from dual;
 		select substr('C1',2) from dual;
 
-	
-	
+
+
 		UAM:Herb	 - Gordon ordered from EIM	11/5/2008	Brandy
 0	0	UAM:Mamm	reserved for "unknown location" container	10/9/2009	DLM
 R[number]C[number]	various	UAM	range cases; inconsistent format (R36C01; R131C6) due to legacy data and space constraints.	10/9/2009	DLM

LN21A1	LN23F5	UAM	Nitrogen freezer positions	10/9/2009	DLM
LN2FRZR1	LN2FRZR3	UAM	Nitrogen freezers	10/9/2009	DLM
ES 000001	ES 019999	UAM:ES	UAM Paleo specimen labels	10/9/2009	DLM
ES20000	ES54999	UAM:ES	Updated UAM Paleo specimen labels		
UAM100000001	UAM100050000	UAM:Ento	UAM Insects specimen labels	10/9/2009	DLM
FRZR1	FRZR9	UAM	freezers	9/22/2014	Kyndall
FRZR1-01A	"FRZR9-12D

<cfinclude template="/includes/_header.cfm">
<a href="barcodeseries.cfm?action=test">test</a>
<cfoutput>
	<cfif action is "nothing">
		<cfparam name="barcode" default="">
		<form name="t" method="get" action="barcodeseries.cfm">
			<input type="hidden" name="action" value="test">
			<label for="barcode">Enter a barcode to test</label>
			<input type="text" value="#barcode#" name="barcode">
			<input type="submit" value="test this barcode">
		</form>
		<cfquery name="d" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
			select * from cf_barcodeseries order by key
		</cfquery>

		<table border>
			<tr>
				<th>Txt</th>
				<th>sql</th>
				<th>status</th>
				<th>statusSQL</th>
				<th>Inst</th>
				<th>Date</th>
				<th>Who</th>
				<th>Note</th>
			</tr>
			<cfloop query="d">
				<td>#barcodeseriestxt#</td>
				<td>#barcodeseriessql#</td>
				<cfif len(barcode) gt 0>
					<cftry>
					<p>Testing #barcodeseriestxt# (#barcodeseriessql#)</p>
					<cfset statusSQL=replace(barcodeseriessql,"barcode","'#barcode#'","all")>
					<br>select count(*) c from dual where #preserveSingleQuotes(statusSQL)#
					<cfquery name="t" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
						select count(*) c from dual where #preserveSingleQuotes(bc)#
					</cfquery>
					<cfif t.c gt 0>
						<cfset tststts='PASS'>
					<cfelse>
						<cfset tststts='FAIL (count: #t.c#)'>
					</cfif>
					<cfcatch>
						<cfset tststts='FAIL: #cfcatch.message# #cfcatch.detail#'>
					</cfcatch>
					</cftry>
				<cfelse>
					<cfset statusSQL='Enter a barcode in the form above to test'>
					<cfset tststts='-'>
				</cfif>


				<td>#tststts#</td>
				<td>#institution#</td>
				<td>#createdate#</td>
				<td>whodunit##</td>
				<td>#notes#</td>
			</cfloop>
			</table>





		</cfif>
	</cfif>
</cfoutput>
