<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set>
<%
	String caseGovId = request.getParameter("caseGovId");
	String lawyerId = request.getParameter("lawyerId");
%>

<style>
.title {
	TEXT-ALIGN: center;
	LINE-HEIGHT: 25pt;
	MARGIN: 0.5pt 0cm;
	FONT-FAMILY: 宋体;
	FONT-SIZE: 25px;
	Color: #101010;
	line-height: 30px
}
.court {
	TEXT-ALIGN: center;
	font-size: 16px;
	font-family: '微软雅黑';
	line-height: 20px;
	color: #8c8c8c
}
</style>
<div id="importDiv" style="display: none">
	<form>
		<select name="caseType" id="case_casetype">
			<option value="201">毒品犯罪</option>
			<option value="202">刑事自诉</option>
			<option value="203">职务犯罪</option>
			<option value="204">经济犯罪</option>
			<option value="205">国家赔偿</option>
			<option value="206">海事海商</option>
			<option value="207">国际贸易</option>
			<option value="208">国际运输</option>
			<option value="209">交通事故</option>
			<option value="210">劳动纠纷</option>
			<option value="211">赡养抚养</option>
			<option value="212">继承</option>
			<option value="213">离婚纠纷</option>
			<option value="214">医疗纠纷</option>
			<option value="215">名誉侵权</option>
			<option value="216">人身损害</option>
			<option value="217">财产损害</option>
			<option value="218">网络购物</option>
			<option value="219">借贷纠纷</option>
			<option value="220">房产纠纷</option>
			<option value="221">建筑工程</option>
			<option value="222">装修工程</option>
			<option value="223">合伙联营</option>
			<option value="224">招标投标</option>
			<option value="225">矿产资源</option>
			<option value="226">股权</option>
			<option value="227">公司解散</option>
			<option value="228">证券期货</option>
			<option value="229">行政诉讼</option>
			<option value="230">刑事辩护</option>
			<option value="231">土地纠纷</option>
			<option value="232">保险理赔</option>
			<option value="233">外商投资</option>
			<option value="234">抵押担保</option>
			<option value="235">知识产权</option>
			<option value="236">银行卡纠纷</option>
			<option value="237">反垄断与不正当竞争</option>
			<option value="238">合同纠纷</option>
			<option value="239">其他</option>
		</select> 
		<input id="submitBtn" type="button" value="导入" /><span id="show" style="display:none">处理中，请稍等...</span>
		<input value="<%=caseGovId%>" name="caseGovIds" type="hidden" /> 
		<input value="<%=lawyerId%>" name="lawyerId" type="hidden" />
	</form>
</div>

<div class="title" id="span_title">${lawyerCase.title}</div>
<br/>
<div class="court"><span id="span_court">${lawyerCase.court}</span> &#9;&#9;<span id="span_casenum">${lawyerCase.casenum}</span></div>
<br/>
<div class="content">
	<!-- pre 定义预格式化的文本,客服从后台添加的案例 -->
	<pre style="font-size: 15px;line-height: 27px;" id="span_content">${lawyerCase.content}</pre>
</div>
<div style="font-size: 10px">案例来源：中国裁判文书网</div>

<script type="text/javascript" src="${contextPath}/static/assets/js/jquery1x.js"></script>
<script type="text/javascript" > 
$.getJSON("${contextPath}/sys/lawyer/getGovCaseContent?caseGovId=<%=caseGovId%>&lawyerId=<%=lawyerId%>", {data:new Date()},  function(result){					 
	if(result && result.isSuccess){		
		$("#span_content").html(result.vo.content);	
		$("#span_title").html(result.vo.title);	
		$("#span_casenum").html(result.vo.casenum);
		$("#span_court").html(result.vo.court);
		$("#importDiv").show();		
	}else{
		$("#content").html(result.message);
	}
});

$("#submitBtn").bind("click", function(){
	var params = $('form').serialize();	
	params +=  "&content=" + $("#content").html();
	showdiv();
	$.post("${contextPath}/sys/lawyer/caseGovImportContent", encodeURI(params), function(data){
		hidediv();
		if (data.isSuccess==true) {
			alert("成功导入" + data.row + "个案例");
			$("#importDiv").hide();
		} else {
			alert(data.message);
		}
	});   				
});

function showdiv() {            
	document.getElementById("show").style.display ="block";
    $("#submitBtn").attr({"disabled":"disabled"});
}

function hidediv() {
	document.getElementById("show").style.display ='none';
    $("#submitBtn").removeAttr("disabled");
}
</script>