<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  	
  </head>
  <body>
			<div class="top"></div>
			<div class="center">
		  		<h3 id="movePopuWin">
		        	<a href="javascript:;" title="关闭" class="message_close" id="closePopuWin"></a>
		        	<span>处理方式</span>
		        </h3>
		        <div class="popuWinMessage_main">
		        	<form id="disposeAlarmForm" action="<%=path %>/json/alarmAction_dispose.action" method="POST">
		        		<ul><li style="text-align:center;"><span id="alarmDisposeMsg" style="color:red;">&nbsp;</span></li></ul>		     
			        	<table width="100%" border="0" style="line-height:35px;">			        		
								<tr>
				        			<td style="width: 70px;text-align: center;">
				        			     <input id="disposeWay_01" name="disposeWay" value="下发文本" type="radio"><label for="disposeWay_01">下发文本</label></input>
				        			</td>
				        			<td style="width: 70px;text-align: center;">
				        			     <input id="disposeWay_02" name="disposeWay" value="下发拍照" type="radio"><label for="disposeWay_02">下发拍照</label></input>
				        			</td>
				        		</tr>
				        		<tr>
				        			<td style="width: 70px;text-align: center;">
				        			     <input id="disposeWay_03" name="disposeWay" value="车辆监听" type="radio"><label for="disposeWay_03">车辆监听</label></input>
				        			</td>
				        			<td style="width: 70px;text-align: center;">
				        			     <input id="disposeWay_04" name="disposeWay" value="解除报警" type="radio" checked="checked"><label for="disposeWay_04">解除报警</label></input>
				        			</td>
				        		</tr>
				        		<tr>
				        			<td style="width: 70px;text-align: center;" colspan="2">
				        			    <input id="disposeAlarmBtn" type="button" value="提交" style="width:80px; height:30px;"/>					    		
				        			</td>
				        		</tr>				        	
			        	</table>
			        	<input type="hidden" id="alarm_createTime" name="createTime" value="${param.createTime}"/>
			        	<input type="hidden" id="alarm_vid" name="vid" value="${param.vid}"/>
			        </form>			     
		        </div>
			</div>
			<div class="bot"></div>	
			<script>
				$(function(){
				
					var vhcId = ${param.vid};
					
					var mobileId = equipmentObject[vhcId].mobileId;
					
					var gprsCode = equipmentObject[vhcId].gprsCode;
					
					var carName = equipmentObject[vhcId].vehicleName;
					
					function getDisposeCmd(maskId){
						var cmd = null;
						for(var i=0;i<comds.data.length;i++){
					      if(comds.data[i].mobileId==mobileId && comds.data[i].mask == maskId){
					      	 cmd = comds.data[i];
					         break; 
					      }
					   }
					   
					   return cmd;					   
					}
					
					function openCmdWin(maskId){
						var cmd = getDisposeCmd(maskId);
						if(cmd == null){
							$("#alarmDisposeMsg").html("*设备不支持此处理方式");
						}else{
							$("#closePopuWin").click();
							$("<li onclick=\"sendComdWin(this)\" name=\"mtId=" + mobileId + ",comdId=" + maskId + ",vidId=" + gprsCode + ",name=" + carName + ",mask=" + maskId + ",eqId=" + vhcId + "\">" + cmd.meaning + "<\li>").click();
						}
					}
					
					$("#disposeAlarmBtn").click(function(){
						
						$("#alarmDisposeMsg").html("&nbsp;");
						$("#disposeAlarmBtn").attr("disable","disable");
						
						var type = $("input:radio[name='disposeWay']:checked").val();
						
						if(type == "下发文本"){
							openCmdWin(7020);
						}else if(type == "下发拍照"){
							openCmdWin(7024);
						}else if(type == "车辆监听"){
							openCmdWin(7029);
						}else{
							openCmdWin(7013);
						}
						
					});
				
				})

				
				
			</script>	
  </body>
</html>
