<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="stylesheet" type="text/css">
<style>
td{font-size:9pt;line-height:120%;color:#353535} 
body{font-size:9pt;line-height:120%} 

a:link          { color: #000000; text-decoration: none }
a:visited       { color: #000000; text-decoration: none }
a:active        { color: #000000; text-decoration: none }
a:hover         { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
<style type=text/css>
.pad {
	padding-left: 150px
}
</style>

<%
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
else
if request.cookies("sundxshop")("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
end if
end if
if session("rank")>1 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权修改管理员！');history.go(-1);</script>"
response.End
end if
%>
<TABLE WIDTH="98%" BORDER="0" ALIGN="center" CELLPADDING="1" CELLSPACING="1"  BGCOLOR="#39867B">
        <TR> 
          <TD width="100%" HEIGHT="20" ALIGN="center"><font color="#FFFFFF">拍拍网店数据导入说明</font></TD>
        </TR>
         <tr> 
    <td align="center"><a href=paipai_toaccess.asp onClick="return confirm('您确定要导入数据吗？')"><font color="#FFFFFF">数据导入操作</font></a><font color="#FFFFFF">|=====|<a href=admin_proall_class.asp ><font color="#FFFFFF">快捷修改分类</font></a><font color="#FFFFFF"></td>
  </tr>
</table>
<%

Dim Driver,DBPath,ex_Rs,ConStr,as_Conn,as_ConnStr,as_i,as_rs



Set Conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath("../data/paipai.xls")&";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
Conn.Open ConnStr


ex_i=0
as_i=0
Sql="Select * From  [paipai$]"
Set ex_Rs=Conn.Execute(Sql)

IF ex_Rs.Eof And ex_Rs.Bof Then
Response.write "没有找到您需要的数据!!"
Else

%>


<table  width="98%"   border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#f1f1f1">
	<tr align="center" bgcolor="#ffffff">
	
	<td width="20%">名称</td>
       
	
	
        <td width="10%">价格</td>
        <td width="20%"  >图片</td>
	<td width="50%"  >详细</td>
	</tr>
	

<%


Do While Not ex_Rs.EOF
set conn = server.createobject("adodb.connection")
connxstr="provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("#sundxshop#.asp")
conn.open connxstr
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from sundxProlist",conn,1,1
prename=rs(0) 
company=rs(1) 
intro=rs(2) 
predate=rs(3) 
pricetitle=rs(4) 
prestock=rs(5) 
other=rs(6) 
pretype=rs(7) 
graph=rs(8) 
graph2=rs(9) 
link=rs(10) 
description=rs(11) 

rs.Close
Set rs=nothing

set as_rs=server.CreateObject("adodb.recordset")
as_rs.open "select * from product",Conn,3,3
as_rs.addnew
as_rs("name")=trim(ex_rs("商品名称"))
price=trim(ex_rs("价格"))
as_rs("price1")=price+price*0.2
as_rs("price2")=price
pic=trim(ex_rs("图片"))
pic=split(pic,"\")
for   i=LBound(pic)   to   UBound(pic)       
  next
  pic0=pic(1)
 propic=replace(pic0,":0:0:",".jpg")
  propic="images/proupfile/"&propic
as_rs("pic")=propic
as_rs("photo")=propic
as_rs("detail")=trim(ex_rs("商品详情"))
as_rs("prename")=prename
as_rs("company")=company
as_rs("intro")=intro
as_rs("predate")=predate
as_rs("price")=pricetitle
as_rs("prestock")=prestock
as_rs("other")=other
as_rs("pretype")=pretype
as_rs("graph")=graph
as_rs("graph2")=graph2
as_rs("link")=link
as_rs("description")=description
as_rs("stock")=100
as_rs("productdate")=year(now)&"年"&month(now)&"月"&day(now)&"日"
as_rs("adddate")=now()
as_rs.Update
as_i=as_i+1
as_rs.Close
Set as_rs=nothing
%>

<tr align="center" bgcolor="#ffffff">
	



<td height=20>

<%=ex_rs("商品名称")%>


	

</td>

<td>
<%=ex_rs("价格")%>
</td>

<td> 
    
<%=propic%>

</td>

 <td> 
      
商品详情

</td>






<script   language="Javascrpt">setTimeout("location.reload()",360000);</script>

</tr>	

<%
ex_rs.MoveNext
Loop
end if
ex_rs.Close
Set ex_rs=nothing

%>


<tr>
<td colspan="7" style="padding-left:50px" height="32">
<%
Response.Write "<br>共更新了"&as_i&"处记录"
%></td>
</tr>
</table>

<%

session("outexcel")=hour(now)
Conn.Close
Set Conn=Nothing
%>

