<h1><?php echo $this->translate("unapproval.title.{$this->form_input['operation']}_confirm"); ?></h1>

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

<form action="<?php echo $this->appPath('controller'); ?>/approve_commit/" method="post">

<table class="form_2col" summary="<?php echo $this->translate('unapproval.caption.basic_info'); ?>">
<tbody>

<tr>
<th><?php echo $this->translate('inquiry.label.inquiry_id'); ?></th>
<td>
<?php echo $this->escape($this->form_input['id']); ?>
<input type="hidden" name="inquiry_id" value="<?php echo $this->escape($this->form_input['id']); ?>">
</td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.service_name'); ?></th>
<td>
<?php echo $this->service['name']; ?>
</td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.subject'); ?></th>
<td>
<?php echo $this->escape($this->form_input['subject']);  ?>
<input type="hidden" 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>
<?php echo $this->escape($this->form_input['received_from']);  ?>
<input type="hidden" name="received_from" value="<?php echo $this->escape($this->form_input['received_from']); ?>">
</td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.status'); ?></th>
<td>
<?php echo $this->status_options[$this->form_input['status']]; ?>
</td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.priority'); ?></th>
<td>
<?php echo $this->priority_options[$this->form_input['priority']]; ?>
<input type="hidden" name="priority" value="<?php echo $this->escape($this->form_input['priority']); ?>">
</td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.create_datetime'); ?></th>
<td><?php echo $this->escape($this->form_input['create_datetime']); ?></td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.registrant_name'); ?></th>
<td>
<?php echo $this->escape($this->form_input['registrant_name']); ?>
</td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.accept_datetime'); ?></th>
<td><?php echo $this->escape($this->form_input['accept_datetime']); ?></td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.accepter_name'); ?></th>
<td>
<?php echo $this->escape($this->form_input['accepter_name']); ?>
</td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.approver_name'); ?></th>
<td>
<?php echo $this->escape($this->form_input['approver_name']); ?>
</td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.content'); ?></th>
<td>
<?php echo nl2br($this->escape($this->form_input['content'])); ?>
<input type="hidden" name="content" value="<?php echo $this->escape($this->form_input['content']); ?>">
</td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.attach_file'); ?></th>
<td>
<ul>
<?php foreach ($this->form_input['attach_files'] as $attach_file) : ?>
<li>
<label for="attach_<?php echo $attach_file['id']; ?>"><?php echo $attach_file['name']; ?></label>
&nbsp;&nbsp;<a href="./inquiry/download_file/inquiry_id/<?php echo $this->form_input['id']; ?>/attach_file_id/<?php echo $attach_file['id']; ?>/">DL</a>
</li>
<?php endforeach; ?>
</ul>
</td>
</tr>

<?php if($this->form_input['operation'] == 'reject') { ?>
<tr>
<th><?php echo $this->translate('inquiry.label.memo'); ?></th>
<td>
<?php echo nl2br($this->escape($this->form_input['memo'])); ?>
<input type="hidden" name="memo" value="<?php echo $this->escape($this->form_input['memo']); ?>">
</td>
</tr>
<?php } ?>

</tbody>

<tfoot>
<tr>
<td colspan="2">
<input type="hidden" name="operation" value=""/>
<?php if($this->form_input['operation'] == 'approve'){ ?>
<input type="button" class="res_button" onClick="javascript: this.form.operation.value='approve'; this.form.submit();" value="<?php echo $this->translate('unapproval.operation.approve'); ?>"/>
<?php } ?>
<?php if($this->form_input['operation'] == 'reject') { ?>
<input type="button" class="res_button" onClick="javascript: this.form.operation.value='reject';  this.form.submit();" value="<?php echo $this->translate('unapproval.operation.reject'); ?>">
<?php } ?>
</td>
</tr>
</tfoot>

</table>

</form>
