{include file="public/header" /}
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>



<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>{$Think.lang.goods_class_index_class}</h3>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>
    
    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom">
            <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
            <span id="explanationZoom" title="收起提示" class="arrow"></span>
        </div>
        <ul>
            <li>{$Think.lang.goods_class_index_help1}</li>
            <li>{$Think.lang.goods_class_index_help2}</li>
            <li>{$Think.lang.goods_class_index_help3}</li>
        </ul>
    </div>
    
  <form method='post'>
    <table class="ds-default-table">
        <input type="hidden" name="submit_type" id="submit_type" value="" />
      <thead>
        <tr class="thead">
          <th></th>
          <th>{$Think.lang.ds_sort}</th>
          <th>{$Think.lang.goods_class_index_name}</th>
          <th>{$Think.lang.goods_class_add_type}</th>
          <th>{$Think.lang.goods_class_add_commis_rate}</th>
          <th></th>
          <th>{$Think.lang.ds_handle}</th>
        </tr>
      </thead>
      <tbody>
        <?php if(!empty($class_list) && is_array($class_list)){ ?>
        <?php foreach($class_list as $k => $v){ ?>
        <tr class="hover edit">
          <td class="w48"><input type="checkbox" name="check_gc_id[]" value="<?php echo $v['gc_id'];?>" class="checkitem">
            <?php if(isset($v['have_child']) && $v['have_child'] == '1'){ ?>
            <img fieldid="<?php echo $v['gc_id'];?>" status="open" nc_type="flex" src="{$Think.config.url_domain_root}static/admin/images/treetable/tv-expandable.gif">
            <?php }else{ ?>
            <img fieldid="<?php echo $v['gc_id'];?>" status="close" nc_type="flex" src="{$Think.config.url_domain_root}static/admin/images/treetable/tv-item.gif">
            <?php } ?></td>
          <td class="w48 sort"><span title="{$Think.lang.ds_editable}" ajax_branch="goods_class_sort" datatype="number" fieldid="<?php echo $v['gc_id'];?>" fieldname="gc_sort" nc_type="inline_edit" class="editable "><?php echo $v['gc_sort'];?></span></td>
          <td class="w50pre name">
          <span title="{$Think.lang.ds_editable}" required="1" fieldid="<?php echo $v['gc_id'];?>" ajax_branch="goods_class_name" fieldname="gc_name" nc_type="inline_edit" class="editable "><?php echo $v['gc_name'];?></span>
          <a class="btn-add-nofloat marginleft" href="{:url('/Admin/Goodsclass/goods_class_add',['gc_parent_id'=>$v.gc_id])}"><span>{$Think.lang.ds_add_sub_class}</span></a>
          </td>
          <td><?php echo $v['type_name'];?></td>
          <td><?php echo $v['commis_rate'];?> %</td>
          <td><?php if ($v['gc_virtual'] == 1) {?>虚拟<?php }?></td>
          <td class="w96">
              <a href="{:url('/Admin/Goodsclass/nav_edit',['gc_id'=>$v.gc_id])}">设置</a> | 
              <a href="{:url('/Admin/Goodsclass/goods_class_edit',['gc_id'=>$v.gc_id])}">{$Think.lang.ds_edit}</a> | 
              <a href="javascript:if(confirm('{$Think.lang.goods_class_index_ensure_del}'))window.location = '{:url('/Admin/Goodsclass/goods_class_del',['gc_id'=>$v.gc_id])}';">{$Think.lang.ds_del}</a>
          </td>
        </tr>
        <?php } ?>
        <?php }else { ?>
        <tr class="no_data">
          <td colspan="10">{$Think.lang.ds_no_record}</td>
        </tr>
        <?php } ?>
      </tbody>
      <?php if(!empty($class_list) && is_array($class_list)){ ?>
      <tfoot>
        <tr class="tfoot">
          <td><input type="checkbox" class="checkall" id="checkall_2"></td>
          <td id="batchAction" colspan="15"><span class="all_checkbox">
            <label for="checkall_2">{$Think.lang.ds_select_all}</label>
            </span>&nbsp;&nbsp;<a href="JavaScript:void(0);" class="btn" onclick="if(confirm('{$Think.lang.goods_class_index_ensure_del}')){$('#submit_type').val('del');$('form:first').submit();}"><span>{$Think.lang.ds_del}</span></a>
            </td>
        </tr>
      </tfoot>
      <?php } ?>
    </table>
  </form>
</div>

<!--<script type="text/javascript" src="{$Think.config.url_domain_root}static/plugins/jquery.edit.js" charset="utf-8"></script>-->
<script src="{$Think.config.url_domain_root}static/admin/js/jquery.goods_class.js"></script>
