📄 payitem.asp
字号:
<%ds="../../"%>
<!--#include file="../../conn/adminconn.asp" -->
<!--#include file="../checkvalid.asp" -->
<!--#include file="../../inc/safe.asp" -->
<%
If Not FRAdminLevel(84) Then
Call ErrorMsg()
End If
%>
<%
action=request("action")
select case action
case "add"
call add()
case "modi"
call modi()
case "del"
call del()
end select
sub add()
price_name=request("price_name")
price_picture=request("price_picture")
price_useday=request("price_useday")
price_value=request("price_value")
price_content=request("price_content")
if price_name="" or price_picture="" or price_useday="" or price_value="" then
response.write"<SCRIPT language=JavaScript>alert('请将信息填写完整!');"
response.write"javascript:history.go(-1)</script>"
response.end
end if
sql="insert into job_prices (price_name,price_picture,price_useday,price_value,price_content,price_type) values('"&price_name&"','"&price_picture&"',"&price_useday&","&price_value&",'"&price_content&"',1)"
conn.execute(sql)
response.write"<SCRIPT language=JavaScript>alert('添加成功!');"
response.write"window.location='PayItem.asp';</script>"
response.end
end sub
sub modi()
id=request("id")
price_name=request("price_name")
price_picture=request("price_picture")
price_useday=request("price_useday")
price_value=request("price_value")
price_content=request("price_content")
if id="" or price_name="" or price_picture="" or price_useday="" or price_value="" then
response.write"<SCRIPT language=JavaScript>alert('请将信息填写完整!');"
response.write"javascript:history.go(-1)</script>"
response.end
end if
sql="update job_prices set price_name='"&price_name&"', price_picture='"&price_picture&"', price_useday="&price_useday&", price_value="&price_value&",price_content='"&price_content&"' where price_type=1 and id="&id
conn.execute(sql)
response.write"<SCRIPT language=JavaScript>alert('修改成功!');"
response.write"window.location='PayItem.asp';</script>"
response.end
end sub
sub del()
id=request("id")
sql = "delete from job_prices where price_type=1 and id="&id
conn.execute(sql)
response.write"<SCRIPT language=JavaScript>alert('删除成功!');"
response.write"window.location='PayItem.asp';</script>"
response.end
end sub
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>自定义消费设定</title>
<LINK href="../css/style.css" rel=stylesheet type=text/css>
<script language="javascript">
function checkdata()
{
if (document.formAdd.price_name.value=="")
{
alert("消费项目名称不能为空!")
document.formAdd.price_name.focus()
return false
}
if (document.formAdd.price_picture.value=="")
{
alert("消费项目图片不能为空!")
document.formAdd.price_picture.focus()
return false
}
if (document.formAdd.price_value.value=="")
{
alert("消费值不能为空!")
document.formAdd.price_value.focus()
return false
}
if (document.formAdd.price_content.value=="")
{
alert("简要说明不能为空!")
document.formAdd.price_content.focus()
return false
}
}
</script></head>
<body>
<div align="center">
<table cellspacing="1" cellpadding="4" width="100%" class="tableBorder">
<form action="PayItem.asp" method="post" name="formAdd" onSubmit="return checkdata();">
<input type="hidden" name="action" value="add">
<tr>
<th height="25" colspan="2" class="header">
<font color="#FFFFFF"><b>添加自定义消费项目</b></font></th>
</tr>
<tr class=altbg1 align=center>
<td class="altbg1" align="right">
<p>消费项目名称:</td>
<td class="altbg2" align="left">
<input type="text" name="price_name" size="30"></td>
</tr>
<tr class=altbg1 align=center>
<td class="altbg1" align="right">项目图片:</td>
<td class="altbg2" align="left"><span class="amrow">
<input name="price_picture" type="text" id="price_picture" value="" size="35" maxlength="255">
<input type="button" name="upfile" value="浏览文件" onClick="window.open('../inc/job_up.asp?fromForm=formAdd&fromEdit=price_picture&saveTo=../../upimages/aboutpic&showPath=','','status=no,scrollbars=no,top=80,left=200,width=420,height=165')">
</span></td>
</tr>
<tr class=altbg1 align=center>
<td class="altbg1" align="right">
可用天数:</td>
<td class="altbg2" align="left"><input name="price_useday" type="text" id="price_useday" size="15" maxlength="10">
天</td>
</tr>
<tr class=altbg1 align=center>
<td class="altbg1" align="right">
消费点数:</td>
<td class="altbg2" align="left"><input name="price_value" type="text" id="price_value" size="15">
点</td>
</tr>
<tr class=altbg1 align=center>
<td class="altbg1" align="right">
简要说明:</td>
<td class="altbg2" align="left"><input name="price_content" type="text" id="price_content" size="50"></td>
</tr>
<tr class=altbg1 align=center>
<td class="altbg1" align="right">
</td>
<td class="altbg2">
<p align="left">
<input type="submit" value="添加项目" name="B1"></td>
</tr>
</form>
</table>
</div>
<table border="0" width="100%" id="table9" cellpadding="0" style="border-collapse: collapse">
<tr>
<td height="5"></td>
</tr>
</table>
<div align="center">
<table cellspacing="1" cellpadding="4" width="100%" class="tableBorder" id="table6">
<tr>
<th height="25" colspan="8" class="header">
<font color="#FFFFFF"><b>自定义消费项目管理</b></font></th>
</tr>
<tr class=altbg1 align=center>
<td width="7%"><b>项目ID</b></td>
<td><b>消费项目名称</b></td>
<td><b>项目图片</b></td>
<td><b>可用天数</b></td>
<td><b>消费点数</b></td>
<td><b>简要说明</b></td>
<td><b>修改</b></td>
<td><b>操作</b></td>
</tr>
<%
sql="select * from job_prices where price_type=1"
set rs=server.CreateObject ("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write "<tr><td colspan=5 class=altbg2 align=center><font color=#ff0000>暂时还没有任何数据,请添加!</a></td></tr>"
else
i=1
do while not rs.eof
id=rs("id")
price_name=rs("price_name")
price_picture=rs("price_picture")
price_useday=rs("price_useday")
price_value=rs("price_value")
price_content=rs("price_content")
%>
<form name="form<%=id%>" action="PayItem.asp" method="post">
<input type="hidden" name="action" value="modi">
<tr class=altbg2>
<td align="center"><span class="amrow"><input type="hidden" name="id" value="<%=id%>"><%=rs("id")%></span></td>
<td><span class="amrow">
<input name="price_name" type="text" value="<%=price_name%>" size="20">
</span> </td>
<td align="center"><input name="price_picture" type="hidden" id="price_picture" value="<%=price_picture%>">
<img src="../../upimages/aboutpic/<%=price_picture%>" width="110" height="80" alt="点击修改此图片" onClick="window.open('../inc/job_up.asp?fromForm=form<%=id%>&fromEdit=price_picture&saveTo=../../upimages/aboutpic&showPath=','','status=no,scrollbars=no,top=80,left=200,width=420,height=165')" style="cursor:pointer;"></td>
<td align="center"><input name="price_useday" type="text" id="price_useday" value="<%=price_useday%>" size="5" maxlength="10"></td>
<td align="center">
<input name="price_value" type="text" value="<%=price_value%>" size="5" maxlength="10">
</td>
<td align="center"><span class="amrow">
<input name="price_content" type="text" value="<%=price_content%>" size="20">
</span></td>
<td align="center">
<input type="submit" value="修改保存" name="B4"></td>
<td align="center">
<a href="#" onClick="javascript:if (confirm('确认要删除此消费项目吗?')){window.location='PayItem.asp?id=<%=id%>&action=del'}">
<u><font color="#0000FF">删除</font></u></a></td>
</tr>
</form>
<%
rs.movenext
i=i+1
loop
end if
rs.close
set rs=nothing
%>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -