<?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 LANGUAGE="JavaScript">

	function add_bizgroup()
	{
		url=site_root+"/index.php?con="+adminpath+"&act=bizgroupmodify";
		$.get(url,{},
		function(data){
			$('#dialog').html(data);
		});
		$('#blurdiv').show();
		$('#blurdiv').height($(document).height());
		$('#dialog').dialog('open');
		$('#dialog').dialog({
			title:'添加商圈',
			width: 400,
			height:250,
			buttons: {},
			close:function(){$('#blurdiv').hide();$('#dialog').html('');}
		});
	}
	function modifybizgroup(id)
	{
		url="index.php?con="+adminpath+"&act=bizgroupmodify&updateid="+id;
		$.get(url,{},
		function(data){
			$('#dialog').html(data);
		});
		$('#blurdiv').show();
		$('#blurdiv').height($(document).height());
		$('#dialog').dialog('open');
		$('#dialog').dialog({
			title:'添加商圈',
			width: 400,
			height:250,
			buttons: {},
			close:function(){$('#blurdiv').hide();$('#dialog').html('');}
		});
	}
	function parseMyData(data)
	{
		var objdata=data;
		if(objdata.dotype=='update')
		{
			$('#cityname-'+objdata.id).html(objdata.cityname);
			$('#bizname-'+objdata.id).html(objdata.bizname);
			Dialog_close();
		}
		else
		{
			$('#city0').append('<TR class="tr1" id="bizgroup'+objdata.id+'"><TD style="text-align:center;"  id="cityname-'+objdata.id+'">'+objdata.cityname+'</TD><TD  style="text-align:center;"  id="bizname-'+objdata.id+'" >'+objdata.bizname+'</TD><td align="center"><A href="javascript:modifybizgroup('+objdata.id+');">修改</A>&nbsp;&nbsp;<A HREF="javascript:deleteVal(\'bizgroup\',\''+objdata.id+'\',\'bizgroup'+objdata.id+'\',\'id\')">删除</A></td></TR>');
			Dialog_close();
		}
	}
	</SCRIPT>
		<div class="subnav">
			<div class="content-menu ib-a blue line-x">
			<a href="javascript:add_bizgroup();" class="add fb"><em>添加商圈</em></a>
		</div>
        <div class="table-list">
            <TABLE cellpadding="1" cellspacing="1" width="70%">
                <thead>
                    <TR>
                        <TH>城市</TH>
                        <TH>商圈</TH>
                        <TH>操作</TH>
                    </TR>
                </thead>
                <tbody id="city0">
                    <?php foreach ($bizgroup['data'] as $key => $val) { ?>
                        <TR class="tr<?php echo $key % 2; ?>" id="bizgroup<?php echo $val['id']; ?>">
                            <TD align="center" id="cityname-<?php echo $val['id']; ?>">
                                <?php echo $val['cityname']; ?>
                            </TD>

							<TD align="center" id="bizname-<?php echo $val['id']; ?>">
                                <?php echo $val['bizname']; ?>
                            </TD>                         

                            <TD align="center">
								<A HREF="javascript:modifybizgroup('<?php echo $val['id'];?>');">修改</A>
                                <A HREF="javascript:deleteVal('bizgroup','<?php echo $val['id']; ?>','bizgroup<?php echo $val['id']; ?>','id')">删除</A>
                            </TD>
                        </TR>
                    <?php } ?>
                </tbody>
            </TABLE>
        </div>
        <div class="pages" style="padding:10px;"><?php echo $bizgroup['pageinfo']; ?></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>
