<%@ include file="validate.jsp" %>
<%@ page language="java" contentType="text/html; charset=GBK"
    pageEncoding="GBK"%>
    <%@ page import="cn.sendsms.jdsmsserver.*"%>
<%
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragrma","no-cache");
response.setDateHeader("Expires",0);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>Ιθ±ΈΧΆ²α</title>
<link href="css.css" type="text/css" rel="stylesheet">
<script type="text/javascript">
 function goback(){
	 window.location.href="/bigdipperInfo?action=refreshBD";
 }
 function check1(){
	
	 var serialnum = document.getElementById('serialnum').value;
	 var regcode = document.getElementById('regcode').value;
	 if(serialnum=='0123456789'){
		 alert('<%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.device_reg_failure_info4")%>');
		 	return false;
	 }
	 if(serialnum=='')
		 {
		 alert('<%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.device_failed_to_get_imei1")%>');
		 	return false;
		 }
	
	 if(regcode==''){
		 alert('<%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.device_input_reg_code")%>');
		 return false;
	 }
	
	 if(regcode.length!=23 && regcode.length!=28){
		 alert('<%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.device_reg_failure_info5")%>');
		 return false;
	 }
	return true;
	 
 }
</script>
</head>
<body>
<div id="top"><span><img src="img/tu1.jpg"></span><%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.device_reg")%></div>
<div id="center">
<%
	String serialnum = (String)request.getAttribute("serialnum");
%>
<form action="/bigdipperInfo" name="form1" method="post" onsubmit="return check1();">
<input type="hidden" name="action" value="regBigDipperDevice">
<input type="hidden" name="gatewayid" value="<%=request.getAttribute("gatewayid")%>">

<table>
<% 
if(request.getAttribute("error")!=null)
	{%>
	<tr><td colspan="2" style="color:#ff0000"><%=request.getAttribute("error") %></td></tr>
<%}else if(request.getAttribute("info")!=null) {%>
	<tr><td colspan="2" style="color:#00ff00"><%=request.getAttribute("info") %></td></tr>
<%} %>
<tr>
<td><%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.device_id")%></td>
<td><input type="text" readonly name="serialnum"  id="serialnum"  size="35"  value="<%=serialnum %>"></td>
</tr>
<tr>
<td><%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.device_reg_code")%> </td>
<td><input type="text" name="regcode" id="regcode" maxlength="28" size="35" value="<%=request.getAttribute("regcode")%>"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value=<%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.device_reg_submit")%>> <input type="reset" value=<%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.device_reg_reset")%>> <input type="button" value=<%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.device_reg_back")%> 

onclick="goback()"></td>
</tr>
<tr>
<td colspan="2" align="center"><%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.device_reg_info1")%> <a target="_top" href="http://www.sendsms.com.cn/">www.sendsms.com.cn</a> <%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.device_reg_info2")%></td>
</tr>
</table>
</form>
</div>
<%if(request.getAttribute("message")!=null) {%>
<script type="text/javascript">
alert('<%=request.getAttribute("message")%>');
</script>
<% }%>
</body>
</html>