?? tf_info_update.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*" errorPage="../../pub_include/ErrPage.jsp" %>
<%request.setCharacterEncoding("gb2312");%>
<jsp:include page="../../pub_include/pub_function_javascript.html" flush="true"/>
<%@ page import="jinLing.pub.*,jinLing.info.*"%>
<html>
<head>
<style>
<!--
.style2 {color: #FFFFFF}
-->
</style>
<link rel="stylesheet" type="text/css" href="../../pub_include/hosc.css">
<link href="../../pub_include/body_css.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
background-color: #ffebbd;
}
-->
</style></head>
<%
String INFO_TYPE = request.getParameter("INFO_TYPE").toString();
Collection col = null;
Hashtable list = new Hashtable();
list.put("INFO_TYPE",INFO_TYPE);
// PubOp pubOp = new PubOp("INFO");
Info info=new Info();
//判斷增加修改
String optype = "1";
if(null != request.getParameter("optype") && !request.getParameter("optype").toString().equals(""))
optype=request.getParameter("optype").toString();
%>
<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' background='../../images/bg.gif' >
<div align='center'>
<center>
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width=98% >
<tr>
<td width='100%' height='10' align='center'></td>
</tr>
<tr>
<td width='100%' height='0' valign='top' align='center'>
<table width='100%' border='1' style='border-collapse: collapse; padding-left:5' bordercolor='#6595D6' cellpadding='0' cellspacing='0'>
<%
String pPageNo = "1";
if (null != request.getParameter("PAGENO") &&!request.getParameter("PAGENO").toString().trim().equals(""))
if (Integer.parseInt(request.getParameter("PAGENO"))<1)
pPageNo="1";
else
pPageNo=request.getParameter("PAGENO");
col = info.execSel(list,pPageNo,"5");
String pPageCount = String.valueOf(info.getRecordcount());
String allCount = pPageCount;
pPageCount = (Integer.parseInt(pPageCount)%5==0)?String.valueOf(Integer.parseInt(pPageCount)/5):String.valueOf(Integer.parseInt(pPageCount)/5+1);
if (Integer.parseInt(pPageCount)<Integer.parseInt(pPageNo))
pPageNo=pPageCount;
Iterator it = col.iterator();
while (it.hasNext())
{
Hashtable rs = (Hashtable) it.next();
%>
<tr class='table_list_lr'>
<td align="left" > <%=rs.get("INFO_CONTENT")%> </td>
<!--刪除和修改還要傳一些條件參數-->
<td align='center' height='20' width='5%' valign='middle'> <img src='../../images/del.gif' width='18' height='18' border='0' style='cursor:hand' onClick="Del_ID('<%=rs.get("INFO_ID")%>')">
</td>
<td align='center' height='20' width='5%' valign='middle'>
<a href='tf_info_update.jsp?optype=2&INFO_TYPE=<%=INFO_TYPE%>&INFO_ID=<%=rs.get("INFO_ID")%>'> <img src='../../images/edit.gif' width='18' height='18' border='0' style='cursor:hand'>
</a>
</td>
</tr>
<%
}
%>
</table>
</td>
</tr>
</table>
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width=90% >
<%
String strpageno = "tf_info_update.jsp";
%>
<form action='<%=strpageno%>' method='POST' name='form_list'>
<tr>
<td height='17' valign='top' align='center'> </td>
<td height='17' valign='top' align='center'> <br>
<%
String vFirstURL = strpageno;
String vPrevURL = strpageno+"?INFO_TYPE="+INFO_TYPE+"&PAGENO="+(Integer.parseInt(pPageNo)-1);
String vNextURL = strpageno+"?INFO_TYPE="+INFO_TYPE+"&PAGENO="+((Integer.parseInt(pPageCount)<(Integer.parseInt(pPageNo)+1))?(Integer.parseInt(pPageCount)):(Integer.parseInt(pPageNo)+1));
String vLastURL = strpageno+"?INFO_TYPE="+INFO_TYPE+"&PAGENO="+pPageCount;
%>
<A onClick="PrevURLFun();" style="cursor:hand "> 上一頁 </A>
<A onClick="NextURLFun();" style="cursor:hand "> 下一頁 </A>
<script language=javascript>
function PrevURLFun()
{
self.location = "<%=vPrevURL%>";
return true;
}
function NextURLFun()
{
self.location = "<%=vNextURL%>";
return true;
}
</script>
</td>
</tr>
</form>
</table>
</center>
</div>
<script language="javascript">
function onCommit() //回車鍵后觸發
{
var p = document.form_list.PAGENO.value;
//輸入頁數若大于總頁數,則跳到最后一頁
if(parseInt(p)><%=Integer.parseInt(pPageCount)%>)
document.form_list.PAGENO.value = <%=Integer.parseInt(pPageCount)%>
if (window.event.keyCode==13)
{
document.form_list.submit();
}
}
//接收上面傳來的唯一A_ID值付給pval
function Del_ID(pval)
{
if (window.confirm("您確認刪除嗎?"))
{
self.location = "tf_info_del.jsp?INFO_ID="+pval+"&INFO_TYPE=<%=INFO_TYPE%>";
return true;
}
return false;
}
</script>
</td>
</tr>
</table>
</center>
</div>
</center>
</div>
<%
String INFO_ID= "" ; //INFO_ID
String INFO_CONTENT= "" ; //INFO_CONTENT
String INFO_REMARK= "" ;
int type=Integer.parseInt(optype);
if(type==2)
{
if(null != request.getParameter("INFO_ID") && !request.getParameter("INFO_ID").toString().equals(""))
{
INFO_ID = request.getParameter("INFO_ID").toString();
list.put("INFO_ID",INFO_ID);
col = info.execSel(list);
Iterator ir = col.iterator();
Hashtable tt = new Hashtable();
if (ir.hasNext())
{
tt=(Hashtable)ir.next();
INFO_TYPE = Util.getNulltoStr(tt.get("INFO_TYPE")); // INFO_TYPE
INFO_CONTENT = Util.getNulltoStr(tt.get("INFO_CONTENT")); // INFO_CONTENT
INFO_REMARK= Util.getNulltoStr(tt.get("INFO_REMARK"));
}
}
}
%>
<form action="tf_info_java.jsp" name="form_query" method="post" onSubmit="return ActionStatus()" >
<input name="optype" type="hidden" value="<%=optype%>" >
<input name="INFO_ID" type="hidden" value="<%=INFO_ID%>">
<input type='hidden' onKeyDown = 'nextInput()' name='INFO_TYPE' size='25' value='<%=INFO_TYPE%>' >
<div align="center">
<center>
<table width='95%' border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111'>
<tr>
<td class='table_list'>標題:
<input type='TEXT' onkeydown = 'nextInput()' name='INFO_CONTENT' size='69' value='<%=INFO_CONTENT%>' > </td>
<tr>
<td class='table_list'>內容:
<textarea cols='68' rows="8" name='INFO_REMARK' ><%=INFO_REMARK%></textarea></td>
<tr>
<td class='table_list'><input type="submit" value="提交" border="0" >
<input type="reset" value="取消"></td>
</table>
</center>
</div>
<br>
</form>
<script language=javascript>
function ActionStatus()
{
return check_input();
}
function check_input(){
var type=true;
type=check_null(document.form_query.INFO_CONTENT,'請輸入標題!!')
if (!type)
{
return false;
}
return true;
}
</script>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -