<?php
/**
 * Screen collectdata\endcollect
 * @version 1.0.1
 * @package Backend\DataRecords
 * 
*/


if ($this->data['closemodal']){ ?>

<script>
$(function() {
	window.parent.location.replace("<?= __SITEBASE ?>/collectdata/");
	}
);
</script>

<?php } else {

$currentstatus = $this->data['currentstatus'];	
$availablestatus = $this->data['availablestatus'];
$responsestatus = $this->data['responsestatus'];

?>
<center>
<h1><?= R('collect_annotation') ?></h1>
<br>
<form class="form-horizontal" action="<?= __SITEBASE ?>/collectdata/end"  method="post">
<textarea cols="60" rows="15" name="annotation"><?= $responsestatus->annotation ?></textarea>
<br>
<br>
<?= R('collect_status') ?>: <select name="statuscodeid">
<?php  foreach($availablestatus as $item) { ?>
   		<option value="<?= $item->to_statecode_id ?>" <?= ($currentstatus == $item->to_statecode_id) ? "selected" : "" ?>><?= D($item->to_statecode__description) ?></option>
<?php  } ?>
</select>
<br>
<br>
<button type="submit" class="btn btn-default"><?= R('save')?></button>&nbsp;&nbsp;<button type="button" onclick="window.parent.location.replace('<?= __SITEBASE ?>/collectdata/');" data-dismiss="modal" class="btn btn-default"><?= R('cancel')?></button>
</form>
</center>
<?php } ?>