[% META
    title  = 'Haematological Malignancy Research Network &raquo; Edit MDT Date'
%]

<!-- BEGIN hmrn/data/edit_mdt_date.tt  -->
    [% # PROCESS dumper.tt dump = data %]
    
	[% addcss =	[
			'validationEngine.jquery.css' # for validationEngine
			'smoothness/jquery-ui-1.8.4.custom.css' # for DatePicker
		]
	%]
	
	[% # PROCESS site/js/jquery.tt # already loaded in html_wrapper %]
	<script type="text/javascript" src="/js/jquery-ui-1.8.4.custom.min.js"></script>	
    <script type="text/javascript">
        $(function() {
            $('.datepicker').datepicker({
                changeMonth: true,
                changeYear: true,
                dateFormat: 'dd/mm/yy',
            });
        });
	</script>

	[% INCLUDE site/js/validationEngine.tt %]
	<script type="text/javascript">
		$(document).ready(function() {
			$("#mdt_date").validationEngine()
		})
	</script>

    <h3>Edit MDT date:</h3>
    
    [% IF dfv_err.size # DFV validation, not CAP::ValidateRM %]
        <p class="error">[% c.cfg('msg').dfv_errors %]</p>
    [% END %]
    
    <form method="post" action="[% app_url %]/hmrn_data/edit_mdt_date/[% c.param('id')
            %]/[% c.param('Id') %]" name="mdt_date" id="mdt_date">
        <p class="indent">
            <input type="text" name="date" id="date" class="validate[required,ajax[ajaxDate]] datepicker" 
				value="[% data.date.strftime('%d.%b.%Y') %]" />
		[% dfv_err.date # DFV msg format %]
			[% IF c.query.param('delete') %]
				<span class="title">confirm deletion (no undo possible):</span>
				<input type="checkbox" name="confirm_delete" value="1" />
				<input type="hidden" name="delete" value="1" />
				[% site.html.submit %]
			[% ELSE %]
				[% site.html.submit %]
				[% site.html.reset %]
				<a href="[% app_url %]/hmrn_data/edit_mdt_date/[% c.param('id')
						%]/[% c.param('Id') %]?date=[% data.date.strftime('%d.%b.%Y') %];delete=1">
					<span class="highlight">delete</span>
				</a>
			[% END %]
        </p>
    </form>
	
	<p class="indent">[% site.html.back_button %]</p>
<!-- END hmrn/data/edit_mdt_date.tt  -->
