<?php if(!empty($companies)):?>
<?php
$companies   = html::select('company', $companies, $company, "class='form-control chosen'");
$companyHTML = <<<EOT
  <th class='w-40px'>{$lang->company->common}</th>
  <td class='w-300px'>{$companies}</td>
EOT;
?>
<script>
    $('#checkForm #depositor').parents('tr').prepend(<?php echo helper::jsonEncode($companyHTML);?>);
    $('#company').change(function()
    {
        var depositor = $('#depositor').val();
        $('#depositor').load(createLink('cash.depositor', 'ajaxGetDepositors', 'company=' + $(this).val()), function()
        {
            $('#depositor').val(depositor).trigger('chosen:updated');
        });
    });
    if($('#company').length > 0) $('#company').change();
</script>
<?php endif;?>
