<?php include_once(mvc::$cfg['PATH_TPL'].'public/topSeller.php');?>
<div class="maintb">
	<?php include_once(mvc::$cfg['PATH_TPL'].'seller/leftMenu.php');?>
<!-- 中间 -->
	<div class="main_middle">
	<form id="sortForm" method="post">
		<div class="containsubmit">
			<input type="button" class="btn btn btn-default" value="添加顶级分类" onclick="addTopChild(this)">
			<input type="button" myAttr='changetext' class="btn btn-info" value="全部展开" onclick="showHideTog(this)"/>
			<input type="button" onclick="submitCheck()" class="btn btn-danger" value="保存更改">
		</div>
		<table class="table table-bordered table-hover" id="sort_table">
			<thead>
				<tr>
					<th>分类名称</th>
					<th>店铺页默认展开</th>
					<th>排序</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			<?php if(!empty($sortArr)){ ?>
				<?php foreach ($sortArr as $key => $value) { ?>
					<tr conbineId="<?php echo $value['sort_id'];?>" myAttr="<?php echo $value['sort_id'];?>" class="level_1">
						<td>
							<i onclick="combineTree(this)" iconType="combine" class="icon icon_cright"></i>
							<input type="text" value="<?php echo $value['sort_name'];?>" submitcheck="checkval" name="data[<?php echo $value['sort_id'];?>][name]" class="form-control" placeholder="请输入分类名称">
							<i onclick="addChild(this,<?php echo $value['sort_id'];?>,'<?php echo $value['sot_path'];?>')" class="icon2 icon2_add"></i>
							<input type="hidden" class="seq" name="data[<?php echo $value['sort_id'];?>][seq]" value="<?php echo $value['sort_seq'];?>">
							<input type="hidden" name="data[<?php echo $value['sort_id'];?>][pid]" value="<?php echo $value['sot_psort_id'];?>">
							<input type="hidden" name="data[<?php echo $value['sort_id'];?>][path]" value="<?php echo $value['sot_path'];?>">
						</td>
						<td>
							<?php if($value['sort_open']==1){ ?>
								<i onclick="togSortOpenStatus(<?php echo $value['sort_id'];?>,'off',this)" class="imsg imsg_use"></i>
							<?php }else{ ?>
								<i onclick="togSortOpenStatus(<?php echo $value['sort_id'];?>,'on',this)" class="imsg imsg_unuse"></i>
							<?php }?>
						</td>
						<td>
							<i class="icon icon_top"></i>
							<i class="icon icon_up"></i>
							<i class="icon icon_down"></i>
							<i class="icon icon_foot"></i>
						</td>
						<td>
							<a href="/seller/productList?shopCate=<?php echo $value['sort_id'];?>" class="a_blue marr5" target="_blank">查看</a>
							<a href="javascript:" class="a_blue" onclick="checkDelShopSort(<?php echo $value['sort_id'];?>);">删除</a>
						</td>
					</tr>
				    <?php if(!empty($value['son'])){ ?>
					  <?php foreach($value['son'] as $kkey=>$vvalue) { ?>
						<tr  conbineId="tree_<?php echo $value['sort_id'];?>" myAttr="<?php echo $vvalue['sort_id'];?>" class="level_2 dispcont">
							<td style="padding-left:25px;">
								└--&nbsp;<input type="text" submitcheck="checkval" value="<?php echo $vvalue['sort_name'];?>"  name="data[<?php echo $vvalue['sort_id'];?>][name]"  class="form-control" placeholder="请输入分类名称">
								<input type="hidden" class="seq" name="data[<?php echo $vvalue['sort_id'];?>][seq]" value="<?php echo $vvalue['sort_seq'];?>">
								<input type="hidden" name="data[<?php echo $vvalue['sort_id'];?>][pid]" value="<?php echo $vvalue['sot_psort_id'];?>">
								<input type="hidden" name="data[<?php echo $vvalue['sort_id'];?>][path]" value="<?php echo $vvalue['sot_path'];?>">
							</td>
							<td>
							</td>						
							<td>
								<i class="icon icon_top"></i>
								<i class="icon icon_up"></i>
								<i class="icon icon_down"></i>
								<i class="icon icon_foot"></i>
							</td>
							<td>
								<a href="/seller/productList?shopCate=<?php echo $vvalue['sort_id'];?>" class="a_blue marr5" target="_blank">查看</a>
								<a href="javascript:" class="a_blue" onclick="checkDelShopSort(<?php echo $vvalue['sort_id'];?>);" >删除</a>
							</td>
						</tr>
					  <?php } ?>
				    <?php } ?>
			   <?php } ?>
			<?php } ?>
			</tbody>
			<tfoot>
			</tfoot>
		</table>
		<div class="containsubmit">
			<input type="button" class="btn btn-default" value="添加顶级分类" onclick="addTopChild(this)">
			<input type="button" myAttr='changetext' class="btn btn-info" value="全部展开" onclick="showHideTog(this)"/>
			<input type="button" onclick="submitCheck()" class="btn btn-danger" value="保存更改">
		</div>
	</form>
	</div>
	<div class="clear"></div>
</div>
<?php include_once(mvc::$cfg['PATH_TPL'].'public/footAll.php');?>
<script type="text/javascript">
$(document).ready(function(){
		SORTSHOP.moveIcon();
});
</script>