<?php
/*
	[Phpup.Net!] (C)2009-2011 Phpup.net.
	This is NOT a freeware, use is subject to license terms

	$Id: admin.class.php 2010-08-24 10:42 $
*/

if(!defined('IN_PHPUP')) {
	exit('Access Denied');
}
?>
<?php include ROOT_PATH.'/views/admin/header.php';?>
<body>
<script type="text/javascript">
<!--
	function addcate()
	{
		url=site_root+"/index.php?pluginid=coupon&con=admin&act=catemodify";
		$.get(url,{},
		function(data){
			$('#dialog').html(data);
		});
		$('#blurdiv').show();
		$('#blurdiv').height($(document).height());
		$('#dialog').dialog('open');
		$('#dialog').dialog({
			title:'添加分类',
			width: 300,
			height:150,
			buttons: {},
			close:function(){$('#blurdiv').hide();$('#dialog').html('');}
		});
	}
	function parseMyCateData(data)
	{
		var objdata=data;
		if(objdata.dotype=='add')
		{
			$('#cate0').append('<TR class="tr1" id="cate'+objdata.id+'"><TD><div id="catename-'+objdata.id+'" onmouseover="this.style.backgroundColor=\'#ff8800\';" onmouseout="this.style.backgroundColor=\'\';" onclick="modifyValue(\'catenameinput-'+objdata.id+'\');">'+objdata.catename+'</div><input class="hideinput" id="catenameinput-'+objdata.id+'" ondblclick="confirmValue(\'plugin_coupon_cate\',this.value,\'catenameinput-'+objdata.id+'\',\'id\');"></TD><TD><A HREF="javascript:deleteVal(\'plugin_coupon_cate\',\''+objdata.id+'\',\'cate'+objdata.id+'\')">删除</A></TD></TR>');
			
		}
		Dialog_close();
	}
//-->
</script>

<div class="subnav">
	<div class="content-menu ib-a blue line-x">
	<a href="javascript:addcate(0);" class="add fb"><em>添加分类</em></a>
	</div>
</div>
<div class="table-list">
<TABLE cellpadding="1" cellspacing="1" style="width:300px;">
<thead>
<TR>
	<TH>类别</TH>
	<TH>操作</TH>
</TR>
</thead>
<tbody id="cate0">
<?php foreach($cates as $key=>$val){?>
<TR class="tr1" id="cate<?php echo $val['id'];?>">
	<TD>
	<div id="catename-<?php echo $val['id'];?>" onmouseover="this.style.backgroundColor='#ff8800';" onmouseout="this.style.backgroundColor='';" onclick="modifyValue('catenameinput-<?php echo $val['id'];?>');"><?php echo $val['catename'];?>
</div>
<input class="hideinput" id="catenameinput-<?php echo $val['id'];?>" ondblclick="confirmValue('plugin_coupon_cate',this.value,'catenameinput-<?php echo $val['id'];?>','id');">
	</TD>
	<td width="170px" align="center">
	<A HREF="javascript:deleteVal('plugin_coupon_cate','<?php echo $val['id'];?>','cate<?php echo $val['id'];?>')">删除</A>
	</td>
</TR>

<?php }?>
</tbody>
</TABLE>
</div>
<div id="dialog" style="display:none;"><IMG SRC="<?php echo STATIC_ROOT;?>/views/js/i/032.gif" WIDTH="32" HEIGHT="32" BORDER="0" ALT=""></div>
<div style="z-index: 1000; background-color: rgb(0, 0, 0); visibility: visible; display: none; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; width:100%;filter:alpha(opacity=50); opacity: 0.5; -moz-opacity:0.5;" id="blurdiv"></div>
</body>
</html>
