<?php
/**
 * The edit view file of budget module of ZDOO.
 *
 * @copyright   Copyright 2009-2017 青岛易软天创网络科技有限公司(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     budget 
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../../sys/common/view/header.modal.html.php';?>
<?php js::set('desc', $lang->budget->tips->desc);?>
<form id='ajaxForm' method='post' action='<?php echo inlink('edit', "budgetID=$budget->id");?>'>
  <table class='table table-form'>
    <?php if(!$budget->month):?>
    <tr>
      <th class='w-80px'><?php echo $lang->budget->year;?></th>
      <td class='w-300px'><?php echo html::select('year', $yearList, $budget->year, "class='form-control chosen'");?></td>
      <td></td>
    </tr>
    <?php endif;?>
    <?php if($budget->month):?>
    <tr>
      <th class='w-80px'><?php echo $lang->budget->year;?></th>
      <td class='w-300px'>
        <?php echo zget($yearList, $budget->year);?>
        <?php echo html::hidden('year', $budget->year);?>
      </td>
      <td></td>
    </tr>
    <tr>
      <th><?php echo $lang->budget->month;?></th>
      <td>
        <?php echo zget($lang->budget->monthList, $budget->month);?>
        <?php echo html::hidden('month', $budget->month);?>
      </td>
      <td></td>
    </tr>
    <?php endif;?>
    <?php if($budget->week):?>
    <tr>
      <th><?php echo $lang->budget->week;?></th>
      <td>
        <?php echo zget($lang->budget->weekList, $budget->week);?>
        <?php echo html::hidden('week', $budget->week);?>
      </td>
      <td></td>
    </tr>
    <?php endif;?>
    <tr>
      <th><?php echo $lang->budget->amebaAccount;?></th>
      <td><?php echo html::select('amebaAccount', $lang->budget->amebaAccountList, $budget->amebaAccount, "class='form-control chosen'");?></td>
      <td></td>
    </tr>
    <tr>
      <th><?php echo $lang->budget->tradeDept;?></th>
      <td><?php echo html::select('tradeDept', $deptList, $budget->tradeDept, "class='form-control chosen'");?></td>
      <td></td>
    </tr>
    <tr>
      <th><?php echo $lang->budget->line;?></th>
      <td><?php echo html::select('line', $productLines, $budget->line, "class='form-control chosen'");?></td>
      <td></td>
    </tr>
    <tr>
      <th><?php echo $lang->budget->product;?></th>
      <td><?php echo html::select('product', $products, $budget->product, "class='form-control chosen'");?></td>
      <td></td>
    </tr>
    <tr>
      <th><?php echo $lang->budget->category;?></th>
      <td><?php echo html::select('category', $categoryList, $budget->category, "class='form-control chosen'");?></td>
      <td></td>
    </tr>
    <tr>
      <th><?php echo $lang->budget->lastMoney;?></th>
      <td><?php echo html::input('lastMoney', '', "class='form-control' disabled='disabled'");?></td>
      <td></td>
    </tr>
    <tr>
      <th><?php echo $lang->budget->money;?></th>
      <td><?php echo html::input('money', $budget->money, "class='form-control'");?></td>
      <td></td>
    </tr>
    <tr>
      <th><?php echo $lang->budget->desc;?></th>
      <td colspan='2'><?php echo html::textarea('desc', $budget->desc, "rows='3' class='form-control' placeholder='{$lang->budget->tips->desc}'");?></td>
    </tr>
    <tr>
      <th></th>
      <td colspan='2' class='form-actions'>
        <?php echo html::hidden('dept', $budget->dept);?>
        <?php echo html::submitButton();?>
      </td>
    </tr>
  </table>
</form>
<?php include '../../../sys/common/view/footer.modal.html.php';?>
