52,799
社区成员
发帖
与我相关
我的任务
分享
<%@ page language="java" pageEncoding="GBK"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<title>收入添加</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="../jQuery/jquery-1.7.2.js"></script>
<script src="../jQuery/jquery.form.js" type="text/javascript"></script>
<script type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" type="text/css" href="../images/styles.css">
<script type="text/javascript">
$(function() {
$(".date").click(function() {
WdatePicker();
});
$("#btn").click(function() {
var url;
if ($("#id").val() != null && $("#id").val() != "") {
url = 'income!update';
} else {
url = 'income!add';
}
alert(url);
var options = {
url : url,
type : 'POST',
success : function(data) {
if (data) {
alert("添加成功!");
$("form").clearForm();
} else
alert("添加失败!");
}
};
$("form").ajaxSubmit(options);
});
});
</script>
</head>
<body>
<div class="div1">
<table width="100%" cellpadding="0" cellspacing="0" border="0"
align="center">
<tr>
<td class="td_title1">
· 当前位置 : 收入管理 >> 编辑收入
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" height="50">
<br>
<form action="" method="post" submit="return false;">
<input type="hidden" name="id" id="id" value="${income.id }">
<table border="0" align="center" width="450">
<tr>
<td align="right">
日期:
</td>
<td align="left">
<input type="text" class="date" name="date" value="<fmt:formatDate value='${income.date}' pattern='yyyy-MM-dd'/>"/>
</td>
</tr>
<tr>
<td align="right">
方式:
</td>
<td align="left">
<input type="text" id="style" name="style" value="${income.style }"/>
</td>
</tr>
<tr>
<td align="right">
金额:
</td>
<td align="left">
<input type="text" id="money" name="money" value="${income.money }"/>
</td>
</tr>
<tr>
<td align="right">
项目:
</td>
<td align="left">
<input type="text" id="project" name="project" value="${income.project }"/>
</td>
</tr>
<tr>
<td align="right">
来源:
</td>
<td align="left">
<input type="text" id="source" name="source" value="${income.source }"/>
</td>
</tr>
<tr>
<td align="right">
人员:
</td>
<td align="left">
<input type="text" id="personnel" name="personnel" value="${income.personnel }"/>
</td>
</tr>
<tr>
<td align="right">
备注:
</td>
<td align="left">
<textarea rows="3" cols="30" id="remarks" name="remarks" value="${income.remarks }"></textarea>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" id="btn" value="提交">
<input type="reset" value="重置">
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</div>
</body>
<a href="income/income_edit.jsp" target="main" class="sub1">添加收入</a>
<a href="javascript:if(confirm('确定要修改${id}吗?'))location='income!updateTo?id=${id}'">修改</a>
<action name="income"
class="com.xqh.action.IncomeAction">
<!-- 为两个逻辑视图配置视图页面 -->
<result name="error">/error.jsp</result>
<result name="add">/income/income_edit.jsp</result>
<result name="paging">/income/income_list.jsp</result>
<result name="update">/income/income_edit.jsp</result>
</action>
// 修改跳转
public String updateTo() {
if (StringUtils.isNotBlank(id)) {
income = service.getIncomeById(Integer.parseInt(id));
request.setAttribute("income", income);
}
return "update";
}