{* <?php die('duotaopu');?> *}
{include file="common/header.php"}
<link rel="stylesheet" href="public/js/keditor/themes/default/default.css" />
<body class="body-main">
<div class="admin_notice"><span>管理操作：</span><a href="?m=shop&a=edit&id=0">添加店铺</a>　┊　<a href="?m=shop">店铺管理</a></div>
<br>
<ul id="admin_sub_title">
	<li class="sub"><a>{if $id==0}添加{else}编辑{/if}店铺</a></li>
	<li class="unsub"><a class="hand" id="search">搜索店铺</a></li>
</ul>
<style type="text/css">
#shoplogo, #biglogo {
  position: absolute;
  right: 3%;
  top: 110px;
}
</style>
<script>
$(function() {
	$("#search").click(function(){
		art.dialog({
			id:'s',
			title:'搜索',
			content:'关键词：<input name="keyword" type="text" class="input" id="keyword" value="" />',
			ok: function(){
				if($('#keyword').val()!='') location.href="?m=shop&q="+$('#keyword').val();
			}
		});
	});
	var editor = KindEditor.editor({
		allowImageUpload : true,
		fileManagerJson : 'public/js/keditor/php/file_manager_json.php',
		allowFileManager : true
	});
	$('#filemanager').click(function() {
		editor.loadPlugin('image', function() {
			editor.plugin.imageDialog({
				imageUrl : $('#logofile').val(),
				clickFn : function(url, title, width, height, border, align) {
					$('#logofile').val(url);
					$('#shoplogo').attr('src',url);
					editor.hideDialog();
				}
			});
		});
	});
});
function nopic(img){
	//var img=event.srcElement;
	img.src="public/images/nopic.gif";
	img.onerror=null;
}
function changrank(rank){
	$('#rankpic').attr('src',"public/images/tao/s_"+rank+".gif");
}
</script>
<div id="admin_right_b">
  <form method="post">
    <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" id="tagContent0">
	<tr>
      <td width="120" align="right" class="tdbg">标题：</td>
	  <input type="hidden" name="con[id]" value="{$id|default:0}">
      <td class="tdbg"><input name="con[shopname]" type="text" value="{$shopname}" class="input" size="50"> <select name="con[style1]">
				<option value="" >默认</option>
				<option value="color:#CC0000;" style="color:#CC0000;"{if stripos($style,'color:#CC0000;')>-1} selected{/if}>红色</option>
				<option value="color:#0000FF;" style="color:#0000FF;"{if stripos($style,'color:#0000FF;')>-1} selected{/if}>蓝色</option>
				<option value="color:#009900;" style="color:#009900;"{if stripos($style,'color:#009900;')>-1} selected{/if}>绿色</option>
				<option value="color:#996600;" style="color:#996600;"{if stripos($style,'color:#996600;')>-1} selected{/if}>咖啡色</option>
				<option value="color:#8142BF;" style="color:#8142BF;"{if stripos($style,'color:#8142BF;')>-1} selected{/if}>紫色</option>
				<option value="color:#FF6600;" style="color:#FF6600;"{if stripos($style,'color:#FF6600;')>-1} selected{/if}>橘黄色</option>
			</select>
			<select name="con[style2]">
				<option value="" >默认</option>
				<option value="font-weight:bold;"{if stripos($style,'font-weight:bold;')>-1} selected{/if}>加粗</option>
				<option value="text-decoration:underline;"{if stripos($style,'text-decoration:underline;')>-1} selected{/if}>下划线</option>
			</select></td>
    </tr>
	<tr>
      <td align="right" class="tdbg">分类：</td>
      <td class="tdbg"><select name="con[cid]">{$class_option}</select></td>
    </tr>

	<tr>
      <td width="120" align="right" class="tdbg">掌柜昵称(旺旺账号)：</td>
      <td class="tdbg"><input name="con[nickname]" type="text" value="{$nickname}" class="input" size="50"> <font color='red'>*</font></td>
    </tr>

	<tr>
      <td width="120" align="right" class="tdbg">综合评分：</td>
      <td class="tdbg"><input name="con[dynamic]" type="text" value="{$dynamic|default:'5.00'}" class="input" size="50"> <font color='red'>*</font> 0.01-5.00</td>
    </tr>

	<tr>
      <td width="120" align="right" class="tdbg">好评率%：</td>
      <td class="tdbg"><input name="con[percent]" type="text" value="{$percent|default:1000}" class="input" size="50"> <font color='red'>*</font> 如果是天猫填1000</td>
    </tr>

	<tr>
      <td width="120" align="right" class="tdbg">所属地区：</td>
      <td class="tdbg"><input name="con[area]" type="text" value="{$area}" class="input" size="50"> <font color='red'>*</font></td>
    </tr>

	<tr>
      <td width="120" align="right" class="tdbg">店铺链接：</td>
      <td class="tdbg"><input name="con[shopurl]" type="text" value="{$shopurl}" class="input" size="50"> <font color='red'>*</font> 店铺链接</td>
    </tr>

	<tr>
      <td width="120" align="right" class="tdbg"><font color='red'>淘客推广链接</font>：</td>
      <td class="tdbg"><input name="con[clickurl]" type="text" value="{$clickurl}" class="input" size="50"> <font color='red'>不填的话显示的是店铺链接</font></td>
    </tr>
	
	<tr>
      <td width="120" align="right" class="tdbg">店铺logo(80x80)：</td>
      <td class="tdbg"><input name="con[logo]" onkeyup="$('#shoplogo').attr('src',this.value);" id="logofile" onchange="$('#shoplogo').attr('src',this.value);" type="text" value="{$logo}" class="input" size="70">
	  <div class="aui_buttons"  style="text-align:left;display: inline;"><button type="button" style="margin-left: 0;" id="filemanager" class="uploadify-button">选择图片</button></div>
	<img id="shoplogo" width="80" onerror="nopic(this);" src="{$logo|default:'public/images/nopic.gif'}"></td>
    </tr>

	<tr>
      <td width="120" align="right" class="tdbg">店铺信誉：</td>
      <td class="tdbg"><select name="con[rank]" id="rank" onchange="changrank(this.value)">
							<option value="100"{if $rank=='100'} selected{/if}>天猫商城</option>
							<option value="1"{if $rank=='1'} selected{/if}>一心</option>
							<option value="2"{if $rank=='2'} selected{/if}>二心</option>
							<option value="3"{if $rank=='3'} selected{/if}>三心</option>
							<option value="4"{if $rank=='4'} selected{/if}>四心</option>
							<option value="5"{if $rank=='5'} selected{/if}>五心</option>
							<option value="6"{if $rank=='6'} selected{/if}>一钻</option>
							<option value="7"{if $rank=='7'} selected{/if}>二钻</option>
							<option value="8"{if $rank=='8'} selected{/if}>三钻</option>
							<option value="9"{if $rank=='9'} selected{/if}>四钻</option>
							<option value="10"{if $rank=='10'} selected{/if}>五钻</option>
							<option value="11"{if $rank=='11'} selected{/if}>一蓝冠</option>
							<option value="12"{if $rank=='12'} selected{/if}>二蓝冠</option>
							<option value="13"{if $rank=='13'} selected{/if}>三蓝冠</option>
							<option value="14"{if $rank=='14'} selected{/if}>四蓝冠</option>
							<option value="15"{if $rank=='15'} selected{/if}>五蓝冠</option>
							<option value="16"{if $rank=='16'} selected{/if}>一黄冠</option>
							<option value="17"{if $rank=='17'} selected{/if}>二黄冠</option>
							<option value="18"{if $rank=='18'} selected{/if}>三黄冠</option>
							<option value="19"{if $rank=='19'} selected{/if}>四黄冠</option>
							<option value="20"{if $rank=='20'} selected{/if}>五黄冠</option>
						</select> <img id="rankpic" src="public/images/tao/s_{$rank|default:100}.gif" style="vertical-align: middle;" /></td>
    </tr>

	<tr>
      <td width="120" align="right" class="tdbg">排序：</td>
      <td class="tdbg"><input name="con[order]" type="text" value="{$order|default:0}" class="input" size="20"> 数字越大越前面</td>
    </tr>
	
	<tr>
      <td width="120" align="right" class="tdbg">店铺类型：</td>
      <td class="tdbg"><input name="con[ismall]" type="radio" value="1" {if $ismall==1 or $ismall==''}checked{/if} />天猫商城 <input name="con[ismall]" type="radio" value="0" {if $ismall=='0'}checked{/if} />集市店铺 </td>
    </tr>
	
	<tr>
      <td width="120" align="right" class="tdbg">推荐：</td>
      <td class="tdbg"><input{if $flag=='c'} checked{/if} name="con[flag]" type="radio" value="c" />推荐 <input{if $flag=='0'  or $flag==''} checked{/if} name="con[flag]" type="radio" value="0" />不推荐</td>
    </tr>

	<tr>
      <td width="120" align="right" class="tdbg">店铺状态：</td>
      <td class="tdbg"><input name="con[isshow]" type="radio" value="1" {if $isshow==1 or $isshow==''}checked{/if} />已审 <input name="con[isshow]" type="radio" value="0" {if $isshow=='0'}checked{/if}/>未审</td>
    </tr>

	<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" >
		<tr class="tdbg">
		  <td width="100">&nbsp;</td>
		  <td><div class="aui_buttons"  style="text-align:left;"><button type="submit" id="dosave" class="aui_state_highlight">保存</button><button type="reset" class="aui_state_highlight">重置</button><button type="button" onClick="history.go(-1)" class="aui_state_highlight">返回</button></div></td>
		</tr>
	</table>
 </form>
<script type="text/javascript">
$("#dosave").click(function(){
		showDialog();
		$.ajax({
			type:"post",
			url:"?m=shop&a=do&do=update&_t="+Math.random()*10,
			data:$("form").serialize(),
			dataType:'json',
			timeout:28000,
			global:false,
			success:function(data){
				if(data.status==1){
					showAlert('success','恭喜你，修改成功','?m=shop&p={$smarty.get.p}');
				}else{
					showAlert('error',data.info);
				}
			}
		});
	 return false;
	});
</script>
<div class="runtime"></div>  
</div>
</body>
</html>