<?php
/**
 * The browse mapping relation view file of kingdee module of ZDOO.
 *
 * @copyright   Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Gang Liu <liugang@cnezsoft.com>
 * @package     kingdee
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../common/view/header.html.php';?>
<div id='menuActions'>
  <?php commonModel::printLink('kingdee', 'batchCreateMappingRelation', "company={$company}", "<i class='icon icon-plus'> </i>" . $lang->kingdee->batchCreateMappingRelation, "class='btn btn-primary'");?>
</div>
<div class='panel main-table' data-ride='table'>
  <table class='table has-sort-head'>
    <thead>
      <tr class='text-center'>
        <?php $vars = "company=$company&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
        <th class='w-60px'><?php commonModel::printOrderLink('id', $orderBy, $vars, $lang->mappingrelation->id);?></th>
        <th class='w-70px'><?php commonModel::printOrderLink('type', $orderBy, $vars, $lang->mappingrelation->type);?></th>
        <th class='w-160px'><?php commonModel::printOrderLink('depositor', $orderBy, $vars, $lang->mappingrelation->depositor);?></th>
        <th class='w-180px'><?php commonModel::printOrderLink('category',$orderBy, $vars, $lang->mappingrelation->category);?></th>
        <th class='w-140px'><?php commonModel::printOrderLink('product', $orderBy, $vars, $lang->mappingrelation->product);?></th>
        <th class='w-160px'><?php commonModel::printOrderLink('invoice', $orderBy, $vars, $lang->mappingrelation->invoice);?></th>
        <th class='w-80px'><?php commonModel::printOrderLink('saleType', $orderBy, $vars, $lang->mappingrelation->saleType);?></th>
        <th><?php commonModel::printOrderLink('account', $orderBy, $vars, $lang->mappingrelation->account);?></th>
        <th class='w-80px text-center'><?php echo $lang->actions;?></th>
      </tr>
    </thead>
    <?php foreach($relations as $key => $relation):?>
    <tr class='text-center'>
      <td><?php echo $key + 1;?></td>
      <td><?php echo zget($lang->mappingrelation->typeList, $relation->type);?></td>
      <td><?php echo zget($depositors, $relation->depositor, '');?></td>
      <td><?php echo zget($categories, $relation->category);?></td>
      <td><?php echo zget($products, $relation->product);?></td>
      <td><?php echo zget($lang->invoice->typeList, $relation->invoice, '');?></td>
      <td><?php echo zget($lang->invoice->saleTypeList, $relation->saleType, '');?></td>
      <?php $relationAccounts = explode(',', $relation->account);?>
      <td class='text-wrap text-left'><?php foreach($relationAccounts as $account) echo zget($accounts, $account) . ' ';?></td>
      <td class='text-center'>
        <?php commonModel::printLink('kingdee', 'editMappingRelation', "relationID={$relation->id}", $lang->edit, "data-toggle='modal'");?>
        <?php commonModel::printLink('kingdee', 'deleteMappingRelation', "relationID={$relation->id}", $lang->delete, "class='deleter'");?>
      </td>
    </tr>
    <?php endforeach;?>
  </table>
  <div class='table-footer'><?php $pager->show();?></div>
</div>
<?php include '../../common/view/footer.html.php';?>
