<!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 = 'none';
				break;
			case 2 :
				logo.style.display = '';
				break;
		}
	}
	function checkLink() {
		var fm = document.contentjs;
		
		if (fm.webname.value == '') {
			alert('友情链接名称不得为空！');
			fm.webname.focus();
			return false;
		}
		if (fm.webname.value.length < 2) {
			alert('友情链接名称不得小于2位！');
			fm.webname.focus();
			return false;
		}
		if (fm.webname.value.length > 100) {
			alert('友情链接名称不得大于100位！');
			fm.webname.focus();
			return false;
		}
		if (fm.weburl.value == '') {
			alert('网站地址不得为空！');
			fm.weburl.focus();
			return false;
		}
		if (fm.weburl.value.length < 2) {
			alert('网站地址不得小于2位！');
			fm.weburl.focus();
			return false;
		}
		if (fm.weburl.value.length > 100) {
			alert('网站地址不得大于100位！');
			fm.weburl.focus();
			return false;
		}
		return true;
	}
</script>
{/literal}
</head>
<body>
<h2><a href="?a=link">返回列表</a>界面管理 -- 修改友情链接条</h2>
<form method="post" name="contentjs" action="?a=link&m=update&id={$OneLink[0]->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" /> Logo链接</td>
			</tr>
			<tr>
				<td class="text_right">网站名称：</td>
				<td class="text_left">
					<input type="text" class="text" name="webname" value="{$OneLink[0]->webname}"/> <span class="red">[必填]</span>
				</td>
			</tr>
			<tr>
				<td class="text_right">网站地址：</td>
				<td class="text_left">
					<input type="text" class="text" name="weburl" value="{$OneLink[0]->weburl}"/> <span class="red">[必填]</span>
				</td>
			</tr>
			<tr>
				<td class="text_right">排　　序：</td>
				<td class="text_left">
					<input type="text" class="text" name="sort" value="{$OneLink[0]->sort}"/>
				</td>
			</tr>
			<tr id="logo" style="display:none;">
				<td class="text_right">Logo地址：</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="{$OneLink[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="{$OneLink[0]->site_logo}"/> <span style="color:red;">（*不能为空，必须是jpg,gif,png，并且200k内）</span>			
				</td>
			</tr>
			<tr>
				<td class="text_right">站 长 名：</td>
				<td class="text_left">
					<input type="text" class="text" name="user" value="{$OneLink[0]->user}"/>
				</td>
			</tr>
			<tr>
				<td></td>
				<td><input type="submit" name="send" value="修改友情链接" onclick="return checkLink();" class="submit level" /></td>
			</tr>
		</table>
	</div>
</form>

</body>
</html>