
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--#include file="../inc/conn.asp"-->
<!--#include file="Inc/Admin.Asp"-->
<!--#include file="Inc/Function.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>导入数据</title>
<link href="css/adminstyle.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="container">
	<div class="local"><h3>您现在的位置：<a href="admin_Index_Main.asp">管理首页</a> >> 导入商家信息</h3></div>
	<table width="100%" border="0" cellpadding="10" cellspacing="0" class="border" style="margin-top:10px;">
    <tr>
      <td>
        <div class="page_content">
          <div class="r_title">
            <h3><img src="images/xiao.jpg" /> 导入商家信息</h3>
          </div>
<%
addok=request("addok")
if addok="" or isnull(addok) then
%>
          <form  method="post" name="setup" id="setup" action="?addok=add">
            <table width="100%" border="0" cellpadding="2" cellspacing="1" class="table_style">              
              <tr>
                <th>文件：</th>
                <td>
                  <input name='path' type='text' id='path' value='' size='40' maxlength='255'>
      <input type="button" value="上传..." onclick="window.open('upload.asp?fuptype=pic&fupname=<%=replace(replace(replace(now(),"-",""),":","")," ","")%>&frmname=setup&bdname=path','_blank','scrollbars=yes,resizable=no,width=650,height=450')">
                </td>
              </tr>			 
              <tr>
                <td height="30" colspan="2" align="center">
                  <input type="submit" value="导入数据">
                </td>
              </tr>
            </table>
          </form>
<%
end if
if addok="add" then
Set xlsconn = server.CreateObject("adodb.connection") 
set rs=server.CreateObject("adodb.recordset")
source1=server.mappath(replace(request("path"),"/","\"))
myConn_Xsl="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &source1& ";Extended Properties=Excel 8.0"
xlsconn.open myConn_Xsl 
sql="select * from [商家信息$]"
set rs=xlsconn.execute(sql)
if not rs.eof then
while not rs.eof 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 
c1=int(split(rs("所属地区"),"|")(1))
c2=int(split(rs("所属分类"),"|")(1))
c3=rs("信息标题")
c4=rs("信息简要")
c5=rs("排序ID")
c6=rs("关键词")
c7=rs("网页描述")
c8=rs("电话")
c9=rs("地址")
c10=rs("公交")
c11=rs("外链")
c12=rs("地图链接")
c13=rs("优惠信息")
c14=rs("温馨提示")
c15=rs("商家介绍")
c16=rs("轮播图片")
c17=rs("发布人")
c18=rs("缩略图")
c19=rs("推荐")
c20=rs("最新")
c21=rs("热门")
c22=rs("精品")
c23=rs("面子卡")
c24=CDate(rs("录入时间"))
sql="insert into [Dream_Menpiao](Dream_Area,Dream_Theme,Dream_Title,Dream_TitleCon,Dream_OrderID,Dream_Keyword,Dream_Description,Dream_Phone,Dream_Address,Dream_Bus,Dream_DownUrl,Dream_MapUrl,Dream_Content4,Dream_Content,Dream_Content3,Dream_Content2,Dream_User,Dream_DefaultPicUrl,Dream_Elite,Dream_New,Dream_Hot,Dream_Choice,Dream_Mzk,Dream_UpdateTime) values ("&c1&","&c2&",'"&c3&"','"&c4&"',"&c5&",'"&c6&"','"&c7&"','"&c8&"','"&c9&"','"&c10&"','"&c11&"','"&c12&"','"&c13&"','"&c14&"','"&c15&"','"&c16&"','"&c17&"','"&c18&"',"&c19&","&c20&","&c21&","&c22&","&c23&",'"&c24&"')"
conn.execute(sql)
rs.movenext
wend
end if
%>
<table width="100%" border="0" cellpadding="2" cellspacing="1">              
  <tr>
	<td height="200" align="center" valign="middle" style="color:#FF0000; font-size:16px;">导入成功</td>
	</tr>
</table>	
<%
end if
%>		  
        </div>
      </td>
    </tr>
  </table>
</div>
</body>
</html>