<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<!--[if lt IE 7 ]><html lang="en" class="ie6 ielt7 ielt8 ielt9"><![endif]--><!--[if IE 7 ]><html lang="en" class="ie7 ielt8 ielt9"><![endif]--><!--[if IE 8 ]><html lang="en" class="ie8 ielt9"><![endif]--><!--[if IE 9 ]><html lang="en" class="ie9"> <![endif]--><!--[if (gt IE 9)|!(IE)]><!--> 
<html lang="en"><!--<![endif]--> 
	<head>
		<%@include file="/WEB-INF/navigation/JsAndCss.jsp" %>
		<link href="/umeditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" charset="utf-8" src="/umeditor/umeditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/umeditor/umeditor.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/umeditor/lang/zh-cn/zh-cn.js"></script>
		<style type="text/css">
		.current_page{border:solid 1px;padding:0 3px;}
		</style>
		<script type="" src="/js/ajaxfileupload.js"></script>
		<script type="text/javascript">
		function attachmentUpload() {  
            $.ajaxFileUpload  
        (  
            {  
                url: '/AttachmentUp.jsp',  
                secureuri: false,  
                fileElementId: 'attachmentFile',  
                dataType: 'json',  
                beforeSend: function() {  
                    $("#loading").show();  
                },  
                complete: function() {  
                    $("#loading").hide();  
                },  
                success: function(data, status) {  
                	//alert(data.url);
                    $('#uri').val("/"+data.url);
                    $('#orginUri').val(data.physicalPath);
                    var t = data.originalName;
                    var title=t.substring(0,t.lastIndexOf("."));
                    $('#label3').html("\(已上传附件\)");
                    $('#attachmentTitle').val(title);

            },  
            error: function(data, status, e) {  
                alert(e);  
            }  
        }  
    );
        return false;  
    }  
		</script>
	</head>
	<body>
		<div class="container">
			<div class="navbar">
				<div class="navbar-inner">
					<%@include file="../navigation/menu.jsp"%>
				</div>
			</div>
			<div class="row">
				
					<%@include file="../navigation/navigation.jsp"%>
				
				<div class="span9">
					<h1>
						附件修改
					</h1>
					<form method="post" action="updateAttachment.do" >
					<fieldset>
							<div class="control-group">
								<label class="control-label" for="uploadPreview">上传附件</label>
								<div class="controls">
									<input id="attachmentFile" type="file" name="attachmentFile" class="fimg1"/>
									<button type="button" class="btn btn-primary" onclick="return attachmentUpload();">上传附件</button>
									<label id="label3"></label>
								</div>
							</div>
							<input id="uri" name="uri" type="hidden" />
							<input id="orginUri" name="orginUri" type="hidden" />
							<div class="control-group">
								<label class="control-label" for="attachmentTitle">文件名</label>
								<div class="controls">
									<input id="attachmentTitle" name="attachmentTitle"  type="text" value="${attachment.title }"/>
								</div>
							</div>
							
							<input id="id" name="id" type="hidden" value="${attachment.id}"/>
							<div class="form-actions">
								<button type="submit" class="btn btn-primary">确定</button> 
								<button class="btn" onclick="history.back();">取消</button>
							</div>
						</fieldset>
						</form>
				</div>
			</div>
		</div>
	</body>
</html>
