123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <%@ page contentType="text/html; charset=utf-8" session="false" %>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>我的工作台</title>
- <%@ include file="../common/header.jsp" %>
- <script type="text/javascript">
-
- //备份数据
- function backupdate(){
- var ip = $("#ip").val();
- var Port = $("#Port").val();
- var pastureName = $("#pastureName").val();
- var pastureCode = $("#pastureCode").val();
-
- if(ip.length == 0){
- alert("【服务器IP】必填");
- $("#ip").focus();
- return false;
- }else if(Port.length == 0){
- alert("【服务器端口】必填");
- $("#Port").focus();
- return false;
- }else if(pastureName.length == 0){
- alert("【牧场名称】必填");
- $("#pastureName").focus();
- return false;
- }else{
- if(pastureCode.length == 0){
- alert("【牧场编号】必填");
- $("#pastureCode").focus();
- return false;
- }else{
- $.ajax({
- async: false,
- type: "post",
- dataType: "jsonp", //返回类型json
- data: "pastureName="+pastureName+"&pastureCode="+pastureCode+"&callback=backjsonp",
- url: "http://"+ip+":"+Port+"/TMRWatchPlatform/admin/basicdata/checkPastureCode.do"
- });
-
- }
- }
-
- }
- function backjsonp(data){
- console.log("backjsonp:"+data.status);
- if(data.status == "success"){
- $.ajax({
- async: false,
- type: "POST",
- dataType: "json", //返回类型json
- data: "pastureName="+$("#pastureName").val()+"&pastureCode="+$("#pastureCode").val(),
- url: "${contextPath}/admin/basicdata/addPasture.html",
- error: function(){alert("系统错误");},
- success: function(json){
- addStatus = json.addStatus;
- if(addStatus == "success"){
- alert("启动成功");
- $("#pastureName").val("");
- $("#pastureCode").val("");
- }else{
- alert("启动失败");
- }
- }
- });
- }else{
- alert("服务器验证牧场信息失败!!!");
- }
- }
- </script>
- </head>
- <body style="background-color: #E0E0E0;">
- <div>
- <div class="navfrm">
- <span>当前位置:</span>
- <span><a href="${contextPath }/admin/welcome.html">首页</a></span>
- <span> >> </span>
- <span>上传登记</span>
- </div>
-
- <table cellspacing="1" cellpadding="0" border="0" style="width: 99%;">
- <tr>
- <td width="10%" align="right"><font color="red">*</font>服务器IP:</td>
- <td algin="left"><input id="ip" name="ip" style="width:100px;" value="" /></td>
- </tr>
- <tr>
- <td align="right"><font color="red">*</font>服务器端口:</td>
- <td><input id="Port" name="Port" style="width:100px;" value="" /></td>
- </tr>
- <tr>
- <td align="right"><font color="red">*</font>牧场名称:</td>
- <td><input id="pastureName" name="pastureName" style="width:100px;" value="" /></td>
- </tr>
- <tr>
- <td align="right"><font color="red">*</font>牧场编号:</td>
- <td><input id="pastureCode" name="pastureCode" style="width:100px;" value="" /></td>
- </tr>
- <tr>
- <td></td>
- <td><input type="button" value="启动" onclick="backupdate();" class="sysub" /></td>
- </tr>
- </table>
- </div>
- </body>
- </html>
|