<?php if(isset($feedbackID)):?>
<?php $feedback  = $this->loadModel('feedback')->getByID($feedbackID);?>
<?php $inputHtml = html::hidden('feedback', (int)$feedbackID);?>
<?php
$replaceHtml  = "<td colspan='2' id='replaceFeedbackBox'>";
$replaceHtml .= "<div class='input-group' id='replaceFeedbackBox'>";
$replaceHtml .= '<div class="input-group">';
$replaceHtml .= '<div class="input-group-addon" style="min-width: 77px;">' . $lang->story->feedbackBy . '</div>';
$replaceHtml .= html::input('feedbackBy', $feedback->feedbackBy, "class='form-control' readonly");
$replaceHtml .= "<span class='input-group-addon'>" . $lang->story->notifyEmail . '</span>';
$replaceHtml .= html::input('notifyEmail', $feedback->notifyEmail, "class='form-control' readonly");
$replaceHtml .= '</div>';
$replaceHtml .= '</div>';
$replaceHtml .= '</td>';
?>
<script language='Javascript'>
$(function()
{
    $('#dataform').children('table').find('tr:last').children('td:last').append(<?php echo json_encode($inputHtml)?>);
    $("#navbar .nav li[data-id=browse]").addClass('active');
    $('#reviewerBox').attr('colspan', 2);
    $('#feedbackBox').replaceWith(<?php echo json_encode($replaceHtml);?>);

    $('#source').on('change', function()
    {   
        $('#reviewerBox').attr('colspan', 2); 
    });
})
</script>
<?php endif;?>
