<form method="post" action="event.php" id="eventform">
<table cellpadding="5" cellspacing="0">
  <tr>
    <td style="vertical-align: top; text-align: right;">
      <?php print_string('eventname', 'calendar'); ?>:
    </td>
    <td>
      <input type="text" name="name" size="67" value="<?php p($form->name); ?>" />
      <?php if (isset($err['name'])) formerr($err['name']); ?>
    </td>
  </tr>
  <tr>
    <td style="vertical-align: top; text-align: right;">
      <?php print_string('eventdescription', 'calendar'); ?>:
    </td>
    <td>
      <?php
          print_textarea($usehtmleditor, 20, 65, 630, 300, "description", $form->description);
          if (isset($err['description'])) formerr($err['description']);
      ?>
    </td>
  </tr>
  <tr>
    <td style="vertical-align: top; text-align: right;"><?php print_string('eventdate', 'calendar'); ?>:</td>
    <td>
      <?php print_date_selector('startday', 'startmon', 'startyr', $form->timestart);?>
      <?php print_string('eventtime', 'calendar');?>
      <?php print_time_selector('starthr', 'startmin', $form->timestart) ?>
      <?php if (isset($err['timestart'])) formerr($err['timestart']); ?>
    </td>
  </tr>
  <tr>
    <td style="vertical-align: top; text-align: right;">
      <?php print_string('eventduration', 'calendar'); ?>:
    </td>
    <td>
      <div>
        <input type="radio" name="duration" value="0" id="duration_none" <?php if($form->duration == 0) echo 'checked="checked"'; ?>/>
        <label for="duration_none">
          <?php print_string('durationnone', 'calendar'); ?>
        </label>
      </div>
      <div>
        <input type="radio" name="duration" value="1" id="duration_yes" <?php if($form->duration == 1) echo 'checked="checked"'; ?>/>
        <label for="duration_yes">
          <?php print_string('durationuntil', 'calendar'); ?>
        </label>
        <?php print_date_selector('endday', 'endmon', 'endyr', $form->timestart + $form->timeduration);?>
        <?php print_string('eventtime', 'calendar');?>
        <?php print_time_selector('endhr', 'endmin', $form->timestart + $form->timeduration) ?>
        <?php if (isset($err['timeduration'])) formerr($err['timeduration']); ?>
      </div>
      <div>
        <input type="radio" name="duration" value="2" id="duration_minutes" <?php if($form->duration == 2) echo 'checked="checked"'; ?>/>
        <label for="duration_minutes"><?php print_string('durationminutes', 'calendar'); ?>:</label>
        <input type="text" name="minutes" size="3" value="<?php p($form->minutes); ?>" />
        <?php if (isset($err['minutes'])) formerr($err['minutes']); ?>
      </div>
    </td>
  </tr>
  <?php if($repeatcount > 1) { ?>
  <tr>
    <td style="vertical-align: top; text-align: right;">
      <?php print_string('eventrepeat', 'calendar'); ?>:
    </td>
    <td>
      <div>
        <input type="radio" name="repeats" value="1" id="edit_all" checked="checked" />
        <label for="edit_all">
          <?php print_string('repeateditall', 'calendar', $repeatcount); ?>
        </label>
      </div>
      <div>
        <input type="radio" name="repeats" value="0" id="edit_this" />
        <label for="edit_this">
          <?php print_string('repeateditthis', 'calendar'); ?>
        </label>
      </div>
    </td>
  </tr>
  <?php } ?>
  <tr>
    <td align="center" colspan="2"><p><input type="submit" value="<?php print_string('savechanges') ?>" /></p></td>
  </tr>
</table>
<p>
<input type="hidden" name="id" value="<?php echo $form->id; ?>" />
<input type="hidden" name="courseid" value="<?php echo $form->courseid; ?>" />
<input type="hidden" name="format" value="<?php echo $form->format; ?>" />
<input type="hidden" name="action" value="edit" />
<input type="hidden" name="course" value="<?php p($urlcourse); ?>" />
</p>
</form>

