  [% META title = 'Admin &raquo; Practitioners &raquo; Search' -%]

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

	[% PROCESS admin/referral_nav.tt page = 'practitioners' %]

	<h2>General Practitioners:</h2>
    [% PROCESS site/page_count.tt %]

	<div class="indent">
		<table>
			<tr>
				<th></th>
				<th>Name</th>
				<th>Code</th>
				<th>Practice address</th>
				<th>Active</th>
			</tr>

			[% FOREACH entry IN referrers %][% # PROCESS dumper.tt dump = d %]
			<tr>
				<td>
                    [% IF cgi_pager; cgi_pager.first_pos_displayed + loop.count - 1; ELSE; loop.count; END %]
                </td>
				<td>
					<input type="text" size="30" name="name" value="[% entry.name | html %]"
						[% site.html.disabled %] />
				</td>
				<td>
					<input type="text" size="8" name="national_code"
                           value="[% entry.national_code | html %]"
                        [% site.html.disabled %] />
				</td>
                [% referral_source =
					entry.referrer_department.parent_organisation.description %]
				<td>
					<input type="text" size="80" name="practice_name"
                        value="[% referral_source | html %]"
                           [% site.html.disabled %] />
				</td>
				<td>
					<select name="active" [% site.html.disabled %]>
					[% FOREACH option IN ['yes', 'no'] %]
						 <option value="[% option %]" [% 'selected' IF option == entry.active %]>
							[% option %]
						</option>
					[% END %]
					</select>
				</td>
				<td align="center">
					<a href="[% app_url %]/config/general-practitioners/edit/[% entry.id %]">Edit</a>
				</td>
			 </tr>
			[% END %]
		</table>
	</div>
    [% PROCESS site/cgi_pager.tt %]
	
	<h3>Search again</h3>
	<div class="indent">
		[% PROCESS search/referrer_search.tt referrer_type = 'general-practitioners' %]
	</div>