<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="cn.exlive.mygpsonline.util.AlarmType"%>
<%@page import="cn.exlive.mygpsonline.util.InternationalizationUtil"%>
<!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">
		        	<ul><li style="text-align:center;"><div style="font-weight:bold;font-size:12px;color:#555;margin:5px 0 5px 5px;">提示 : 取消选中即可过滤该类型报警信息</div></li></ul>
		        	<form id="alarmTypeForm" method="POST">
			        	<table width="100%" border="0" style="line-height:35px;">
			        		<tr>
			        			<td title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_OVERSPEED")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_OVERSPEED %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_OVERSPEED", 7)%>
			        				</input>
			        			</td>  
			        			<td  title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_LOWSPEED")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_LOWSPEED %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_LOWSPEED", 7) %>
			        				</input>
			        			</td>  
			        			<td title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_SOS")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_SOS %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_SOS", 7) %>
			        				</input>
			        			</td>        						        				       			     			
			        		</tr>
			        		<tr>
			        			<td  title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_POWEROFF")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_POWEROFF %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_POWEROFF", 7) %>
			        				</input>
			        			</td>  
			        			<td title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_OUTREGION")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_OUTREGION %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_OUTREGION", 7) %>
			        				</input>
			        			</td>  
			        			<td title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_INREGION")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_INREGION %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_INREGION", 7) %>
			        				</input>
			        			</td>        						        				       			     			
			        		</tr>
			        		<tr>
			        			<td title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_TIREDDRIVE")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_TIREDDRIVE %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_TIREDDRIVE", 7) %>
			        				</input>
			        			</td>  
			        			<td title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_LINEAWAY")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_LINEAWAY %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_LINEAWAY", 7) %>
			        				</input>
			        			</td>  
			        			<td title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_LINEOFF")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_LINEOFF %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_LINEOFF", 7) %>
			        				</input>
			        			</td>        						        				       			     			
			        		</tr>
			        		<tr>
			        			<td  title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_TEMPERATURE")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_TEMPERATURE %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_TEMPERATURE", 7) %>
			        				</input>
			        			</td>  
			        			<td  title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_UNLAWOPENDOOR")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_UNLAWOPENDOOR %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_UNLAWOPENDOOR", 7) %>
			        				</input>
			        			</td>  
			        			<td  title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_UNLAWFIRE")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_UNLAWFIRE %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_UNLAWFIRE", 7) %>
			        				</input>
			        			</td>        						        				       			     			
			        		</tr>
			        		<tr>
			        			<td  title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_STOPDEF")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_STOPDEF %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_STOPDEF", 7) %>
			        				</input>
			        			</td>  
			        			<td  title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_TINGCHECHAOSHI")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_TINGCHECHAOSHI %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_TINGCHECHAOSHI", 7) %>
			        				</input>
			        			</td>  
			        			<td  title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_LOUYOU_VAL")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_LOUYOU_VAL %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_LOUYOU_VAL", 7) %>
			        				</input>
			        			</td>        						        				       			     			
			        		</tr>
			        		<tr>
			        			<td  title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_LOWPOWER_ORDER")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_LOWPOWER_ORDER %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_LOWPOWER_ORDER", 7) %>
			        				</input>
			        			</td>  
			        			<td  title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_TURNOFF_ORDER")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_TURNOFF_ORDER %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_TURNOFF_ORDER", 7) %>
			        				</input>
			        			</td>  
			        			<td  title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_FANZHUAN_ORDER")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_FANZHUAN_ORDER %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_FANZHUAN_ORDER", 7) %>
			        				</input>
			        			</td>        						        				       			     			
			        		</tr>
			        		<tr>
			        			<td  title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_VHCONLINE")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_VHCONLINE %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_VHCONLINE", 7) %>
			        				</input>
			        			</td>  
			        			<td title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_VHCOFFLINE")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_VHCOFFLINE %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_VHCOFFLINE", 7) %>
			        				</input>
			        			</td>  
			        			<td title="<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_ZHENDONGBJ")%>">
			        				<input type="checkbox" name="alarmType" checked="checked" value="<%=AlarmType.ALARM_ZHENDONGBJ %>">
			        					<%=InternationalizationUtil.getText("mygpsonline.alarm.ALARM_ZHENDONGBJ", 7) %>
			        				</input>
			        			</td>        						        				       			     			
			        		</tr>
			        	</table>        	
						<input id="saveAlarmType" type="button" value="保存" onclick="saveAlarmTypeSetting();" style="width:80px; height:30px; margin-left:110px; margin-top:20px;" />					
        			</form>
		        </div>
			</div>
			<div class="bot"></div>
			  	<script>

					function saveAlarmTypeSetting(){
							
							var filterType = 0;
							
							var formData =  $("#alarmTypeForm").serializeArray();
							for(var i = 0; i < formData.length; i++ ) 
								filterType = filterType | parseInt(formData[i].value) ;
								
							setCurUserAlarmTypeCookie(filterType);
							$("#closePopuWin").click();
							
					}
					
					(function(){
						
						if(curUserAlarmTypeVal + 1 ==0) return ;
						
						var curUserAlarmTypeVal = getCurUserAlarmTypeValue();
						$("#alarmTypeForm").find("input[name='alarmType']").each(function(){
						
							if(( parseInt($(this).val()) & curUserAlarmTypeVal ) <= 0) 
								$(this).attr("checked",false);
								
						});
						
					})();
									  		
			  	</script>
  </body>
</html>
