zoukankan      html  css  js  c++  java
  • 5.29团队第二阶段冲刺(四)

    燃尽图:

     任务板:

    会议照片:

     

    昨天完成的任务:制作用户发表意见表的功能,并且做一个查询功能,其可以根据按失物丢失时间和捡到时间进行查询,设一个全局变量session用来保存登陆的用户名,同时做到每个页面没有用户名将退出主界面到登陆界面

    今天的任务:做个人中心,其可以根据用户的类型分为普通用户个人中心和管理员用户中心,并且实现用户对发表的表单进行修改删除等管理。

    明天的任务:做管理员的失物招领信息的管理,对用户的管理等,对含不良信息表单删除等功能。并对用户的信用度进行降低处理

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
        <%@ page import="java.sql.*" %>
    <jsp:useBean id="dao" class="Dao.Dao" scope="page"/>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <%
    if(session.getAttribute("userName")==null)
    {
    	response.sendRedirect("jiemian.jsp");
    }
    %>
    <%
    String userName=String.valueOf(session.getAttribute("userName"));
    int type=dao.type(userName);
    if(type==1)
    {
    	response.sendRedirect("main_right.jsp");
    }
    else if(type==2)
    {
    	response.sendRedirect("managerds.jsp");
    }
    %>
    </body>
    </html>
    

      

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>首页</title>
        <!-- Meta tag Keywords -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta charset="UTF-8" />
        <meta name="keywords" content="" />
        <script>
            addEventListener("load", function() {
                setTimeout(hideURLbar, 0);
            }, false);
            function hideURLbar() {
                window.scrollTo(0, 1);
            }
        </script>
        <!-- //Meta tag Keywords -->
        <!-- Custom-Files -->
        <link rel="stylesheet" href="css/bootstrap.css">
        <!-- Bootstrap-Core-CSS -->
        <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
        <link rel="stylesheet" href="css/slider.css" type="text/css" media="all" />
        <!-- Style-CSS -->
        <!-- font-awesome-icons -->
        <link href="css/font-awesome.css" rel="stylesheet">
        <!-- //font-awesome-icons -->
        <!-- /Fonts -->
        <link href="http://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800" rel="stylesheet">
        <!-- //Fonts -->
    </head>
    <body>
    <%
             //String userName=request.getParameter("userName");
             String userName=  String.valueOf(request.getAttribute("userName"));
             session.setAttribute("userName", userName);
             System.out.print("!"+session.getAttribute("userName"));
    	     Object message = request.getAttribute("message");//放置一个字符串,并取出
    	     if(message!=null && !"".equals(message)){
    	 
    	%>
    	     <script type="text/javascript">
    	          alert("<%=request.getAttribute("message")%>");
    	     </script>
    <%} %>
        <!-- mian-content -->
        <div class="main-w3-pvt-header-sec" id="home">
            <!-- header -->
                <header>
                    <div class="container">
                        <div class="header d-lg-flex justify-content-between align-items-center py-lg-3 px-lg-3">
                            <!-- logo -->
                            <div id="logo">
                                <h1><a href="index.jsp"><span class="fa fa-recycle mr-2"></span>返回首页</a></h1>
                            </div>
                            <!-- //logo -->
                            <div class="w3pvt-bg">
                                <!-- nav -->
                                <div class="nav_w3pvt">
                                    <nav>
                                        <label for="drop" class="toggle">Menu</label>
                                        <input type="checkbox" id="drop" />
                                        <ul class="menu">
                                            <li><a href="index.jsp?">首页</a></li>
                                        <li>
                                                <!-- First Tier Drop Down -->
                                                <label for="drop-2" class="toggle toogle-2">表单信息 <span class="fa fa-angle-down" aria-hidden="true"></span>
                                                </label>
                                                <a href="blog.jsp">失物寻物信息栏 <span class="fa fa-angle-down" aria-hidden="true"></span></a>
                                                <input type="checkbox" id="drop-2" />
                                                <ul>
                                                    <li><a href="blog.jsp" class="drop-text">寻物启事</a></li>
                                                    <li><a href="blog1.jsp" class="drop-text">失物招领</a></li>
                                                </ul>
                                                                            
                                        </li>
                                        <li>
                                            <label for="drop-2" class="toggle toogle-2">发布信息 <span class="fa fa-angle-down" aria-hidden="true"></span>
                                            </label>
                                            <a href="contact.jsp">发布信息 <span class="fa fa-angle-down" aria-hidden="true"></span></a>
                                            <input type="checkbox" id="drop-2" />
                                            <ul>
                                                <li><a href="contact.jsp" class="drop-text">发布寻物启事</a></li>
                                                <li><a href="contact1.jsp" class="drop-text">发布失物招领</a></li>
                                            </ul>
                                        </li>
                                            <li><a href="search.jsp">查询</a></li>
                                        </ul>
                                    </nav>
                                </div>
                                <!-- //nav -->
                                <div class="justify-content-center">
                                    <!-- search -->
                                    <div class="apply-w3-pvt ml-lg-3">
                                       <a class="btn read" href="linshi.jsp" role="button"><%=session.getAttribute("userName")%></a>
                                    </div>
                                    <!-- //search -->
                                </div>
                                  <div class="justify-content-center">
                                    <!-- search -->
                                    <div class="apply-w3-pvt ml-lg-3">
                                       <a class="btn read" href="jiemian.jsp" role="button">退出</a>
                                    </div> 
                                    <!-- //search -->
                                </div>
                            </div>
                        </div>
                    </div>
                </header>
            <section class="banner_w3pvt">
                <div class="csslider infinity" id="slider1">
                    <input type="radio" name="slides" checked="checked" id="slides_1" />
                    <input type="radio" name="slides" id="slides_2" />
                    <input type="radio" name="slides" id="slides_3" />
    
                    <ul>
                        <li>
                            <div class="banner-top">
                                <div class="overlay">
                                    <div class="container">
                                        <div class="banner-info">
                                            <div class="banner-w3ls-inner">
                                                <h3>请在右上角选择对应功能。</h3> 
                                                <div class="test-info text-left mt-lg-5 mt-4">
    <!--                                                 <a href="single.jsp" class="btn mr-2">阅读更多</a>
                                                    <a href="contact.jsp" class="btn">联系我们</a> -->
                                                </div>
                                            </div>
    
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="banner-top1">
                                <div class="overlay sec">
                                    <div class="container">
                                        <div class="banner-info">
                                            <div class="banner-w3ls-inner">
                                                <h3>感谢您使用此系统!</h3>                                 
                                                <div class="test-info text-left mt-lg-5 mt-4">
    <!--                                                 <a href="single.jsp" class="btn mr-2">阅读更多</a>
                                                    <a href="contact.jsp" class="btn">联系我们</a> -->
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="banner-top2">
                                <div class="overlay">
                                    <div class="container">
                                        <div class="banner-info">
                                            <div class="banner-w3ls-inner">
                                                <h3>再次感谢!</h3>
                                                <div class="test-info text-left mt-lg-5 mt-4">
    <!--                                                 <a href="single.jsp" class="btn mr-2">阅读更多</a>
                                                    <a href="contact.jsp" class="btn">联系我们</a> -->
                                                </div>
                                            </div>
    
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </li>
    
                    </ul>
                    <div class="arrows">
                        <label for="slides_1"></label>
                        <label for="slides_2"></label>
                        <label for="slides_3"></label>
                    </div>
                </div>
            </section>
            <!-- //slider -->
        </div>
    </body>
    </html>
    </body>
    </html>
    

      

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
        <%@ page import="java.sql.*" %>
    <jsp:useBean id="dao" class="Dao.Dao" scope="page"/>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="css/style1.css" type="text/css" media="all" />
    <title>失物信息管理</title>
    <style> 
            .black_overlay{ 
                display: none; 
                position: absolute; 
                top: 0%; 
                left: 0%; 
                 100%; 
                height: 100%; 
                background-color: black; 
                z-index:1001; 
                -moz-opacity: 0.8; 
                opacity:.80; 
                filter: alpha(opacity=88); 
            } 
            .white_content { 
                display: none; 
                position: absolute; 
                top: 25%; 
                left: 25%; 
                 55%; 
                height: 55%; 
                padding: 20px; 
                border: 10px solid orange; 
                background-color: white; 
                z-index:1002; 
                overflow: auto; 
            } 
        </style> 
    </head>
    <body>
    <!-- String userName = String.valueOf(session.getAttribute("userName")); -- > 
    <%       String  userName = String.valueOf(session.getAttribute("userName"));
    	     Object message = request.getAttribute("message");//放置一个字符串,并取出
    	     if(message!=null && !"".equals(message)){
    	 
    	%>
    	     <script type="text/javascript">
    	          alert("<%=request.getAttribute("message")%>");
    	     </script>
    <%} %>
    
    <!-- Header -->
    <div id="header">
    	<div class="shell">
    		<!-- Logo + Top Nav -->
    		<div id="top">
    			<h1><a href="#">个人中心</a></h1>
    			<div id="top-navigation">
    				欢迎 <a href="#"><strong>关于我的</strong></a>
    				<span>|</span>
    				<a href="#">帮助</a>
    				<span>|</span>
    				<a href="index.jsp">退出</a>
    				<span>|</span>
    			</div>
    		</div>
    		<!-- End Logo + Top Nav -->
    		
    		<!-- Main Nav -->
    		<div id="navigation">
    			<ul>
    			    <li><a href="main_right.jsp" class="active"><span>我发表的寻物启事</span></a></li>
    			    <li><a href="main_right1.jsp"><span>我发表的失物招领</span></a></li>
    			    
    			</ul>
    		</div>
    		<!-- End Main Nav -->
    	</div>
    </div>
    <!-- End Header -->
    
    <!-- Container -->
    <div id="container">
    	<div class="shell">
    		
    		<!-- Small Nav -->
    		
    		<!-- End Small Nav -->
    		
    		<!-- Message OK -->		
    		<!--
    		<div class="msg msg-ok">
    			<p><strong>Your file was uploaded succesifully!</strong></p>
    			<a href="#" class="close">close</a>
    		</div> --> 
    		<!-- End Message OK -->		
    		
    		<!-- Message Error -->
    		<!--
    		<div class="msg msg-error">
    			<p><strong>You must select a file to upload first!</strong></p>
    			<a href="#" class="close">close</a>
    		</div>  -->
    		
    		
    		<!-- End Message Error -->
    		<br />
    		<!-- Main -->
    		<div id="main">
    			<div class="cl"> </div>
    			
    			<!-- Content -->
    			<div id="content">
    				
    				<!-- Box -->
    				<div class="box">
    					<!-- Box Head -->
    					<form action="searchdsByuserName.jsp" method="post">
    					<div class="box-head">
    						<h2 class="left">列表</h2>
    						
    						
    						
    					</div>
    					</form>
    					<!-- End Box Head -->	
    
    					<!-- Table -->
    					<form action="addServlet?method=main_right_deleteds" method="post">
    					<div class="table">
    						<table width="100%" border="0" cellspacing="0" cellpadding="0">
    							<tr>
    								<th width="13"> </th>
    								
    								<th>物品类别</th>
    								<th>丢失地点</th>
    								<th>丢失时间</th>
    								<th>联系方式</th>
    								<th>详细信息</th>
    								<th width="110" class="ac">操作</th>
    							</tr>
    							<%
            ResultSet rs=dao.searchdsByuserName(userName);
    		int dsnumber = 1;
    		
    		
    		 
    		
          if(rs==null){
        	  %>
              <tr align="center" valign="middle"><td colspan="4">没有记录显示!</td>
              </tr>
              <%
           }
          else{
        	  
    		while(rs.next()){%>
    							<tr>
    								<td><input type="checkbox" class="checkbox" name="checkds" value="<%=rs.getInt("id") %>" /></td>
    								
    								<td><h3><%=rs.getString("name") %></h3></td>
    								<td><%=rs.getString("place") %></td>
    								<td><%=rs.getString("time") %></td>
    								<td><%=rs.getString("people") %></td>
    								<td><%=rs.getString("info") %></td>
    								
    								<td><a onclick="return check()" href="main_right_deleteds.jsp?id=<%=rs.getInt("id") %>" class="ico del">删除</a><a href="main_right_updateds.jsp?id=<%=rs.getInt("id") %>" class="ico edit">修改</a></td>
    							</tr>
    							<%
    							dsnumber++;}
    							}%>
    							
    						</table>
    		<script type="text/javascript">
    		function check() {
    			if (confirm("确定删除吗?")){
    				return true;
    			}else{
    				return false;
    			}
    		}
    	</script>				
    						
    						<!-- Pagging -->
    						<div class="pagging">
    							<div class="left">1-<%=dsnumber-1 %></div>
    							<div class="left">
    							 		<input type="submit"onclick="return check()" class="button" value="删除所选内容" />
    						    </form>
    						    </div>
    							<div class="right">
    								<a href="#">前一页</a>
    								<a href="#">1</a>
    								<a href="#">2</a>
    								<a href="#">3</a>
    								<a href="#">4</a>
    								<span>...</span>
    								<a href="#">下一页</a>
    							</div>
    						</div>
    						<!-- End Pagging -->
    						
    					</div>
    					<!-- Table -->
    					
    				</div>
    				<!-- End Box -->
    				
    				<!-- Box -->
    				<div class="box">
    					<!-- Box Head -->
    					<div class="box-head">
    						<h2>添加备注记录</h2>
    					</div>
    					<!-- End Box Head -->
    					
    					<form action="" method="post">
    						
    						<!-- Form -->
    						<div class="form">
    								<p>
    									<span class="req">100字以内</span>
    									<label>备注主题<span>(必填)</span></label>
    									<input type="text" class="field size1" />
    								</p>	
    								<p class="inline-field">
    									<label>日期</label>
    									<input type="datetime-local" class="field size1" name="date">
    								</p>
    								
    								<p>
    									<span class="req">1000以内</span>
    									<label>备注内容 <span>(必填)</span></label>
    									<textarea class="field size1" rows="10" cols="30"></textarea>
    								</p>	
    							
    						</div>
    						<!-- End Form -->
    						
    						<!-- Form Buttons -->
    						<div class="buttons">
    							<input type="submit" class="button" value="提交" />
    						</div>
    						<!-- End Form Buttons -->
    					</form>
    				</div>
    				<!-- End Box -->
    
    			</div>
    			<!-- End Content -->
    			
    			<!-- Sidebar -->
    			<div id="sidebar">
    				
    				<!-- Box -->
    				<div class="box">
    					
    					<!-- Box Head -->
    					<div class="box-head">
    						<h2>管理</h2>
    					</div>
    					<!-- End Box Head-->
    					
    					<div class="box-content">
    						
    						<div class="cl"> </div>
    						
    						<p class="select-all"><input type="checkbox" class="checkbox" /><label>选择全部</label></p>
    						<p><a href="#">其他</a></p>
    						
    						<!-- Sort -->
    						
    						<!-- End Sort -->
    						
    					</div>
    				</div>
    				<!-- End Box -->
    			</div>
    			<!-- End Sidebar -->
    			
    			<div class="cl"> </div>			
    		</div>
    		<!-- Main -->
    	</div>
    </div>
    <!-- End Container -->
    
    <!-- Footer -->
    <div id="footer">
    	<div class="shell">
    		<span class="left"> </span>
    		<span class="right">
    		
    		</span>
    	</div>
    </div>
    <!-- End Footer -->
    </body>
    </html>
    

      

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
        <%@ page import="java.sql.*" %>
    <jsp:useBean id="dao" class="Dao.Dao" scope="page"/>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>删除</title>
    </head>
    <body>
    <%
    int id = Integer.parseInt(request.getParameter("id"));
    if(dao.deleteds(id)){
    	%>
    	<script>
    	alert('删除成功!');
    	parent.location("main_right.jsp");
    	
    	</script>
    	<%
    	
    }
    
    %>
    </body>
    </html>
    

      

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
       <%@ page import="java.sql.*" %>
    <jsp:useBean id="dao" class="Dao.Dao" scope="page"/>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="css/style1.css" type="text/css" media="all" />
    <title>失物信息管理</title>
    <style> 
            .black_overlay{ 
                display: none; 
                position: absolute; 
                top: 0%; 
                left: 0%; 
                 100%; 
                height: 100%; 
                background-color: black; 
                z-index:1001; 
                -moz-opacity: 0.8; 
                opacity:.80; 
                filter: alpha(opacity=88); 
            } 
            .white_content { 
                display: none; 
                position: absolute; 
                top: 25%; 
                left: 25%; 
                 55%; 
                height: 55%; 
                padding: 20px; 
                border: 10px solid orange; 
                background-color: white; 
                z-index:1002; 
                overflow: auto; 
            } 
        </style> 
    </head>
    <body>
    <%
    	     Object message = request.getAttribute("message");//放置一个字符串,并取出
    	     if(message!=null && !"".equals(message)){
    	 
    	%>
    	     <script type="text/javascript">
    	          alert("<%=request.getAttribute("message")%>");
    	     </script>
    <%} %>
    <!-- Header -->
    <div id="header">
    	<div class="shell">
    		<!-- Logo + Top Nav -->
    		<div id="top">
    			<h1><a href="#">个人中心</a></h1>
    			<div id="top-navigation">
    				欢迎 <a href="#"><strong>关于我的</strong></a>
    				<span>|</span>
    				<a href="#">帮助</a>
    				<span>|</span>
    				<a href="index.jsp">退出</a>
    				<span>|</span>
    			</div>
    		</div>
    		<!-- End Logo + Top Nav -->
    		
    		<!-- Main Nav -->
    		<div id="navigation">
    			<ul>
    			    <li><a href="main_right.jsp" class="active"><span>我发表的失物表单</span></a></li>
    			    <li><a href="main_right1.jsp"><span>我发表的招领表单</span></a></li>
    			    
    			</ul>
    		</div>
    		<!-- End Main Nav -->
    	</div>
    </div>
    <!-- End Header -->
    
    <!-- Container -->
    <div id="container">
    	<div class="shell">
    		
    		<div id="main">
    			<div class="cl"> </div>
    			
    			<!-- Content -->
    			<div id="content">
    				
    				<!-- Box -->
    				<div class="box">
    
    <%        int id = Integer.parseInt(request.getParameter("id"));
    		ResultSet rs=dao.listdsByid(id);
    		if(rs==null){ 
        	  %>
        	  
        	  
                   没有记录显示!
              
              
              
              
              <%
           }
          else{
        	  
    		if(rs.next()){%>
    						
    								
    								
    								<!-- Box -->
    				<div class="box">
    					<!-- Box Head -->
    					<div class="box-head">
    						<h2>修改信息</h2>
    					</div>
    					<!-- End Box Head -->
    					
    					<form action="addServlet?method=main_right_updateds" method="post">
    						
    						<!-- Form -->
    						<div class="form">
    								
    								<P><label>物品类别</label><input type="text" name="name" value=" <%=rs.getString("name") %>" class="field size1"></P> 
    								<P><label>丢失地点</label><input type="text" name="place" value=" <%=rs.getString("place") %>" class="field size1" ></P>
    								<P><label>丢失时间</label><input type="datetime-local" name="time"  class="field size1"></P> 
    								<P><label>联系方式</label><input type="text" name="people" value=" <%=rs.getString("people") %>" class="field size1"></P> 
    								<P><label>详细信息</label><input type="text" name="info" value=" <%=rs.getString("info") %>" class="field size1" ></P> 
    								<input type="hidden" name="id" value="<%=rs.getInt("id") %>">
    							
    						</div>
    						<!-- End Form -->
    						
    						<!-- Form Buttons -->
    						<div class="buttons">
    							<input type="submit" class="button" value="确认修改" />
    						</div>
    						<!-- End Form Buttons -->
    					</form>
    				</div>
    				<!-- End Box -->
    
    			</div>
    		<%
    							}
    							}
    							%>		
    						
    					
    					<!-- Table -->
    					
    				</div>
    				<!-- End Box -->
    				
    				<!-- Box -->
    
    				<!-- End Box -->
    
    			</div>
    			<!-- End Content -->
    			
    			<!-- Sidebar -->
    			
    			<!-- End Sidebar -->
    			
    			<div class="cl"> </div>			
    		</div>
    		<!-- Main -->
    	</div>
    
    <!-- End Container -->
    
    <!-- Footer -->
    <div id="footer">
    	<div class="shell">
    		<span class="left"> </span>
    		<span class="right">
    		
    		</span>
    	</div>
    </div>
    <!-- End Footer -->
    </body>
    </html>
    

      

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
        <%@ page import="java.sql.*" %>
    <jsp:useBean id="dao" class="Dao.Dao" scope="page"/>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>删除</title>
    </head>
    <body>
    <%
    int id = Integer.parseInt(request.getParameter("id"));
    if(dao.deletejd(id)){
    	%>
    	<script>
    	alert('删除成功!');
    	parent.location("main_right1.jsp");
    	
    	</script>
    	<%
    	
    }
    
    %>
    </body>
    </html>
    

      

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
       <%@ page import="java.sql.*" %>
    <jsp:useBean id="dao" class="Dao.Dao" scope="page"/>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="css/style1.css" type="text/css" media="all" />
    <title>失物信息管理</title>
    <style> 
            .black_overlay{ 
                display: none; 
                position: absolute; 
                top: 0%; 
                left: 0%; 
                 100%; 
                height: 100%; 
                background-color: black; 
                z-index:1001; 
                -moz-opacity: 0.8; 
                opacity:.80; 
                filter: alpha(opacity=88); 
            } 
            .white_content { 
                display: none; 
                position: absolute; 
                top: 25%; 
                left: 25%; 
                 55%; 
                height: 55%; 
                padding: 20px; 
                border: 10px solid orange; 
                background-color: white; 
                z-index:1002; 
                overflow: auto; 
            } 
        </style> 
    </head>
    <body>
    <%
    	     Object message = request.getAttribute("message");//放置一个字符串,并取出
    	     if(message!=null && !"".equals(message)){
    	 
    	%>
    	     <script type="text/javascript">
    	          alert("<%=request.getAttribute("message")%>");
    	     </script>
    <%} %>
    <!-- Header -->
    <div id="header">
    	<div class="shell">
    		<!-- Logo + Top Nav -->
    		<div id="top">
    			<h1><a href="#">个人中心</a></h1>
    			<div id="top-navigation">
    				欢迎 <a href="#"><strong>关于我的</strong></a>
    				<span>|</span>
    				<a href="#">帮助</a>
    				<span>|</span>
    				<a href="index.jsp">退出</a>
    				<span>|</span>
    			</div>
    		</div>
    		<!-- End Logo + Top Nav -->
    		
    		<!-- Main Nav -->
    		<div id="navigation">
    			<ul>
    			    <li><a href="main_right.jsp"><span>我发表的失物表单</span></a></li>
    			    <li><a href="main_right1.jsp" class="active"><span>我发表的招领表单</span></a></li>
    			    
    			</ul>
    		</div>
    		<!-- End Main Nav -->
    	</div>
    </div>
    <!-- End Header -->
    
    <!-- Container -->
    <div id="container">
    	<div class="shell">
    		
    		<div id="main">
    			<div class="cl"> </div>
    			
    			<!-- Content -->
    			<div id="content">
    				
    				<!-- Box -->
    				<div class="box">
    
    <%        int id = Integer.parseInt(request.getParameter("id"));
    		ResultSet rs=dao.listjdByid(id);
    		if(rs==null){ 
        	  %>
        	  
        	  
                   没有记录显示!
              
              
              
              
              <%
           }
          else{
        	  
    		if(rs.next()){%>
    						
    								
    								
    								<!-- Box -->
    				<div class="box">
    					<!-- Box Head -->
    					<div class="box-head">
    						<h2>修改信息</h2>
    					</div>
    					<!-- End Box Head -->
    					
    					<form action="addServlet?method=main_right1_updatejd" method="post">
    						
    						<!-- Form -->
    						<div class="form">
    								
    								<P><label>物品类别</label><input type="text" name="name" value=" <%=rs.getString("name") %>" class="field size1"></P> 
    								<P><label>丢失地点</label><input type="text" name="place" value=" <%=rs.getString("place") %>" class="field size1" ></P>
    								<P><label>丢失时间</label><input type="datetime-local" name="time"  class="field size1"></P> 
    								<P><label>联系方式</label><input type="text" name="people" value=" <%=rs.getString("people") %>" class="field size1"></P> 
    								<P><label>详细信息</label><input type="text" name="info" value=" <%=rs.getString("info") %>" class="field size1" ></P> 
    								<input type="hidden" name="id" value="<%=rs.getInt("id") %>">
    							
    						</div>
    						<!-- End Form -->
    						
    						<!-- Form Buttons -->
    						<div class="buttons">
    							<input type="submit" class="button" value="确认修改" />
    						</div>
    						<!-- End Form Buttons -->
    					</form>
    				</div>
    				<!-- End Box -->
    
    			</div>
    		<%
    							}
    							}
    							%>		
    						
    					
    					<!-- Table -->
    					
    				</div>
    				<!-- End Box -->
    				
    				<!-- Box -->
    
    				<!-- End Box -->
    
    			</div>
    			<!-- End Content -->
    			
    			<!-- Sidebar -->
    			
    			<!-- End Sidebar -->
    			
    			<div class="cl"> </div>			
    		</div>
    		<!-- Main -->
    	</div>
    
    <!-- End Container -->
    
    <!-- Footer -->
    <div id="footer">
    	<div class="shell">
    		<span class="left"> </span>
    		<span class="right">
    		
    		</span>
    	</div>
    </div>
    <!-- End Footer -->
    </body>
    </html>

      

     private void deleteds(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        	request.setCharacterEncoding("utf-8");
        	String[] checkds = request.getParameterValues("checkds");
        	int[] id = new int[checkds.length];
        	for(int i = 0 ; i < checkds.length;i++) {
        		id[i] = Integer.parseInt(checkds[i]) ;
        	}
        	if(dao.deleteds(id) ){
        		request.setAttribute("message", "删除操作成功");
    			request.getRequestDispatcher("managerds.jsp").forward(request, response);
        	}else {
    			request.setAttribute("message", "删除操作失败,请重新尝试!!!");
    			request.getRequestDispatcher("managerds.jsp").forward(request, response);
    		
        	}
        	
        }
        private void deletejd(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        	request.setCharacterEncoding("utf-8");
        	String[] checkjd = request.getParameterValues("checkjd");
        	int[] id = new int[checkjd.length];
        	for(int i = 0 ; i < checkjd.length;i++) {
        		id[i] = Integer.parseInt(checkjd[i]) ;
        	}
        	if(dao.deletejd(id) ){
        		request.setAttribute("message", "删除操作成功");
    			request.getRequestDispatcher("managerjd.jsp").forward(request, response);
        	}else {
    			request.setAttribute("message", "删除操作失败,请重新尝试!!!");
    			request.getRequestDispatcher("managerjd.jsp").forward(request, response);
    		
        	}
        	
        }
        private void updateds(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        	request.setCharacterEncoding("utf-8");
        	int id = Integer.parseInt(request.getParameter("id")) ;
        	String name = request.getParameter("name");
        	String place = request.getParameter("place");
        	String time = request.getParameter("time");
        	String people = request.getParameter("people");
        	String info = request.getParameter("info");
        	if(dao.updateds(id,name,place,time,people,info)) {
        		request.setAttribute("message", "修改成功!!!");
    			request.getRequestDispatcher("managerds.jsp").forward(request, response);
        	}else {
    			request.setAttribute("message", "修改失败,请重新尝试!!!");
    			request.getRequestDispatcher("updateds.jsp").forward(request, response);
    		
        	}
        	
        }
        private void updatejd(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        	request.setCharacterEncoding("utf-8");
        	int id = Integer.parseInt(request.getParameter("id"));
        	String name = request.getParameter("name");
        	String place = request.getParameter("place");
        	String time = request.getParameter("time");
        	String people = request.getParameter("people");
        	String info = request.getParameter("info");
        	if(dao.updatejd(id,name,place,time,people,info)) {
        		request.setAttribute("message", "修改成功!!!");
    			request.getRequestDispatcher("managerjd.jsp").forward(request, response);
        	}else {
    			request.setAttribute("message", "修改失败,请重新尝试!!!");
    			request.getRequestDispatcher("updatejd.jsp").forward(request, response);
    		
        	}
        	
        }
    private void main_right1_updatejd(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        	request.setCharacterEncoding("utf-8");
        	int id = Integer.parseInt(request.getParameter("id"));
        	String name = request.getParameter("name");
        	String place = request.getParameter("place");
        	String time = request.getParameter("time");
        	String people = request.getParameter("people");
        	String info = request.getParameter("info");
        	if(dao.updatejd(id,name,place,time,people,info)) {
        		request.setAttribute("message", "修改成功!!!");
    			request.getRequestDispatcher("main_right1.jsp").forward(request, response);
        	}else {
    			request.setAttribute("message", "修改失败,请重新尝试!!!");
    			request.getRequestDispatcher("main_right1.jsp").forward(request, response);
    		
        	}
        	
        }
      private void main_right_updateds(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        	request.setCharacterEncoding("utf-8");
        	int id = Integer.parseInt(request.getParameter("id")) ;
        	String name = request.getParameter("name");
        	String place = request.getParameter("place");
        	String time = request.getParameter("time");
        	String people = request.getParameter("people");
        	String info = request.getParameter("info");
        	if(dao.updateds(id,name,place,time,people,info)) {
        		request.setAttribute("message", "修改成功!!!");
    			request.getRequestDispatcher("main_right.jsp").forward(request, response);
        	}else {
    			request.setAttribute("message", "修改失败,请重新尝试!!!");
    			request.getRequestDispatcher("main_right.jsp").forward(request, response);
    		
        	}
        	
        }
     private void main_right1_deletejd(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        	request.setCharacterEncoding("utf-8");
        	String[] checkjd = request.getParameterValues("checkjd");
        	int[] id = new int[checkjd.length];
        	for(int i = 0 ; i < checkjd.length;i++) {
        		id[i] = Integer.parseInt(checkjd[i]) ;
        	}
        	if(dao.deletejd(id) ){
        		request.setAttribute("message", "删除操作成功");
    			request.getRequestDispatcher("main_right1.jsp").forward(request, response);
        	}else {
    			request.setAttribute("message", "删除操作失败,请重新尝试!!!");
    			request.getRequestDispatcher("main_right1.jsp").forward(request, response);
    		
        	}
        	
        }
    private void main_right_deleteds(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        	request.setCharacterEncoding("utf-8");
        	String[] checkds = request.getParameterValues("checkds");
        	int[] id = new int[checkds.length];
        	for(int i = 0 ; i < checkds.length;i++) {
        		id[i] = Integer.parseInt(checkds[i]) ;
        	}
        	if(dao.deleteds(id) ){
        		request.setAttribute("message", "删除操作成功");
    			request.getRequestDispatcher("main_right.jsp").forward(request, response);
        	}else {
    			request.setAttribute("message", "删除操作失败,请重新尝试!!!");
    			request.getRequestDispatcher("main_right.jsp").forward(request, response);
    		
        	}
        	
        }
    

      

    运行截图:

  • 相关阅读:
    [luoguP2342] 叠积木(并查集)
    [luoguP2147] [SDOI2008]Cave 洞穴勘测(并查集 || lct)
    [POJ1611]The Suspects(并查集)
    [POJ2912]Rochambeau(并查集)
    网站图片增强JS插件2.0(兼容IE&FF)
    jQuery简单纯文字提示条
    复选框--全选/全不选/反选。简易版
    Magic Grid ComboBox JQuery 版
    SWFObject 的基本使用方法
    全局Timestamp管理器 检测js执行时间
  • 原文地址:https://www.cnblogs.com/ruan1705/p/11062118.html
Copyright © 2011-2022 走看看