<%@ LANGUAGE = "VBScript.Encode" CODEPAGE="65001"%>
<!--
'##################################################################                                                                 
'★         web08.net - 威博购物系统                                              
'★  版权所有: web08.net                                                                                                       
'★  程序制作: 威博网络技术公司                                     
'★           email:web08net@hotmail.com                           
'★            Q Q :645095280,475980829
'★	       电话:021-55520018                                                                                                         
'★  相关网址: [产品介绍] http://www.021web.com.cn/gwxt.html
'★            [支持论坛] http://bbs.web08.net/                                                                                     
'★  主页地址: http://www.web08.net/  
'★		http://www.021web.com.cn/			                                                                 
'###################################################################
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../css/css.css" rel="stylesheet" type="text/css">
<title>商品批量上传</title></head>
</html>

<html>
<head>
</head>
<script language="JavaScript" src="../../ajax/Prototype.js" type="text/JavaScript"></script>
<script language="JavaScript" type="text/JavaScript">
function uppiclogo(model,frmname) 
{
window.open("../uploadxls/upload.asp?uppath=xlsdata&ProdId="+model+"&frmname="+frmname,"upload", "width=550, height=280, resizable=no,menubar=1,scrollbars=1")
}
</script>

<style>
.xingmu {
line-height: 20px;
font-family: "Verdana, 新宋体";
color:#333333;
font-size:12px;
font-weight:bolder;
background:#DBDAD9;
}
.processline,Button,input,textarea{
FONT-FAMILY: "新宋体";
FONT-SIZE: 12px;
COLOR:#333333;
text-decoration: none;
background:#F0F0F0;
border-bottom:solid;
border-bottom-color:#A7A7A7;
border-bottom-width:1;
border-left:solid;
border-left-color:#A7A7A7;
border-left-width:1;
border-right:solid;
border-right-color:#A7A7A7;
border-right-width:1;
border-top:solid;
border-top-color:#A7A7A7;
border-top-width:1;
}
</style>
<!--#include file=../include2.asp-->
<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 class="background" onLoad="LoadFinish()">
<!-- #include file="../loading2.asp" -->
<center>
<!--#include file="web_mall_include.asp"-->
<div class="div-top">
<span class="left-span">&nbsp;&nbsp;<strong>管理中心</strong>  - 批量上传 </span>
</div>
<div class="tab-div">
<div id="RefreshMain">

<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<form name="myform" method="post" action="store_showxlsdata.asp">

<tr>
<td width="20%" height="30" align="right" bgcolor="#FFFFFF">模版下载：</td>
<td width="80%" height="30" bgcolor="#FFFFFF"><a href="xls/web08.rar"><Font color="#ff0000">下载批量CSV模版文件</font></a></td>
</tr>
<tr>
<td width="20%" height="30" align="right" bgcolor="#FFFFFF">商品分类：</td>
<td width="80%" height="30" align="left" bgcolor="#FFFFFF">&nbsp;
<select name="fid" id="fid" >
<%#@~^uwAAAA==~1WU	N(@#@&k+D~Dk'd+M\n.cmDCYW4Nn^YvJmNGN8 M+^WM[/YEb@#@&/5s{Jd+^n1Y~CP6DWsPqn4|n.W;VCdkPh4nDP0b[x!,PKD[+.~(X~k9~lkmE@#@&D/ Ga+UPk5^~^Kx	~FB&@#@&NKPAtbVn~	WY,./c+W6@#@&k9'M/cJr[r#@#@&szkAAA==^#~@%>
<%#@~^GwAAAA==~b0~k+^+mDk9xDk`Ek9Jb~Dt+	~zwgAAA==^#~@%>
	<option value="<%=#@~^CAAAAA==.k`EbNr#RwIAAA==^#~@%>|<%=#@~^CwAAAA==.k`E^+7+Vr#kgMAAA==^#~@%>" selected><%=#@~^CgAAAA==.k`E	ls+J*GwMAAA==^#~@%></option>
<%#@~^BQAAAA==~VdyQEAAA==^#~@%>
	<option value="<%=#@~^CAAAAA==.k`EbNr#RwIAAA==^#~@%>|<%=#@~^DQAAAA==.k`E^+7+Vr#3q7gMAAA==^#~@%>" ><%=#@~^CgAAAA==.k`E	ls+J*GwMAAA==^#~@%></option>
<%#@~^BwAAAA==~x[,k6RgIAAA==^#~@%>
<%#@~^IgAAAA==~1ls^P	WV\s`rn4|n.G;VlkdJBkNBqbYAsAAA==^#~@%>
<%#@~^KQAAAA==~@#@&.kRsW\xaY@#@&sWKw~@#@&D/c^VK/+@#@&CAoAAA==^#~@%>
</select></td>
</tr>
<tr>
<td width="20%" height="30" align="right" bgcolor="#FFFFFF">模版选择：</td>
<td width="80%" height="30" align="left" bgcolor="#FFFFFF">&nbsp;
<input name="Templet" type="text"  id="Templet" size="50" value="<%=#@~^OwAAAA==OMkhvoYW	+7CV!+cJS+8mD+:aslD+JBEP{aDKN;mOEBJO{!d+6VCL{FJbb9hQAAA==^#~@%>">
<input type="button" name="Submit" value="选择模板" onClick="OpenWindowAndSetValue('../../inc/SelectTemplet.asp?CurrPath=<%=#@~^EQAAAA==	4m;{k+Y!w6GV9+.zAYAAA==^#~@%>Template',400,300,window,document.myform.Templet);document.myform.Templet.focus();"></td>
</tr>
<tr>
<td width="20%" height="30" align="right" bgcolor="#FFFFFF">数据文件上传：</td>
<td width="80%" height="30" bgcolor="#FFFFFF"><label>&nbsp;
<input name="xlspath" type="text"  size="50" value="" readonly>
<input type="button" name="Submit2" value="上 传" onClick="javascript:uppiclogo('one','xlspath');">

<font  color="#ff0000">（CSV文件大小最好不要超过200K.）</font></label></td>
</tr>
<tr>
<td height="30" align="center" bgcolor="#FFFFFF">&nbsp;</td>
<td height="30" align="left" bgcolor="#FFFFFF"><input type="button" name="Submit3" value=" 数据导入 " onClick="Submit_Data_To_Refresh('SYS','<%=#@~^GgAAAA==.;;/DRmKW0r+k`E30l[hbxJ*mAkAAA==^#~@%>','uploaddate',this.form)"></td>
</tr>
<tr>
<td height="40" colspan="2" align="left" bgcolor="#FFFFFF"><font color="#ff0000">使用步骤：<BR>
1.请先下载系统提供的csv模版文件<BR>
2.填写csv文件，其中遇到“是否”之类，填写数字0或者1，0代表“否”，1代表“是”；<BR>
商品大图请直接填写大图的名称，商品小图直接填写小图名称 ,多图请以$分隔图片名称，图片名称必须带图片扩展名<BR>
请将图片上传至 /uploadimage/product/目录下 <BR>
3.选择所上传商品的类别，上传csv文件<BR>
4.文件中一次上传商品数量不得超过1000条，CSV文件大小最好不要超过200K
注意：批量上传文件只能属于同一个商品类别，不要将两个或两个以上类别的商品输入在同一个csv文件中。</font></td>
</tr>
</form>
</table>
</div>
</div>
</center>
<!-- #include file="../bottom2.asp" -->
<!--显示结果窗口-->
<table width="60%" border="0" cellspacing="0" cellpadding="0" id="tdstyle" style="display:none" align=center>
<tr>
<td height="20" align="center"><div id="RefreshSchedule" style="display:none;" align=center></div></td>
</tr>
</table>
<%#@~^HAAAAA==Oswm"+6D+kt!.V{JA+({[OkRlk2JrQoAAA==^#~@%>
</body>
</html>
<script language="JavaScript" type="text/JavaScript">
var G_REFRESH_NUM_TIME=0;
countnum=1;
function Submit_Data_To_Refresh(Sys,Table,Type,FormObj)
{

	var Action='',Str='',Obj=null;
	if (typeof(FormObj)=="object"){
		for(var i=0;i<FormObj.length;i++)
		{
			Obj = FormObj[i];
			if ((Obj.tagName=='INPUT')&&(Obj.type=='text')) Str=Obj.name+':'+Obj.value;
			if (Obj.tagName=='SELECT') {Str=Obj.name+':'+GetSelectID(Obj);}
			if (Str!='')
			{
				if (Action=='') Action=Str;
				else Action=Action+';'+Str;
			}
			Str='';
		}
	}else{
		Action="";
	}
	Action=FormObj.fid.value;
	Action=Sys+'$'+Table+'$'+Type+'$'+FormObj.Templet.value+'$'+Action;
	Action="Action="+Action;
	//alert(Action)
	$('RefreshMain').style.display="none";
	$('tdstyle').style.display="";
	$('RefreshSchedule').style.display="";
	$('RefreshSchedule').innerHTML="<div class=\"processline\" align=\"left\"><div class=\"xingmu\" id=\"RefreshLen\"></div></div>\
	<span id=\"result_str\" align=\"center\"></span><br><br>";
	$("RefreshLen").style.width ="0%";
	$("RefreshLen").innerHTML="&nbsp;<span class=\"xingmu\">0%</span>";
	$('result_str').innerHTML="正在准备...&nbsp;&nbsp;";
	Start_Refresh('<%=#@~^DgAAAA==Oswm"+6D+kt!.V0gUAAA==^#~@%>',Action);
}

function Start_Refresh(url,Action){
	var myAjax = new Ajax.Request(
		url,
		{method:'get',
		parameters:Action,
		onComplete:Refresh_Receive
		}
		);
}
function Refresh_Receive(OriginalRequest){
	var check,goback;
	var percent=0;
	goback="<a href=\"返回\" onclick=\"$('RefreshMain').style.display='';$('RefreshSchedule').style.display='none';return false;\">返回</a>";
	//alert(OriginalRequest.responseText);
	if (OriginalRequest.responseText.indexOf("$")>-1)
	{
		check=OriginalRequest.responseText.split("$");
		switch (check[0]) {
			case "Next" :
				percent=(parseInt(check[2])/parseInt(check[1]))*100;
				percent=Math.round(percent);
				$("RefreshLen").style.width =percent+"%";
				$("RefreshLen").innerHTML="&nbsp;<span class=\"xingmu\">"+percent+"%</span>";
				$('result_str').innerHTML="总共要导入" + check[1] + "条数据,已经导入" + check[2] + "条数据...";
				Start_Refresh("web_dts.asp","");
				countnum++;
				break;
			case "End" :
				$("RefreshLen").style.width ="100%";
				$("RefreshLen").innerHTML="&nbsp;<span class=\"xingmu\">100%</span>";
				$('result_str').innerHTML="总共要导入" + check[1] + "条数据,已经导入" + (check[2]-1) + "条数据...";
				$('result_str').innerHTML=$('result_str').innerHTML+"<br />导入结束&nbsp;&nbsp;"+goback;
				countnum=1;
				break;
			case "No" :
				$('result_str').innerHTML="没有要导入的数据&nbsp;&nbsp;"+goback;
				countnum=1;
				break;
			case "NoData" :
				$('result_str').innerHTML="数据文件不存在，请上传后再执行导入&nbsp;&nbsp;"+goback;
				countnum=1;
				break;
			default :
				alert(OriginalRequest.responseText);
				//$('result_str').innerHTML=OriginalRequest.responseText;
				//Start_Refresh("PublicSite/Public_Refresh.asp","");
				$('result_str').innerHTML="导入失败，请与管理员联系。&nbsp;&nbsp;"+goback+"<br>错误描述如下：<span class=\"tx\">"+check[1]+"</span><span class=\"tx\">"+decodeURI(check[2])+"</span>";
				//Start_Refresh("PublicSite/Public_Refresh.asp","");
		} 
	}
	else
	{
		$('result_str').innerHTML="导入失败，请与管理员联系。&nbsp;&nbsp;"+goback+"<br>错误描述如下："+OriginalRequest.responseText;
	}
}
function GetSelectID(Obj)
{
	var SelectObj=null,Str='';
	for(var i=0;i<Obj.options.length;i++)
	{
		SelectObj=Obj.options[i];
		if(SelectObj.selected)
		{
			if(Str=='') Str=SelectObj.value;
			else Str=Str+'*'+SelectObj.value;
		}
	}
	return Str;
}
</script>








