<!--#include file="../Include/Char.jsp" -->
<!--#include file="../Include/Conn.jsp" -->
<!--#include file="../Include/const.jsp" -->
<%

'if CheckStr(Request("update"))="OK"  then
 ' m_linkman = CheckStr(Request("linkman"))
 ' if m_linkman <> "" then
 '   SQL="UPDATE CityCard_League SET linkman ='"& m_linkman &"' WHERE CompanyID="&ID 
 '   Conn.Execute SQL
 ' end if
  
 ' m_address = CheckStr(Request("address"))
 ' if m_address <> ""  then
 '   SQL="UPDATE CityCard_League SET address ='"& m_address &"' WHERE CompanyID="&ID 
 '   Conn.Execute SQL
 ' end if
 
' UploadImage = Request.Cookies("UploadImage") 
 'if UploadImage <> "" then
 '   SQL="UPDATE CityCard_League SET logo ='"& UploadImage &"' WHERE CompanyID="&ID 
  '  Conn.Execute SQL
 'end if
    
 ' m_tel = CheckStr(Request("tel"))
 ' m_email = CheckStr(Request("email"))
 ' m_website = CheckStr(Request("website"))
 ' m_post = CheckStr(Request("post"))
 ' m_traffic = CheckStr(Request("traffic"))
 ' m_content = CheckStr(Request("content"))
  'SQL="UPDATE CityCard_League SET tel ='"& m_tel &"',email = '"& m_email &"',website = '"& m_website &"' , post = '"& m_post &"',traffic = '"& m_traffic &"',content = '"& m_content &"' WHERE CompanyID='"& ID &"'"
 ' Conn.Execute SQL
  
 ' Response.Cookies("UploadImage") = ""
  
  'Response.Redirect("Index.jsp")
 ' Response.End()

'end if



if Request.ServerVariables("REQUEST_METHOD")="POST" then
   m_UserName = checkStr(Trim(Request.Form("txtUserName")))
   m_Password = checkStr(Trim(Request.Form("txtPassword")))
    m_rePassword = checkStr(Trim(Request.Form("re_txtPassword")))
     if m_username="" or m_password="" then
	 call msgbox("对不起，用户名与密码不能为空",1)
	response.end 
	 end if
	 if m_repassword<>m_password then
	 call msgbox("对不起，请确认输入的密码！",1)
	 response.end 
	 end if
   m_PayClass = checkStr(Trim(Request.Form("txtPayClass")))
 '  m_Operation = checkStr(Trim(Request.Form("txtOperation")))   
   m_CompanyName = checkStr(Trim(Request.Form("txtCompanyName")))
     if m_companyname="" then
	 call msgbox("对不起，商家名称不能为空",1)
	 response.end 
	 end if
   m_TypeID = Request.Form("TypeID")
   if instr(m_TypeID,":") <> 0 then
     m_CityTypeID = mid(m_TypeID,1,instr(m_TypeID,":")-1)
     m_AreaTypeID = mid(m_TypeID,instr(m_TypeID,":")+1)
   else
	 m_CityTypeID = 0
	 m_AreaTypeID = 0
   end if
   m_TradeType = checkStr(Trim(Request.Form("selTrade")))
  ' m_Grade = checkStr(Trim(Request.Form("selGrade")))
   m_Traffic = checkStr(Trim(Request.Form("Traffic")))
   m_Consume = checkStr(Trim(Request.Form("txtConsume")))
   m_Linkman = checkStr(Trim(Request.Form("Linkman")))
      if m_linkman="" then
	 call msgbox("对不起，联系人不能为空",1)
	 response.end 
	 end if
   m_BusinessHours = checkStr(Trim(Request.Form("txtBusinessHours")))
   m_BusinessHours2 = checkStr(Trim(Request.Form("txtBusinessHours2")))
   m_YouhuiTime = (Trim(Request.Form("txtYouhuiTime")))
   m_YouhuiTime2 = (Trim(Request.Form("txtYouhuiTime2")))
   m_Other = checkStr(Trim(Request.Form("txtOther")))
   m_Tbtj = checkStr(Trim(Request.Form("txtTbtj")))
      m_Agio = checkStr(Trim(Request.Form("txtAgio")))
    if m_Agio="" then
	 call msgbox("对不起，打折折扣不能为空",1)
	 response.end 
	 end if
   m_Tel = checkStr(Trim(Request.Form("Tel")))  
    if m_Tel="" then
	 call msgbox("对不起，联系电话不能为空",1)
	 response.end 
	 end if
   m_StarGrade = checkStr(Trim(Request.form("selStarGrade")))
   m_Address = checkStr(Trim(Request.Form("Address")))
     if m_Address="" then
	 call msgbox("对不起，商家地址不能为空",1)
	 response.end 
	 end if
   m_WebSite = checkStr(Trim(Request.Form("WebSite")))
   m_post = checkStr(Trim(Request.Form("post")))
   m_email = checkStr(Trim(Request.Form("email")))
  m_Car = checkStr(Trim(Request.Form("txtCar")))
   m_Commend = checkStr(Trim(Request.Form("txtCommend")))

   m_AgioContent = checkStr(Trim(Request.Form("txtAgioContent")))
   'm_Image = checkStr(Trim(Request.Form("txtImage")))
   m_Image1 = checkStr(Trim(Request.Form("txtImage1")))
   m_Image2 = checkStr(Trim(Request.Form("txtImage2")))
   m_Image3 = checkStr(Trim(Request.Form("txtImage3")))
   m_Image4 = checkStr(Trim(Request.Form("txtImage4")))
   'm_Image5 = checkStr(Trim(Request.Form("txtImage5")))
  ' m_UploadImage = Request.Cookies("UploadImage") '图片上传后的
   
   m_Intro = checkStr(rTrim(Request.Form("content")))
   
   m_uptype = checkStr(Trim(Request.Form("up_type")))'判定是/否为聚宝卡加盟商
   if m_uptype="" then
   m_uptype="0"
   end if
   m_uptype1 = checkStr(Trim(Request.Form("up_type1")))'判定是/否为手机短信加盟商
   if m_uptype1="" then
   m_uptype1="0"
   end if
   m_uptype=m_uptype&","&m_uptype1
   m_gettype = checkStr(rTrim(Request.Form("get_type")))
 if Request.Querystring("action")="Insert" then
    m_SQL = "Select * From CityCard_League Where username='"&m_UserName&"'"
	Set rs = conn.Execute(m_SQL)
	if not rs.Eof then
	   rs.Close
	   call msgbox("对不起，该用户名已存在，请更换用户名后再试",1)
	else
	  rs.Close
	  m_Sql = "Insert Into CityCard_League(username,password,name,iscard,operation,payclass,grade,hangyeid,stateid,cityid,traffic,Consume,linkman,startbusinesstime,endbusinesstime,starttime,endtime,businesstimecontent,tel,Car,Tbtj,cabaretgrade,address,email,post,website,tuijian,agio,agiocontent,content,adddate,ischecked,logo,logo1,logo2,logo3,logo4)"
	  m_Sql = m_Sql + "Values('"&m_UserName&"','"&m_Password&"','"&m_CompanyName&"','"&m_uptype&"','"&m_Operation&"','"&m_PayClass&"','"&m_gettype&"',"&m_TradeType&","&m_CityTypeID&","&m_AreaTypeID&",'"&m_Traffic&"','"&m_Consume&"','"&m_Linkman&"','"&m_BusinessHours&"','"&m_BusinessHours2&"','"&m_YouhuiTime&"','"&m_YouhuiTime2&"','"&m_Other&"','"&m_Tel&"','"&m_Car&"','"&m_Tbtj&"',"&m_StarGrade&",'"&m_Address&"','"&m_email&"','"&m_post&"','"&m_Website&"','"&m_Commend&"','"&m_Agio&"','"&m_AgioContent&"','"&m_Intro&"','"&now&"',0,'"&m_UploadImage&"','"&m_Image1&"','"&m_Image2&"','"&m_Image3&"','"&m_Image4&"')"
	conn.Execute(m_Sql)
	   Response.Cookies("UploadImage") = ""
	   call msgbox("恭喜您，您的加盟申请已经提交请等待审核！24小时之内我们会与您联系！","http://www.yclife.cn")
      response.end 
	 
     end if '//rs.eof
  end if
  
  
end if
 Response.Cookies("UploadImage") = ""
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=site_info(0)%> - 商家申请加盟</title>
<link href="../Include/Style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
</head>

<body onLoad="MM_preloadImages('images/xf_link1b.gif','images/xf_link2b.gif','images/xf_link3b.gif','images/xf_link4b.gif','images/xf_link5b.gif','images/ly_b_2b.gif','images/ly_b_4b.gif','images/ly_b_1b.gif','images/ly_b_3b.gif','images/ly_b_5b.gif')">

<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td width="170" height="500" valign="top" bgcolor="f5f5f5">
      <!--#include file="Left.jsp" -->
    </td>
    <td width="10" valign="top"></td>
    <td width="600" valign="top">
      <table width="600" border="1" cellpadding="0" cellspacing="5" bordercolor="e2e2e2" bgcolor="f5f5f5">
        <tr> 
          <td height="25" background="images/about_bj.gif" class="p4">&nbsp;<b>·申请加盟　　　　　<% response.write "<font color=ff0000>"&messagebox&"</font>"%></b></td>
        </tr>
      </table>
      <table width="600" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="5"></td>
        </tr>
        <tr> 
          <td height="1" background="images/line.gif" ></td>
        </tr>
      </table>
<%
   '   ID = Request.Cookies("UserID")
     ' SET rs=server.createobject("adodb.recordset")
   '   SQL="SELECT * FROM  CityCard_League WHERE CompanyID ="&ID
    '  rs.Open SQL,conn,1,1 




%>
      <TABLE class=Table_bg height=55 cellSpacing=1 cellPadding=0 width="89%" 
      align=center border=0>
        <TBODY>
          <TR> 
            <TD bgColor=#f7f7f7> <TABLE cellSpacing=0 cellPadding=0 width="99%" align=center 
border=0>
                <TBODY>
                  <TR> 
                    <TD style="LINE-HEIGHT: 180%"><FONT 
                  color=#ff6600>您所填写的资料必须通过我们客户服务人员的审核，<U>审核时间一般为24小时之内</U>， 为了确保您能够享受运城生活网的超值服务请务必认真填写您公司的详细信息</FONT></TD>
                  </TR>
                </TBODY>
              </TABLE>
            </TD>
          </TR>
        </TBODY>
      </TABLE>
      <table width="89%" height="436" border="0" align="center" cellpadding="4" cellspacing="2" bgcolor="#FFFFFF">
        <form name="form1" method="post" action="reginfo.jsp?action=Insert">
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="19" align="center">用 户 名：</td>
            <td width="88%"> <input name="txtUserName" type="text" size="15" maxlength="20"> 
              <font color="#FF0000"> * 注：用户名可以为字母、数字与汉字</font></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="19" align="center">密　　码：</td>
            <td width="88%"> <input name="txtPassword" type="password" size="15" maxlength="20"> 
              <font color="#FF0000">*</font> </td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="19" align="center">确认密码：</td>
            <td width="88%"> <input name="re_txtPassword" type="password" id="re_txtPassword" size="15" maxlength="20"> 
              <font color="#FF0000">*</font> </td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="8" colspan="2">&nbsp;&nbsp;
                <input name="up_type" type="checkbox" id="up_type" value="1">
                            聚宝卡加盟商
                            <input name="up_type1" type="checkbox" id="up_type1" value="1">
                            手机短信加盟商（平台开发中）</td>
          </tr>
          <tr bgcolor="f5f5f5">
            <td height="9" colspan="2">&nbsp;&nbsp;选择申请类型： 
              <select name="get_type" id="get_type">
			     <%
			   m_SQL = "SELECT F_ID,F_Value FROM citycard_grade ORDER BY F_ID "
			   Set rs = conn.Execute(m_SQL)
			   Do While Not rs.Eof
			     Response.write "<option value='"&rs(0)&"'>"&rs(1)&"</option>"
				 rs.MoveNext
			   Loop
			   rs.Close
			   %>
               </select>
              <a href="service_info.jsp" target="_blank">[<font color="#FF0000">查看商家类型服务说明</font></a>]</td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="19" align="center">商家名称：</td>
            <td width="88%"> <input name="txtCompanyName" type="text" size="36" maxlength="20"> 
              <font color="#FF0000">*</font></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="19" align="center">所属分类：</td>
            <td width="88%"> <select name="selBigCategory" onChange="TypeChange(this);" >
                <%
             m_SQL="Select F_ID,F_Value From T_CityType order by F_ID"
			 Set rs = conn.Execute(m_SQL)

			 mBigArray = rs.GetRows()
			 for i=0 to ubound(mBigArray,2)
			   m_SQL2="Select * From T_AreaType Where F_CityTypeID="&mBigArray(0,i)&" order by F_Grade"
			   Set rs = conn.Execute(m_SQL2)
			   strSmallCategory = mBigArray(0,i)&"-"
			   Do While not rs.Eof 
   			     strSmallCategory = strSmallCategory & rs("F_ID")&"+"&rs("F_Value")+"-"
				 rs.Movenext
			   Loop
			   Response.write "<option value="&strSmallCategory&">"&mBigArray(1,i)&"</option>"
			 next'for
          %>
              </select> <script language="javascript">                               
function TypeChange(theSelect)
{
var sTemp,sString,i,sBigTypeID;
sValue=theSelect.value;
sSubTypeArray=sValue.split("-");
sBigTypeID = sSubTypeArray[0];
sString="<select name='TypeID'>";
for(i=1;i<sSubTypeArray.length-1;i++)
{
 sTemp=sSubTypeArray[i].split("+");

 sString+="<option value='"+sBigTypeID+":"+sTemp[0]+"'>"+sTemp[1]+"</option>";
}
 sString+="<option value='"+sBigTypeID+":0'>全　部</option>";
sString+="</Select>"
form1.TypeID.outerHTML=sString;

}
</script> <select name="TypeID" >
              </select> <script language="javascript">TypeChange(form1.selBigCategory);</script></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="2" align="center">区　　域：</td>
            <td width="88%"> <select name="selTrade">
                <%
			   m_SQL = "SELECT F_ID,F_Value FROM T_TradeType ORDER BY F_ID "
			   Set rs = conn.Execute(m_SQL)
			   Do While Not rs.Eof
			     Response.write "<option value='"&rs(0)&"'>"&rs(1)&"</option>"
				 rs.MoveNext
			   Loop
			   rs.Close
			   %>
              </select></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="19" align="center">付款方式：</td>
            <td width="88%"> <input name="txtPayClass" type="text" size="21" maxlength="20"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="15" align="center">联 系 人：</td>
            <td> <input name="linkman" type="text" id="linkman" value="" size="10"> 
              <font color="#FF0000">*</font></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" align="center">商家地址：</td>
            <td> <input name="address" type="text" id="address" size="45"> <font color="#FF0000">*</font></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="17" align="center">停 车 位：</td>
            <td width="88%"> <input name="txtCar" type="text" size="36" maxlength="80"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="9" align="center">最低消费：</td>
            <td> <input name="txtConsume" type="text" size="36" maxlength="80">
              例：100RMB</td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="8" align="center">特别推荐：</td>
            <td> <input name="txtTbtj" type="text" size="50" > </td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="8" align="center">营业时间：</td>
            <td width="88%">自 
              <input name="txtBusinessHours" type="text" size="8" maxlength="80">
              至 
              <input name="txtBusinessHours2" type="text"  size="8" maxlength="80">
              例 16至21</td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="17" align="center">补充说明：</td>
            <td width="88%"> <input name="txtOther" type="text" size="36" maxlength="80"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="8" align="center">优惠期限：</td>
            <td width="88%">自 
              <input name="txtYouhuiTime" type="text" size="8" maxlength="80">
              至 
              <input name="txtYouhuiTime2" type="text" size="8" maxlength="80">
              例 2006-3-25至2006-8-25</td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="8" align="center">酒店星级：</td>
            <td width="88%"> <select name="selStarGrade">
                <%
			   m_SQL = "SELECT F_ID,F_Value FROM Tour_StarGradeType ORDER BY F_ID DESC"
			   Set rs = conn.Execute(m_SQL)
			   Do While Not rs.Eof
			     Response.write "<option value='"&rs(0)&"'>"&rs(1)&"</option>"
				 rs.MoveNext
			   Loop
			   rs.Close
			   %>
              </select>
              非酒店不需输入</td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="8" align="center"><font color="#FF6600">打折：</font></td>
            <td width="88%"> <input name="txtAgio" type="text" value="0" size="12" maxlength="20"> 
              <font color="#FF0000">* </font></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="8" align="center"><font color="#FF6600">折扣说明：</font></td>
            <td width="88%"> <textarea name="txtAgioContent" cols="50"></textarea></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" align="center">电　　话：</td>
            <td> <input name="tel" type="text" id="tel"> <font color="#FF0000">*</font></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" align="center">电子邮件：</td>
            <td> <input name="email" type="text" id="email"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" align="center">网　　址：</td>
            <td> <input name="website" type="text" id="website"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" align="center">邮　　编：</td>
            <td> <input name="post" type="text" id="post" size="8" maxlength="6"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" align="center">交通指向：</td>
            <td> <input name="traffic" type="text" id="traffic" size="35"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" align="center" valign="top">公司简介： </td>
            <td> <textarea name="content" cols="55" rows="10" id="content"></textarea></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" valign="top">&nbsp;</td>
            <td> <input type="submit" name="Submit" value="申请加盟"> <input type="reset" name="Submit2" value="取 消"></td>
          </tr>
        </form>
      </table> </td>
  </tr>
</table>

</body>
</html>
