admin_softinfo.asp
来自「.asp网站程序。专业的二手汽车商店网站。功能强大」· ASP 代码 · 共 577 行 · 第 1/2 页
ASP
577 行
<!-- #include file="config.asp" -->
<!-- #include file="top.asp" -->
<!--#include file="navbar.asp" -->
<HTML><HEAD><TITLE>物品详细信息</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
</HEAD>
<SCRIPT LANGUAGE=javascript>
<!--
function Juge(myform)
{
if (myform.SoftName.value == "")
{
alert("信息名称不能为空!");
myform.SoftName.focus();
return (false);
}
if (myform.cateid.value == "")
{
alert("信息所属大类不能为空!");
myform.cateid.focus();
return (false);
}
if (myform.SoftSize.value == "")
{
alert("你是要免费相送吗?");
myform.SoftSize.focus();
return (false);
}
if (checktext(myform.SoftSize.value))
{
alert("还是只输入价格吧…");
myform.SoftSize.select();
myform.SoftSize.focus();
myform.SoftSize.value="";
return (false);
}
if (myform.subcateid.value == "")
{
alert("信息所属小类不能为空!");
myform.subcateid.focus();
return (false);
}
if (myform.softtype.value == "")
{
alert("交易类型不能为空!");
myform.softtype.focus();
return (false);
}
if (myform.System.value == "")
{
alert("信息运行环境不能为空!");
myform.System.focus();
return (false);
}
if (checktext(myform.SoftSize.value))
{
alert("物品价格输入数字即可 !");
myform.SoftSize.select();
myform.SoftSize.focus();
myform.SoftSize.value="";
return (false);
}
if (myform.LicenceType.value == "")
{
alert("交易地区不能为空!");
myform.LicenceType.focus();
return (false);
}
if (myform.SoftFrom.value == "")
{
alert("相关此类信息不能为空!");
myform.SoftFrom.focus();
return (false);
}
if (myform.SoftType.value == "")
{
alert("交易类型不能为空!");
myform.SoftType.focus();
return (false);
}
if (myform.content.value == "")
{
alert("信息简介不能为空!");
myform.content.focus();
return (false);
}
}
function checktext(text)
{
allValid = false;
var checkOK = "0123456789.";
for (i = 0; i < text.length; i++)
{
ch = text.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = true;
break;
}
}
return allValid;
}
//-->
</script>
<SCRIPT language=javaScript src="inc/ubbcode.js" type=text/javascript></SCRIPT>
<BODY leftMargin=0 topmargin="2" onkeydown='if(event.keyCode==13 && event.ctrlKey)myform.submit()'>
<%
if UserName="" then
msgtitle="添加信息失败"
msginfo="<li>你没有登录系统。<li><a href=""User.Asp"">点此登录系统</a></li>"
call Sysmsg(msgtitle,msginfo)
else
select case request("action")
case "add"
call SaveAdd()
case "modify"
call SaveModify()
case "edit"
isEdit=True
call chkUser(isEdit)
case else
isEdit=False
' call myform(isEdit)
call chkUser(isEdit)
end select
end if
dim AllSoft,DayUpdateAll,DayUpdateCHS,DayUpdateENG,DayUpdateHy,AllCHS,AllENG,AllHy,AllDownNum
set Rs=server.createobject("adodb.recordset")
'全部物品数量
sql1="Select count(SoftID) from "&CategoryName&"_SoftInfo"
rs.open sql1,conn,1,1
AllSoft=rs(0)
if isnull(AllSoft) then AllSoft=0
rs.close
'今日推出物品
sql2="Select count(SoftID) from "&CategoryName&"_SoftInfo Where SoftTime=Date()"
rs.open sql2,conn,1,1
DayUpdateAll=rs(0)
if isnull(DayUpdateAll) then DayUpdateAll=0
rs.close
'今日要转让的物品
sql3="Select count(SoftID) from "&CategoryName&"_SoftInfo Where SoftTime=Date() and SoftType='转让'"
rs.open sql3,conn,1,1
DayUpdateCHS=rs(0)
if isnull(DayUpdateCHS) then DayUpdateCHS=0
rs.close
'今日要购进的物品
sql4="Select count(SoftID) from "&CategoryName&"_SoftInfo Where SoftTime=Date() and SoftType='求购'"
rs.open sql4,conn,1,1
DayUpdateENG=rs(0)
if isnull(DayUpdateENG) then DayUpdateENG=0
rs.close
'今日出租信息
sql5="Select count(SoftID) from "&CategoryName&"_SoftInfo Where SoftTime=Date() and SoftType='出租'"
rs.open sql5,conn,1,1
DayUpdateHy=rs(0)
if isnull(DayUpdateHy) then DayUpdateHy=0
rs.close
'今日求租信息
sql5="Select count(SoftID) from "&CategoryName&"_SoftInfo Where SoftTime=Date() and SoftType='求租'"
rs.open sql5,conn,1,1
DayUpdateHy=rs(0)
if isnull(DayUpdateHy) then DayUpdateHy=0
rs.close
'要转让的物品总数
sql6="Select count(SoftID) from "&CategoryName&"_SoftInfo Where SoftType='转让'"
rs.open sql6,conn,1,1
AllCHS=rs(0)
if isnull(AllCHS) then AllCHS=0
rs.close
'要求购的物品总数
sql7="Select count(SoftID) from "&CategoryName&"_SoftInfo Where SoftType='求购'"
rs.open sql7,conn,1,1
AllENG=rs(0)
if isnull(AllENG) then AllENG=0
rs.close
'要出租的物品总数
sql8="Select count(SoftID) from "&CategoryName&"_SoftInfo Where SoftType='出租'"
rs.open sql8,conn,1,1
AllHy=rs(0)
if isnull(AllHy) then AllHy=0
rs.close
'要求租的物品总数
sql8="Select count(SoftID) from "&CategoryName&"_SoftInfo Where SoftType='求租'"
rs.open sql8,conn,1,1
AllHy=rs(0)
if isnull(AllHy) then AllHy=0
rs.close
'物品总浏览量
sql8="Select sum(AllHits) from "&CategoryName&"_SoftInfo"
rs.open sql8,conn,1,1
AllDownNum=rs(0)
if isnull(AllDownNum) then AllDownNum=0
rs.close
conn.execute("update "&CategoryName&"_DayUpdate set AllSoft="&AllSoft&",DayUpdateAll="&DayUpdateAll&",DayUpdateCHS="&DayUpdateCHS&",DayUpdateENG="&DayUpdateENG&",DayUpdateHy="&DayUpdateHy&",AllCHS="&AllCHS&",AllENG="&AllENG&",AllHy="&AllHy&",AllDownNum="&AllDownNum&" where ID=1")
set rs=nothing
msgtitle="更新公告"
msginfo="操作成功,今日更新公告的数据已经更新!"
sub Sysmsg(msgtitle,msginfo)
end sub
sub chkUser(isEdit)
if isEdit=True then
if not chkEditUser(UserName,trim(request("SoftID"))) then
msgtitle="修改信息失败"
msginfo="<li>你没有权限修改他人添加的信息。</li><li>如有问题请联系管理员。</li>"
call Sysmsg(msgtitle,msginfo)
elseif chkEditUser(UserName,trim(request("SoftID"))) then
call myform(isEdit)
end if
elseif isEdit=False then
if request("cateid")="" and request("subcateid")="" then
msgtitle="添加信息失败"
msginfo="<li>你没有选择要添加信息的分类。"&_
"<li><A href=""Admin_Category.asp""> 选择信息分类</A><br>"
call Sysmsg(msgtitle,msginfo)
elseif not chkPubUser(UserName,request("subcateid")) then
msgtitle="添加信息失败"
msginfo="<li>你没有在此分类中发布信息的权限。<li>如有问题请联系管理员</li>"
call Sysmsg(msgtitle,msginfo)
elseif chkPubUser(UserName,request("subcateid")) then
call myform(isEdit)
end if
end if
end sub
sub SaveModify()
set rs=server.createobject("adodb.recordset")
sql="select * from "&CategoryName&"_SoftInfo where SoftID="&request.form("SoftID")
rs.open sql,conn,1,3
rs("SoftName")=checkstr(request.form("SoftName"))
rs("SoftVer")=checkstr(request.form("SoftVer"))
rs("CateID")=trim(request.form("CateID"))
rs("SubCateID")=trim(request.form("SubCateID"))
rs("Content")=request.form("content")
rs("Images")=checkstr(trim(request.form("Images")))
rs("SoftFrom")=checkstr(trim(request.form("SoftFrom")))
rs("LicenceType")=trim(request.form("LicenceType"))
rs("SoftSize")=trim(request.form("SoftSize"))
rs("Language")=Trim(Request.Form("Language"))
rs("System")=trim(request.form("System"))
rs("SoftType")=checkstr(trim(request.form("SoftType")))
if trim(request.form("updateTime"))="yes" then
rs("SoftTime")=date()
end if
rs.update
rs.close
set rs=nothing
msgtitle="保存修改成功"
call Sysmsg(msgtitle,msginfo)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?