📄 select.asp
字号:
strwhere=strwhere+" and productid="&theid&" and sysaccountid="&sysid
sql = "select * from vw_product_location where 1=1 "&strwhere
elseif instr(theName,"location")>0 then
sql = "select * from v_location where 1=1 "&strwhere
elseif theName="order" or theName="corder" then
if objcheck.CheckUserFunction2("payment","edit") or objcheck.CheckUserFunction2("delivery","edit") then
sql = "select top 50 * from v_order where sysaccountid="&sysid&" "&strwhere&" order by orderid desc"
else
sql = "select top 50 * from v_order where (userid='"&session("loginid")&"' or userid in(select userid from v_userreportto_all where reportto='"&session("loginid")&"')) and sysaccountid="&sysid&" "&strwhere&" order by orderid desc"
end if
elseif theName="delivery" then
if objcheck.CheckUserFunction2("payment","edit") or objcheck.CheckUserFunction2("delivery","edit") then
sql = "select top 50 * from v_delivery where sysaccountid="&sysid&strwhere&" order by deliveryid desc"
else
sql = "select top 50 * from v_delivery where (userid='"&session("loginid")&"' or userid in(select userid from v_userreportto_all where reportto='"&session("loginid")&"')) and sysaccountid="&sysid&strwhere&" order by deliveryid desc"
end if
elseif theName="deal" then
sql = "select top 50 * from v_deal where (owner='"&session("loginid")&"' or owner in(select userid from v_userreportto_all where reportto='"&session("loginid")&"'))"&strwhere&" and accountid="&theid
elseif theName="expense" then
sql = "select top 50 * from v_expense where (owner='"&session("loginid")&"' or owner in(select userid from v_userreportto_all where reportto='"&session("loginid")&"'))"&strwhere
elseif instr(theName,"quote")>0 then
sql = "select top 50 * from v_quote where (userid='"&session("loginid")&"' or userid in(select userid from v_userreportto_all where reportto='"&session("loginid")&"')) and (status='通过' or status='同意' or status='转换')"&strwhere
elseif theName="poreceive" then
if objcheck.CheckUserFunction2("delivery","edit") then
sql = "select top 50 * from v_poreceive where sysaccountid="&sysid&strwhere&" order by poreceiveno desc"
else
sql = "select top 50 * from v_poreceive where (owner='"&session("loginid")&"' or owner in(select userid from v_userreportto_all where reportto='"&session("loginid")&"')) and sysaccountid="&sysid&strwhere&" order by poreceiveno desc"
end if
elseif theName="receivesheet" then
if objcheck.CheckUserFunction2("delivery","edit") then
sql = "select top 50 * from v_poreceive where status='已收货' and sysaccountid="&sysid&strwhere
else
sql = "select top 50 * from v_poreceive where status='已收货' and (owner='"&session("loginid")&"' or owner in(select userid from v_userreportto_all where reportto='"&session("loginid")&"')) and sysaccountid="&sysid&strwhere
end if
elseif theName="payment" then
if strwhere<>"" then toprecordnum="" else toprecordnum=" top 20 "
if theid<>"undefined" and theid<>"" then strorder=" and orderid="&theid
if objcheck.CheckUserFunction2("payment","edit") then
sql="select "&toprecordnum&" * from v_orderpayment where sysaccountid="&sysid&" "&strwhere&strorder
else
sql="select "&toprecordnum&" * from v_orderpayment where (creator='"&session("loginid")&"' or userid='"&session("loginid")&"' or userid in(select userid from v_userreportto_all where reportto='"&session("loginid")&"')) and sysaccountid="&sysid&" "&strwhere&strorder
end if
elseif theName="popayment" then
if strwhere<>"" then toprecordnum="" else toprecordnum=" top 20 "
if theid<>"undefined" and theid<>"" then strpo=" and poid="&theid
if objcheck.CheckUserFunction2("payment","edit") then
sql="select "&toprecordnum&" * from v_popayment where sysaccountid="&sysid&" "&strwhere&strpo
else
sql="select "&toprecordnum&" * from v_popayment where (creator='"&session("loginid")&"' or userid='"&session("loginid")&"' or userid in(select userid from v_userreportto_all where reportto='"&session("loginid")&"')) and sysaccountid="&sysid&" "&strwhere&strpo
end if
end if
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open connstring
'Response.Write sql
'response.end
rs.Open sql,conn,1,1
if not rs.EOF and not rs.BOF then
while not rs.EOF
%>
<tr bgcolor=white>
<%if instr(theName,"owner")>0 or theName="user" then
if theName="bowner" then
%>
<td align="center" nowrap><input type="checkbox" name="userid" value="<%=rs("loginid")%>"><input type="hidden" name="user<%=rs("loginid")%>" value="<%=rs("username")%>"></td>
<td align="center" nowrap><a href="javascript:pickup8('<%=rs("username")%>','<%=rs("loginid")%>');"><%= rs("UserName")%></a></td>
<td align="center" nowrap><a href="javascript:pickup8('<%=rs("username")%>','<%=rs("loginid")%>');"><%= rs("loginid")%></a></td>
<td align="center" nowrap><a href="javascript:pickup8('<%=rs("username")%>','<%=rs("loginid")%>');"><%= rs("title")%></a></td>
<td align="center" nowrap><a href="javascript:pickup8('<%=rs("username")%>','<%=rs("loginid")%>');"><%= rs("Territoryname")%></a></td>
<td align="center" nowrap><a href="javascript:pickup8('<%=rs("username")%>','<%=rs("loginid")%>');"><%= rs("phone")%></a></td>
<%
else
%>
<td align="center" nowrap><a href="javascript:pickup2('<%=rs("username")%>','<%=rs("loginid")%>');"><%= rs("UserName")%></a></td>
<td align="center" nowrap><a href="javascript:pickup2('<%=rs("username")%>','<%=rs("loginid")%>');"><%= rs("loginid")%></a></td>
<td align="center" nowrap><a href="javascript:pickup2('<%=rs("username")%>','<%=rs("loginid")%>');"><%= rs("title")%></a></td>
<td align="center" nowrap><a href="javascript:pickup2('<%=rs("username")%>','<%=rs("loginid")%>');"><%= rs("Territoryname")%></a></td>
<td align="center" nowrap><a href="javascript:pickup2('<%=rs("username")%>','<%=rs("loginid")%>');"><%= rs("phone")%></a></td>
<%
end if
elseif theName="caccount" then%>
<td align="center" nowrap><a href="javascript:pickup6('<%=rs("account")%>','<%=rs("accountid")%>','<%=rs("billaddress")%>','<%=rs("phone")%>','<%=rs("fax")%>','<%=rs("city1")%>','<%=rs("zip1")%>');"><%= rs("account")%></a></td>
<td align="center" nowrap><%= rs("Siccode")%></td>
<td align="center" nowrap><%= rs("industry")%></td>
<td align="center" nowrap><%= rs("accounttype")%></td>
<td align="center" nowrap><%= rs("phone")%></td>
<%elseif instr(theName,"account")>0 then%>
<td align="center" nowrap><a href="javascript:pickup2('<%=rs("account")%>','<%=rs("accountid")%>');"><%= rs("account")%></a></td>
<td align="center" nowrap><%= rs("Siccode")%></td>
<td align="center" nowrap><%= rs("industry")%></td>
<td align="center" nowrap><%= rs("accounttype")%></td>
<td align="center" nowrap><%= rs("phone")%></td>
<%elseif theName="Manufacturer" or theName="Supplier" then%>
<td align="center" nowrap><a href="javascript:pickup2('<%=rs("account")%>','<%=rs("accountid")%>');"><%= rs("account")%></a></td>
<td align="center" nowrap><%= rs("Siccode")%></td>
<td align="center" nowrap><%= rs("industry")%></td>
<td align="center" nowrap><%= rs("accounttype")%></td>
<td align="center" nowrap><%= rs("phone")%></td>
<%elseif theName="contact" then%>
<td align="center" nowrap><a href="javascript:pickup2('<%=rs("contact")%>','<%=rs("contactid")%>');"><%= rs("contact")%></a></td>
<td align="center" nowrap><%= rs("contactdepartment")%></td>
<td align="center" nowrap><%= rs("title")%></td>
<td align="center" nowrap><%= rs("workphone")%></td>
<td align="center" nowrap><%= rs("account")%></td>
<%elseif theName="PO" then%>
<td align="center" nowrap><a href="javascript:pickup2('<%=rs("pono")%>','<%=rs("poid")%>');"><%= rs("pono")%></a></td>
<td align="center" nowrap><%= rs("account")%></td>
<td align="center" nowrap><%= rs("totalamount")%></td>
<td align="center" nowrap><%= rs("status")%></td>
<td align="center" nowrap><%= rs("podate")%></td>
<td align="center" nowrap><%= rs("owner")%></td>
<%elseif instr(theName,"sendlocation")>0 then%>
<td align="center" nowrap><a href="javascript:pickup3('<%=rs("location")%>','<%=rs("locationid")%>','<%=rs("qty_on_hand")-rs("qty_rsvd")%>','<%=rs("nonnet")%>');"><%= rs("location")%></a></td>
<td align="center" nowrap><%= rs("whse")%></td>
<td align="center" nowrap><%= rs("productcode")%></td>
<td align="center" nowrap><%= rs("model")%></td>
<td align="center" nowrap><%= rs("qty_on_hand")%></td>
<td align="center" nowrap><%if rs("nonnet") then Response.Write "是" else Response.Write "否"%></td>
<%elseif instr(theName,"location")>0 then%>
<td align="center" nowrap><a href="javascript:pickup2('<%=rs("location")%>','<%=rs("locationid")%>');"><%= rs("location")%></a></td>
<td align="center" nowrap><%= rs("whse")%></td>
<td align="center" nowrap><%= rs("locationtype")%></td>
<td align="center" nowrap><%if rs("nonnet") then Response.Write "保留或者不可用货位" else Response.Write "正常货位"%></td>
<%elseif theName="order" then%>
<td align="center" nowrap><a href="javascript:pickup2('<%=rs("ordernum")%>','<%=rs("orderid")%>');"><%= rs("ordernum")%></a></td>
<td align="center" nowrap><%= rs("account")%></td>
<td align="center" nowrap><%= rs("totalamount")%></td>
<td align="center" nowrap><%= rs("status")%></td>
<td align="center" nowrap><%= rs("signeddate")%></td>
<td align="center" nowrap><%= rs("owner")%></td>
<%elseif theName="corder" then%>
<td align="center" nowrap><a href="javascript:pickup21('<%=rs("ordernum")%>','<%=rs("orderid")%>','<%=rs("account")%>','<%=rs("accountid")%>');"><%= rs("ordernum")%></a></td>
<td align="center" nowrap><%= rs("account")%></td>
<td align="center" nowrap><%= rs("totalamount")%></td>
<td align="center" nowrap><%= rs("status")%></td>
<td align="center" nowrap><%= rs("signeddate")%></td>
<td align="center" nowrap><%= rs("owner")%></td>
<%elseif theName="CPO" then%>
<td align="center" nowrap><a href="javascript:pickup22('<%=rs("pono")%>','<%=rs("poid")%>','<%=rs("account")%>','<%=rs("accountid")%>');"><%= rs("pono")%></a></td>
<td align="center" nowrap><%= rs("account")%></td>
<td align="center" nowrap><%= rs("totalamount")%></td>
<td align="center" nowrap><%= rs("status")%></td>
<td align="center" nowrap><%= rs("podate")%></td>
<td align="center" nowrap><%= rs("owner")%></td>
<%elseif theName="delivery" then%>
<td align="center" nowrap><a href="javascript:pickup2('<%=rs("deliveryno")%>','<%=rs("deliveryid")%>');"><%= rs("deliveryno")%></a></td>
<td align="center" nowrap><%= rs("account")%></td>
<td align="center" nowrap><%= rs("totalamount")%></td>
<td align="center" nowrap><%= rs("status")%></td>
<td align="center" nowrap><%= rs("owner")%></td>
<%elseif theName="deal" then%>
<%if theseq<>"DealProcess" then%>
<td align="center" nowrap><a href="javascript:pickup2('<%=rs("subject")%>','<%=rs("dealid")%>');"><%= rs("deal")%></a></td>
<%else%>
<td align="center" nowrap><a href="javascript:pickup4('<%=rs("subject")%>','<%=rs("dealid")%>',<%=rs("dealprocessid")%>);"><%= rs("deal")%></a></td>
<%end if%>
<td align="center" nowrap><%= rs("subject")%></td>
<td align="center" nowrap><%= rs("account")%></td>
<td align="center" nowrap><%= rs("totalamount")%></td>
<td align="center" nowrap><%= rs("status")%></td>
<td align="center" nowrap><%= rs("opendate")%></td>
<td align="center" nowrap><%= rs("owner")%></td>
<%elseif theName="expense" then%>
<td align="center" nowrap><a href="javascript:pickup5('<%=rs("expenseno")%>','<%=rs("expenseid")%>');"><%= rs("expenseno")%></a></td>
<td align="center" nowrap><%=rs("subject")%></td>
<td align="center" nowrap><%= rs("totalamount")%></td>
<td align="center" nowrap><%= rs("status")%></td>
<td align="center" nowrap><%= rs("username")%></td>
<%elseif instr(theName,"quote")>0 then%>
<td align="center" nowrap><a href="javascript:pickup5('<%=rs("quoteno")%>','<%=rs("quoteid")%>');"><%= rs("quoteno")%></a></td>
<td align="center" nowrap><%= rs("account")%></td>
<td align="center" nowrap><%= rs("totalamount")%></td>
<td align="center" nowrap><%= rs("status")%></td>
<td align="center" nowrap><%= rs("quotedate")%></td>
<td align="center" nowrap><%= rs("owner")%></td>
<%elseif theName="poreceive" or theName="receivesheet" then%>
<td align=center height=18><a href="javascript:pickup2('<%=rs("poreceiveno")%>','<%=rs("poreceiveid")%>');"><%=rs("poreceiveno")%></a></td>
<td align=center><%=rs("account")%></td>
<td align=center><%=rs("totalamount")%></td>
<td align=center><%=rs("status")%></td>
<td align=center><%=rs("PoDate")%></td>
<td align=center><%=rs("username")%></td>
<%elseif theName="payment" then%>
<td align=center height=18><a href="javascript:pickup7('<%=rs("account")%>','<%=rs("accountid")%>','<%=rs("paymentno")%>','<%=rs("paymentid")%>','<%=rs("ordernum")%>','<%=rs("orderid")%>');"><%=rs("paymentno")%></a></td>
<td align=center><a href="javascript:pickup7('<%=rs("account")%>','<%=rs("accountid")%>','<%=rs("paymentno")%>','<%=rs("paymentid")%>','<%=rs("deliveryamount")%>');"><%=rs("account")%></a></td>
<td align=center><%=rs("ordernum")%></td>
<td align=center><%=rs("deliveryamount")%></td>
<td align=center><%=rs("invoicedate")%></td>
<td align=center><%=rs("username")%></td>
<%elseif theName="popayment" then%>
<td align=center height=18><a href="javascript:pickup9('<%=rs("account")%>','<%=rs("accountid")%>','<%=rs("paymentno")%>','<%=rs("paymentid")%>','<%=rs("pono")%>','<%=rs("poid")%>');"><%=rs("paymentno")%></a></td>
<td align=center><a href="javascript:pickup7('<%=rs("account")%>','<%=rs("accountid")%>','<%=rs("paymentno")%>','<%=rs("paymentid")%>','<%=rs("amount")%>');"><%=rs("account")%></a></td>
<td align=center><%=rs("pono")%></td>
<td align=center><%=rs("amount")%></td>
<td align=center><%=rs("invoicedate")%></td>
<td align=center><%=rs("username")%></td>
<%end if%>
</tr>
<%
rs.MoveNext
wend
if theName="bowner" then
%>
<tr bgcolor=white>
<td align=center><input type=button value="提交" onclick="form1.submit()"></td>
<td colspan=5></td>
</tr>
<%
end if
%>
</table>
<%
else
Response.Write "<table width=100% cellspacing=1><tr bgcolor=white><td >无记录</td></tr></table>"
end if
rs.close
Set rs = nothing
conn.Close
set conn = nothing
'end if
%>
</form>
</body>
</html>
<%set objcheck=nothing%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -