<h1><?php echo $this->translate('unaccept.title.view_detail'); ?></h1>

<h2><?php echo $this->translate('unaccept.caption.basic_info'); ?></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) :?>
<li><?php echo $this->translate("inquiry.label.$element_name") . $mess_value; ?></li>
<?php endforeach; ?>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>

<form action="<?php echo $this->appPath('controller'); ?>/accept_confirm/" method="POST" enctype="multipart/form-data">

<table class="form_2col">
<tbody>

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

<tr>
<th><?php echo $this->translate('inquiry.label.service_name'); ?></th>
<td>
<?php echo $this->service['name']; ?>
<?php if ($this->can_inquiry_accept) : ?>
<input type="hidden" name="service_id" value="<?php echo $this->escape($this->form_input['service_id']); ?>">
<?php endif; ?>
</td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.subject'); ?></th>
<td>
<?php if ($this->can_inquiry_accept) : ?>
<input type="text" size="80" name="subject" value="<?php echo $this->escape($this->form_input['subject']); ?>"></td>
<?php else : ?>
<?php echo $this->escape($this->form_input['subject']); ?>
<?php endif; ?>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.received_from'); ?></th>
<td>
<?php if ($this->can_inquiry_accept) : ?>
<input type="text" size="80" name="received_from" value="<?php echo $this->escape($this->form_input['received_from']); ?>"></td>
<?php else : ?>
<?php echo $this->escape($this->form_input['received_from']); ?>
<?php endif; ?>
</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 if ($this->can_inquiry_accept) : ?>
<input type="hidden" name="priority" value=""/>
<?php foreach ($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; ?> 
<?php else : ?>
<?php  echo $this->priority_options[$this->form_input['priority']]; ?>
<input type="hidden" name="priority" value="<?php  echo $this->form_input['priority']; ?>"/>
<?php endif; ?>
</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.content'); ?></th>
<td>
<?php if ($this->can_inquiry_accept) : ?>
<textarea name="content" cols="100" rows="15"><?php echo $this->escape($this->form_input['content']);?></textarea>
<?php else : ?>
<?php echo nl2br($this->form_input['content']); ?>
<?php endif; ?>
</td>
</tr>

<tr>
<th><?php echo $this->translate('inquiry.label.attach_file'); ?></th>
<td>
<?php if ($this->can_inquiry_accept) : ?>
<input type="file" name="attach_files[]" class="multi" maxlength="3">
<?php endif; ?>
<ul>
<?php $count=0; ?>
<?php foreach ($this->form_input['attach_files'] as $attach_file) : ?>
<li><?php echo $attach_file['name']; ?>
&nbsp;&nbsp;<a href="./inquiry/download_file/inquiry_id/<?php echo $this->form_input['id']; ?>/attach_file_id/<?php echo $attach_file['id']; ?>/">DownLoad</a>
<input type="hidden" name="attach_files[<?php echo $count; ?>][type]" value="<?php echo $attach_file['type']; ?>"/>
<input type="hidden" name="attach_files[<?php echo $count; ?>][name]" value="<?php echo $attach_file['name']; ?>"/>
<input type="hidden" name="attach_files[<?php echo $count; ?>][tmp_name]" value="<?php echo $attach_file['tmp_name']; ?>"/>
</li>
<?php $count++; ?>
<?php endforeach; ?>
</ul>
</td>
</tr>

<?php if ($this->form_input['status'] == '25') : ?>
<tr>
<th><?php echo $this->translate('inquiry.label.memo'); ?></th>
<td>
<?php echo nl2br($this->form_input['memo']); ?>
</td>
</tr>
<?php endif; ?>

</tbody>

<?php if ($this->can_inquiry_accept) : ?>
<tfoot>
<tr>
<td colspan="2">
<input type="submit" style="width:80px" value="<?php echo $this->translate('unaccept.operation.accept'); ?>" />
</td>
</tr>
</tfoot>
<?php endif; ?>

</table>
</form>

<br/>
<ul>
<li>&gt;&gt;&nbsp;&nbsp;<a href="<?php echo $this->appPath('controller'); ?>/view_list/service_id/<?php echo $this->service['id']; ?>"><?php echo $this->translate('unaccept.operation.back_list'); ?></a></li>
<li>&gt;&gt;&gt;&nbsp;&nbsp;<a href="<?php echo $this->appPath(''); ?>/inquiry/view_all/service_id/<?php echo $this->service['id']; ?>"><?php echo $this->translate('inquiry.operation.back_list'); ?></a></li>
</ul>
