您现在的位置是:首页 >>LayuiLayui

Fun函数页面

zhang2021-07-22 15:34:24【Layui】人已围观

简介:
<!--#include file="../crmfun.asp" --><%isCrmLogindim i,id,sql,rs,action,s_field,s_keywor...

<!--#include file="../crmfun.asp" -->
<%
isCrmLogin
dim i,id,sql,rs,action,s_field,s_keyword, page, psize, order, ordsc
id=getForm("id","both")
action=getForm("action","both")
s_field =getForm("s_field","both")
s_keyword=getForm("s_keyword","both")
page=getForm("page","get")
psize=getForm("limit","get")
order=getForm("order","get")
if isnul(order) then order="CID"
ordsc=getForm("ordsc","get")
if isnul(ordsc) then ordsc="desc"
dim CID,AddTime,ContentOrder,ContentStatus,Country,Company,WorkType,GraduationStatus,ReimbursementStatus,OpenTime,Remark,UserID
CID=getForm("CID","post")
AddTime=getForm("AddTime","post")
ContentOrder=getForm("ContentOrder","post")
ContentStatus=getForm("ContentStatus","post")
Country=getForm("Country","both")
Company=getForm("Company","post")
WorkType=getForm("WorkType","post")
GraduationStatus=getForm("GraduationStatus","both")
ReimbursementStatus=getForm("ReimbursementStatus","both")
OpenTime=getForm("OpenTime","post")
Remark=getForm("Remark","post")
UserID=getForm("UserID","post")


Select case action
case "list" : listGetjob
case "add" : addGetjob
case "del" : delGetjob
case "edit" : editGetjob
End Select

Sub getGetjob
if not isnul(id) then
sql ="select * from CxCms_TableContent8 where CID="&id
set rs = conn.exec(sql,"r1")
if rs.eof then
alertMsgAndGo "没有这条记录","-1"
else
CID=rs("CID")
AddTime=rs("AddTime")
ContentOrder=rs("ContentOrder")
ContentStatus=rs("ContentStatus")
Country=rs("Country")
Company=rs("Company")
WorkType=rs("WorkType")
GraduationStatus=rs("GraduationStatus")
ReimbursementStatus=rs("ReimbursementStatus")
OpenTime=rs("OpenTime")
Remark=rs("Remark")
UserID=rs("UserID")
end if
rs.close : set rs=nothing
else
alertMsgAndGo "没有这条记录","-1"
end if
End Sub

Sub addGetjob
conn.Exec "insert into CxCms_TableContent8(AddTime,ContentOrder,ContentStatus,Country,Company,WorkType,GraduationStatus,ReimbursementStatus,OpenTime,Remark,UserID)values('"&now()&"',9,1,'"&Country&"','"&Company&"','"&WorkType&"','"&GraduationStatus&"','"&ReimbursementStatus&"','"&OpenTime&"','"&Remark&"','"&UserID&"')","exe"
die "{""status"":""success"",""msg"":""添加成功""}"
End Sub

Sub EditGetjob
conn.Exec "update CxCms_TableContent8 set Country='"&Country&"',Company='"&Company&"',WorkType='"&WorkType&"',GraduationStatus='"&GraduationStatus&"',ReimbursementStatus='"&ReimbursementStatus&"',OpenTime='"&OpenTime&"',Remark='"&Remark&"',UserID='"&UserID&"' where CID="&id,"exe"
die "{""status"":""success"",""msg"":""编辑成功""}"
End Sub

Sub delGetjob
conn.Exec "delete * from CxCms_TableContent8 where CID in ("&id&")","exe"
die "{""status"":""success"",""msg"":""删除成功""}"
End Sub

Sub listGetjob
dim whereStr,orderStr
if not isnum(psize) then psize=10
if isNul(page) then page=1 else page=clng(page)
if page=0 then page=1
orderStr=" order by "&order&" "&ordsc &""
whereStr=" where 1=1"
if not isNul(s_keyword) then
if isNul(s_field) then
whereStr = whereStr&" and (Company like '%"&s_keyword&"%' or WorkType like '%"&s_keyword&"%' or Remark like '%"&s_keyword&"%')"
else
whereStr = whereStr&" and "&s_field&" like '%"&s_keyword&"%'"
end if
end if
if not isnul(Country) then whereStr = whereStr&" and Country = '"&Country&"'"
if not isnul(GraduationStatus) then whereStr = whereStr&" and GraduationStatus = '"&GraduationStatus&"'"
if not isnul(ReimbursementStatus) then whereStr = whereStr&" and ReimbursementStatus = '"&ReimbursementStatus&"'"
sql="select * from CxCms_TableContent8 "&whereStr&" "&orderStr
set rs = conn.Exec(sql,"r1")
rs.pagesize = psize
if page>rs.pagecount then page=rs.pagecount
if rs.recordcount=0 then
if not isNul(s_keyword) or not isNul(s_Field) then
die "{""status"": ""success"" ,""msg"":""搜索条件没有记录"" ,""count"": ""0"" ,""data"": []}"
else
die "{""status"": ""success"" ,""msg"":""该分类没有记录"" ,""count"": ""0"" ,""data"": []}"
end if
else
echo "{""status"": ""success"" ,""msg"":""数据请求成功"" ,""count"": """&rs.recordcount&""" ,""data"": ["
rs.absolutepage = page
for i = 1 to psize
if i>1 then echo ","
echo "{"&vbcrlf
echo """index"": """&psize*page-psize+i&""""&vbcrlf
echo ",""id"": """&rs(0)&""""&vbcrlf
echo ",""CID"" : """&rs("CID")&""""&vbcrlf
echo ",""AddTime"" : """&rs("AddTime")&""""&vbcrlf
echo ",""ContentOrder"" : """&rs("ContentOrder")&""""&vbcrlf
echo ",""ContentStatus"" : """&rs("ContentStatus")&""""&vbcrlf
echo ",""Country"" : """&rs("Country")&""""&vbcrlf
echo ",""Company"" : """&rs("Company")&""""&vbcrlf
echo ",""WorkType"" : """&rs("WorkType")&""""&vbcrlf
echo ",""GraduationStatus"" : """&rs("GraduationStatus")&""""&vbcrlf
echo ",""ReimbursementStatus"" : """&rs("ReimbursementStatus")&""""&vbcrlf
echo ",""OpenTime"" : """&rs("OpenTime")&""""&vbcrlf
echo ",""Remark"" : """&rs("Remark")&""""&vbcrlf
echo ",""UserID"" : """&rs("UserID")&""""&vbcrlf
if isnum(rs("UserID")) then
echo ",""UserName"" : """&conn.exec("select TrueName from CxCms_TableContent1 where CID="&rs("UserID"),"r1")(0)&""""&vbcrlf
end if
echo "}"&vbcrlf
rs.movenext
if rs.eof then exit for
next
echo "]}"
end if
rs.close:set rs=nothing
response.end()
End Sub
%>




上一篇:Edit编辑页面

下一篇:List列表页面

文章评论

    评论加载中...

标签云

站点信息

  • 建站时间:2018-11-17
  • 文章统计:165篇文章
  • 微信交流:扫描二维码,添加我
在线客服
在线客服
在线咨询:
点击这里给我发消息技术交流
点击这里给我发消息技术交流
电话咨询:
(微信同步)
15629136039
微信二维码