Class.asp
资源名称:NetPhone.rar [点击查看]
上传用户:xxtaishan
上传日期:2022-01-02
资源大小:4063k
文件大小:4k
源码类别:
IP电话/视频会议
开发平台:
ASP/ASPX
- <!--#include file="../../inc/conn.asp"-->
- <!--#include file="../../inc/func.asp"-->
- <html>
- <head>
- <title></title>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <link href="../Images/style.css" rel="stylesheet" type="text/css">
- <style type="text/css">
- <!--
- .style1 {color: #FFFFFF}
- -->
- </style>
- </head>
- <%
- function showinfo(string)
- response.write "<script>alert('"&string&"');location.href='?';</script>"
- response.end
- end function
- %>
- <%
- dim rs
- dim rs1
- dim rs2
- dim rs3
- dim sql
- select case request("Submit")
- case "添加"
- if request.form("class")="" then
- call showinfo("系统提示:请先填写要添加的类别名称!")
- else
- sql="insert into class(classname) values('"&trim(request.form("class"))&"')"
- set rs=conn.execute(sql)
- call showinfo("系统提示:类别添加成功!")
- end if
- case "修改"
- if request.form("classid")="" then
- call showinfo("系统提示:未选择要修改的类别!")
- else
- if request.form("class2")="" then
- call showinfo("系统提示:修改类别名称不能为空!")
- else
- sql="update class set classname='"&trim(request.form("class2"))&"' where "
- sql=sql&"id="&request.form("CLASSID")
- set rs=conn.execute(sql)
- call showinfo("系统提示:类别名称修改成功!")
- end if
- end if
- case "del"
- if request("CLASSID")="" then
- call showinfo("系统提示:请先选择要删除的类别!")
- else
- sql="delete from class where id="&request("CLASSID")
- set rs=conn.execute(sql)
- sql="delete from nclass where classid="&request("CLASSID")
- set rs=conn.execute(sql)
- call showinfo("系统提示:类别删除成功!")
- end if
- end select
- call getclassify
- %>
- <% function getclassify %>
- <html>
- <body>
- <script language=javascript>
- function report()
- {
- var options_string = "";
- var the_select = window.document.form1.CLASSID;
- for (loop=0; loop < the_select.options.length; loop++)
- {
- if (the_select.options[loop].selected == true)
- {
- options_string += the_select.options[loop].text;
- }
- }
- window.document.form1.class2.value=options_string;
- }
- </script><body>
- <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
- <tr>
- <td width="100%">
- <div align="center"></div>
- </td>
- </tr>
- <tr>
- <td width="100%">
- <form name="form1" method="post" action="?">
- <table width="100%" border="1" cellspacing="0" cellpadding="2" bordercolordark="#ffffff" bordercolorlight="#000000">
- <tr>
- <td height="25" bgcolor="#23458B"><span class="style1">添加类别:</span></td>
- </tr>
- <tr>
- <td height="25">填写辅助名称:
- <input type="text" name="class" size="15">
- <input type="submit" name="Submit" value="添加"> </td>
- </tr>
- </table>
- <br>
- <table width="100%" border="1" cellspacing="0" cellpadding="2" bordercolordark="#ffffff" bordercolorlight="#000000">
- <tr>
- <td height="25" bgcolor="#23458B" class="style1">对类别修改和删除:</td>
- </tr>
- <tr>
- <td height="50">
- <%
- sql="select * from class"
- set rs=conn.execute(sql)
- if not rs.eof then
- %>
- 选择类别:
- <select name="CLASSID" onChange="report();">
- <option value="">--请选择类别--</option>
- <%do while not rs.eof%>
- <option value="<%=rs("id")%>"><%=rs("classname")%></option>
- <%rs.movenext
- loop
- %>
- </select>
- <br>
- 类别名称:
- <input type="text" name="class2">
- <input type="submit" name="Submit" value="修改">
- <input type="button" name="Submit" value="删除" onClick="class_del();">
- <%else%>
- 没有任何类别,请添加类别!
- <%end if%> </td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
- </table>
- </body>
- </html>
- <script language="javascript">
- function class_del()
- {
- if(confirm('* 确定删除该类别吗? *nn* 该网站类别下的子类及产品信息将一起被删除! *nn* 确定删除? *'))
- {
- form1.action="?submit=del&CLASSID="+document.form1.CLASSID.value;
- form1.submit();
- }
- }
- </script>
- <% end function %>
- <%
- conn.close
- set conn=nothing
- %>