js文件:
var where=" where pd_Isjifen=0 and pd_Isok=1"; //查询条件
var psize=16; //查询数据数目
var pindex=0;//当前页数
var order=" order by pd_Update desc,type_sort,pd_brand,pd_typeid"; //排序条件
var temp=0; //模板名称
var Pcount=0;
//获取参数
function getUrlPara(paraName)
{
var str=window.location.search;
if (str.indexOf(paraName)!=-1)
{
var pos_start=str.indexOf(paraName)+paraName.length+1;
var pos_end=str.indexOf("&",pos_start);
if (pos_end==-1)
{
return str.substring(pos_start);
}
else
{
return str.substring(pos_start,pos_end)
}
}
else
{
return "";
}
}
//设置查询条件
function Set_Where()
{
var country=getUrlPara("country");
if(country!='')
{
where+=" and pd_country='" + unescape(country) + "'";
}
var search=getUrlPara("search");
if(search!='')
{
where+=" and " + Get_where(unescape(search));
}
var cell=getUrlPara("cell");
if(cell!='')
{
where+=" and pd_Is" + cell + "=1";
}
var days=getUrlPara("days");
if(days!='')
{
where+=" and DATEDIFF([day], pd_update, GETDATE()) <= " + days;
}
var tp=getUrlPara("tp");
if(tp!='')
{
where+=" and pd_Isimport='" + (parseInt(tp)-1)+"'";
order=" order by pd_Update desc,type_sort desc,pd_brand,pd_typeid";
}
var brand=getUrlPara("brend");
if(brand!='')
{
where+=" and pd_brand='" + unescape(brand) + "'";
}
}
function Get_where(str)
{
return " (charindex(RTRIM('" + str + "'),RTRIM(pd_keyword))>0 or charindex(RTRIM('" + str + "'),RTRIM(pd_name))>0 or charindex(RTRIM('" + str + "'),RTRIM(pd_search))>0 or pd_brand='" + str + "' or pd_itemno='" + str + "')";
}
//获取数据
function Get_div()
{
var div="查询数据超时,请刷新页面重新查询!";
where=where.replace(/\