<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>在线商城后台管理</title>
<link rel="stylesheet" type="text/css" href="view/admin/style/basic.css" />
<link rel="stylesheet" type="text/css" href="view/admin/js/css/jquery-ui.css" />
{literal}
<script>
function showJs(id) {
    var sbtitle = document.getElementById(id);
    sbtitle.colSpan = 4;
    if (sbtitle) {
        if (sbtitle.style.display == '') {
            sbtitle.style.display = 'none';
        } else {
            sbtitle.style.display = '';
            // sbtitle.colspan = 6;
            //sbtitle.setAttribute("colspan", "4"); 
        }
    }
}
</script>
{/literal}
</head>
<body>

<h2><a href="?a=ad&m=add">添加广告</a>界面管理 -- 广告列表</h2>
<div id="list">
	<table>
		<tr><th>广告名称</th><th>广告地址</th><th>广告类型</th><th>广告标识</th><th>操作</th></tr>
		{if $AllAd}
		{foreach from=$AllAd key=key item=value}
		<tr>		
			<td>{$value->name}</td>
			<td>{$value->url}</td>
			<td>{$value->type}</td>
			<td>{$value->adindex}</td>		
			<td><a href="javascript:showJs({$value->id})" title="查看js代码"><img src="view/admin/images/icon_view.gif" /></a> <a href="?a=ad&m=update&id={$value->id}"><img title="编辑" alt="编辑" src="view/admin/images/edit.gif"></a> <a href="?a=ad&m=delete&id={$value->id}" onclick="return confirm('你真的要删除吗？') ? true : false"><img title="删除" alt="删除" src="view/admin/images/drop.gif"></a></td>
		</tr>
		<tr id="{$value->id}" style="display:none;">		
			<td style="" colspan="5">
				<input value="<script language='javascript' src='data/adjs/{$value->adindex}.js'></script>" style="width:600px;">
			</td>
		</tr>		
		{/foreach}		
		{else}
		<tr><td colspan="5">对不起，没有任何数据</td></tr>
		{/if}
	</table>
</div>
<div id="page">{$page}</div>
<div style="width:100%;"><p style="text-align:center; color:red; padding:20px;"><span >温馨提示：点击查看按钮，就可以查看广告，复制广告的 "调用代码" 粘贴到模板相应位置即可!     [广告标识无法修改] </span></p></div>
</body>
</html>