<div class='companyInfo hide'>
  <?php foreach($depositors as $depositor):?>
  <?php $company = zget($companies, $depositor->company, '');?>
  <div id="company<?php echo $depositor->id;?>">
    <dl class='dl-horizontal'>
      <dt><?php echo $lang->depositor->company . $lang->colon;?></dt>
      <dd><?php echo zget($company, 'name', '');?></dd>
    </dl>
    <dl class='dl-horizontal'>
      <dt><?php echo $lang->company->taxNumber . $lang->colon;?></dt>
      <dd><?php echo zget($company, 'taxNumber', '');?></dd>
    </dl>
  </div>
  <?php endforeach;?>
</div>

<script>
$('.card-caption.row').each(function()
{
    var currentID = $(this).data('id');
    $(this).prepend($('.companyInfo div#company' + currentID).html());
})

$('.table > thead > tr > th').first().after($('.companyTH').html());

$('.table > tbody > tr').each(function()
{
    var currentID = $(this).data('id');
    $(this).find('td').first().after($('.companyInfo tr#company' + currentID).html());
})
</script>
