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

📄 handle_mod.jsp

📁 这是一个简单但是很实用的JSP应用实例
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.lang.*,java.io.*" %>
<%@include file="/db/dbPool.inc"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="/lib/main.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 3px;
	margin-right: 3px;
	margin-bottom: 3px;
}
td{
	border-left-width:0px;
	border-right-width:0px;
	border-top-width:0px;
	border-bottom-width:0px;
}
-->
</style>
<title>提交修改信息</title>
</head>
<script src="/lib/jsFunc.js"></script>
<script src="/office/lib/strfunc.js"></script>
<script language="javascript">
function checkFm()
{
with(document.fm)
	{
    if(trim(logCon.value)==""||trim(logCon.value)=="(50字以内)"){
			alert("请填写工位修改描述!");
			logCon.value="";
			logCon.focus();
			return false;
		}
	
	if(logCon.value.length>100)
	{
		alert("工位修改描述不能超过50个字!");
		logCon.focus();
		return false;	
	}
	
	else if(confirm("您确定要发布该信息吗?")){
			fm.action='handle_log.jsp';
			fm.submit();
		}
	}
}
</script>
<jsp:useBean id="queryBean" scope="page" class="Query.Query"/>
  <%
	int isSuc1=0;
	String str_isSuc1="";
	String bID="";
	String sID="";
	String wID="";
	String wName="";
	String hasPic="";
	String oInstr="";
	String isSend="";
	String isComp="";
	String schID="";
	String schName="";
	String picName="";
	int busyNum=0;
	
	bID=request.getParameter("bID");
	sID=request.getParameter("sID");
	wID=request.getParameter("wID");
	wName=request.getParameter("wName");
	hasPic=request.getParameter("hasPic");
	oInstr=request.getParameter("oInstr");
	isSend=request.getParameter("isSend");
	isComp=request.getParameter("isComp");
	busyNum=java.lang.Integer.parseInt(request.getParameter("tmp_busyNum"));
    if(isSend==null||isSend.equals("")) isSend="";
    if(isComp==null||isComp.equals("")) isComp="";

	Statement stmt=null;
	stmt=conn1.createStatement();
	ResultSet rs=stmt.executeQuery("select stateSch.schID,manuSch.schName from stateSch,manuSch where sID='"+sID+"' and stateSch.schID=manuSch.schID");
	if(rs.next()){
		schID=rs.getString("schID");//方案号
		schName=rs.getString("schName");//方案名称
	}
	
	if(!isSend.equals("")){
		rs=stmt.executeQuery("select picName from partsInfo where pID='"+isSend+"'");
		rs.next();
		picName=rs.getString("picName");
	}else
		picName="";
 try{
	isSuc1=stmt.executeUpdate("update wpList set oInstr='"+oInstr+"',picName='"+picName+"',pID='"+isComp+"',busyNum='"+busyNum+"' where wID='"+wID+"' and bID='"+bID+"'  update wsConf set pID='"+isComp+"',picName='"+picName+"' where sID='"+sID+"' and wID='"+wID+"'");

  }
	catch(SQLException e)
  {
	System.out.println("SQL语句执行出错");
	System.out.println("ERROR CODE IS:" +e.getErrorCode());
	isSuc1=0;
%>
	<script language="javascript">
		failTips("抱歉,数据插入错误,请重试!",false,true);
	</script>
<%
}
finally{
	if (stmt!=null)
		try{
			stmt.close();
		}
		catch(SQLException e){
			System.out.println("SQL出错,ERROR CODE IS:" + e.getErrorCode());
		}
}
if(isSuc1>0)
	str_isSuc1=java.lang.Integer.toString(isSuc1);
 %>
<BODY style="background-color:#FFFFFF " text="000000" link="000099"  vlink="000099" alink="ff0000" bgcolor="#FFFFFF">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><a href="#">【</a><a href="../schManage/index.jsp"><strong>生产计划管理</strong></a>→<a href="bList.jsp"><font color="#FF0000">生产计划确认</font></a>→修改工位信息→填写修改日志】</td>
	<td width=50 align="center">&nbsp;</td>
  </tr>  
</table>
<br>
<br>
<table width="600" border="1" cellpadding="3" cellspacing="0"  align="center" bordercolor="#cccccc">
<form name="fm" method="post" action="">
<input type="hidden" name="bID" value="<%=bID%>">
<input type="hidden" name="schID" value="<%=schID%>">
<input type="hidden" name="wID" value="<%=wID%>">
<input type="hidden" name="wName" value="<%=wName%>">
<input type="hidden" name="str_isSuc1" value="<%=str_isSuc1%>">
  <tr>
    <td  bgcolor="#efefef"  height="23" colspan="4">【<strong>填写修改日志</strong>】(<font color="#FF0000">*</font>为必填项)</td>
  </tr>
 <tr>
    <td width="105" align="right">批&nbsp;次&nbsp;号:</td>
	<td width="477" colspan="3" align="left"><%=bID%></td>
  </tr>
 <tr>
    <td width="105" align="right">方案名称:</td>
	<td width="477" colspan="3" align="left"><%=schName%></td>
  </tr>
  <tr>
	<td width="105" align="right">工位名称:</td>
	<td colspan="3"><font color="#FF0000"><%=wName%></font></td>
  </tr> 
<tr>
	<td width="105" align="right" valign="top">修改描述:</td>
	<td colspan="3"><textarea name="logCon" cols="50" rows="3" id="logCon"  onFocus="if (value =='(50字以内)'){value =''}" onBlur="if (value ==''){value='(50字以内)'}">(50字以内)</textarea> 
	&nbsp;<font color="#FF0000">*</font></td>
  </tr>
  <tr bgcolor="efefef">
    <td colspan="5" align="center">
	<input type="button"  class="flatBtn" style="width:50 " onClick="checkFm();"  onMouseOut="this.style.color='000000'" onMouseOver="this.style.color='FF0000'" value="发 布">
	&nbsp;
   <input type="reset"  class="flatBtn" style="width:50 " onClick="history.back();"onMouseOut="this.style.color='000000'" onMouseOver="this.style.color='FF0000'" value="取 消"></td>
  </tr>
</form>
</table>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color="#FF0000">提示:</font>如未对工位信息进行任何修改,则请填写&quot;无&quot;。
</body>
</html>
<%@ include file="/db/dbpoolEnd.inc" %>
<script src="/lib/jsFooter.js"></script>

⌨️ 快捷键说明

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