<? global $vis_language; ?>
<div id="vis_client_list"><div class="vis_main_window vis_shadow vis_round_corner">
    <div class="vis_main_header"><? echo $task['subject']; ?></div>
    <div class="vis_main_window_content vis_round_corner"><div id="vis_calendar_area">
        <form name="vis_edit_task_form" id="vis_edit_task_form"><table border="0" cellpadding="3" cellspacing="3" width="100%">
            <tr><td width="120"><? echo $vis_language['TXTTITLE']; ?></td><td><input name="vis_title" id="vis_title" type="text" class="vis_input" value="<? echo $task['subject']; ?>" /></td></tr>
            <tr><td><? echo $vis_language['TXTDESCRIPTION']; ?> </td><td><textarea name="vis_details" id="vis_details" class="vis_input"><? echo $task['description']; ?></textarea></td></tr>
            <tr><td><? echo $vis_language['TXTSTARTDATE']; ?></td><td><input name="vis_from_dt" id="vis_cal_from_dt" value="<? echo date("Y-m-d", $task['start_date']); ?>" /></td></tr>
            <tr><td><? echo $vis_language['TXTENDDATE']; ?></td><td><input name="vis_to_dt" id="vis_cal_to_dt" value="<? echo date("Y-m-d", $task['end_date']); ?>" /></td></tr>
            <tr><td><? echo $vis_language['TXTACCESS']; ?></td><td><input name="vis_type" id="vis_type_pub" value="0"<? if($task['task_type']==0) echo ' checked="checked"'; ?> type="radio"><label for="vis_type_pub"><? echo $vis_language['TXTPUBLIC']; ?></label> <input name="vis_type" id="vis_type_pri" value="1"<? if($task['task_type']!=0) echo ' checked="checked"'; ?> type="radio"><label for="vis_type_pri"><? echo $vis_language['TXTPRIVATE']; ?></label></td></tr>
            <tr><td><? echo $vis_language['TXTSTATUS']; ?></td><td><select name="vis_status" id="vis_status" class="vis_input">
                <option value="None"><? echo $vis_language['TXTNONE']; ?></option><option value="Not started"<? if($task['task_status']=='Not started') echo ' selected="selected"'; ?>><? echo $vis_language['TXTNOTSTARTED']; ?></option><option value="In progress"<? if($task['task_status']=='In progress') echo ' selected="selected"'; ?>><? echo $vis_language['TXTINPROGRESS']; ?></option><option value="Completed"<? if($task['task_status']=='Completed') echo ' selected="selected"'; ?>><? echo $vis_language['TXTCOMPLETED']; ?></option><option value="Planned"<? if($task['task_status']=='Planned') echo ' selected="selected"'; ?>><? echo $vis_language['TXTPLANNED']; ?></option>
            </select></td></tr>
            <tr><td><? echo $vis_language['TXTPRIORITY']; ?></td><td><select name="vis_priority" id="vis_priority" class="vis_input">
                <option value="Low"<? if($task['priority']=='LOW') echo ' selected="selected"'; ?>><? echo $vis_language['TXTLOW']; ?></option><option value="Medium"<? if($task['priority']=='Medium') echo ' selected="selected"'; ?>><? echo $vis_language['TXTMEDIUM']; ?></option><option value="High"<? if($task['priority']=='High') echo ' selected="selected"'; ?>><? echo $vis_language['TXTHIGH']; ?></option></select></td></tr>
            <tr><td><? echo $vis_language['TXTLABEL']; ?></td><td><select name="vis_label" id="vis_label" class="vis_input">
                <option value="None"><? echo $vis_language['TXTNONE']; ?></option><option value="Important"<? if($task['label']=='Important') echo ' selected="selected"'; ?>><? echo $vis_language['TXTIMPORTANT']; ?></option><option value="Business"<? if($task['label']=='Business') echo ' selected="selected"'; ?>><? echo $vis_language['TXTBUSINESS']; ?></option><option value="Personal"<? if($task['label']=='Personal') echo ' selected="selected"'; ?>><? echo $vis_language['TXTPERSONAL']; ?></option></select></td></tr>
            <tr><td><? echo $vis_language['TXTLOCATION']; ?></td><td><input name="vis_location" id="vis_location" class="vis_input" type="text" value="<?= $task['location'] ?>" /></td></tr>
            <tr><td colspan="2"><div class="vis_seperator_horizontal"></div></td></tr>
            <tr><td colspan="2"><input type="hidden" name="vis_task_id" value="<? echo $task['task_id']; ?>" /><span class="vis_button" onclick="$('#vis_global_msg_div').visExecution('submit_form', {'vis_module':'home', 'vis_operation':'update_cal_task', 'vis_form':'vis_edit_task_form'})"><? echo $vis_language['TXTUPDATE']; ?></span></td></tr>
        </table></form>
    </div>
</div>
<script>
    var dates=$( "#vis_cal_from_dt, #vis_cal_to_dt" ).datepicker({
        numberOfMonths: 2,
        dateFormat: 'yy-mm-dd',
        onSelect: function( selectedDate ) {
            var option=this.id=="vis_cal_from_dt"?"minDate":"maxDate",
                instance=$( this ).data( "datepicker" ),
                date=$.datepicker.parseDate ( instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings );
            dates.not(this).datepicker("option", option, date);
        }
    });
</script>