 <cfif action is "edbatch">
 	<cfoutput>
 		<cfquery name="b" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
-			select * from genbank_batch where batch_name='#batch_name#'
+			select * from genbank_batch where batch_id=#batch_id#
 		</cfquery>
 		<cfdump var=#b#>
+		<hr>
+		<h3>People</h3>
+		<br>Add Person
+		<form name="f" method="post" action="genbank_submit.cfm">
+			<input type="hidden" name="action" value="add_agent">
+			<input type="hidden" name="batch_id" value="#batch_id#">
+			<input type="hidden" name="new_agent_id" id="new_agent_id" value="">
+			<input type="text" name="new_agent" id="new_agent" value=""
+				onchange="pickAgentModal('new_agent_id',this.id,this.value); return false;"
+				onKeyPress="return noenter(event);" placeholder="pick an agent" class="reqdClr minput">
+			<br><input type="submit" value="create batch" class="insBtn">
+		</form>
+		<cfquery name="p" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+			select * from genbank_people where genbank_batch_id=#batch_id#
+		</cfquery>
+		<cfdump var=#p#>
+
+
+	</cfoutput>
+</cfif>
+
+<!--------------------------------------------------------------------------------------------->
+<cfif action is "add_agent">
+	<cfoutput>
+		<cfquery name="d" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+			insert into genbank_people (
+				genbank_people_id,
+				genbank_batch_id,
+				agent_id
+			) values (
+				someRandomSequence.nextval,
+				#batch_id#,
+				'#new_agent_id#'
+			)
+		</cfquery>
+		<cflocation url="genbank_submit.cfm?action=edbatch&batch_id=#batch_id#" addtoken="false">
 	</cfoutput>
 </cfif>
 <!--------------------------------------------------------------------------------------------->

			select * from genbank_batch order by batch_name
		</cfquery>
		<cfloop query="d">
			<br><a href="genbank_submit.cfm?action=edbatch">edit batch #batch_name#</a>

		</cfloop>
	</cfoutput>

<!--------------------------------------------------------------------------------------------->

<cfif action is "create_batch">
	<cfquery name="k" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
		select someRandomSequence.nextval k from dual
	</cfquery>

	<cfquery name="d" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
		insert into genbank_batch (
			genbank_batch_id,
			created_agent_id,
			batch_name
		) values (
			#k.k#,
			#session.myAgentID#,
			'#batch_name#'
		)
	</cfquery>
	<cflocation url="genbank_submit.cfm?action=edbatch&batch_id=#k.k#" addtoken="false">
</cfif>
<!--------------------------------------------------------------------------------------------->

