RSS Git Download  Clone
Raw Blame History
  [% META title = 'Admin » Specimens' -%]
<!-- BEGIN admin/config/specimens/default.tt -->

	[% # PROCESS dumper.tt dump = specimen_lab_test_map %]

  [% PROCESS admin/misc_nav.tt page = 'specimens' %]

  [% specimens_dfv_js %]

  <h2 align="center">Specimens</h2>

    [% IF dfv_errors %]
        <p class="error">[% c.config('msg').dfv_errors %]</p>
    [% END %]

    <p class="title">
		[% div_name = 'new'; INCLUDE site/snippets/toggleview.tt %]
		Add new entry
	</p>

	<div class="[% dfv_errors ? 'visible' : 'itemhidden' %]" id="[% div_name %]">
		<form method="post" action="[% app_url %]/config/specimens/update" [% specimens_onsubmit %]
        name="lab_test" id="lab_test">
		<div class="indent">
			<table>
				<tr>
					<td class="label">Sample code:</td>
					<td class="content">
                        [% PROCESS site/ajax_input.tt field = 'sample_code' %]
						[% error_sample_code %]
					</td>
				</tr>
				<tr>
					<td class="label">Description:</td>
					<td class="content">
						<input type="text" name="description" id="description" value=""  size="20" />
						[% error_description %]
 					</td>
				</tr>
				<tr>
					<td class="label">Active:</td>
					<td class="content">
						<select name="active" [% site.html.onfocus %]>
						[% FOREACH option IN ['yes', 'no'] %]
						 <option value="[% option %]">[% option %]</option>
						[% END %]
						</select>
						[% error_active %]
 					</td>
				</tr>
            </table>

			<p class="indent">[% site.html.submit %]</p>
		</div>
		</form>
	</div>

	<p class="spacer">&nbsp;</p>

	[% IF specimens.size # only empty if new db %]
	<div class="[% dfv_errors ? 'itemhidden' : 'visible' %]">
        [% PROCESS site/page_count.tt %]

		<table>
			<tr>
				<th></th>
				<th>Sample Code</th>
				<th>Description</th>
				<th>Tests</th>
				<th>Active</th>
			</tr>

			[% FOREACH s IN specimens %]
			<tr>
				<td>
                    [% IF cgi_pager; cgi_pager.first_pos_displayed + loop.count - 1; ELSE; loop.count; END %]
                </td>
				<td>
					<input type="text" size="15" name="sample_code" value="[% s.sample_code | html %]"
						[% site.html.disabled %] />
				</td>
				<td>
					<input type="text" size="45" name="description" value="[% s.description | html %]"
                        [% site.html.disabled %] />
				</td>
				<td align="center">
					[% IF specimen_lab_test_map.item(s.id);
						title = specimen_lab_test_map.item(s.id).lab_test_names.join(', ');
					%]					
						<span class="acronym" title="[% title %]">Yes</span>
					[% END %]
				</td>
				<td>
					<select name="active" [% site.html.disabled %]>
					[% FOREACH option IN ['yes', 'no'] %]
						 <option value="[% option %]" [% 'selected' IF option == s.active %]>
							[% option %]
						</option>
					[% END %]
					</select>
				</td>
				<td align="center">
					<a href="[% app_url %]/config/specimens/edit/[% s.id %]">Edit</a>
				</td>
			 </tr>
			[% END %]

		</table>
	</div>
	[% END %]

    [% PROCESS site/cgi_pager.tt %]
<!-- BEGIN admin/config/specimens/default.tt -->