<!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>{echo: lp{m_u_center};/}</title>
<link rel="stylesheet" type="text/css" href="skin/{echo: $SYSINFO['templates'];/}/css/modules.css">
<style type="text/css">
th{background:#EFEFEF}
.red { color:red; }
td div {float:left; text-align:center; border: 1px solid #DADADA; margin: 5px; padding:2px; width:130px;}
td span {display:block; margin-left:10px;}
.imga {display:block; margin-bottom:4px; height:130px;}
</style>
</head>
<body>
<div class="header">{inc: require("shop/index_header.php");/}</div>
<div class="main">
	<div class="left_menu">
		{inc: require("modules/left_menu.php");/}
	</div>
	<div class="bigpart">
		<div class="title_uc"><h3>{echo: lp{m_shop_honor};/}</h3></div>
		<form action="do.php?act=shop_honor_update" method="post" name="form_shop_honor_update" enctype="multipart/form-data">
		<table width="98%" class="form_table">
			<tr><td class="center">
			{sta: if(!empty($honor_list)){
				foreach($honor_list as $value)[loop]}
			<div id="honor_{echo: $value['honor_id'];/}">
				<a href="javascript:;" onclick="if (confirm('{echo: lp{m_suredel_honor};/}')) dropImg('{echo: $value['honor_id'];/}')">[{echo: lp{m_del};/}]</a>
				<br />
				<a href="{echo: $value['honor_original'];/}" target="_blank" class="imga"><img src="{echo: $value['honor_thumb'];/}" class="img" onerror="this.src='skin/default/images/nopic.gif'"/></a>
				<input type="text" value="{echo: $value['honor_desc'];/}" size="15" name="old_img_desc[{echo: $value['honor_id'];/}]" maxlength="50" />
            </div>
			{sta: }}else [exc]}
				echo "{echo: lp{m_not_uploadimg};/}";
			{end:if/}
			</td></tr>
			<tr><td id="upload_img">
			<span><a href="javascript:addNewUploadSpan();">[+]</a> {echo: lp{m_img_desc};/}：<input type="text" name="img_desc[]" maxlength="50" /> {echo: lp{m_upload_file};/}：<input type="file" name="attach[]" /></span>
			</td></tr>
			<tr><td class="center"><input type="hidden" name="shop_id" value="{echo: $shop_id;/}" />
			<input type="submit" name="submit" value="{echo: lp{m_update_image};/}" /></td></tr>
		</table>
		</form>
	</div>
	<div class="clear"></div>
</div>
<div class="footer">{inc: require("shop/index_footer.php");/}</div>
<script language="JavaScript" src="servtools/ajax_client/ajax.js"></script>
<script language="JavaScript">
<!--
function addNewUploadSpan() {
	var upload_img = document.getElementById("upload_img");
	var newspan = document.createElement("span");
	newspan.innerHTML = '<a href="javascript:removeUploadSpan();">[-]</a> {echo: lp{m_img_desc};/}：<input type="text" name="img_desc[]" maxlength="50" /> {echo: lp{m_upload_file};/}：<input type="file" name="attach[]" />';
	upload_img.appendChild(newspan);
}

function removeUploadSpan() {
	var upload_img = document.getElementById("upload_img");
	var number = upload_img.children.length;
	var delnode = upload_img.children[number-1];
	upload_img.removeChild(delnode);
}

function dropImg(id) {
	ajax("do.php?act=shop_honor_drop","POST","id="+id+"&sid={echo: $shop_id;/}",function(data){
		if(data==1) {
			document.getElementById("honor_"+id).style.display='none';
		} else {
			alert('{echo: lp{m_delfail_tryagain};/}');
		}
	});
}
//-->
</script>
</body>
</html>
