📄 user.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" import="java.sql.*" %>
<%@ page import="mfkvit.*,java.util.*" %>
<jsp:useBean id="login" class="mfkvit.login" scope="session">
</jsp:useBean>
<script Language="JavaScript">
<!--
function isspacestring(mystring)
{ var istring=mystring;
var temp,i,strlen;
temp=true;
strlen=istring.length;
for (i=0;i<strlen;i++)
{
if ((istring.substring(i,i+1)!=" ")&(temp))
{ temp=false; }
}
return temp;
}
function firstisspace(mystring)
{ var istring=mystring;
var temp,i,strlen;
temp=false;
if (istring.substring(0,1)==" ")
{ temp=true; }
return temp;
}
function check_input(theForm)
{
if ((theForm.GS_name.value == "")|(firstisspace(theForm.GS_name.value)))
{
alert("请输入公司名称.不能以空格开头");
theForm.GS_name.focus();
return (false);
}
if ((theForm.GS_web.value == "")|(isspacestring(theForm.GS_web.value)))
{
alert("请输入网址.");
theForm.GS_web.focus();
return (false);
}
if ((theForm.GS_address.value == "")|(isspacestring(theForm.GS_address.value)))
{
alert("请输入地址.");
theForm.GS_address.focus();
return (false);
}
if ((theForm.GS_zipcode.value == "")|(isspacestring(theForm.GS_zipcode.value)))
{
alert("请输入邮政编码.");
theForm.GS_zipcode.focus();
return (false);
}
if ((theForm.GS_phone.value == "")|(isspacestring(theForm.GS_phone.value)))
{
alert("请输入电话.");
theForm.GS_phone.focus();
return (false);
}
if ((theForm.GS_fax.value == "")|(isspacestring(theForm.GS_fax.value)))
{
alert("请输入传真.");
theForm.GS_fax.focus();
return (false);
}
if ((theForm.GS_phone2.value == "")|(isspacestring(theForm.GS_phone2.value)))
{
alert("请输入手机号码.");
theForm.GS_phone2.focus();
return (false);
}
if ((theForm.GS_qq1.value == "")|(isspacestring(theForm.GS_qq1.value)))
{
alert("请输入QQ.");
theForm.GS_qq1.focus();
return (false);
}
if ((theForm.GS_email.value == "")|(isspacestring(theForm.GS_email.value)))
{
alert("请输入电子邮箱.");
theForm.GS_email.focus();
return (false);
}
}
//-->
</script>
<%
if(session.isNew()){response.sendRedirect("index.jsp");}
String success=login.getSuccess();
if(success==null){success="";}
if(!(success.equals("ok"))){response.sendRedirect("index.jsp");}
%>
<html>
<head>
<title>
gsjj</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="c.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
background-image: url();
background-color: #d6dff7;
margin-top: 50px;
}
.STYLE4 {color: #FF0000}
-->
</style></head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<div align="center" class="ff"><strong>会员管理</strong></div>
<TABLE cellSpacing="2" cellPadding="0" width="100%" align="center" border="0">
<TBODY>
<TR bgColor="#c0c0c0">
<TD width="39" height="20" align="middle" bgcolor="#799ae1" class="c"><div align="center">序号</div></TD>
<TD width="83" height="20" align="middle" bgcolor="#799ae1" class="c"><div align="center">登录名</div></TD>
<TD width="88" height="20" align="middle" bgcolor="#799ae1" class="c"><div align="center">联系人</div></TD>
<TD width="161" height="20" align="middle" bgcolor="#799ae1" class="c"><div align="center">公司名称</div></TD>
<TD width="128" align="middle" bgcolor="#799ae1" class="c"><div align="center">所在省份</div></TD>
<TD width="138" align="middle" bgcolor="#799ae1" class="c"><div align="center">联系电话</div></TD>
<TD width="128" align="middle" bgColor="#799ae1" class="c"><div align="center">电子邮件</div></TD>
<TD width="41" height="20" align="middle" bgColor="#799ae1" class="c"><div align="center">操作</div></TD>
</TR><%
JdbcBean jdbc = new JdbcBean();
request.setCharacterEncoding("gb2312");
String f=request.getParameter("w");
if(f!=null){
String condition = "delete from Mcutomer where UserID=" +f;
jdbc.execUpdate(condition);
out.println("<script languaga=\"JavaScript\">alert(\"删除成功!\");window.location = \"user.jsp\";</script>");
}
request.setCharacterEncoding("gb2312");
try{
JdbcBean dbutil = new JdbcBean();
int rowcount = dbutil.execQueryName("select * from Mcutomer");
ArrayList al = dbutil.getRS();
for(int i=0;i<rowcount;i++){
HashMap colValue = (HashMap)al.get(i);
String id=(String)colValue.get("UserID");
String email=(String)colValue.get("u_eml"); %>
<TR bgColor="#e3e3e3" class="c">
<TD height="34" align="middle" bgcolor="#E8EDF4"><div align="center"><%=i%></div></TD>
<TD align="middle" bgcolor="#E8EDF4"><div align="center"><%=(String)colValue.get("UserName")%></div></TD>
<TD align="middle" bgcolor="#E8EDF4"><div align="center"><%=(String)colValue.get("u_ctt_cn")%> </div></TD>
<TD bgcolor="#E8EDF4"><div align="center"><%=(String)colValue.get("u_copnme_cn")%></div></TD>
<TD bgcolor="#E8EDF4"><div align="center"><%=(String)colValue.get("u_prv_cn")%></div></TD>
<TD bgcolor="#E8EDF4"><div align="center"><%=(String)colValue.get("u_tel")%></div></TD>
<TD align="middle" bgcolor="#E8EDF4"><div align="center"><a href="mailto:<%=email%>"><%=email%></a></div></TD>
<TD align="middle" bgcolor="#E8EDF4"><div align="center"><a href="user.jsp?w=<%=id%>" class="c">删除</A></div></TD>
</TR><% } %>
<%
}
catch (Exception ex) {ex.printStackTrace();} %>
</TBODY>
</TABLE>
<BR>
<BR>
<p><br>
</p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -