 	exp_Date,
 	permit_Num,
 	permit_Type,
-	permit_remarks 
-from 
+	permit_remarks
+from
 	permit,
 	preferred_agent_name issuedToPref,
 	preferred_agent_name issuedByPref,
 	agent_name issuedTo,
-	agent_name issuedBy 
-where 
+	agent_name issuedBy
+where
 	permit.issued_by_agent_id = issuedBy.agent_id and
 	permit.issued_to_agent_id = issuedTo.agent_id and
 		permit.issued_by_agent_id = issuedByPref.agent_id and

		<cfquery name="addPermit" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
			INSERT INTO permit_trans (permit_id, transaction_id) VALUES (#permit_id#, #transaction_id#)
		</cfquery>
		
		
		
		Added permit #permit_id# to transaction #transaction_id#. 
		<br>Search to add another permit to this accession or click
		<a href="##" onclick="javascript: self.close();">here</a> to close this window.
	</cfoutput>	
	
	
</cfif>
<cfinclude template="../includes/_pickFooter.cfm">
	<cfset sql = "#sql# AND permit_Num = '#permit_Num#'">
</cfif>
<cfif len(#permit_Type#) gt 0>

		<cfset permit_Type = #replace(permit_type,"'","''","All")#>


	<cfset sql = "#sql# AND permit_Type = '#permit_Type#'">
</cfif>
<cfif len(#permit_remarks#) gt 0>
