⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 accountperiod.asp

📁 1 除掉了 时间 限制 2 除掉了 人数 限制 改为 500人 原为5人 3 发现一点小缺陷 增加人员的时候没有判断 登陆名是否重复! 自己写吧~~~:) 4 又 是一点缺陷
💻 ASP
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
dim conn
dim rs 
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open connstring
if Request("strfield")<>"" then
	strwhere=" and "&request("strfield")&" like '%"&request("strvalue")&"%'"
end if
if Request.Form("strfield")<>"" then
	strwhere=" and "&request("strfield")&" like '%"&request.form("strvalue")&"%'"
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_account where (AccountPeriod is not null)"&strwhere,conn,1,1

'搜索时用
selecttablename="v_account where (AccountPeriod is not null)"

if Request.QueryString("CurPage") = "" or Request("CurPage") = 0  or tofirstpage=true 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>
</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 relativeinput_onchange()
{
if (form1.strfield.value=="createuser"){
	strvalue1.style.display='none';
	strvalue2.style.display='block';
	form1.strvalue1.value="";
	}
if (form1.strfield.value!="createuser"){
	strvalue1.style.display='block';
	strvalue2.style.display='none';
	form1.strvalue2.value="";
	}
}
function GetStrValue()
{
if (form1.strfield.value!="createuser"){
	form1.strvalue.value=form1.strvalue1.value;
	}
if (form1.strfield.value=="createuser"){
	form1.strvalue.value=form1.strvalue2.value;
	}
form1.submit();
}
</SCRIPT>
<body leftmargin="10" rightmargin="10" topmargin="10">
<form name="form1" method="post" action="AccountPeriod.asp"   onsubmit="return GetStrValue();">
  <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="10%"><select name="strfield" onchange="relativeinput_onchange();">
          <option value=account <%if request("strfield")="account" then Response.Write "selected"%>>客户</option>
          <option value=createuser <%if request("strfield")="createuser" then Response.Write "selected"%>>所有者</option>
        </select></td>
      <td width="18%">
	  <div id=strvalue1 <%if request("strfield")<>"createuser" or request("strfield")=""  then response.write "style=display:block" else response.write "style=display:none" end if%>>
          <input type="text" name="strvalue1" value="<%=request("strvalue1")%>">
        </div>
	  <div id=strvalue2 <%if request("strfield")="createuser" then response.write "style=display:block" else response.write "style=display:none" end if%>>
	  		<select name="strvalue2" class="stedit">
                  <option value="">--请选择所有者--</option>
                  <%getgrouptype selecttablename,"createuser",request("strvalue2")%>
            </select></div>
		</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='AccountPeriod.asp?turnpage=yes&orderby="&session("orderby")&"&orderbyfield="&request("orderbyfield")&"&strvalue="&request("strvalue")&"&strfield="&request("strfield")&"&CurPage=1'><img src='../images/button_start.gif' border=0></a>&nbsp;"
		else
		    Response.Write "<a href='AccountPeriod.asp?turnpage=yes&orderby="&session("orderby")&"&orderbyfield="&request("orderbyfield")&"&strvalue="&request("strvalue")&"&strfield="&request("strfield")&"&CurPage=1'><img src='../images/button_start.gif' border=0></a>&nbsp;"
		    Response.Write "<a href='AccountPeriod.asp?turnpage=yes&orderby="&session("orderby")&"&orderbyfield="&request("orderbyfield")&"&strvalue="&request("strvalue")&"&strfield="&request("strfield")&"&CurPage="&CurPage-1&"'><img src='../images/button_backward.gif' border=0></a>&nbsp;"
		end if
   		if CurPage>=RS.PageCount then
			Response.Write "<a href='AccountPeriod.asp?turnpage=yes&orderby="&session("orderby")&"&orderbyfield="&request("orderbyfield")&"&strvalue="&request("strvalue")&"&strfield="&request("strfield")&"&CurPage="&RS.PageCount&"'><img src='../images/button_end.gif' border=0></a>"
		else
			Response.Write "<a href='AccountPeriod.asp?turnpage=yes&orderby="&session("orderby")&"&orderbyfield="&request("orderbyfield")&"&strvalue="&request("strvalue")&"&strfield="&request("strfield")&"&CurPage="&CurPage+1&"'><img src='../images/button_forward.gif' border=0></a>&nbsp;"
			Response.Write "<a href='AccountPeriod.asp?turnpage=yes&orderby="&session("orderby")&"&orderbyfield="&request("orderbyfield")&"&strvalue="&request("strvalue")&"&strfield="&request("strfield")&"&CurPage="&RS.PageCount&"'><img src='../images/button_end.gif' border=0></a>"
		end if
		%>
		</td>
    </tr>
    <tr> 
      <td height="25" colspan=3><strong><font size="2" class=title>客户帐期列表</font></strong> &nbsp;&nbsp;<a href="javascript:opensubwin('resizable=yes, scrollbars=yes, left= 300, top=220, menubar=no, location=no, toolbar=no ,width=320, height=220','newAccountPeriod.asp?type=新建');"><img src="../images/button_new.gif" border=0></a></td>
    </tr>
    <tr > 
      <td height="16" colspan="3" background="../images/title.gif">&nbsp;</td>
    </tr>
    <tr>
      <td height=4  colspan=3></td>
    </tr>
  </table>
  <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="DECFAD">
    <tr bgcolor="EFEFEF"> 
      <td height=15 align=center><a href="AccountPeriod.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>&orderbyfield=account&orderby=<%=session("orderby")%>">客户</a></td>
      <td width="15%" height="15" align=center><a href="AccountPeriod.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>&orderbyfield=AccountPeriod&orderby=<%=session("orderby")%>">帐期(天)</a></td>
      <td width="15%" align=center><a href="AccountPeriod.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>&orderbyfield=OwnerName&orderby=<%=session("orderby")%>">所有者</a></td>
      <td width="15%" height="15" align=center><a href="AccountPeriod.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>&orderbyfield=lastmoddate&orderby=<%=session("orderby")%>">更新日期</a></td>
      <td width="15%" height="15" align=center>操作</td>
  </tr>
  <%
  set accountid=rs("accountid")
  set account=rs("account")
  set AccountPeriod=rs("AccountPeriod")
  set OwnerName=rs("owner")

  i=1:do while not rs.EOF and i<=session("pagesize")%>
  <tr bgcolor="#FFFFFF"> 
    <td align=center height=18>
		<table width=100%>
		<tr id="IMGtr1<%=i%>" style="display:block">
			<td width=90% align=center><%=account%></td>
			<td width=10% align=right><a href="javascript:showit('tr1<%=i%>',1)"><img src="../images/button1.gif" border=0></a><td></tr>
		<tr id="IMG1tr1<%=i%>" style="display:none">
			<td width=90% align=center><%=account%></td>
			<td width=10% align=right><a href="javascript:showit('tr1<%=i%>',1)"><img src="../images/button2.gif" border=0></a></td></tr></table>
</td>
      <td align=center><%=AccountPeriod%></td>
    <td align=center><%=OwnerName%></td>
    <td align=center><%=Year(rs("lastmoddate"))&"-"&Month(rs("lastmoddate"))&"-"&Day(rs("lastmoddate"))%></td>
    <td align=center><a href="javascript:opensubwin('resizable=yes, scrollbars=yes, left= 300, top=220, menubar=no, location=no, toolbar=no ,width=320, height=220','newAccountPeriod.asp?id=<%=accountid%>&type=编辑');">编辑</a> <a href="javascript:opensubwin('resizable=yes, scrollbars=yes, left= 300, top=220, menubar=no, location=no, toolbar=no ,width=320, height=220','newAccountPeriod.asp?id=<%=accountid%>&type=删除');">删除</a></td>
  </tr>
	<tr bgcolor="#FFFFFF" border=0  id='tr1<%=i%>' style=display:none><td colspan=7>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="FFFFFF">
          <tr bgcolor="#FFFFFF"> 
            <td width="10%" height=18 align=left  bgcolor="DEDFDE"><div align="left">客户代码</div></td>
            <td width="20%" align=left bgcolor="EFEFEF"><%=rs("Siccode")%> <div align="left"></div></td>
            <td width="10%" align=left bgcolor="DEDFDE"><div align="left">电话</div></td>
            <td width="20%" align=left bgcolor="EFEFEF"><%=rs("phone")%></td>
            <td width="10%" align=left bgcolor="DEDFDE"><div align="left">传真</div></td>
            <td width="30%" align=left bgcolor="EFEFEF"><%=rs("fax")%></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td align=left height=18  bgcolor="DEDFDE"><div align="left">类型</div></td>
            <td align=left bgcolor="EFEFEF"><%=rs("accounttype")%> <div align="left"></div></td>
            <td align=left bgcolor="DEDFDE"><div align="left">国家</div></td>
            <td align=left bgcolor="EFEFEF"><%=rs("country1")%></td>
            <td align=left bgcolor="DEDFDE"><div align="left">来源</div></td>
            <td align=left bgcolor="EFEFEF"><%=rs("source")%></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td align=left height=18  bgcolor="DEDFDE"><div align="left">开户银行</div></td>
            <td align=left bgcolor="EFEFEF"><%=rs("accountbank")%> <div align="left"></div></td>
            <td align=left bgcolor="DEDFDE"><div align="left">区域</div></td>
            <td align=left bgcolor="EFEFEF"><%=rs("territory")%></td>
            <td align=left bgcolor="DEDFDE"><div align="left">省份</div></td>
            <td align=left bgcolor="EFEFEF"><%=rs("province1")%></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td align=left height=18  bgcolor="DEDFDE"><div align="left">帐号</div></td>
            <td align=left bgcolor="EFEFEF"><%=rs("accountno")%> <div align="left"></div></td>
            <td align=left bgcolor="DEDFDE"><div align="left">邮编</div></td>
            <td align=left bgcolor="EFEFEF"><%=rs("zip1")%></td>
            <td align=left bgcolor="DEDFDE"><div align="left">城市</div></td>
            <td align=left bgcolor="EFEFEF"><%=rs("city1")%></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td align=left height=18  bgcolor="DEDFDE"><div align="left">税号</div></td>
            <td align=left bgcolor="EFEFEF"><%=rs("taxno")%> <div align="left"></div></td>
            <td align=left bgcolor="DEDFDE"><div align="left">失效</div></td>
            <td align=left bgcolor="EFEFEF"><%=rs("disable")%></td>
            <td align=left bgcolor="DEDFDE"><div align="left">所有制</div></td>
            <td align=left bgcolor="EFEFEF"><%=rs("ownershipname")%></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td align=left height=18  bgcolor="DEDFDE"><div align="left">发货地址</div></td>
            <td colspan="3" align=left bgcolor="EFEFEF"><%=rs("shipaddress")%></td>
            <td align=left bgcolor="DEDFDE"><div align="left">地址</div></td>
            <td align=left bgcolor="EFEFEF"><%=rs("billaddress")%></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td align=left height=18  bgcolor="DEDFDE"><div align="left">描述</div></td>
            <td colspan="3" align=left bgcolor="EFEFEF"><%=rs("taxno")%></td>
            <td align=left bgcolor="DEDFDE">&nbsp;</td>
            <td align=left bgcolor="EFEFEF">&nbsp; </td>
          </tr>
        </table>
</td></tr>
  <%
  i=i+1
  rs.MoveNext
  loop
%>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr height="50"><td>第<%=CurPage%>页&nbsp;/&nbsp;共<%=RS.PageCount%>页&nbsp;/&nbsp;记录数:<%=Rs.RecordCount%>条
</td></tr></table>
<%
  rs.Close
  set rs=nothing
  conn.Close 
  set conn=nothing
%>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -