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

📄 chargeitem.jsp

📁 由于信息产业、网络通讯、电子技术的高速发展、宽频网络的应用
💻 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;       
	    	}
	    }
        
        //  获得各操作记录数和主键编号
        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+" 记录吗?如果删除将无法恢复!") )
                {
                	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("确认保存数据?") )
       			{
       				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("没有找到相关信息!");
				out.println("</td></tr>");
			}
			session.setAttribute("chargeItems",null);
		 %>
	</tbody>
</table>
</form>
</body>
</html>

⌨️ 快捷键说明

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