⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 listpicnews.jsp

📁 这是一个功能齐全强大的新闻发布软件
💻 JSP
字号:
<%@page contentType="text/html; charset=ISO8859_1" language="java" %>
<%
String news_location="listpicnews";
%>
<%@ include file="session.jsp" %>
<%@page import="Eclass.News" %>
<%@ include file="config.jsp" %>
<%
java.sql.ResultSet rs=null;
String action=request.getParameter("action");
int picid=0,border=0;
String title="",pic_url="",url="",pic_width="",pic_height="",open_pic="";
if(action==null)
{action="";}
//增加图片JS
if(action.equals("AddPicNews"))
{border=Integer.parseInt(request.getParameter("border"));
title=new String(request.getParameter("title").getBytes("ISO8859-1"),"gb2312");
pic_url=request.getParameter("pic_url");
url=request.getParameter("url");
pic_width=request.getParameter("pic_width");
pic_height=request.getParameter("pic_height");
open_pic=request.getParameter("open_pic");
News empire1=new News();
empire1.AddPicNews(news_basic_path,title,pic_url,url,pic_width,pic_height,open_pic,border);
%>
<script>
alert("增加图片JS成功");self.location.href="ListPicNews.jsp";
</script>
<%
return;
}
//修改图片JS
if(action.equals("EditPicNews"))
{picid=Integer.parseInt(request.getParameter("picid"));
border=Integer.parseInt(request.getParameter("border"));
title=new String(request.getParameter("title").getBytes("ISO8859-1"),"gb2312");
pic_url=request.getParameter("pic_url");
url=request.getParameter("url");
pic_width=request.getParameter("pic_width");
pic_height=request.getParameter("pic_height");
open_pic=request.getParameter("open_pic");
News empire1=new News();
empire1.EditPicNews(news_basic_path,picid,title,pic_url,url,pic_width,pic_height,open_pic,border);
%>
<script>
alert("修改图片JS成功");self.location.href="ListPicNews.jsp";
</script>
<%
return;
}
//删除图片JS
if(action.equals("DelPicNews"))
{
picid=Integer.parseInt(request.getParameter("picid"));
News empire1=new News();
empire1.DelPicNews(news_basic_path,picid);
%>
<script>
alert("删除图片JS成功");self.location.href="ListPicNews.jsp";
</script>
<%
return;
}
%>
<jsp:useBean id=empire scope="page" class="Eclass.jdbc_sql" />
<%
rs=empire.query("select picid,pic_url,url,title,pic_width,pic_height,open_pic,border from enews_pic");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../images/ebb.css" type="text/css">
<title>无标题文档</title>
<script>
function check_pic(obj)
{
if(obj.title.value=="")
{alert("新闻标题不能为空");obj.title.focus();return false;}
if(obj.pic_url.value=="")
{alert("图片地址不能为空");obj.pic_url.focus();return false;}
return true;
}
</script>
</head>

<body>
<form name=form1 method=post action=ListPicNews.jsp onsubmit="return check_pic(document.form1)">
  <table width=80% align=center cellpadding=0 cellspacing=0 bgcolor="3370A6">
    <tr>
      <td colspan=2><font color="#FFFFFF" size=5><strong>增加首页图片新闻</strong></font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width=165 height="23">图片地址:</td>
      <td width=635 height="23"> 
        <input name=pic_url type=text id="pic_url">
        (大小:宽 
        <input name=pic_width type=text id="pic_width" value=111 size=4 maxlength=4>
        pix 高 
        <input name=pic_height type=text id="pic_height" value=146 size=4 maxlength=4>
        pix)边框: 
        <select name="border" id="border">
          <option value="0">没有边框</option>
          <option value="1">有边框</option>
        </select>
        <input name="action" type="hidden" id="action" value="AddPicNews"></td></tr>
    <tr bgcolor="#FFFFFF"> 
      <td width=165 height="23">新闻标题:</td>
      <td width=635 height="23"> 
        <input name=title type=text size="50"></td></tr>
    <tr bgcolor="#FFFFFF"> 
      <td width=165 height=23>连接地址:</td>
      <td width=635 height=23> 
        <input name=url type=text id="url" value='http://' size="70"></td></tr>
    <tr bgcolor="#FFFFFF"> 
      <td width=165 height="23">打开链接方式:</td>
      <td width=635 height="23"> 
        <select name=open_pic id="open_pic">
          <option value="_blank">在新窗口打开</option>
          <option value="_parent">在原窗口打开</option>
        </select></td></tr>
    <tr bgcolor="#FFFFFF"> 
      <td width=165 height="23">&nbsp; </td>
      <td width=635 height="23"> 
        <input type=submit name=zz value=增加><input type=reset name=Submit2 value=重置>
</td></tr></table></form>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="3370A6">
  <tr> 
    <td width="12%"><div align="center">图片ID</div></td>
    <td width="46%"><div align="center">图片</div></td>
    <td width="42%"><div align="center"></div>
      <div align="center">操作</div></td>
  </tr>
  <%
  while(rs.next())
  {
  %>
  <tr bgcolor="#FFFFFF"> 
    <td><div align="center"><%=rs.getInt("picid")%></div></td>
    <td><div align="center"><a href='<%=rs.getString("url")%>' target=<%=rs.getString("open_pic")%>><img src='<%=rs.getString("pic_url")%>' border='<%=rs.getInt("border")%>' 
width='<%=rs.getString("pic_width")%>' height='<%=rs.getString("pic_height")%>' alt='<%=rs.getString("title")%>'></a></div></td>
    <td><div align="center"></div>
      <div align="center">[<a href=EditPicNews.jsp?picid=<%=rs.getInt("picid")%>>修改</a>]&nbsp;&nbsp;[<a href=ListPicNews.jsp?action=DelPicNews&picid=<%=rs.getInt("picid")%> onclick="return confirm('确认要删除?');">删除</a>]&nbsp;&nbsp;[<a href=../test.jsp?classid=pic_<%=rs.getInt("picid")%> target=_blank>预览</a>]</div></td>
  </tr>
  <%
  }
  %>
</table>
</body>
</html>
<%
rs.close();
empire.closestmt();
empire.closeconn();
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -