{php include template("admin/header");}
<script src="<?php echo SITE_URL; ?>public/js/jquery.js" type="text/javascript"></script>
<script src="<?php echo SITE_URL; ?>js/ajaxfileupload.min.js" type="text/javascript"></script>
<script>
function insertMenu(){
	$("#before").before('<tr onmouseover="this.style.background=\'#F1F8FC\'" onmouseout="this.style.background=\'\'"><td><input class="input-text" style="width:20px;" name="sort[]" value="" /></td><td width="100"><input class="input-text" type="hidden" name="cate_id[]" value="" /><input class="input-text" style="width:100px;" name="cate_name[]" value="" /></td><td><input class="input-text" style="width:100px;" name="appname[]" value="" /></td><td><textarea name="seo_keywords[]" ></textarea></td><td><textarea name="seo_desc[]" ></textarea></td><td></td><td></td></tr>');
}
//设为显示
function isappnav(cate_id){
	$.ajax({
		type:"POST",
		url:"index.php?app=system&ac=sitenav&ts=isnav",
		data:"&cate_id="+cate_id,
		beforeSend:function(){},
		success:function(b){
			window.location.reload(true); 
		}
	})
}

//取消隐藏
function unisappnav(cate_id){
	$.ajax({
		type:"POST",
		url:"index.php?app=system&ac=sitenav&ts=unnav",
		data:"&cate_id="+cate_id,
		beforeSend:function(){},
		success:function(b){
				window.location.reload(true); 
		}
	})
}


function UploadShareImg(g_id){
	
	$("#l_"+g_id). show();
	$.ajaxFileUpload({
		url:"<?php echo SITE_URL; ?>index.php?app=share&ac=do&le=UploadTagImg&f=uploadShareImg_"+g_id,
		secureuri:false,
		dataType:'text',
		fileElementId:'uploadShareImg_'+g_id,
		success:function(result){
			$("#l_"+g_id).hide();
			var img_src = "<?php echo SITE_URL; ?>"+result;
			$("#a_"+g_id).css({"background-image":"url("+result+")","background-size":"30px 30px"});
			$("#img_url_"+g_id).attr("value",result);
			}
		}
	)}


</script>

<style>
.laoding { background-image: url(<?php echo SITE_URL; ?>images/ico-operating.gif);}
.zhu { border-color:#FFD0D0}
.puimg {
display: block;
float:left;
width: 30px;
height: 30px;
background: no-repeat url(<?php echo SITE_URL; ?>images/b1_wide_120802.png) center center;
text-indent: 9999999px;
border: #DDD 1px solid;
overflow: hidden;
line-height:30px;
}
	.tfile {
filter: alpha(opacity=0);
opacity: 0;
font-size: 16px;
height: 31px;
width: 31px;
margin-left:-31px;
overflow:hidden;
cursor: pointer;
}


</style>


<div class="midder">

<h2>手机分类设置</h2>

<div>
{php include template("admin/mobile_menu");}
<span style="color:#FF0000; font-size:12px;">该分类默认与web端相同，可以独立修改，同步分类即手机端对应web端的分类，如果只想在手机端显示的话，那么可以在后台分类管理里面添加一个分类，然后隐藏该分类，并同步到手机端，这样web端就不显示该分类，而手机端则正常显示！提示：修改后别忘了提交！</span>
<form method="POST" action="index.php?app=mobile&ac=admin&mg=setcate&ts=do_nav">

<table  cellpadding="0" cellspacing="0">
<tr class="old">
<td width="20">排序</td>
<td width="80">分类名称</td>
<td width="80">同步分类ID（请填ID）</td>
<td width="170">图标 (尺寸比例为正方形即可！为美观图片背景色请用#E7E7E7)</td>

<td width="38">删除</td>
</tr>

<!--{loop $sitenav $key $item}-->
<input type="hidden" name="cate_id[]" value="{$item[cate_id]}" />
<input type="hidden" name="img[]" id="img_url_{$item[cate_id]}" value="{$item[img]}" />
<tr onmouseover="this.style.background='#F1F8FC'" onmouseout="this.style.background=''">
<td><input class="input-text" style="width:30px;" name="sort[]" value="{$item[sort]}" /></td>
<td width="100"><input class="input-text" style="width:100px;" name="cate_name[]" value="{$item[cate_name]}" /></td>
<td width="100"><input class="input-text" style="width:100px;" name="tbcateid[]" value="{$item[tbcateid]}" /></td>
<td>
<a class="puimg" href="javascript:;" <!--{if $item[img]}-->
style="background-image:url({$item[img]});background-size:30px 30px;"<!--{/if}-->  class="zhu" id="a_{$item['cate_id']}">上传图片</a>
<input class="tfile PUB_PIC_FILE" name="uploadShareImg_{$item['cate_id']}" type="file" id="uploadShareImg_{$item['cate_id']}" onchange="return UploadShareImg({$item['cate_id']});">
<span id="l_{$item['cate_id']}" style="display:none">加载中...</span>   
                </td>

<td><a href="index.php?app=mobile&ac=admin&mg=setcate&ts=del&cate_id={$item[cate_id]}" onClick="return confirm('您确定要删除吗，如不确定请点取消')">删除</a></td>
</tr>

<!--{/loop}-->
<tr id='before' style=" display:none"><td></td><td></td><td></td><td></td><td></td></tr>


<tr><td></td><td><a href="javascript:void('0');" onclick="insertMenu();">点我添加分类</a></td><td></td><td></td><td></td></tr>

<tr>
<td></td><td><input class="btn btn_submit" type="submit" value="提 交" /></td><td></td><td></td><td></td>
</tr>

</table>

<div class="clear"></div>
<br />
</form>

</div>

</div>
{php include template("admin/footer");}