set_network.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. <?php
  2. ini_set('error_reporting', E_ALL | E_STRICT);
  3. $tag_header = 'set';
  4. include 'head.php';
  5. $obj = json_decode(trim($output[2]));//var_dump($obj);
  6. $InternetConn='';
  7. switch ($obj->{'InternetConn'}){
  8. case 0:
  9. $InternetConn='disconnected';
  10. break;
  11. case 1:
  12. $InternetConn='connected';
  13. break;
  14. }
  15. $WifiNetworkConn='';
  16. switch ($obj->{'WifiNetworkConn'}){
  17. case 0:
  18. $WifiNetworkConn='disconnected';
  19. break;
  20. case 1:
  21. $WifiNetworkConn='connected';
  22. break;
  23. }
  24. $TelcomNetworkConn='';
  25. switch ($obj->{'TelcomNetworkConn'}){
  26. case 0:
  27. $TelcomNetworkConn='disconnected';
  28. break;
  29. case 1:
  30. $TelcomNetworkConn='connected';
  31. break;
  32. }
  33. $TelcomSimStatus='';
  34. switch ($obj->{'TelcomSimStatus'}){
  35. case 0:
  36. $TelcomSimStatus='no SIM card is found';
  37. break;
  38. case 1:
  39. $TelcomSimStatus='valid SIM card';
  40. break;
  41. case 2:
  42. $TelcomSimStatus='invalid SIM card';
  43. break;
  44. }
  45. $TelcomModemMode='';
  46. switch ($obj->{'TelcomModemMode'}){
  47. case 0:
  48. $TelcomModemMode='No services';
  49. break;
  50. case 1:
  51. $TelcomModemMode='CDMA';
  52. break;
  53. case 2:
  54. $TelcomModemMode='GSM/GPRS';
  55. break;
  56. case 3:
  57. $TelcomModemMode='WCDMA';
  58. break;
  59. case 4:
  60. $TelcomModemMode='GSM/WCDMA';
  61. break;
  62. case 5:
  63. $TelcomModemMode='TD_SCDMA mode';
  64. break;
  65. case 6:
  66. $TelcomModemMode='Unknow';
  67. break;
  68. }
  69. ?>
  70. <style>
  71. img {
  72. display: block;
  73. margin-left: auto;
  74. margin-right: auto;
  75. }
  76. </style>
  77. <div class="envor-content">
  78. <!--
  79. Page Title start
  80. //-->
  81. <section class="envor-page-title-1" data-stellar-background-ratio="0.5">
  82. <div class="container">
  83. <div class="row">
  84. <div class="col-lg-9 col-md-9 col-sm-9">
  85. <h1><?php echo $lang->showWord("network"); ?></h1>
  86. </div>
  87. </div>
  88. </div>
  89. <!--
  90. Page Title end
  91. //-->
  92. </section>
  93. <!--
  94. Main Content start
  95. //-->
  96. <a id="loadinghref"><div id="loading" style="display:none;"><img src="img/giphy.gif"/></div></a>
  97. <section class="envor-section">
  98. <div class="container">
  99. <div class="row">
  100. <div class="col-lg-12">
  101. <div class="envor-sorting" id="faq-sorting">
  102. <div class="envor-toggle">
  103. <!--Network Status-->
  104. <article class="envor-sorting-item css">
  105. <header><?php echo $lang->showWord("network_status"); ?><i class="fa fa-plus"></i></header>
  106. <section>
  107. <div class="form-group" style="display:<?php echo $am101;?>">
  108. <label>Internet Connection Status</label>
  109. <input type="text" readonly class="form-control" placeholder="<?php echo $InternetConn;?>">
  110. <input type="hidden" name="InternetConn" id="InternetConn" value="<?php echo $obj->{'InternetConn'};?>">
  111. </div>
  112. <?php /* <div class="form-group" style="display:<?php echo $am101;?>">
  113. <label>FtpServer</label>
  114. <input type="text" name="FtpServer" id="FtpServer" class="form-control" value="<?php echo $obj->{'FtpServer'};?>">
  115. </div>*/?>
  116. </section>
  117. </article>
  118. <!--Ethernet Interface0-->
  119. <article class="envor-sorting-item css" style="display:<?php echo $am101;?>">
  120. <header><?php echo $lang->showWord("ethernet_interface"); ?><i class="fa fa-plus"></i></header>
  121. <section>
  122. <div class="form-group">
  123. <label>DHCP Client</label>
  124. <select class="form-control" id="Eth0DhcpClient" name="Eth0DhcpClient">
  125. <option value="0" <?php echo $obj->{'Eth0DhcpClient'}=="0"?"selected":""?>>enable</option>
  126. <option value="1" <?php echo $obj->{'Eth0DhcpClient'}=="1"?"selected":""?>>disable</option>
  127. </select>
  128. </div>
  129. <div class="form-group">
  130. <label>Mac Address</label>
  131. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Eth0MacAddress'};?>">
  132. <input type="hidden" name="Eth0MacAddress" id="Eth0MacAddress" value="<?php echo $obj->{'Eth0MacAddress'};?>">
  133. </div>
  134. <div class="form-group">
  135. <label>IP Address</label>
  136. <input type="text" name="Eth0IpAddress" id="Eth0IpAddress" class="form-control" value="<?php echo $obj->{'Eth0IpAddress'};?>">
  137. </div>
  138. <div class="form-group">
  139. <label>Submask Address</label>
  140. <input type="text" name="Eth0SubmaskAddress" id="Eth0SubmaskAddress" class="form-control" value="<?php echo $obj->{'Eth0SubmaskAddress'};?>">
  141. </div>
  142. <div class="form-group">
  143. <label>Gateway Address</label>
  144. <input type="text" name="Eth0GatewayAddress" id="Eth0GatewayAddress" class="form-control" value="<?php echo $obj->{'Eth0GatewayAddress'};?>">
  145. </div>
  146. </section>
  147. </article>
  148. <?php /* <!--Ethernet Interface1-->
  149. <article class="envor-sorting-item css" style="display:<?php echo $am101;?>">
  150. <header><?php echo $lang->showWord("ethernet_interface"); ?><i class="fa fa-plus"></i></header>
  151. <section>
  152. <div class="form-group">
  153. <label>Eth1DhcpClient</label>
  154. <select class="form-control" id="Eth1DhcpClient" name="Eth1DhcpClient">
  155. <option value="0" <?php echo $obj->{'Eth1DhcpClient'}=="0"?"selected":""?>>enable</option>
  156. <option value="1" <?php echo $obj->{'Eth1DhcpClient'}=="1"?"selected":""?>>disable</option>
  157. </select>
  158. </div>
  159. <div class="form-group">
  160. <label>Eth1MacAddress</label>
  161. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Eth1MacAddress'};?>">
  162. <input type="hidden" name="Eth1MacAddress" id="Eth1MacAddress" value="<?php echo $obj->{'Eth1MacAddress'};?>">
  163. </div>
  164. <div class="form-group">
  165. <label>Eth1IpAddress</label>
  166. <input type="text" name="Eth1IpAddress" id="Eth1IpAddress" class="form-control" value="<?php echo $obj->{'Eth1IpAddress'};?>">
  167. </div>
  168. <div class="form-group">
  169. <label>Eth1SubmaskAddress</label>
  170. <input type="text" name="Eth1SubmaskAddress" id="Eth1SubmaskAddress" class="form-control" value="<?php echo $obj->{'Eth1SubmaskAddress'};?>">
  171. </div>
  172. <div class="form-group">
  173. <label>Eth1GatewayAddress</label>
  174. <input type="text" name="Eth1GatewayAddress" id="Eth1GatewayAddress" class="form-control" value="<?php echo $obj->{'Eth1GatewayAddress'};?>">
  175. </div>
  176. </section>
  177. </article>*/?>
  178. <!--WiFi Module-->
  179. <article class="envor-sorting-item css" style="display:<?php echo $showWifi;?>">
  180. <header><?php echo $lang->showWord("WiFi_module"); ?><i class="fa fa-plus"></i></header>
  181. <section>
  182. <div class="form-group">
  183. <label>Mode</label>
  184. <select class="form-control" id="WifiMode" name="WifiMode" onchange="WifiMode_changed();">
  185. <option value="0" <?php echo $obj->{'WifiMode'}=="0"?"selected":""?>>disable</option>
  186. <option value="1" <?php echo $obj->{'WifiMode'}=="1"?"selected":""?>>station</option>
  187. <option value="2" <?php echo $obj->{'WifiMode'}=="2"?"selected":""?>>Acess Point</option>
  188. <?php /* <option value="3" <?php echo $obj->{'WifiMode'}=="3"?"selected":""?>>Ad-Hoc</option>*/?>
  189. </select>
  190. </div>
  191. <div class="form-group">
  192. <label>SSID</label>
  193. <input type="text" name="WifiSsid" id="WifiSsid" class="form-control" value="<?php echo $obj->{'WifiSsid'};?>">
  194. </div>
  195. <div class="form-group">
  196. <label>Password</label>
  197. <input type="text" name="WifiPassword" id="WifiPassword" class="form-control" value="<?php echo $obj->{'WifiPassword'};?>">
  198. </div>
  199. <div class="form-group">
  200. <label>RSSI</label>
  201. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'WifiRssi'};?> dBm">
  202. <input type="hidden" name="WifiRssi" id="WifiRssi" value="<?php echo $obj->{'WifiRssi'};?>">
  203. </div>
  204. <div class="form-group">
  205. <label>DHCP Server</label>
  206. <select class="form-control" id="WifiDhcpServer" name="WifiDhcpServer">
  207. <option value="0" <?php echo $obj->{'WifiDhcpServer'}=="0"?"selected":""?>>enable</option>
  208. <option value="1" <?php echo $obj->{'WifiDhcpServer'}=="1"?"selected":""?>>disable</option>
  209. </select>
  210. </div>
  211. <div class="form-group">
  212. <label>DHCP Client</label>
  213. <select class="form-control" id="WifiDhcpClient" name="WifiDhcpClient">
  214. <option value="0" <?php echo $obj->{'WifiDhcpClient'}=="0"?"selected":""?>>enable</option>
  215. <option value="1" <?php echo $obj->{'WifiDhcpClient'}=="1"?"selected":""?>>disable</option>
  216. </select>
  217. </div>
  218. <div class="form-group">
  219. <label>Mac Address</label>
  220. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'WifiMacAddress'};?>">
  221. <input type="hidden" name="WifiMacAddress" id="WifiMacAddress" value="<?php echo $obj->{'WifiMacAddress'};?>">
  222. </div>
  223. <div class="form-group">
  224. <label>IP Address</label>
  225. <input type="text" name="WifiIpAddress" id="WifiIpAddress" class="form-control" value="<?php echo $obj->{'WifiIpAddress'};?>">
  226. </div>
  227. <div class="form-group">
  228. <label>Submask Address</label>
  229. <input type="text" name="WifiSubmaskAddress" id="WifiSubmaskAddress" class="form-control" value="<?php echo $obj->{'WifiSubmaskAddress'};?>">
  230. </div>
  231. <div class="form-group">
  232. <label>Gateway Address</label>
  233. <input type="text" name="WifiGatewayAddress" id="WifiGatewayAddress" class="form-control" value="<?php echo $obj->{'WifiGatewayAddress'};?>">
  234. </div>
  235. <div class="form-group">
  236. <label>Network Connection Status</label>
  237. <input type="text" readonly class="form-control" value="<?php echo $WifiNetworkConn;?>">
  238. <input type="hidden" name="WifiNetworkConn" id="WifiNetworkConn" value="<?php echo $obj->{'WifiNetworkConn'};?>">
  239. </div>
  240. </section>
  241. </article>
  242. <!--3G/4G Module-->
  243. <article class="envor-sorting-item css" style="display:<?php echo $showTelcom;?>">
  244. <header><?php echo $lang->showWord("3G/4G_module"); ?><i class="fa fa-plus"></i></header>
  245. <section>
  246. <div class="form-group">
  247. <label>APN</label>
  248. <input type="text" name="TelcomApn" id="TelcomApn" class="form-control" value="<?php echo $obj->{'TelcomApn'};?>">
  249. </div>
  250. <div class="form-group">
  251. <label>RSSI</label>
  252. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomRssi'};?> dBm">
  253. <input type="hidden" name="TelcomRssi" id="TelcomRssi" value="<?php echo $obj->{'TelcomRssi'};?>">
  254. </div>
  255. <div class="form-group">
  256. <label>Chap Pap Id</label>
  257. <input type="text" name="TelcomChapPapId" id="TelcomChapPapId" class="form-control" value="<?php echo $obj->{'TelcomChapPapId'};?>">
  258. </div>
  259. <div class="form-group">
  260. <label>Chap Pap Pwd</label>
  261. <input type="text" name="TelcomChapPapPwd" id="TelcomChapPapPwd" class="form-control" value="<?php echo $obj->{'TelcomChapPapPwd'};?>">
  262. </div>
  263. <div class="form-group">
  264. <label>Modem IMEI</label>
  265. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomModemImei'};?>">
  266. <input type="hidden" name="TelcomModemImei" id="TelcomModemImei" value="<?php echo $obj->{'TelcomModemImei'};?>">
  267. </div>
  268. <div class="form-group">
  269. <label>SIM IMSI</label>
  270. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomSimImsi'};?>">
  271. <input type="hidden" name="TelcomSimImsi" id="TelcomSimImsi" value="<?php echo $obj->{'TelcomSimImsi'};?>">
  272. </div>
  273. <div class="form-group">
  274. <label>SIM ICCID</label>
  275. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomSimIccid'};?>">
  276. <input type="hidden" name="TelcomSimIccid" id="TelcomSimIccid" value="<?php echo $obj->{'TelcomSimIccid'};?>">
  277. </div>
  278. <div class="form-group">
  279. <label>SIM Status</label>
  280. <input type="text" readonly class="form-control" placeholder="<?php echo $TelcomSimStatus;?>">
  281. <input type="hidden" name="TelcomSimStatus" id="TelcomSimStatus" value="<?php echo $obj->{'TelcomSimStatus'};?>">
  282. </div>
  283. <div class="form-group">
  284. <label>Modem Mode</label>
  285. <input type="text" readonly class="form-control" placeholder="<?php echo $TelcomModemMode;?>">
  286. <input type="hidden" name="TelcomModemMode" id="TelcomModemMode" value="<?php echo $obj->{'TelcomModemMode'};?>">
  287. </div>
  288. <div class="form-group">
  289. <label>IP Address</label>
  290. <input type="text" name="TelcomIpAddress" id="TelcomIpAddress" class="form-control" value="<?php echo $obj->{'TelcomIpAddress'};?>">
  291. </div>
  292. <div class="form-group">
  293. <label>Network Connection Status</label>
  294. <input type="text" readonly class="form-control" value="<?php echo $TelcomNetworkConn;?>">
  295. <input type="hidden" name="TelcomNetworkConn" id="TelcomNetworkConn" value="<?php echo $obj->{'TelcomNetworkConn'};?>">
  296. </div>
  297. </section>
  298. </article>
  299. <!--Bluetooth Module-->
  300. <?php /* <article class="envor-sorting-item css">
  301. <header><?php echo $lang->showWord("bluetooth_module"); ?><i class="fa fa-plus"></i></header>
  302. <section>
  303. <div class="form-group" style="display:<?php echo $am101;?>">
  304. <label>LoginCentralID</label>
  305. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'LoginCentralID'};?>">
  306. <input type="hidden" name="LoginCentralID" id="LoginCentralID" value="<?php echo $obj->{'LoginCentralID'};?>">
  307. </div>
  308. <div class="form-group" style="display:<?php echo $am101;?>">
  309. <label>isLogin</label>
  310. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'isLogin'};?>">
  311. <input type="hidden" name="isLogin" id="isLogin" value="<?php echo $obj->{'isLogin'};?>">
  312. </div>
  313. <div class="form-group" style="display:<?php echo $am101;?>">
  314. <label>isRequestStart</label>
  315. <input type="text" readonly class="form-control" value="<?php echo $isRequestStart;?>">
  316. <input type="hidden" name="isRequestStart" id="isRequestStart" value="<?php echo $obj->{'isRequestStart'};?>">
  317. </div>
  318. <div class="form-group" style="display:<?php echo $am101;?>">
  319. <label>isRequestStop</label>
  320. <input type="text" readonly class="form-control" value="<?php echo $isRequestStop;?>">
  321. <input type="hidden" name="isRequestStop" id="isRequestStop" value="<?php echo $obj->{'isRequestStop'};?>">
  322. </div>
  323. </section>
  324. </article> */?>
  325. <article class="envor-sorting-item css">
  326. <div align="center"><button id="save"><?php echo $lang->showWord("set")?></button></div>
  327. </article>
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. </section>
  334. </div>
  335. <?php
  336. include 'foot.php';
  337. ?>
  338. <script type="text/JavaScript">
  339. $(document).ready(function(){
  340. WifiMode_changed();
  341. });
  342. document.getElementById("save").onclick = function() {
  343. if(formCheck())
  344. {
  345. window.location="#loadinghref";
  346. document.getElementById("loading").style.display="block";
  347. // 發送 Ajax 查詢請求並處理
  348. var request = new XMLHttpRequest();
  349. request.open("POST", "set_network_action.php");
  350. // POST 參數須使用 send() 發送
  351. // var data = "FtpServer=" + document.getElementById("FtpServer").value +
  352. var data = "Eth0DhcpClient=" + document.getElementById("Eth0DhcpClient").value+
  353. "&Eth0IpAddress=" + document.getElementById("Eth0IpAddress").value+
  354. "&Eth0SubmaskAddress=" + document.getElementById("Eth0SubmaskAddress").value+
  355. "&Eth0GatewayAddress=" + document.getElementById("Eth0GatewayAddress").value+
  356. // "&Eth1DhcpClient=" + document.getElementById("Eth1DhcpClient").value+
  357. // "&Eth1IpAddress=" + document.getElementById("Eth1IpAddress").value+
  358. // "&Eth1SubmaskAddress=" + document.getElementById("Eth1SubmaskAddress").value+
  359. // "&Eth1GatewayAddress=" + document.getElementById("Eth1GatewayAddress").value+
  360. "&WifiMode=" + document.getElementById("WifiMode").value+
  361. "&WifiSsid=" + document.getElementById("WifiSsid").value+
  362. "&WifiPassword=" + document.getElementById("WifiPassword").value+
  363. "&WifiDhcpServer=" + document.getElementById("WifiDhcpServer").value+
  364. "&WifiDhcpClient=" + document.getElementById("WifiDhcpClient").value+
  365. "&WifiIpAddress=" + document.getElementById("WifiIpAddress").value+
  366. "&WifiSubmaskAddress=" + document.getElementById("WifiSubmaskAddress").value+
  367. "&WifiGatewayAddress=" + document.getElementById("WifiGatewayAddress").value+
  368. "&TelcomApn=" + document.getElementById("TelcomApn").value+
  369. "&TelcomChapPapId=" + document.getElementById("TelcomChapPapId").value+
  370. "&TelcomChapPapPwd=" + document.getElementById("TelcomChapPapPwd").value+
  371. "&TelcomIpAddress=" + document.getElementById("TelcomIpAddress").value;
  372. // POST 請求必須設置表頭在 open() 下面,send() 上面
  373. request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  374. request.send(data);
  375. request.onreadystatechange = function() {
  376. // 伺服器請求完成
  377. if (request.readyState == 4) {
  378. document.getElementById("loading").style.display="none";
  379. // 伺服器回應成功
  380. if (request.status == 200 && JSON.parse(request.responseText).result=="Success") {
  381. alert("<?php echo $lang->showWord("done")?>");
  382. location.href="set_network.php";
  383. } else {
  384. alert(JSON.parse(request.responseText).message);
  385. }
  386. request = null;
  387. }
  388. }
  389. }
  390. }
  391. function formCheck()
  392. {
  393. if(document.getElementById("Eth0IpAddress").value != ""){
  394. if(!ValidateIPaddress("Eth0IpAddress")) return false;
  395. }
  396. if(document.getElementById("Eth0SubmaskAddress").value != ""){
  397. if(!ValidateIPaddress("Eth0SubmaskAddress")) return false;
  398. }
  399. if(document.getElementById("Eth0GatewayAddress").value != ""){
  400. if(!ValidateIPaddress("Eth0GatewayAddress")) return false;
  401. }
  402. // if(document.getElementById("Eth1IpAddress").value != ""){
  403. // if(!ValidateIPaddress("Eth1IpAddress")) return false;
  404. // }
  405. // if(document.getElementById("Eth1SubmaskAddress").value != ""){
  406. // if(!ValidateIPaddress("Eth1SubmaskAddress")) return false;
  407. // }
  408. // if(document.getElementById("Eth1GatewayAddress").value != ""){
  409. // if(!ValidateIPaddress("Eth1GatewayAddress")) return false;
  410. // }
  411. if(document.getElementById("WifiIpAddress").value != ""){
  412. if(!ValidateIPaddress("WifiIpAddress")) return false;
  413. }
  414. if(document.getElementById("WifiSubmaskAddress").value != ""){
  415. if(!ValidateIPaddress("WifiSubmaskAddress")) return false;
  416. }
  417. if(document.getElementById("WifiGatewayAddress").value != ""){
  418. if(!ValidateIPaddress("WifiGatewayAddress")) return false;
  419. }
  420. if(document.getElementById("TelcomIpAddress").value != ""){
  421. if(!ValidateIPaddress("TelcomIpAddress")) return false;
  422. }
  423. return true;
  424. }
  425. function WifiMode_changed(){
  426. if(document.getElementById("WifiMode").value=="0"){
  427. document.getElementById("WifiDhcpServer").disabled=true;
  428. document.getElementById("WifiDhcpClient").disabled=true;
  429. document.getElementById("WifiDhcpServer").selectedIndex=1;
  430. document.getElementById("WifiDhcpClient").selectedIndex=1;
  431. document.getElementById("WifiSsid").disabled=true;
  432. document.getElementById("WifiPassword").disabled=true;
  433. document.getElementById("WifiSsid").value="";
  434. document.getElementById("WifiPassword").value="";
  435. }
  436. if(document.getElementById("WifiMode").value=="1"){
  437. document.getElementById("WifiDhcpServer").disabled=true;
  438. document.getElementById("WifiDhcpClient").disabled=false;
  439. document.getElementById("WifiDhcpServer").selectedIndex=1;
  440. document.getElementById("WifiDhcpClient").selectedIndex=0;
  441. document.getElementById("WifiSsid").disabled=false;
  442. document.getElementById("WifiPassword").disabled=false;
  443. document.getElementById("WifiSsid").value="<?php echo $obj->{'WifiSsid'};?>";
  444. document.getElementById("WifiPassword").value="<?php echo $obj->{'WifiPassword'};?>";
  445. }
  446. if(document.getElementById("WifiMode").value=="2"){
  447. document.getElementById("WifiDhcpServer").disabled=false;
  448. document.getElementById("WifiDhcpClient").disabled=true;
  449. document.getElementById("WifiDhcpServer").selectedIndex=0;
  450. document.getElementById("WifiDhcpClient").selectedIndex=1;
  451. document.getElementById("WifiSsid").disabled=true;
  452. document.getElementById("WifiPassword").disabled=true;
  453. document.getElementById("WifiSsid").value="";
  454. document.getElementById("WifiPassword").value="";
  455. }
  456. }
  457. function isNumberKey(evt)
  458. {
  459. var charCode = (evt.which) ? evt.which : event.keyCode
  460. if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 46))
  461. return false;
  462. return true;
  463. }
  464. function ValidateIPaddress(id) {
  465. var ipaddress = document.getElementById(id).value;
  466. if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipaddress)) {
  467. return true;
  468. }
  469. alert("You have entered an invalid IP address on " + id + "!")
  470. document.getElementById(id).focus();
  471. return false;
  472. }
  473. </script>
  474. </html>