?? chargeitem.jsp
字號:
<%@ page language="java" import="java.util.*,bean.ChargeItem" pageEncoding="gbk"%>
<html>
<head>
<title>收費項目管理</title>
<link rel="stylesheet" type="text/css" href="../../../css/secondcss.css">
<script type="text/javascript">
var str="";
// 全選操作
function checkJs(obj)
{
var elem = document.form1.elements;
for(var i = 0; i < elem.length; i++)
{
if(elem[i].type=="checkbox")
elem[i].checked=obj.checked;
}
}
// 獲得各操作記錄數(shù)和主鍵編號
function getInfo()
{
var elem=document.form1.elements;
var count=0;
str="";
for(var i=0;i<elem.length;i++)
{
if(elem[i].type=="checkbox"&&elem[i].checked==true&&elem[i].id!="chkAll")
{
count++;
str += elem[i].value + ",";
}
}
return count;
}
// 刪除操作提示
function DeleteInfo()
{
var count = getInfo();
if(count<1)
{
alert("請選擇要刪除的記錄!");
return false;
}
else
{
if( confirm("您確定要刪除這 "+count+" 記錄嗎?如果刪除將無法恢復(fù)!") )
{
document.form1.action="../../../deleteChargeItem.do?s="+str;
document.form1.submit();
}
else
return false;
}
}
// 編輯操作提示
function EditInfo()
{
var count = getInfo();
if(count<1)
{
alert("請選擇要編輯的記錄!");
return false;
}
else if( count > 1 )
{
alert('只能選擇一項記錄進行編輯!');
return false;
}
else
{
str = str.substring(0,str.length-1);
window.open('editChargeItem.jsp?s='+ str,'newwiow','height=200,width=350,top=280,left=350' );
}
}
// 增加新的收費項目
function saveNewCharge()
{
if(form1.newCharge.value.length==0)
alert('收費項目名稱不能為空!');
else{
if( confirm("確認保存數(shù)據(jù)?") )
{
document.form1.action="../../../addChargeItem.do";
document.form1.submit();
}
else
return false;
}
}
</script>
</head>
<body >
<form id="form1" name="form1" method="post">
<table width="99%" border="0" style="border-top-width: 0px; border-left-width: 0px; background: none transparent scroll repeat 0% 0%;
border-bottom-width: 0px; letter-spacing: 0px; border-right-width: 0px; border-spacing: 0px">
<!--按鈕操作表格-->
<tr>
<td width="36%"><div align="left"><strong><font size="3">收費項目管理</font></strong></div></td>
<td width="8%"><img src="../../../images/zengjia1.gif" width="69" height="22px" style="cursor:hand"
onmousemove="this.src='../../../images/zengjia2.gif'"
onmouseout="this.src='../../../images/zengjia1.gif'"
onmousedown="this.src='../../../images/zengjia3.gif'"
onmouseup="this.src='../../../images/zengjia2.gif'"
onclick="document.getElementById('tab').style.visibility = 'visible';"></td>
<td width="8%"><img src="../../../images/bianji1.gif" width="69" height="22px" style="cursor:hand"
onmousemove="this.src='../../../images/bianji2.gif'"
onmouseout="this.src='../../../images/bianji1.gif'"
onmousedown="this.src='../../../images/bianji3.gif'"
onmouseup="this.src='../../../images/bianji2.gif'"
onclick="return EditInfo();"></td>
<td width="8%"><img src="../../../images/shanchu1.gif" width="69" height="22px" style="cursor:hand"
onmousemove="this.src='../../../images/shanchu2.gif'"
onmouseout="this.src='../../../images/shanchu1.gif'"
onmousedown="this.src='../../../images/shanchu3.gif'"
onmouseup="this.src='../../../images/shanchu2.gif'"
onclick="return DeleteInfo();"></td>
<td width="8%"><img src="../../../images/dayin1.gif" width="69" height="22px" style="cursor:hand"
onmousemove="this.src='../../../images/dayin2.gif'"
onmouseout="this.src='../../../images/dayin1.gif'"
onmousedown="this.src='../../../images/dayin3.gif'"
onmouseup="this.src='../../../images/dayin2.gif'"
onclick="if(confirm('您確定打印嗎?')){ window.print();}"></td>
</tr>
</table>
<br>
<hr color="green">
<table id="tab" style="visibility: hidden;width:550px;">
<tbody>
<tr><td>費用名稱<input type="text" name="newCharge" style='text-align: center;width: 80px;height: 18px'>
<td>收費方式
<select name="newType" style="font-size: 9pt">
<option value="儀表">儀表
<option value="面積">面積
</select>
</td>
<td>單價<input type="text" name="newPrice" style='text-align: center;width: 80px;height: 18px'></td>
<td><img src="../../../images/baocun1.gif" height="22px" style="cursor:hand"
onmousemove="this.src='../../../images/baocun2.gif'"
onmouseout="this.src='../../../images/baocun1.gif'"
onmousedown="this.src='../../../images/baocun3.gif'"
onmouseup="this.src='../../../images/baocun2.gif'"
onclick="return saveNewCharge();">
<img src="../../../images/fanhui1.gif"height="22px" style="cursor:hand"
onmousemove="this.src='../../../images/fanhui2.gif'"
onmouseout="this.src='../../../images/fanhui1.gif'"
onmousedown="this.src='../../../images/fanhui3.gif'"
onmouseup="this.src='../../../images/fanhui2.gif'"
onclick="document.getElementById('tab').style.visibility = 'hidden';"><td>
</tr>
</tbody>
</table>
<table id="tb" width="99%" style="border-top-width: 0px; border-left-width: 0px; background: none transparent scroll repeat 0% 0%;
border-bottom-width: 0px; letter-spacing: 0px; border-right-width: 0px; border-spacing: 0px;">
<tbody>
<tr style="background-color:#5D7B9D;color:white; ">
<td><input type="checkbox" id="chkAll" onclick="checkJs(this)"/>全選</td>
<td>費用名稱</td>
<td>收費方式</td>
<td>單價(元)</td>
</tr>
<%
List arrayList = (ArrayList)session.getAttribute("chargeItems");
if( arrayList != null )
{
for( int i=0; i<arrayList.size(); i++)
{
ChargeItem chargeItem = (ChargeItem)arrayList.get(i);
%>
<tr style="background-color: #F7F6F3;color:#333333; " id="tr"+<%=chargeItem.getRateID() %>>
<td><input type="checkbox" id="chkid" name="chkid" value="<%=chargeItem.getRateID() %>"/></td>
<td><%=chargeItem.getRateName() %></td>
<td><%=chargeItem.getType() %></td>
<td><%=chargeItem.getPrice() %></td>
</tr>
<%
}
}
else
{
out.println("<tr><td colspan='5' style='text-align: left'>");
out.println("沒有找到相關(guān)信息!");
out.println("</td></tr>");
}
session.setAttribute("chargeItems",null);
%>
</tbody>
</table>
</form>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -