📄 price.asp
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")
objcheck.CheckUserFunction "price","add"
set objcheck=nothing
dim conn
dim rs
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open connstring
if Request("strfield")<>"" and Request("strfield")<>"createdate" then
if Request("strvalue")<>"" then
strwhere=" and "&request("strfield")&" like '%"&request("strvalue")&"%'"
end if
end if
if Request.Form("strfield")<>"" and Request.form("strfield")<>"createdate" then
if Request.form("strvalue")<>"" then
strwhere=" and "&request("strfield")&" like '%"&request.form("strvalue")&"%'"
end if
end if
if Request.QueryString("orderbyfield")<>"" then
'排序字段改变返回第一页
if session("orderbyfield")<>Request.QueryString("orderbyfield") then
tofirstpage=true
else
tofirstpage=false
end if
'翻页时保持排序方式,不翻页循环改变升序/降序
if request("turnpage")="" then
if request("orderby")="" or request("orderby")="desc" then
session("orderby")="asc"
else
session("orderby")="desc"
end if
strwhere=strwhere & " order by "&Request.QueryString("orderbyfield")&" "&session("orderby")
else
if request("orderbyfield")<>"" then
strwhere=strwhere & " order by "&Request.QueryString("orderbyfield")&" "&session("orderby")
end if
end if
'保存当前排序字段
session("orderbyfield")=Request.QueryString("orderbyfield")
else
strwhere=strwhere&" order by lastmoddate desc"
end if
rs.Open "select * from v_price where (accountid in(select accountid from account where Owner='"&session("loginid")&"' or owner in(select userid from v_userreportto_all where reportto='"&session("loginid")&"')) or accountid is null) and (SalesPriceType like '%"&request.querystring("type")&"%')"&strwhere ,conn,1,1
'搜索时用
selecttablename="v_price where (SalesPriceType like '%"&request.querystring("type")&"%')"
if Request.QueryString("CurPage") = "" or Request("CurPage") = 0 then
CurPage = 1
else
CurPage = cint(Request.QueryString("CurPage"))
end If
if not Rs.eof then
Rs.PageSize=session("PageSize")
Rs.AbsolutePage=CurPage
else
CurPage=0
end if
%>
<html>
<head>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>销售价格列表</title>
<script language=javascript>
window.top.frames (1).document.location='../left.asp?type=product';
</script>
</head>
<script language="javascript">
function showit(objname,imgn){
if (eval(objname+'.style.display=="block"') == true)
{
eval(objname+'.style.display="none";');
eval('IMG'+objname+'.style.display="block";');
eval('IMG1'+objname+'.style.display="none";');
//alert('IMG'+objname+'.src = "../images/button2.gif";');
//eval('IMG'+objname+'.src = "../images/button2.gif";');
}
else
{
eval(objname+'.style.display="block";');
eval('IMG'+objname+'.style.display="none";');
eval('IMG1'+objname+'.style.display="block";');
//alert('IMG'+objname+'.src = "../images/button1.gif";');
//eval('IMG'+objname+'.src = "../images/button1.gif";');
}
}
function showit1(objname,imgn){
if (eval('account'+objname+'.style.display=="block"') == true)
{
eval('account'+objname+'.style.display="none";');
eval('IMG'+objname+'.style.display="block";');
eval('IMG1'+objname+'.style.display="none";');
//alert('IMG'+objname+'.src = "../images/button2.gif";');
//eval('IMG'+objname+'.src = "../images/button2.gif";');
}
else
{
eval('account'+objname+'.style.display="block";');
eval('IMG'+objname+'.style.display="none";');
eval('IMG1'+objname+'.style.display="block";');
//alert('IMG'+objname+'.src = "../images/button1.gif";');
//eval('IMG'+objname+'.src = "../images/button1.gif";');
}
}
function showit2(objname,imgn){
if (eval('producttype'+objname+'.style.display=="block"') == true)
{
eval('producttype'+objname+'.style.display="none";');
eval('IMG'+objname+'.style.display="block";');
eval('IMG1'+objname+'.style.display="none";');
//alert('IMG'+objname+'.src = "../images/button2.gif";');
//eval('IMG'+objname+'.src = "../images/button2.gif";');
}
else
{
eval('producttype'+objname+'.style.display="block";');
eval('IMG'+objname+'.style.display="none";');
eval('IMG1'+objname+'.style.display="block";');
//alert('IMG'+objname+'.src = "../images/button1.gif";');
//eval('IMG'+objname+'.src = "../images/button1.gif";');
}
}
function chgselect(){
if(form1.strfield1.value==""){
link="price.asp?type=";
document.location.href=link;
}
if(form1.strfield1.value=="productprice"){
link="price.asp?type=productprice";
document.location.href=link;
}
if(form1.strfield1.value=="productqty"){
link="price.asp?type=productqty";
document.location.href=link;
}
if(form1.strfield1.value=="productaccount"){
link="price.asp?type=productaccount";
document.location.href=link;
}
if(form1.strfield1.value=="producttype"){
link="price.asp?type=producttype";
document.location.href=link;
}
}
function relativeinput_onchange()
{
if (form1.strfield.value=='createdate'){
dateformat.style.display='block';
}
if (form1.strfield.value!='createdate'){
dateformat.style.display='none';
}
}
function GetStrValue()
{
form1.strvalue.value=form1.strvalue1.value;
if (form1.strfield.value=='createdate'){
if(form1.strvalue.value==""){
alert("请输入搜索日期!");
return false;
}
if(CheckDate(document.form1.strvalue.value)){
alert("请输入正确格式的日期!");
return false;
}
}
form1.submit();
}
</script>
<body leftmargin="10" rightmargin="0" topmargin="10">
<form name="form1" method="post" action="price.asp" onsubmit="return GetStrValue();">
<table align=center width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
<tr><td width="13%">
<select name="strfield1" onchange="chgselect();">
<option value=productprice <%if request.querystring("type")="productprice" or request.querystring("type")="" then Response.Write "selected"%>>按产品</option>
<option value=productaccount <%if request.querystring("type")="productaccount" then Response.Write "selected"%>>按产品与客户</option>
<option value=productqty <%if request.querystring("type")="productqty" then Response.Write "selected"%>>按产品与数量</option>
<option value=producttype <%if request.querystring("type")="producttype" then Response.Write "selected"%>>按产品类型</option>
<option value="" <%if request.querystring("type")="" then Response.Write "selected"%>>按所有政策</option>
</select></td>
<td width="10%"><select name="strfield" onchange="relativeinput_onchange();">
<option value=model <%if request("strfield")="model" then Response.Write "selected"%>>型号</option>
<option value=productcode <%if request("strfield")="productcode" then Response.Write "selected"%>>货号</option>
<option value=account <%if request("strfield")="account" then Response.Write "selected"%>> 客户</option>
<option value=createdate <%if request("strfield")="createdate" then Response.Write "selected"%>>更新日期</option>
</select></td>
<td width="18%">
<input type="text" name="strvalue1" value="<%=request("strvalue1")%>">
</td>
<td>
<input type=hidden name="strvalue" value="<%=request("strvalue")%>" >
<input type=image src="../images/button_submit.gif" style="cursor:hand" border=0>
<%
if CurPage<=1 then
Response.Write "<a href='price.asp?turnpage=yes&orderby="&session("orderby")&"&orderbyfield="&request("orderbyfield")&"&strvalue="&request("strvalue")&"&strfield="&request("strfield")&"&type="&request.querystring("type")&"&CurPage=1'><img src='../images/button_start.gif' border=0></a> "
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -