<?php
/**
 * The detail view file of depositor module of ZDOO.
 *
 * @copyright   Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Tingting Dai <daitingting@xirangit.com>
 * @package     depositor
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include $app->getModuleRoot() . 'common/view/header.html.php'; ?>
<div id='mainTitle' class='clearfix'>
  <div class='btn-toolbar pull-left'>
    <?php if(!isonlybody()):?>
    <?php echo html::a("javascript:history.go(-1);", '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, "class='btn btn-back'");?>
    <div class="divider"></div>
    <?php endif;?>
    <div class="page-title">
      <span class="label label-id"><?php echo $depositor->id?></span>
      <span class="text" title='<?php echo $depositor->abbr;?>'><?php echo $depositor->abbr;?></span>
      <span class='label label-info'> <?php echo zget($lang->depositor->publicList, $depositor->public, '');?></span>
    </div>
  </div>
</div>
<div class='main-row'>
  <div class='main-col col-8'>
    <?php echo $this->fetch('action', 'history', "objectType=depositor&objectID={$depositor->id}");?>
    <div class='main-actions'>
      <div class='btn-toolbar'>
      <?php
      $canEdit   = $this->depositor->isClickable($depositor, 'edit');
      $canCheck  = $this->depositor->isClickable($depositor, 'check');
      $canForbid = $this->depositor->isClickable($depositor, 'forbid');
      $canActive = $this->depositor->isClickable($depositor, 'activate');
      $canDelete = $this->depositor->isClickable($depositor, 'delete');

      echo html::backButton();
      echo "<div class='divider'></div>";
      if($canEdit) echo html::a(inlink('edit', "depositorID=$depositor->id"), $this->lang->edit, "class='btn btn-default' data-toggle='modal'");
      if($canCheck) echo html::a(inlink('check', "depositorID=$depositor->id"), $lang->depositor->check, "class='btn btn-default'");
      if($canForbid) echo html::a(inlink('forbid', "depositorID=$depositor->id"), $lang->depositor->forbid, "class='btn btn-default' data-toggle=modal");
      if($canActive) echo html::a(inlink('activate', "depositorID=$depositor->id"), $lang->depositor->activate, "class='btn btn-default' data-toggle=modal");

      commonModel::printLink('balance', 'browse', "depositorID=$depositor->id", $lang->depositor->balance, "class='btn btn-default' data-toggle='modal'");

      echo "<div class='divider'></div>";
      if($canDelete) echo html::a(inlink('delete', "depositorID=$depositor->id"), $lang->delete, "class='btn btn-default' class='deleter'");
      ?>
      </div>
    </div>
  </div>
  <div class='side-col col-4'>
    <div class='panel panel-block'>
      <div class='panel-heading'><strong><?php echo $lang->depositor->basicInfo;?></strong></div>
      <div class='panel-body'>
        <table class='table table-data table-basic'>
          <tr>
            <th class='w-80px'><?php echo $lang->depositor->type;?></th>
            <td><?php echo zget($lang->depositor->typeList, $depositor->type);?></td>
          </tr>

          <?php if($depositor->type != 'cash'):?>
          <tr>
            <th class='w-80px'><?php echo $lang->depositor->title;?></th>
            <td>
              <?php echo $depositor->title;?>
            </td>
          </tr>
          <tr>
            <th><?php echo $depositor->type == 'online' ? $lang->depositor->serviceProvider : $lang->depositor->bankProvider;?></th>
            <td><?php echo zget($lang->depositor->providerList, $depositor->provider);?> </td>
          </tr>
          <tr>
            <th><?php echo $lang->depositor->account;?></th>
            <td><?php echo $depositor->account;?></td>
          </tr>
          <?php endif;?>

          <?php if($depositor->type == 'bank'):?>
          <tr>
            <th><?php echo $lang->depositor->unionBankNo;?></th>
            <td><?php echo $depositor->unionBankNo;?></td>
          </tr>
          <?php endif;?>

          <tr>
            <th><?php echo $lang->depositor->currency;?></th>
            <td><?php echo zget($this->lang->currencyList, $depositor->currency);?></td>
          </tr>
          <tr>
            <th><?php echo $lang->depositor->status;?></th>
            <td><?php echo zget($lang->depositor->statusList, $depositor->status);?></td>
          </tr>
          <tr>
            <th><?php echo $lang->depositor->tags;?></th>
            <td><?php echo $depositor->tags;?></td>
          </tr>
          <tr>
            <th><?php echo $lang->depositor->createdBy;?></th>
            <td><?php echo zget($users, $depositor->createdBy) . $lang->at . formatTime($depositor->createdDate, DT_DATETIME1);?></td>
          </tr>
          <tr>
            <th><?php echo $lang->depositor->editedBy;?></th>
            <td><?php echo $depositor->editedBy ? zget($users, $depositor->editedBy) . $lang->at . formatTime($depositor->editedDate, DT_DATETIME1) : '';?></td>
          </tr>
        </table>
      </div>
    </div> 
  </div>
</div>
<?php include '../../common/view/footer.html.php';?>
