<h1><?php echo $this->translate("inquiry.title.{$this->action_prefix}input"); ?></h1>

<h2><?php echo $this->translate('inquiry.caption.input'); ?></h2>

<?php if(!empty($this->error_messages)) : ?>
<div id="errorMessage">
<ul>
<?php foreach($this->error_messages as $element_name => $element_mess) : ?>
<?php foreach($element_mess as $mess_key => $mess_value) :?>
<?php $field_name = ""; if (!empty($element_name)) $field_name = $this->translate("inquiry.label.$element_name");  ?>
<li><?php echo $field_name . $mess_value; ?></li>
<?php endforeach; ?>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>

<form action="<?php echo $this->appPath('controller') ."/". $this->action_prefix; ?>confirm" method="POST" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?php echo $this->escape($this->form_input['id']); ?>"/>
<input type="hidden" name="parent_inquiry_id" value="<?php echo $this->escape($this->form_input['parent_inquiry_id']); ?>"/>

<table class="form_2col">
<tbody>
<tr>
<th><?php echo $this->translate('inquiry.label.service_name'); ?></th>
<td>
<?php echo $this->service['name']; ?>
<input type="hidden" name="service_id" value="<?php echo $this->form_input['service_id']; ?>"/>
</td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.priority'); ?></th>
<td>
<input type="hidden" name="priority" value=""/>
<?php foreach ((array) $this->priority_options as $id => $value) : ?>
<?php $checked = ($id == $this->form_input['priority']) ? "checked=\"checked\"" : "" ; ?>
<input type="radio" name="priority" class="option" id="priority_<?php echo $this->escape($id); ?>" value="<?php echo $this->escape($id); ?>" <?php echo $checked; ?> />
<label class="option" for="priority_<?php echo $this->escape($id); ?>"><?php echo $this->escape($value); ?></label>
<?php endforeach; ?>
</td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.subject'); ?></th>
<td><input type="text" class="text_field" size="50" name="subject" value="<?php echo $this->escape($this->form_input['subject']); ?>" /></td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.received_from'); ?></th>
<td><input type="text" class="text_field" size="50" name="received_from" value="<?php echo $this->escape($this->form_input['received_from']); ?>" /></td>
</tr>


<tr>
<th><?php echo $this->translate('inquiry.label.content'); ?></th>
<td><textarea name="content" cols="60" rows="16"><?php echo $this->escape($this->form_input['content']); ?></textarea></td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.attach_file'); ?></th>
<td>
<input type="file" name="attach_files[]" class="multi" maxlength="3">
</td>
</tr>
</tbody>
<tfoot>

<tr>
<td colspan="2">
<input type="submit" style="width:80px;" name="submit" value="<?php echo $this->translate('common.operation.register'); ?>"/>
<input type="reset"  style="width:80px;" name="reset" value="<?php echo $this->translate('common.operation.reset'); ?>"/>
</td>
</tr>

</tfoot>
</table>

</form>

