📄 usertype.asp
字号:
<%@language="vbscript" codepage="936"%>
<%response.buffer = true%>
<%Public HOME_PATH:HOME_PATH = "../"%>
<!--#include file="../db.asp"-->
<!--#include file="../inc/function.asp"-->
<%Public title:title = "用户类别"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><%=title%></title><%
if isLogin = false then
Response.Write viewinfo("Logingo","","")
Response.end
end if
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<link href="<%=HOME_PATH%>css/style.css" rel="stylesheet" type="text/css">
<style>
html{min-width: 776px;}
fieldset {padding:3px;}
</style>
</head>
<body style = 'border-style:none;margin:0px;'>
<div style = 'text-align:center;'>
<table border = '1' cellspacing = '0' cellpadding = '2' borderColorLight="#848284" borderColorDark="#eeeeee" bordercolor="#EFBAEF" style = 'width:100%;border-bottom:0px solid;border-right:0px solid;'/>
<form method='post' action="<%=SELVAR("FN","")%>">
<input type = 'hidden' name = 'Options' value = 'Addmain'/>
<tr>
<td style = 'height:25px;width:45px;text-align:right;'>序号 </td>
<td style = 'width:100px;'>主类名</td>
<td style = 'width:30px;'>排列</td>
<td style = 'width:50px;'>已有数量</td>
<td style = 'width:50px;'>含子类数</td>
<td style = 'width:55px;'>客.商签别</td>
<td style = 'width:auto;'>备注</td>
<td style = 'width:88px;'> </td>
</tr>
<tr>
<td style = 'text-align:right;'>新加 </td>
<td><input type="text" name="uTypeName" style = 'width:100%;' class = 'input'/></td>
<td><input type = 'text' name = 'uTypeArray' style = 'width:100%;' class = 'input'/></td>
<td> </td>
<td> </td>
<td><%=classagin("identifyCode",3)%></td>
<td><input type = 'text' name = 'uTypeRemark' style = 'width:100%;' class = 'input'/></td>
<td><input type="submit" value = '新添加主类' style = 'width:72px;'></td>
</tr>
</form>
<%
SQL = ("select * From usertype where uTypeSelect = 0 Order By identifyCode , utypeid Desc")
Rs.Open(SQL),Conn,1,1
if not Rs.eof then
For i = 1 to Rs.RecordCount
utypeid = Rs("utypeid")
uTypeName = Rs("uTypeName")
uTypeArray = Rs("uTypeArray")
uTypeSelect = Rs("uTypeSelect")
AboutSub = DataCount("select count(utypeid) from usertype where uTypeSelect = " & utypeid & "",0)
uTypeRemark = Rs("uTypeRemark")
RsidentifyCode = isNumber(Rs("identifyCode"),"int",0)
supplierMainCount = DataCount("select count(uid) from supplier where utypeid in(select utypeid from usertype where uTypeSelect = " & utypeid & ")",0) '该主类的注册用户数
deleteButton = "<input type = 'submit' onclick = ""javascript:formm" & i & ".Options.value = 'deletemain';return confirm('即将彻底删除类别:(" & uTypeName & ")及与其相关的所有商品或购买记录.\n\n此操作不可撤消.是否继续?');return true;"" value = '删除'/>"
Response.Write"" &_
"<form method = 'post' action='" & SELVAR("FN","") & "' name = 'formm" & i & "'>" &_
"<input name = 'Options' type = 'hidden'/><input type = 'hidden' value = '" & RsidentifyCode & "' name = 'isIdentifyCode'/>" & _
"<input name = 'utypeid' type = 'hidden' value = '" & utypeid & "'/>" & _
"<tr>" &_
"<td style = 'text-align:right;'>" & utypeid & " </td>" & _
"<td><input type = 'text' name = 'uTypeName' value = '" & uTypeName & "' style = 'width:100%;' class = 'input'/></td>" & _
"<td><input type = 'text' name = 'uTypeArray' value = '" & uTypeArray & "' style = 'width:100%;' class = 'input'/></td>" & _
"<td style = 'text-align:center;'>" & supplierMainCount & "</td>" &_
"<td>" & AboutSub & "</td>" & _
"<td>" & classagin("identifyCode",RsidentifyCode) & "</td>" & _
"<td><input type = 'text' name = 'uTypeRemark' value = '" & uTypeRemark & "' style = 'width:100%;' class = 'input'/></td>" & _
"<td><input type = 'submit' value = '修改' onclick = ""javascript:formm" & i &".Options.value = 'updatemain';""/>" & deleteButton & "</td>" &_
"</tr>" & _
"</form>"
Rs.movenext
Next
uTypeData = true
else
uTypeData = false
Response.Write"<tr><td colspan = '7' style = 'color:red;text-align:center;'>请先添加一个用户主类!</td></tr>"
end if
Rs.Close
Function ata(SELExe , oldRequestid , newRequestid)
dim AboutUserTypeArr , AUTUBound , i_AUT
oldRequestid = GetText(oldRequestid,"P","number",1,10,0)
newRequestid = GetText(newRequestid,"P","number",1,10,0)
AboutUserTypeArr = array("stock","sale")
AUTUBound = UBound(AboutUserTypeArr)
Select Case SELExe
Case "U"
Conn.Execute("update usertype set uTypeSelect = " & newRequestid & " where utypeid = " & oldRequestid & "")
For i_AUT = 0 to AUTUBound
Conn.Execute("update " & AUTUBound(i_AUT) & " set utypeid = " & newRequestid & " where utypeid = " & oldRequestid & "")
Next
Case "D"
For i_AUT = 0 to AUTUBound
Conn.Execute(SQL)
Next
End Select
End Function
dim SQLAdd
Select Case trim(Request.Form("Options"))
Case "Addmain"
SQLAdd = "insert into usertype (uTypeName,uTypeArray,uTypeSelect,uTypeRemark,identifyCode) values ('" & Replace(GetText("uTypeName","P","Str",1,110,"none"),"'","’") & "' , " & GetText("uTypeArray","P","number",1,10,0) & " , 0 , '" & Replace(GetText("uTypeRemark","P","Str",1,1000,"none"),"'","’") & "' , " & GetText("identifyCode","P","number",1,10,0) & ") "
Conn.Execute(SQLAdd)
Response.Write viewinfo("alertLoca","主类添加成功!",SELVAR("FN",""))
SQL = ""
Case "updatemain"
Rutypeid = abs(GetText("utypeid","P","number",1,10,0))
RidentifyCode = GetText("identifyCode","P","number",1,10,0)
SQL = "update usertype Set uTypeName = '" & Replace(GetText("uTypeName","P","Str",1,110,"none"),"'","’") & "' , uTypeArray = " & GetText("uTypeArray","P","number",1,10,0) & " , uTypeSelect = " & GetText("uTypeSelect","P","number",1,10,0) & " , uTypeRemark = '" & Replace(GetText("uTypeRemark","P","Str",1,1000,"none"),"'","’") & "' , identifyCode = " & RidentifyCode & " where utypeid = " & Rutypeid & ""
SQLsub = "update usertype set identifyCode = " & RidentifyCode & " where uTypeSelect = " & Rutypeid & ""
Conn.Execute(SQL)
Conn.Execute(SQLsub)
Response.Write viewinfo("alertLoca","主类修改成功!",SELVAR("FN",""))
Case "deletemain"
uTypeid__ = abs(GetText("utypeid","P","number",1,10,0))
SQL = "delete from usertype where utypeid = " & uTypeid__ & ""
SQLm = "delete from usertype where utypeid = " & uTypeid__ & ""
SQLs = "delete from usertype where uTypeSelect = " & uTypeid__ & ""
SQLsupplier = "delete from supplier where utypeid in (select utypeid from userType where uTypeSelect = " & uTypeid__ & ")"
SQLstock = "delete from stock where supplierid in (select supplierid from userType where uTypeSelect = " & uTypeid__ & ")"'''''OK
SQLsale = "delete from sale where supplierid in (select supplierid from userType where uTypeSelect = " & uTypeid__ & ")"'OK
SQLsalelist = "delete from salelist where saleid in(select saleid from sale where supplierid in(select supplierid from userType where uTypeSelect = " & uTypeid__ & "))"'OK
SQLpayment = "delete from payment where supplierid in (select uid from supplier where utypeid in (select utypeid from usertype where uTypeSelect = " & uTypeid__ & "))"
'Set oO = Server.CreateObject("Adodb.RecordSet")
'oO.Open(SQLpayment),Conn,1,1
'if not oO.eof then
' for iii = 1 to oO.RecordCount
' Response.Write oO(0) & "<br/>"
' oO.movenext
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -