  [% META title = 'Admin &raquo; Edit General Practitioner' -%]
<!-- BEGIN admin/config/generalpractitioners/edit.tt -->

  [% # PROCESS dumper.tt dump = c.stash.errs %]

  [% # PROCESS admin/system_nav.tt page = 'trials' %]

  [% general_practitioners_dfv_js %]

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

  <h2 align="center">Edit General Practitioner Details</h2>

    [% IF dfv_errors %]
    <dl>
        <dt class="error">[% c.cfg('msg').dfv_errors %]</dt>
        [% IF error_national_code %]
            <dd>GP code [% error_national_code %]</dd>[% END %]
        [% IF error_name %]
            <dd>Name [% error_name %]</dd>[% END %]
        [% IF error_practice_code %]
            <dd>Practice code [% error_practice_code %]</dd>[% END %]
    </dl>
    [% END %]

    <form method="post" action="[% app_url %]/config/general-practitioners/update/[% data.id %]"
		[% general_practitioners_onsubmit %] name="general_practitioner" id="general_practitioner">
		
    <table>
        <tr>
            <th [% IF error_national_code %]class="error"[% END %]>GP Code</th>
            <th [% IF error_name %]class="error"[% END %]>Name</th>
			<th>Practice Address</th>
			<th [% IF error_practice_code %]class="error"[% END %]>Practice Code</th>
			<th [% IF error_active %]class="error"[% END %]>Active</th>
        </tr>
        <tr>
            <td><!-- can't edit this: -->
				<p>[% data.national_code | html %]</p>
             </td>
            <td>
                <input type="text" name="name" size="20" value="[% data.name %]" />
             </td>
            <td><!-- can't edit this: -->
                <p>[% data.display_name | html %]</p>
             </td>
            <td><!-- can't edit this: -->
                <p>[% data.organisation_code | html %]</p>
            </td>
			<td>
				<select name="active">
				[% FOREACH option IN ['yes', 'no'] %]
                     <option value="[% option %]" [% 'selected' IF option == data.active %]>
                        [% option %]
                    </option>
			    [% END %]
				</select>
			</td>
            <td>
                [% site.html.submit %]
            </td>
        </tr>
    </table>

    </form>

    <p>[% site.html.back_button %]</p>
<!-- END admin/config/generalpractitioners/edit.tt -->