<!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" />
<script type="text/javascript" src="view/admin/js/basic.js"></script>
{literal}
<script type="text/javascript">
	function link(type) {		
		var logo = document.getElementById('logo');		
		switch (type) {
			case 1 :
				logo.style.display = '';
				break;
			case 2 :
				logo.style.display = 'none';				
				break;
		}
	}
	function updateAd() {
		var fm = document.contentjs;		
		if (fm.name.value == '') {
			alert('广告名称不得为空！');
			fm.name.focus();
			return false;
		}
		if (fm.name.value.length < 2) {
			alert('广告名称不得小于2位！');
			fm.name.focus();
			return false;
		}
		if (fm.name.value.length > 100) {
			alert('广告名称不得大于100位！');
			fm.name.focus();
			return false;
		}
		if (fm.url.value == '') {
			alert('广告链接地址不得为空！');
			fm.url.focus();
			return false;
		}
		if (fm.adindex.value == '') {
			alert('广告标识不得为空！');
			fm.adindex.focus();
			return false;
		}
		return true;
	}
</script>
{/literal}
</head>
<body>
<h2><a href="?a=ad">返回列表</a>界面管理 -- 修改广告</h2>
<form method="post" name="contentjs" action="?a=ad&m=update&id={$OneAd[0]->id}">
	<input type="hidden" value="{$OneAd[0]->id}" name="id" />	
	<div class="add_update">
		<table cellspacing="0">			
			<tr>
				<td></td>
				<td colspan="2">网站类型：<input type="radio" name="type" onclick="link(1)" value="1" checked="checked" />图片广告
									   <input type="radio" name="type" onclick="link(2)" value="2" /> 文字广告</td>
			</tr>
			<tr>
				<td class="text_right">广告名称：</td>
				<td class="text_left">
					<input type="text" class="text" name="name" value="{$OneAd[0]->name}" /> <span class="red">[必填]</span>
				</td>
			</tr>
			<tr>
				<td class="text_right">广告链接地址：</td>
				<td class="text_left">
					<input type="text" class="text" name="url" value="{$OneAd[0]->url}" /> <span class="red">[必填]</span>
				</td>
			</tr>
			<tr>
				<td class="text_right">广告标识：</td>
				<td class="text_left">
					<input type="text" class="text" name="adindex" value="{$OneAd[0]->adindex}" readonly="readonly"/> <span class="red">[提示：广告标识不能修改]</span>
				</td>
			</tr>			
			<tr id="logo">
				<td class="text_right">广告图片：</td>
				<td class="text_left">
				
					<input type="hidden" name="sourcepath" class="text"/> 
					<input type="text" class="input-text" name="site_logo" class="text" readonly="readonly" value="{$OneAd[0]->site_logo}" size=40 /> 
					<input type="button" value="上传缩略图" onclick="centerWindow('?a=upload&m=upfile&width=120&height=45','upfile','400','160')" />
					</br><img name="pic" src="{$OneAd[0]->site_logo}" style="dispaly:none;"/> <span style="color:red;">（*不能为空，必须是jpg,gif,png，并且200k内）</span>					
				</td>
			</tr>	
			<tr>
				<td></td>
				<td><input type="submit" name="send" value="新增广告" onclick="return updateAd();" class="submit level" /></td>
			</tr>
		</table>
	</div>
</form>
</body>
</html>