<?php
/**
 * The detail view file of budget module of ZDOO.
 *
 * @copyright   Copyright 2009-2017 青岛易软天创网络科技有限公司 
 * @license     商业软件，非开源软件
 * @author      Gang Liu <liugang@cnezsoft.com>
 * @package     budget 
 * @version     $Id$
 * @link        http://www.zdoo.com 
 */
?>
<?php include '../../common/view/header.html.php';?>
<div class='main-row'>
  <div class='main-col col-8'>
    <div class='panel panel-block'>
      <div class='panel-heading'><strong><?php echo $lang->budget->desc;?></strong></div>
      <div class='panel-body'>
        <p><?php echo $budget->desc;?></p>
      </div> 
    </div> 
    <?php echo $this->fetch('action', 'history', "objectType=budget&objectID=$budget->id");?>
    <div class='main-actions'>
      <div class='btn-toolbar'>
        <?php echo html::backButton();?>
        <div class='divider'></div>
        <?php if($budget->month == '' && $budget->week == ''):?>
        <?php commonModel::printLink('budget', 'edit',   "budgetID=$budget->id", $lang->edit, "class='btn btn-primary' data-toggle='modal'");?>
        <?php commonModel::printLink('budget', 'delete', "budgetID=$budget->id", $lang->delete, "class='btn btn-primary deleter'");?>
        <?php elseif($budget->week == ''):?>
        <?php commonModel::printLink('budget', 'batchCreate', "period=month&year=$budget->year&month=&week=&dept=$budget->dept", $lang->edit, "class='btn btn-primary'");?>
        <?php else:?>
        <?php commonModel::printLink('budget', 'batchCreate', "period=week&year=$budget->year&month=$budget->month&week=&dept=$budget->dept", $lang->edit, "class='btn btn-primary'");?>
        <?php endif;?>
      </div>
    </div>
  </div>
  <div class='side-col col-4'>
    <div class='panel panel-block'>
      <div class='panel-heading'>
        <strong><?php echo $lang->budget->basic;?></strong>
      </div>
      <div class='panel-body'>
        <table class='table table-data'>
          <tr>
            <th class='w-80px'><?php echo $lang->budget->id;?></th>
            <td><?php echo $budget->id;?></td>
          </tr>
          <tr>
            <th><?php echo $lang->budget->year;?></th>
            <td><?php echo $budget->year;?></td>
          </tr>
          <tr>
            <th><?php echo $lang->budget->dept;?></th>
            <td><?php echo zget($deptPairs, $budget->dept);?></td>
          </tr>
          <tr>
            <th><?php echo $lang->budget->amebaAccount;?></th>
            <td><?php echo zget($lang->budget->amebaAccountList, $budget->amebaAccount);?></td>
          </tr>
          <tr>
            <th><?php echo $lang->budget->tradeDept;?></th>
            <td><?php echo zget($deptPairs, $budget->tradeDept, '');?></td>
          </tr>
          <tr>
            <th><?php echo $lang->budget->line;?></th>
            <td><?php echo zget($productLines, $budget->line, '');?></td>
          </tr>
          <tr>
            <th><?php echo $lang->budget->product;?></th>
            <td><?php echo zget($products, $budget->product, '');?></td>
          </tr>
          <tr>
            <th><?php echo $lang->budget->category;?></th>
            <td><?php echo zget($categoryList, $budget->category, '');?></td>
          </tr>
          <tr>
            <th><?php echo $lang->budget->money;?></th>
            <td><?php echo $budget->money;?></td>
          </tr>
          <tr>
            <th><?php echo $lang->budget->createdBy;?></th>
            <td><?php echo zget($userList, $budget->createdBy);?></td>
          </tr>
          <tr>
            <th><?php echo $lang->budget->createdDate;?></th>
            <td><?php echo formatTime($budget->createdDate, DT_DATE1);?></td>
          </tr>
          <tr>
            <th><?php echo $lang->budget->editedBy;?></th>
            <td><?php echo zget($userList, $budget->editedBy);?></td>
          </tr>
          <tr>
            <th><?php echo $lang->budget->editedDate;?></th>
            <td><?php echo formatTime($budget->editedDate, DT_DATE1);?></td>
          </tr>
        </table>
      </div>
    </div>
  </div>
</div>
<?php include '../../common/view/footer.html.php';?>
