<!--#include file="../Include/Char.asp" -->
<!--#include file="../Include/Conn.asp" -->
<%
if trim(Request.Cookies("UserID")) = "" or trim(Session("UserID"))=""  THEN
     Response.Redirect("Login.asp")
	 Response.End()
   end if

 ID = Request.cookies("UserID")

if CheckStr(Request("update"))="OK"  then
     
  m_linkman = CheckStr(Request("linkman"))
  if m_linkman = "" then
   call msgbox("对不起，联系人不能为空",1)
	  response.end()
  '  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
  call msgbox("对不起，商家地址不能为空",1)
	  response.end()
  '  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 = Request("content")
  m_content=replace(m_content," ","&nbsp;")
m_content=replace(m_content,"  ","&nbsp;&nbsp;")
m_content=replace(m_content,vbcrlf,"<br>")
  t2 = CheckStr(Request("t2"))
     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
   ' on error resume next
   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_TradeType = checkStr(Trim(Request.Form("selTrade")))
   m_Consume = checkStr(Trim(Request.Form("txtConsume")))
   if m_Consume = "" then m_Consume = "附近没有学校" 
   m_StarGrade = checkStr(Trim(Request.form("selStarGrade")))
   m_Car = checkStr(Trim(Request.Form("txtCar")))
   m_PayClass = checkStr(Trim(Request.Form("txtPayClass")))
   if uploadimage<>"" then
	  SQL="UPDATE CityCard_League SET logo ='"& UploadImage &"',address ='"& m_address &"',linkman ='"& m_linkman &"',tel ='"& m_tel &"',email = '"& m_email &"',website = '"& m_website &"' , post = '"& m_post &"',traffic = '"& m_traffic &"'"
	  else
  SQL="UPDATE CityCard_League SET address ='"& m_address &"',linkman ='"& m_linkman &"',tel ='"& m_tel &"',email = '"& m_email &"',website = '"& m_website &"' , post = '"& m_post &"',traffic = '"& m_traffic &"'"
  end if
  sql=sql&",content = '"& m_content &"',startbusinesstime= '"&m_BusinessHours&"',endbusinesstime= '"&m_BusinessHours2&"',starttime= '"&m_YouhuiTime&"',endtime= '"&m_YouhuiTime2&"',businesstimecontent= '"&m_Other&"',tbtj= '"&m_tbtj&"',hangyeid= '"&m_TradeType&"',Consume= '"&m_Consume&"',cabaretgrade= '"&m_StarGrade&"',Car='"&m_car&"',PayClass='"&m_PayClass&"',stateid="&m_CityTypeID&",cityid="&m_AreaTypeID
  sql=sql&" WHERE CompanyID="& ID  
  Conn.Execute SQL
  'response.write sql
  'response.end
 
  '错误
	
 'Response.Cookies("UploadImage") = ""
 ' response.end
  call msgbox("信息更新成功","index.asp")
  Response.End()

end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>襄樊生活网-商家管理系统</title>
<link href="../css/Style.css" rel="stylesheet" type="text/css"><link href="../css/Menu.css" rel="stylesheet" type="text/css"><link href="../css/aCardList.css" rel="stylesheet" type="text/css"><SCRIPT src="../js/029bxw.js" type=text/javascript></SCRIPT>
<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];}}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</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')">
<!--#include file="../Include/cardMenu.htm" -->
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td width="170" height="500" valign="top" bgcolor="f5f5f5">
      <!--#include file="Left.asp" -->    </td>
    <td width="10" valign="top"></td>
    <td width="600" valign="top">
      <!--#include file="Ad.asp" -->
      <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 

 if Not rs.Eof then
   m_UserName = rs("username")
   m_Password = rs("password")
   m_CompanyName = rs("name")
   m_PayClass = rs("payclass")
   m_Operation = rs("operation")
   m_Grade = rs("grade")
   m_CityTypeID = rs("stateid")
   m_AreaTypeID = rs("cityid")
   m_TradeType = rs("hangyeid")
   m_Traffic = rs("traffic")
   m_Tbtj = rs("Tbtj")
   m_Linkman = rs("linkman")
   m_BusinessHours = rs("startbusinesstime")
   m_BusinessHours2 = rs("endbusinesstime")
   m_YouhuiTime = rs("starttime")
   m_YouhuiTime2 = rs("endtime")
   m_Other = rs("businesstimecontent")
   m_Consume = rs("Consume")
  
   
   m_Tel = rs("tel")
   m_StarGradeTypeID = rs("cabaretgrade")
   m_Address = rs("address")
   m_WebSite = rs("website")
   m_Car = rs("car")
   m_Commend = rs("tuijian")
   m_Agio = rs("agio")
   m_AgioContent = rs("agiocontent")
   m_Image = rs("logo")
   m_Intro = rs("content")
 End if


%>
     
      <table width="89%" height="37" border="0" align="center" cellpadding="4" cellspacing="2" bgcolor="#FFFFFF">
        <tr> 
          <td colspan="2"> <b> 
            <%
		    Response.write "商家:"&rs("name")
		  %>
            </b></td>
        </tr>
        <form name="form1" method="post" action="?update=OK">
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="15" align="right">联 系 人：</td>
            <td><input name="linkman" type="text" id="linkman" value="<%=rs("linkman")%>" size="10"> 
              <font color="#FF0000">*若为空将不改</font></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" align="right">商家地址：</td>
            <td><input name="address" type="text" id="address" value="<%=rs("address")%>" size="45"> 
              <font color="#FF0000">*若为空将不改</font></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="19" align="right">区　　域：</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 rs2 = conn.Execute(m_SQL)
			 mBigArray = rs2.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 rs2 = conn.Execute(m_SQL2)
			   strSmallCategory = mBigArray(0,i)&"-"
			   Do While not rs2.Eof 
   			     strSmallCategory = strSmallCategory & rs2("F_ID")&"+"&rs2("F_Value")+"-"
				 rs2.Movenext
			   Loop
			   if m_CityTypeID = mBigArray(0,i) then
			      Response.write "<option selected value="&strSmallCategory&">"&mBigArray(1,i)&"</option>"
			   else
			      Response.write "<option value="&strSmallCategory&">"&mBigArray(1,i)&"</option>"
               end if
			 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("+");
 if (sTemp[0]==<%=m_AreaTypeID%>)
 sString+="<option selected value='"+sBigTypeID+":"+sTemp[0]+"'>"+sTemp[1]+"</option>";
 else
 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 height="15" align="right">商家图片：</td>
            <td><a href="#" onClick="MM_openBrWindow('UploadImage.asp','','top=130,width=453,height=115')"><font color="#FF0000">立刻上传</font></a></td>
          </tr>
          <tr bgcolor="f5f5f5">          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="2" align="right">所属分类：</td>
            <td width="88%"> <select name="selTrade">
              <%
			   m_SQL = "SELECT F_ID,F_Value FROM T_TradeType ORDER BY F_ID "
			   Set rs2 = conn.Execute(m_SQL)
			   Do While Not rs2.Eof
			      if (m_TradeType) = (rs2("F_ID")) then
     				Response.write "<option value=" + cstr(rs2("F_ID"))
           			Response.write " selected"
       				Response.write ">" + rs2("F_Value")
                  Else
                    Response.write "<option value='" & rs2("F_ID") &"'>"& rs2("F_Value") &"</option>"
                  End if
				 rs2.MoveNext
			   Loop
			   rs2.Close
			   set rs2=nothing
			   %>
            </select></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" align="right">折　　扣：</td>
            <td><%=rs("agio")%></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="19" align="right">付款方式：</td>
            <td width="88%"> <input name="txtPayClass" type="text" value="<%=m_PayClass%>" size="21" maxlength="20"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="17" align="right">停 车 位：</td>
            <td width="88%"> <input name="txtCar" type="text" value="<%=m_car%>" size="36" maxlength="80"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="9" align="right">附近学校：</td>
            <td> <input name="txtConsume" type="text" value="<%=m_consume%>" size="36" maxlength="80">              </td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="8" align="right">特别推荐：</td>
            <td> <input name="txtTbtj" type="text" value="<%=m_Tbtj%>" size="50" >            </td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="8" align="right">营业时间：</td>
            <td width="88%">自 
              <input name="txtBusinessHours" type="text" value="<%=m_BusinessHours%>" size="8" maxlength="80">
              至 
              <input name="txtBusinessHours2" type="text" value="<%=m_BusinessHours2%>"  size="8" maxlength="80">
              例 16至21</td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="17" align="right">补充说明：</td>
            <td width="88%"> <input name="txtOther" type="text" value="<%=m_other%>" size="36" maxlength="80"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="8" align="right">优惠期限：</td>
            <td width="88%">自 
              <input name="txtYouhuiTime" type="hidden" value="<%=m_YouhuiTime%>" size="8" maxlength="80">
              至 
              <input name="txtYouhuiTime2" type="hidden" value="<%=m_YouhuiTime2%>" size="8" maxlength="80">
              例 2004-2-2至2005-2-2</td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td width="16%" height="8" align="right">酒店星级：</td>
            <td width="88%"> <select name="selStarGrade">
                <%
			   m_SQL = "SELECT F_ID,F_Value FROM Tour_StarGradeType ORDER BY F_ID DESC"
			   Set rs2 = conn.Execute(m_SQL)
			   Do While Not rs2.Eof
			     if Trim(m_StarGradeTypeID) = Trim(rs2("F_ID")) then
     				Response.write "<option value=" + cstr(rs2("F_ID"))
           			Response.write " selected"
       				Response.write ">" + rs2("F_Value")
                  Else
                    Response.write "<option value='" & rs2("F_ID") &"'>"& rs2("F_Value") &"</option>"
                  End if
				 rs2.MoveNext
			   Loop
			   rs2.Close
			   set rs2=nothing
			   %>
              </select>
              非酒店不需输入</td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" align="right">电　　话：</td>
            <td><input name="tel" type="text" id="tel" value="<%=rs("tel")%>"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" align="right">电子邮件：</td>
            <td><input name="email" type="text" id="email" value="<%=rs("email")%>"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" align="right">网　　址：</td>
            <td><input name="website" type="text" id="website" value="<%=rs("website")%>"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" align="right">邮　　编：</td>
            <td><input name="post" type="text" id="post" value="<%=rs("post")%>" size="8" maxlength="6"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" align="right">交通指向：</td>
            <td><input name="traffic" type="text" id="traffic" value="<%=rs("traffic")%>" size="35"></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" valign="top">&nbsp;&nbsp;&nbsp;公司简介： </td>
            <td height="15" valign="top"><%m_content=rs("content")
			m_content=replace(m_content,"&nbsp;"," ")
m_content=replace(m_content,"&nbsp;&nbsp;","  ")
m_content=replace(m_content,"<br>",vbcrlf)%><textarea name="content" cols="60" rows="12" id="content"><%=m_content%></textarea></td>
          </tr>
          <tr bgcolor="f5f5f5"> 
            <td height="15" colspan="2" align="center" valign="top">&nbsp;</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>
    <td valign="top">
	<!--#include file="Inc_Ser.asp"-->
</td>
  </tr>
</table>
<!--#include file="../Include/CopyRight.htm" -->
</body>
</html>
