 		}
 	}
 </script>
+
+<!---------------------------------------------------------------->
+<cfif action is "nothing">
+	<cfset title="Edit Container">
+	<cfquery name="getCont" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+		SELECT
+			container.container_id as container_id,
+			container.parent_container_id as parent_container_id,
+			container_type,
+			label,
+			description,
+			container_remarks,
+			barcode,
+			parent_install_date,
+			width,
+			length,
+			height,
+			number_positions,
+			locked_position,
+			institution_acronym
+		FROM
+			container
+		WHERE
+			container.container_id = #container_id#
+	</cfquery>
+	<cfquery name="ctInst" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+		select distinct(institution_acronym) institution_acronym from collection order by institution_acronym
+	</cfquery>
+	<cfquery name="ContType" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+		select container_type from ctcontainer_type where container_type != 'collection object' order by container_type
+	</cfquery>
+	<cfquery name="ctcontainer_env_parameter" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+		select parameter_type from ctcontainer_env_parameter ORDER BY parameter_type
+	</cfquery>
+	<cfoutput>
+	<h2>Edit Container</h2>
+	<table><tr><td valign="top"><!---- left column ---->
+	<form name="form1" method="post" action="EditContainer.cfm">
+		<input type="hidden" name="container_id" value="#getCont.container_id#">
+		<table cellpadding="0" cellspacing="0">
+	 		<tr>
+				<td>
+					<label for="label">Label</label>
+					<input name="label" id="label" type="text" value="#getCont.label#" size="30" class="reqdClr">
+				</td>
+				<td>
+					<label for="barcode">Barcode</label>
+					<input name="barcode" type="text" value="#getCont.barcode#" id="barcode">
+				</td>
+			</tr>
+			<tr>
+				<td>
+					 <label for="container_type">Container Type</label>
+					 <cfif getCont.container_type is not "collection object">
+						 <select name="container_type" id="container_type" size="1" class="reqdClr" onChange="magicNumbers(this.value);">
+					          <cfloop query="ContType">
+		            			<option
+									<cfif getCont.Container_Type is ContType.container_type> selected="selected" </cfif>
+									value="#ContType.container_type#">#ContType.container_type#</option>
+		         			 </cfloop>
+						</select>
+					<cfelse>
+						<cfquery name="findItem" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+							select
+								guid,
+								part_name
+							FROM
+								coll_obj_cont_hist,
+								specimen_part,
+								flat
+							WHERE
+								coll_obj_cont_hist.collection_object_id = specimen_part.collection_object_id AND
+								specimen_part.derived_from_cat_item = flat.collection_object_id AND
+								coll_obj_cont_hist.container_id = #container_id#
+						</cfquery>
+						<input type="text" name="container_type" id="container_type" value="collection object" readonly="yes" />
+						<cfif findItem.recordcount is 1>
+							<a href="/guid/#findItem.guid#" target="_blank">
+								#findItem.guid# (#findItem.part_name#)</a>
+						<cfelse>
+							Something is goofy - this containers matches #findItem.recordcount# items. File a bug report.
+							<br />#findItem.guid#
+						</cfif>
+					</cfif>
+				</td>
+				<td>
+					 <label for="institution_acronym">Institution</label>
+					 <select name="institution_acronym" id="institution_acronym" size="1" class="reqdClr">
+				          <cfloop query="ctInst">
+	            				<option
+	            					<cfif getCont.institution_acronym is ctInst.institution_acronym> selected="selected" </cfif>
+	            					value="#institution_acronym#">#institution_acronym#</option>
+	         			 </cfloop>
+					</select>
+				</td>
+			</tr>
+			<tr>
+				<td>
+					<label for="parent_install_date">Last Moved Date</label>
+					<div id="parent_install_date">#Dateformat(getCont.parent_install_date, "yyyy-mm-dd")#</div>
+				</td>
+				<td>
+					<label for="locked_position">Locked?</label>
+						<select name="locked_position" id="locked_position" size="1">
+							<option <cfif getCont.locked_position is 0> selected </cfif>value="0">no</option>
+							<option <cfif getCont.locked_position is 1> selected </cfif>value="1">yes</option>
+						</select>
+				</td>
+			</tr>
+			<tr>
+				<td colspan="2">
+					<label for="dimTbl">Dimensions</label>
+					<table cellspacing="0" cellpadding="0" width="100%" id="dimTbl">
+						<tr>
+							<td>
+								<label for="width">Width (cm)</label>
+								<input type="text" id="width" name="width" value="#getCont.width#" size="4">
+							</td>
+							<td>
+								<label for="height">Height (cm)</label>
+								<input type="text" id="height" name="height" value="#getCont.height#" size="4">
+							</td>
+							<td>
+								<label for="length">Length (cm)</label>
+								<input type="text" id="length" name="length" value="#getCont.length#" size="4">
+							</td>
+							<td>
+								<label for="number_positions">## Positions</label>
+								<input type="text" name="number_positions" value="#getCont.number_positions#" size="2" id="number_positions">
+							</td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+	  		<tr>
+				<td colspan="2">
+					<label for="description">Description</label>
+					<textarea rows="2" cols="60" name="description" id="description">#getCont.Description#</textarea>
+				</td>
+			</tr>
+	 		<tr>
+				<td colspan="2">
+					<label for="container_remarks">Remarks?</label>
+					<textarea rows="2" cols="60" id="container_remarks" name="container_remarks">#getCont.container_remarks#</textarea>
+				</td>
+			</tr>
+
+			<tr>
+				<td colspan="2">
+					<table cellpadding="0" cellspacing="0" width="100%">
+						<tr>
+							<td>
+								<input type="button"
+									value="Print"
+									class="lnkBtn"
+									onclick="window.open('Reports/report_printer.cfm?container_id=#getCont.container_id#');">
+							</td>
+							<td>
+								<input type="button"
+									value="Update"
+									class="savBtn"
+									onclick="form1.action.value='update';submit();">
+							</td>
+							<td>
+								<input type="button"
+									value="Delete"
+									class="delBtn"
+									onclick="form1.action.value='delete';confirmDelete('form1');" >
+							</td>
+							<td>
+								<input type="button"
+									value="Clone"
+									class="insBtn"
+									onclick="form1.action.value='newContainer';submit();">
+							</td>
+							<td>
+								<cfif getCont.parent_container_id gt 0>
+									<input type="button"
+										value="Edit Parent"
+										class="lnkBtn"
+										onclick="document.location='EditContainer.cfm?container_id=#getCont.parent_container_id#';">
+								</cfif>
+							</td>
+							<td>
+								<label for="newParentBarcode">Move To Barcode</label>
+								<input type="hidden" name="parent_container_id" id="parent_container_id" value="#getCont.parent_container_id#">
+								<input type="text" name="newParentBarcode" id="newParentBarcode" />
+							</td>
+						</tr>
+					</table>
+					<input type="hidden" name="action" value="update">
+				</td>
+			</tr>
+	</table>
+</form>
+<h2>Container Environment History</h2>
+<cfquery name="container_environment" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+	select
+		container_environment_id,
+		check_date,
+		getPreferredAgentName(checked_by_agent_id) checkedby,
+		parameter_type,
+		parameter_value,
+		remark
+	from
+		container_environment
+	where
+		container_id=#getCont.container_id#
+	order by check_date
+</cfquery>
+<table border>
+	<tr>
+		<th>Date</th>
+		<th>CheckedBy</th>
+		<th>Parameter</th>
+		<th>Value</th>
+		<th>Remark</th>
+	</tr>
+	<cfloop query="container_environment">
+		<tr>
+			<td>#check_date#</td>
+			<td>#checkedby#</td>
+			<td>#parameter_type#</td>
+			<td>#parameter_value#</td>
+			<td>#remark#</td>
+		</tr>
+	</cfloop>
+</table>
+
+
+ create table container_environment (
+ 	container_environment_id number not null,
+ 	container_id number not null,
+ 	check_date date not null,
+	checked_by_agent_id number not null,
+ 	parameter_type varchar2(60) not null,
+ 	parameter_value number not null,
+	remark varchar2(4000)
+ );
+
+
+
+
+
+
+
+<tr>
+				<td colspan="2">
+					<label for="fluidTbl">Fluid</label>
+					<table id="fluidTbl" cellspacing="0" cellpadding="0" width="100%">
+						<tr>
+							<td>
+								<label for="checked_date">Fluid Check Date</label>
+								<input name="checked_date" id="checked_date"
+								type="text"
+								value="#dateformat(getCont.checked_date,'yyyy-mm-dd')#"
+								size="10">
+							</td>
+							<td>
+								<label for="fluid_type">Fluid Type</label>
+								<cfset thisFluid="#getCont.fluid_type#">
+								 <select name="fluid_type" id="fluid_type" size="1">
+									<option value=""></option>
+										<cfloop query="FluidType">
+											<option
+												<cfif #thisFluid# is "#FluidType.Fluid_Type#"> selected </cfif>
+												value="#FluidType.Fluid_Type#">#FluidType.Fluid_Type#
+											</option>
+										</cfloop>
+								</select>
+							</td>
+							<td>
+								<label for="concentration">Fluid Concentration</label>
+								<select name="concentration" id="concentration" size="1">
+									<option value=""></option>
+										<cfloop query="ctConc">
+											<option
+												<cfif #ctConc.concentration# is #getCont.concentration#>
+													selected
+												</cfif>
+												value="#ctConc.concentration#">#ctConc.concentration#
+											</option>
+										</cfloop>
+								</select>
+							</td>
+						</tr>
+					</table>
+				</td>
+			<tr>
+			<tr>
+				<td colspan="2">
+					<label for="fluid_remarks">Fluid Remarks</label>
+					<input name="fluid_remarks" id="fluid_remarks" type="text" value="#getCont.fluid_remarks#" size="80">
+				</td>
+			</tr>
+
+
+
+
+
+
+
+
+<form name="envcheck" method="post" action="EditContainer.cfm">
+	<input type="hidden" name="action" value="saveEnvCheck">
+	<input type="hidden" name="container_id" value="#getCont.container_id#">
+<table border="1">
+		<tr>
+			<td>
+				<label for="checkedBy">Checked By</label>
+				<input type="text"
+					name="checked_by" id="checked_by" class="reqdClr" value="#session.username#"
+					 onchange="getAgent('checked_agent_id','checked_by','checked',this.value); return false;"
+					 onKeyPress="return noenter(event);">
+					<input type="hidden" name="checked_agent_id" value="#session.MyAgentId#">
+			</td>
+			<td>
+				<label for="check_date">Checked Date</label>
+				<input type="text"
+					name="check_date" id="check_date" class="reqdClr" value="#dateformat(now(),'yyyy-mm-dd')#" >
+			</td>
+			<td>
+				<label for="check_remark">Check Remark</label>
+				<input type="text" name="check_remark" id="check_remark">
+			</td>
+			<td>
+				<input type="submit" value="Save Check" class="savBtn">
+			</td>
+
+		</tr>
+	</table>
+
+ </form>
+<cfquery name="checked" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+	select * from container_check,
+	preferred_agent_name
+	 where
+	 checked_agent_id = agent_id and
+	 container_id=#container_id# order by check_date
+</cfquery>
+<cfif checked.recordcount is 0>
+	No checked history.
+<cfelse>
+	<table border="1">
+		<tr>
+			<td>Date</td>
+			<td>Checked By</td>
+			<td>Remark</td>
+		</tr>
+		<cfloop query="checked">
+			<tr>
+				<td>#check_date#</td>
+				<td>#agent_name#</td>
+				<td>#check_remark#</td>
+			</tr>
+		</cfloop>
+	</table>
+</cfif>
+</td>
+<td valign="top"><!---- right column ---->
+
+	<cfquery name="children" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+		select
+			container_id,
+			barcode,
+			container_type,
+			label
+		from
+			container
+		where
+			parent_container_id=#container_id#
+		order by
+			container_type,barcode,label
+	</cfquery>
+	<h3>Contents</h3>
+	<form name="moveChillun" method="post" action="EditContainer.cfm">
+		<input type="hidden" name="action" value="moveChillun">
+		<input type="hidden" name="container_id" value="#getCont.container_id#">
+		<label for="newParentBarcode">Move all children of this container to barcode:</label>
+		<input type="text" name="newParentBarcode" id="newParentBarcode" class="reqdClr">
+		<br><input type="submit" value="Move all children of this container to scanned barcode" class="savBtn">
+	</form>
+	<p></p>
+	<label for ="ctabl">Children of this container</label>
+	<table border>
+		<tr>
+			<th>Barcode</th>
+			<th>Label</th>
+			<th>Container Type</th>
+			<th>Tools</th>
+		</tr>
+		<cfloop query="children">
+			<tr>
+				<td>#barcode#</td>
+				<td>#label#</td>
+				<td>#container_type#</td>
+				<td>
+					<a href="/EditContainer.cfm?container_id=#container_id#">[ edit ]</a>
+					<a href="/findContainer.cfm?container_id=#container_id#">[ find ]</a>
+				</td>
+			</tr>
+		</cfloop>
+	</table>
+</td>
+</tr></table>
+</cfoutput>
+</cfif>
+<!-------------------------------------------------------------->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 <cfif action is "update">
 	<cfoutput>
 		<cfif len(newParentBarcode) gt 0>

	</cfoutput>
</cfif>
<!-------------------------------------------------------------->
<cfif #Action# is "saveChecked">
	<cfoutput>
		<cfquery name="saveCheck" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
			insert into container_check (
				CONTAINER_ID,
				CHECK_DATE,
				CHECKED_AGENT_ID,

			</cfquery>
			<cfset parent_container_id=isGoodParent.container_id>
		</cfif>
		<cftransaction>
			<cfstoredproc procedure="updateContainer" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
				<cfprocparam cfsqltype="cf_sql_varchar" value="#container_id#"><!---- v_container_id ---->
