<%@ 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="/phoneInfoPage?action=refreshTest";
 }
 function check1(){
	
	 var serialnum = document.getElementById('serialnum').value;
	 var regcode = document.getElementById('regcode').value;
	 if(serialnum=='0123456789'){
			alert('设备序列号无效,请联系春笛公司授权!');
		 	return false;
	 }
	 if(serialnum=='')
		 {
		 	alert('获取设备序列号失败！');
		 	return false;
		 }
	
	 if(regcode==''){
		 alert('请输入注册码！');
		 return false;
	 }
	
	 if(regcode.length!=23 && regcode.length!=28){
		 alert('注册码长度应该为23位或28位！');
		 return false;
	 }
	return true;
	 
 }
</script>
<style type="text/css">
	input{
		height:22px;
		line-height: 22px;
	}
	#center .left_col{
		font-size: 14px;
		color:#202020;
		font-weight: 600;
	}
	.wbtn1,.wbtn2{
		padding:5px 10px;
		line-height: 15px;
		border:1px solid #9cc0c1;
		background: #fff;
		color:#5db3b6;
		border-radius: 5px;
		margin-right:10px;
		width:100px;
		height:auto;
	}
	.wbtn2{
		background: #5db3b6;
		color:#fff;

	}
</style>
</head>
<body>
<div id="top"><span><img src="img/tu1.jpg"></span>设备注册</div>
<div id="center">
<%
	String serialnum = (String)request.getAttribute("serialnum");
%>
<form action="/phoneInfoPage" name="form1" method="post" onsubmit="return check1();">
<input type="hidden" name="action" value="regPhoneDevice">
<input type="hidden" name="phoneNo" value="<%=request.getAttribute("phoneNo")%>">

<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>手机序列号</td>
<td><input type="text" readonly name="serialnum"  id="serialnum"  size="35"  value="<%=serialnum %>"></td>
</tr>
<tr>
<td>注册码 </td>
<td><input type="text" name="regcode" id="regcode" maxlength="28" size="35" value="<%=request.getAttribute("regcode")%>"></td>
</tr>
<tr>
	<td></td>
	<td>
		<%=ResourceManager.getInstance().getBykey(ResourceManager.getInstance().m_sDefault).getString("settings.device_reg_info1")%>
		<div></div>
		<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>
<tr>
<td colspan="2" align="center"> <input type="reset" class="wbtn1" value="重置"><input type="submit" class="wbtn2" value="提交"> <input type="button" class="wbtn1" value="返回" 

onclick="goback()"></td>
</tr>

</table>
</form>
</div>
<%if(request.getAttribute("message")!=null) {%>
<script type="text/javascript">
alert('<%=request.getAttribute("message")%>');
</script>
<% }%>
</body>
</html>