<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="gb2312">
<meta name="keywords" content="{$Meta_Keywords}">
<meta name="description" content="{$Meta_Description}">
<link type="text/css" rel="stylesheet" href="{$InstallDir}Skins/{$SkinDir}/Style/Style.css" />
<link type="text/css" rel="stylesheet" href="{$InstallDir}Skins/{$SkinDir}/Style/Coupon.css" />
<Script language="JavaScript" Src="{$InstallDir}Inc/Site.Js"></Script>
<Script language="JavaScript" Src="{$InstallDir}Inc/Menu.Js"></Script>
<meta name="generator" content="WRMPS {$SystemVersion}" />
<meta name="copyright" content="2004-2010 Wangren Inc." />
<title>登记优惠券 - {$ChannelName} - {$SiteTitle}</title>
<script>
function get_Code(){
document.getElementById("imgurl").src='{$InstallDir}inc/{$CodePlan}.asp?'+Math.random()
}

function ClickSubmit() {
  var Msg = "";
  if (document.myform.AreaID.value == ""){
    document.getElementById("AreaID1").innerHTML = "<font class=F03><strong>请选择所属地区</strong></font>";
    Msg = "Err";
  }
  if (document.myform.ClassID.value == ""){
    document.getElementById("ClassID1").innerHTML = "<font class=F03><strong>请选择所属分类</strong></font>";
    Msg = "Err";
  }
  if (document.myform.Title.value == ""){
    document.getElementById("Title1").innerHTML = "<font class=F03><strong>优惠券名称不能为空</strong></font>";
    Msg = "Err";
  }
  if (document.myform.Content.value == ""){
    document.getElementById("Content1").innerHTML = "<font class=F03><strong>请输入优惠券详细说明</strong></font>";
    Msg = "Err";
  }
    var objs = document.getElementsByName("AgioType");
    var i = 0;
	var selectedIndex;
    for (i=0; i<objs.length; i++){
        if (objs[i].checked){
            selectedIndex = objs[i].value;
            break;
        }
    }
    if(selectedIndex==0){
	  if(document.myform.Agio1.value==""){
        document.getElementById("Agio11").innerHTML = "<font class=F03><strong>您选择的折扣类型为折扣券，请填写相应的折扣额</strong></font>";
        Msg = "Err";
      }
      if (isNaN(document.myform.Agio1.value)){
        document.getElementById("Agio11").innerHTML = "<font class=F03><strong>折扣额只能为小数或数字</strong></font>";
        Msg = "Err";
      }
	}else if(selectedIndex==1){
	  if(document.myform.Agio2.value==""){
        document.getElementById("Agio21").innerHTML = "<font class=F03><strong>您选择的折扣类型为抵价券，请填写相应的抵价金额</strong></font>";
        Msg = "Err";
	  }
      if (isNaN(document.myform.Agio2.value)){
        document.getElementById("Agio21").innerHTML = "<font class=F03><strong>抵价金额只能为小数或数字</strong></font>";
        Msg = "Err";
      }
	}else{
	  if(document.myform.Agio3.value==""){
        document.getElementById("Agio31").innerHTML = "<font class=F03><strong>您选择的折扣类型为礼品券，请填写相应的礼品券名称</strong></font>";
        Msg = "Err";
	  }
	}
  if (document.myform.Begin.value == ""){
    document.getElementById("Begin1").innerHTML = "<font class=F03><strong>请选择优惠券开始时间</strong></font>";
    Msg = "Err";
  }
  if (document.myform.End.value == ""){
    document.getElementById("End1").innerHTML = "<font class=F03><strong>请选择优惠券结束时间</strong></font>";
    Msg = "Err";
  }
  if (document.myform.Pic.value == ""){
    document.getElementById("Pic1").innerHTML = "<font class=F03><strong>请至少上传一幅优惠券相关图片</strong></font>";
    Msg = "Err";
  }
  if ("{$IsIDCode}" == "True" && document.myform.Code.value == ""){
    document.getElementById("Code1").innerHTML = "<font class=F03><strong>请输入验证码</strong></font>";
    Msg = "Err";
  }
  if (Msg == ""){
	document.myform.submit();
  }else{
	return false;
  }
}
</script>
<style>
.Up{float:right;padding:5px;border:1px #cccccc solid;background:#EFEFEF}
.UpFont{font-weight:bold;padding:5px;border:1px #cccccc solid;background:#EFEFEF;text-align:center}
</style>
</head>
<body>
<div class=div>
{$My_通用_Hand}
</div>
<div class=div>
<Script language='JavaScript' Src='{$InstallDir}Inc/GetDate.Js'></Script>
<table width="80%" border="0" cellspacing="0" cellpadding="0" align="center" class=Table>
  <tr><td>
<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
		<form name="myform" method="post" action="{url:post}">
          <input name="Action" type="hidden" value="Save">
          <input name="ComID" type="hidden" value="{$ComID}">
          <tr><td colspan=2 height=20px></td></tr>
          <tr><td colspan=2 height=30px class=F14 style="border-bottom:1px #cccccc solid"><img src="{$InstallDir}Skins/{$SkinDir}/icon_04.gif" align=absmiddle onClick="show()"> <a><strong>选择分类</strong></a> (必选项)</td></tr>
          <tr>
            <td>
              <!--=======================-->
              <table width="100%" border="0" cellspacing="5" cellpadding="0" align="center">
                <tr>
                  <td width="17%" height=30px align=right><strong>选择地区 <font class=F03>*</font></strong></td>
                  <td class=Remark width="83%"><script language="JavaScript" src="{$InstallDir}Inc/Js/AreaPost.Js"></Script><br><span id=AreaID1></span></td>
                </tr>
                <tr id=AreaDBtr style='display:none'>
                  <td height=30px align=right><strong>相关区域　</strong></td>
                  <td class=Remark><span id=AreaDBShow></span></td>
                </tr>
                <tr>
                  <td height=30px align=right><strong>选择分类 <font class=F03>*</font></strong></td>
                  <td><script language="JavaScript" src="{$InstallDir}Inc/Js/CouponPost.Js"></Script><br><span id=ClassID1></span></td>
                </tr>
              </table>
              <!--=======================-->
            </td>
          </tr>
          <tr><td height=20></td></tr>
          <script language="JavaScript">
          function DBOption(t,sid){
            if (t=="AreaID"){
              areadbajax(sid,"",0);
            }else{
              dbajax(3,sid,0);
            }
          }
          </script>
          <tr><td colspan=2 height=30px class=F14 style="border-bottom:1px #cccccc solid"><img src="{$InstallDir}Skins/{$SkinDir}/icon_04.gif" align=absmiddle onClick="show()"> <a><strong>优惠券信息</strong></a> (打 <strong><font class=F03>*</font></strong> 为必填项)</td></tr>
          <tr>
            <td>
              <!--=======================-->
              <table width="100%" border="0" cellspacing="5" cellpadding="0" align="center">
                <tr>
                  <td width="17%" height=30px align=right><strong>优惠券名称 <font class=F03>*</font></strong></td>
                  <td class=Remark width="83%"><input name="Title" type="text" Style="width:400px" maxlength=50><br><span id=Title1></span></td>
                </tr>
                <tr>
                  <td height=30px align=right valign=top><strong>详细说明 <font Class=F03>*</font></strong></td>
                  <td class=Remark><textarea name="Content" style='height:150px;width:80%' onKeyUp="textLimitCheck(this,1000);"></textarea><br><span id=Content1></span></td>
                </tr>
                <tr>
                  <td height=30px align=right><strong>折扣类型 <font class=F03>*</font></strong></td>
                  <td><input type="radio" name="AgioType" value=0 checked onclick="agio1.style.display='';agio2.style.display='none';agio3.style.display='none';">折扣券　<input type="radio" name="AgioType" value=1 onclick="agio1.style.display='none';agio2.style.display='';agio3.style.display='none';">抵价券　<input type="radio" name="AgioType" value=2 onclick="agio1.style.display='none';agio2.style.display='none';agio3.style.display='';">礼品券</td>
                </tr>
                <tr id=agio1>
                  <td height=30px align=right><strong>折扣额 <font class=F03>*</font></strong></td>
                  <td class=Remark><input name="Agio1" type="text" Style="width:100px" maxlength=10> 折<br><span id=Agio11></span></td>
                </tr>
                <tr id=agio2 style="display:none">
                  <td height=30px align=right><strong>抵价金额 <font class=F03>*</font></strong></td>
                  <td class=Remark><input name="Agio2" type="text" Style="width:100px" maxlength=10> 单位：元<br><span id=Agio21></span></td>
                </tr>
                <tr id=agio3 style="display:none">
                  <td height=30px align=right><strong>礼品名称 <font class=F03>*</font></strong></td>
                  <td class=Remark><input name="Agio3" type="text" Style="width:200px" maxlength=50><br><span id=Agio31></span></td>
                </tr>
                <tr>
                  <td height=30px align=right><strong>针对项目</strong>　</td>
                  <td class=Remark><input name="Item" type="text" Style="width:200px" maxlength=50><br>如：全场项目</td>
                </tr>
                <tr>
                  <td height=30px align=right><strong>使用限制</strong>　</td>
                  <td class=Remark><input name="Circumscribe" type="text" Style="width:200px" maxlength=50><br>如：特价、酒水、套餐除外</td>
                </tr>
                <tr>
                  <td height=30px align=right><strong>开始时间 <font class=F03>*</font></strong></td>
                  <td class=Remark><input name="Begin" type="text" Style="width:100px" maxlength=10 readonly onClick='PopCalendar.show(document.myform.Begin, "yyyy-mm-dd", null, null, null, "11");'><a style='cursor:pointer;' onClick='PopCalendar.show(document.myform.Begin, "yyyy-mm-dd", null, null, null, "11");'><img src='../Images/other/Calendar.gif' border='0' align=absmiddle></a><br><span id=Begin1></span></td>
                </tr>
                <tr>
                  <td height=30px align=right><strong>结束时间 <font class=F03>*</font></strong></td>
                  <td class=Remark><input name="End" type="text" Style="width:100px" maxlength=10 readonly onClick='PopCalendar.show(document.myform.End, "yyyy-mm-dd", null, null, null, "11");'><a style='cursor:pointer;' onClick='PopCalendar.show(document.myform.End, "yyyy-mm-dd", null, null, null, "11");'><img src='../Images/other/Calendar.gif' border='0' align=absmiddle></a><br><span id=End1></span></td>
                </tr>
                <tr>
                  <td height=30px align=right><strong>预定电话</strong>　</td>
                  <td class=Remark><input name="Tel" type="text" Style="width:200px" maxlength=30></td>
                </tr>
                <tr>
                  <td height=30px align=right><strong>地址</strong>　</td>
                  <td class=Remark><input name="Address" type="text" Style="width:300px" maxlength=50></td>
                </tr>
				<tr>
				<td height=30px align=right><strong>标注地图</strong>　</td>
				<td class=Remark><input name=Coordinate type=hidden><a href=javascript:ShowDialog("{$Map}",600,400) class=red><img src="{$InstallDir}Skins/{$SkinDir}/icon_qi.gif" align="absmiddle" border="0"><span id=Add>标注地图位置</span></a> 标注后，店铺将定位到电子地图上。</td>
				</tr>
				<tr>
                  <td height=30px align=right valign=top><strong>上传文件<font class=F03>*</font></strong>　</td>
                  <td><div class="UpInput Remark"><input type="hidden" name="PicList"><select name=Pic onChange=PicReset(this.value) size=5 style="width:330px"></select><br>以此下拉框中的图片做为默认图片 <span id=Pic1></span><br><div id=PicUp style='display:none'><a name=Up></a><iframe id=up_iframe src="" width="320px"  height="100px" frameborder=0 scrolling=no></iframe></div><a href="#Up" onclick="document.getElementById('PicPreview').style.display='';document.getElementById('PicUp').style.display='';document.getElementById('up_iframe').src='../Plus/UpLoad/Index.asp?Type=9&User=3'"><img src={$InstallDir}Skins/{$SkinDir}/upfile.gif border=0></a></div>
				  <div class=Upfile><div style='width:120px; height:120px; z-index:1;overflow:auto;' class=updiv ID=PicPreview><Img src='{$InstallDir}Skins/{$SkinDir}/nopic.gif'></div></div>
				  </td>
				</tr>
                <tr>
                  <td height=30px align=right><strong>标签</strong>　</td>
                  <td class=Remark><input name="Tags" type="text" Style="width:300px" maxlength=50><br>多个关键字用英文逗号隔开</td>
                </tr>
                <tr {$IDCode}>
                  <td height=30px align=right><strong>验证码 <font class=F03>*</font></strong></td>
                  <td><input name=Code size=8 maxlength=6 onfocus="get_Code()"> <img src={$InstallDir}Skins/{$SkinDir}/code.gif id=imgurl align=absmiddle style='cursor:pointer' alt='验证码看不清楚?请点击刷新验证码' onclick="this.src='../inc/{$CodePlan}.asp?'+Math.random()"><br><span id=Code1></span></td>
                </tr>
              </table>
              <!--=======================-->
            </td>
          </tr>

          <tr>
            <td colspan=2 height=50px align=center><img src="{$InstallDir}Skins/{$SkinDir}/reg.gif" onClick="ClickSubmit();" style="cursor:pointer"></td>
          </tr>
        </form>
      </table>

  </td></tr>
</table>
</div>
{$ScriptCkeck}
{$My_Bottom}
</body>
</html>