<?php 
include_once(''.P.'/public/header.html');
?>

<script type="text/javascript" src="res/bootstrapplugin/jquery-bootstable.js"></script>


<script>

function initbody(){
	
	table = $('#viewshow').bootstable({
		url:'index.php?m=agent&a=data',method:'get',celleditor:true,table:'0',
		cellurl:'index.php',fanye:false,cellurl:'index.php?m=agent&a=savecell',
		columns:[{
			text:'图标',dataIndex:'picurl',renderer:function(v){
				if(v)v='<img src="'+v+'" width="30">';
				return v;
			}
		},{
			text:'名称',dataIndex:'name',editor:true
		},{
			text:'agentkey',dataIndex:'agentkey',editor:true
		},{
			text:'系统地址',dataIndex:'callurl',editor:true
		},{
			text:'操作时间',dataIndex:'optdt',sortable:true
		},{
			text:'状态',dataIndex:'status',sortable:true,type:'checkbox',editor:true
		},{
			text:'ID',dataIndex:'id'
		},{
			text:'客服人员',dataIndex:'kefulist'
		},{
			text:'',dataIndex:'opts',renderer:function(s,d){
				return '<a class="zhu" href="?m=agent&a=form&id='+d.id+'">编辑</a>&nbsp;<a class="zhu" href="javascript:;" onclick="deleterecord('+d.id+',0,false)">删</a>&nbsp;<a href="javascript:;" onclick="getcode(\''+d.agentkey+'\')">获取引入代码</a>';
			}
		}]
		
		
	});
}
function getcode(id){
	var str = '&lt;script src="'+NOWURL+'?m=front&key='+id+'"&gt;&lt;/script&gt;';
	js.alert('在你的页面引入如下代码：<br>'+str);
}
</script>
</head>

<body style="background:#f1f1f1">

<?php 
include_once(''.P.'/public/top.html');
?>

<div align="center">

<div style="width:<?=$maxwidth?>;margin:20px 0px" align="left">
	<div style="color:#cccccc">
		<a href="?m=index" class="zhu">平台首页</a> &gt;
		<a href="" class="zhu">应用管理</a>
	</div>
	<div style="background-color:white;margin:20px 0px;border:1px #eeeeee solid;min-height:500px;border-radius:5px">
		<div style="padding:10px">
			<div style="padding:5px 0px"><a class="webbtn" style="border-radius:5px" href="?m=agent&a=form&id=0">新增</a></div>
			<div class="blank10"></div>
			<div id="viewshow"></div>
		</div>
	</div>
</div>



<?php 
include_once(''.P.'/public/footer.html');
?>
</div>

</body>
</html>