set_network.php 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  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. $system = json_decode(trim($output[0]),true);//var_dump($obj);
  7. $ModelName = $system['ModelName'];
  8. $SerialNumber = $system['SerialNumber'];
  9. $InternetConn='';
  10. switch ($obj->{'InternetConn'}){
  11. case 0:
  12. $InternetConn=$lang->showWord('disconnected');
  13. break;
  14. case 1:
  15. $InternetConn=$lang->showWord('connected');
  16. break;
  17. }
  18. $WifiNetworkConn='';
  19. switch ($obj->{'WifiNetworkConn'}){
  20. case 0:
  21. $WifiNetworkConn=$lang->showWord('disconnected');
  22. break;
  23. case 1:
  24. $WifiNetworkConn=$lang->showWord('connected');
  25. break;
  26. }
  27. $TelcomNetworkConn='';
  28. switch ($obj->{'TelcomNetworkConn'}){
  29. case 0:
  30. $TelcomNetworkConn=$lang->showWord('disconnected');
  31. break;
  32. case 1:
  33. $TelcomNetworkConn=$lang->showWord('connected');
  34. break;
  35. }
  36. $TelcomSimStatus='';
  37. switch ($obj->{'TelcomSimStatus'}){
  38. case 0:
  39. $TelcomSimStatus='no SIM card is found';
  40. break;
  41. case 1:
  42. $TelcomSimStatus='valid SIM card';
  43. break;
  44. case 2:
  45. $TelcomSimStatus='invalid SIM card';
  46. break;
  47. }
  48. $TelcomModemMode='';
  49. switch ($obj->{'TelcomModemMode'}){
  50. case 0:
  51. $TelcomModemMode='No services';
  52. break;
  53. case 1:
  54. $TelcomModemMode='CDMA';
  55. break;
  56. case 2:
  57. $TelcomModemMode='GSM/GPRS';
  58. break;
  59. case 3:
  60. $TelcomModemMode='WCDMA';
  61. break;
  62. case 4:
  63. $TelcomModemMode='GSM/WCDMA';
  64. break;
  65. case 5:
  66. $TelcomModemMode='TD_SCDMA mode';
  67. break;
  68. case 6:
  69. $TelcomModemMode='HSPA';
  70. break;
  71. case 7:
  72. $TelcomModemMode='LTE';
  73. break;
  74. case 9:
  75. $TelcomModemMode='Unknown';
  76. break;
  77. }
  78. ?>
  79. <style>
  80. img {
  81. display: block;
  82. margin-left: auto;
  83. margin-right: auto;
  84. }
  85. </style>
  86. <div class="envor-content">
  87. <!--
  88. Page Title start
  89. //-->
  90. <section class="envor-page-title-1" data-stellar-background-ratio="0.5">
  91. <div class="container">
  92. <div class="row">
  93. <div class="col-lg-9 col-md-9 col-sm-9">
  94. <h1><?php echo $lang->showWord("network"); ?></h1>
  95. </div>
  96. </div>
  97. </div>
  98. <!--
  99. Page Title end
  100. //-->
  101. </section>
  102. <!--
  103. Main Content start
  104. //-->
  105. <a id="loadinghref"><div id="loading" style="display:none;"><img src="img/giphy.gif"/></div></a>
  106. <section class="envor-section">
  107. <div class="container">
  108. <div class="row">
  109. <div class="col-lg-12">
  110. <div class="envor-sorting" id="faq-sorting">
  111. <div class="envor-toggle">
  112. <!--Network Status-->
  113. <article class="envor-sorting-item css">
  114. <header><?php echo $lang->showWord("network_status"); ?><i class="fa fa-plus"></i></header>
  115. <section>
  116. <div class="form-group" style="display:<?php echo $am101;?>">
  117. <label><?php echo $lang->showWord("internet_connection_status"); ?></label>
  118. <input type="text" readonly class="form-control" placeholder="<?php echo $InternetConn;?>">
  119. <input type="hidden" name="InternetConn" id="InternetConn" value="<?php echo $obj->{'InternetConn'};?>">
  120. </div>
  121. <?php /* <div class="form-group" style="display:<?php echo $am101;?>">
  122. <label>FtpServer</label>
  123. <input type="text" name="FtpServer" id="FtpServer" class="form-control" value="<?php echo $obj->{'FtpServer'};?>">
  124. </div>*/?>
  125. </section>
  126. </article>
  127. <!--Ethernet Interface0-->
  128. <article class="envor-sorting-item css" style="display:<?php echo $am101;?>">
  129. <header><?php echo $lang->showWord("ethernet_interface"); ?><i class="fa fa-plus"></i></header>
  130. <section>
  131. <div class="form-group">
  132. <label>DHCP Client</label>
  133. <select class="form-control" id="Eth0DhcpClient" name="Eth0DhcpClient" onchange="EthDhcp_changed();">
  134. <option value="0" <?php echo $obj->{'Eth0DhcpClient'}=="0"?"selected":""?>>enable</option>
  135. <option value="1" <?php echo $obj->{'Eth0DhcpClient'}=="1"?"selected":""?>>disable</option>
  136. </select>
  137. </div>
  138. <div class="form-group">
  139. <label><?php echo $lang->showWord("mac_address"); ?></label>
  140. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Eth0MacAddress'};?>">
  141. <input type="hidden" name="Eth0MacAddress" id="Eth0MacAddress" value="<?php echo $obj->{'Eth0MacAddress'};?>">
  142. </div>
  143. <div class="form-group">
  144. <label><?php echo $lang->showWord("ip_address"); ?></label>
  145. <input type="text" name="Eth0IpAddress" id="Eth0IpAddress" class="form-control" value="<?php echo $obj->{'Eth0IpAddress'};?>">
  146. </div>
  147. <div class="form-group">
  148. <label><?php echo $lang->showWord("submask_address"); ?></label>
  149. <input type="text" name="Eth0SubmaskAddress" id="Eth0SubmaskAddress" class="form-control" value="<?php echo $obj->{'Eth0SubmaskAddress'};?>">
  150. </div>
  151. <div class="form-group">
  152. <label><?php echo $lang->showWord("gateway_address"); ?></label>
  153. <input type="text" name="Eth0GatewayAddress" id="Eth0GatewayAddress" class="form-control" value="<?php echo $obj->{'Eth0GatewayAddress'};?>">
  154. </div>
  155. </section>
  156. </article>
  157. <?php /* <!--Ethernet Interface1-->
  158. <article class="envor-sorting-item css" style="display:<?php echo $am101;?>">
  159. <header><?php echo $lang->showWord("ethernet_interface"); ?><i class="fa fa-plus"></i></header>
  160. <section>
  161. <div class="form-group">
  162. <label>Eth1DhcpClient</label>
  163. <select class="form-control" id="Eth1DhcpClient" name="Eth1DhcpClient">
  164. <option value="0" <?php echo $obj->{'Eth1DhcpClient'}=="0"?"selected":""?>>enable</option>
  165. <option value="1" <?php echo $obj->{'Eth1DhcpClient'}=="1"?"selected":""?>>disable</option>
  166. </select>
  167. </div>
  168. <div class="form-group">
  169. <label>Eth1MacAddress</label>
  170. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Eth1MacAddress'};?>">
  171. <input type="hidden" name="Eth1MacAddress" id="Eth1MacAddress" value="<?php echo $obj->{'Eth1MacAddress'};?>">
  172. </div>
  173. <div class="form-group">
  174. <label>Eth1IpAddress</label>
  175. <input type="text" name="Eth1IpAddress" id="Eth1IpAddress" class="form-control" value="<?php echo $obj->{'Eth1IpAddress'};?>">
  176. </div>
  177. <div class="form-group">
  178. <label>Eth1SubmaskAddress</label>
  179. <input type="text" name="Eth1SubmaskAddress" id="Eth1SubmaskAddress" class="form-control" value="<?php echo $obj->{'Eth1SubmaskAddress'};?>">
  180. </div>
  181. <div class="form-group">
  182. <label>Eth1GatewayAddress</label>
  183. <input type="text" name="Eth1GatewayAddress" id="Eth1GatewayAddress" class="form-control" value="<?php echo $obj->{'Eth1GatewayAddress'};?>">
  184. </div>
  185. </section>
  186. </article>*/?>
  187. <!--WiFi Module-->
  188. <article class="envor-sorting-item css" style="display:<?php echo $showWifi;?>">
  189. <header><?php echo $lang->showWord("WiFi_module"); ?><i class="fa fa-plus"></i></header>
  190. <section>
  191. <div class="form-group">
  192. <label><?php echo $lang->showWord("mode"); ?></label>
  193. <select class="form-control" id="WifiMode" name="WifiMode" onchange="WifiMode_changed();">
  194. <option value="0" <?php echo $obj->{'WifiMode'}=="0"?"selected":""?>>disable</option>
  195. <option value="1" <?php echo $obj->{'WifiMode'}=="1"?"selected":""?>>station</option>
  196. <option value="2" <?php echo $obj->{'WifiMode'}=="2"?"selected":""?>>Access Point</option>
  197. <?php /* <option value="3" <?php echo $obj->{'WifiMode'}=="3"?"selected":""?>>Ad-Hoc</option>*/?>
  198. </select>
  199. </div>
  200. <div class="form-group" id="WifiSsidDiv">
  201. <label>SSID</label>
  202. <input type="text" name="WifiSsid" id="WifiSsid" class="form-control" value="<?php echo $obj->{'WifiSsid'};?>">
  203. <a id="scan" href="scan_wifi.php"><input type="button" value="Scan" class="form-control"></a>
  204. </div>
  205. <div class="form-group" id="WifiPasswordDiv">
  206. <label>Password</label>
  207. <input type="text" name="WifiPassword" id="WifiPassword" class="form-control" value="<?php echo $obj->{'WifiPassword'};?>">
  208. </div>
  209. <div class="form-group" id="WifiBroadcastSsidDiv">
  210. <label>Wifi Broadcast SSID</label>
  211. <select class="form-control" id="WifiBroadcastSsid" name="WifiBroadcastSsid">
  212. <option value="0" <?php echo $obj->{'WifiBroadcastSsid'}=="0"?"selected":""?>>hidden</option>
  213. <option value="1" <?php echo $obj->{'WifiBroadcastSsid'}=="1"?"selected":""?>>broadcast</option>
  214. </select>
  215. </div>
  216. <div class="form-group" id="WifiTargetBssidMacDiv">
  217. <label>Wifi Target Bssid Mac</label>
  218. <input type="text" name="WifiTargetBssidMac" id="WifiTargetBssidMac" class="form-control" value="<?php echo $obj->{'WifiTargetBssidMac'};?>">
  219. </div>
  220. <div class="form-group" id="WifiRssiDiv">
  221. <label>RSSI</label>
  222. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'WifiRssi'};?> dBm">
  223. <input type="hidden" name="WifiRssi" id="WifiRssi" value="<?php echo $obj->{'WifiRssi'};?>">
  224. </div>
  225. <div class="form-group" id="WifiDhcpServerDiv">
  226. <label>DHCP Server</label>
  227. <select class="form-control" id="WifiDhcpServer" name="WifiDhcpServer">
  228. <option value="0" <?php echo $obj->{'WifiDhcpServer'}=="0"?"selected":""?>>enable</option>
  229. <option value="1" <?php echo $obj->{'WifiDhcpServer'}=="1"?"selected":""?>>disable</option>
  230. </select>
  231. </div>
  232. <div class="form-group" id="WifiDhcpClientDiv">
  233. <label>DHCP Client</label>
  234. <select class="form-control" id="WifiDhcpClient" name="WifiDhcpClient" onchange="WifiDhcp_changed();">
  235. <option value="0" <?php echo $obj->{'WifiDhcpClient'}=="0"?"selected":""?>>enable</option>
  236. <option value="1" <?php echo $obj->{'WifiDhcpClient'}=="1"?"selected":""?>>disable</option>
  237. </select>
  238. </div>
  239. <div class="form-group" id="WifiMacAddressDiv">
  240. <label><?php echo $lang->showWord("mac_address"); ?></label>
  241. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'WifiMacAddress'};?>">
  242. <input type="hidden" name="WifiMacAddress" id="WifiMacAddress" value="<?php echo $obj->{'WifiMacAddress'};?>">
  243. </div>
  244. <div class="form-group" id="WifiIpAddressDiv">
  245. <label><?php echo $lang->showWord("ip_address"); ?></label>
  246. <input type="text" name="WifiIpAddress" id="WifiIpAddress" class="form-control" value="<?php echo $obj->{'WifiIpAddress'};?>">
  247. </div>
  248. <div class="form-group" id="WifiSubmaskAddressDiv">
  249. <label><?php echo $lang->showWord("submask_address"); ?></label>
  250. <input type="text" name="WifiSubmaskAddress" id="WifiSubmaskAddress" class="form-control" value="<?php echo $obj->{'WifiSubmaskAddress'};?>">
  251. </div>
  252. <div class="form-group" id="WifiGatewayAddressDiv">
  253. <label><?php echo $lang->showWord("gateway_address"); ?></label>
  254. <input type="text" name="WifiGatewayAddress" id="WifiGatewayAddress" class="form-control" value="<?php echo $obj->{'WifiGatewayAddress'};?>">
  255. </div>
  256. <div class="form-group" id="WifiNetworkConnDiv">
  257. <label><?php echo $lang->showWord("network_connection_status"); ?></label>
  258. <input type="text" readonly class="form-control" value="<?php echo $WifiNetworkConn;?>">
  259. <input type="hidden" name="WifiNetworkConn" id="WifiNetworkConn" value="<?php echo $obj->{'WifiNetworkConn'};?>">
  260. </div>
  261. </section>
  262. </article>
  263. <!--3G/4G Module-->
  264. <article class="envor-sorting-item css" style="display:<?php echo $showTelcom;?>">
  265. <header><?php echo $lang->showWord("3G/4G_module"); ?><i class="fa fa-plus"></i></header>
  266. <section>
  267. <div class="form-group">
  268. <label><?php echo $lang->showWord("mode"); ?></label>
  269. <select class="form-control" id="TelcomEnabled" name="TelcomEnabled">
  270. <option value="0" <?php echo $obj->{'TelcomEnabled'}=="0"?"selected":""?>>Disable</option>
  271. <option value="1" <?php echo $obj->{'TelcomEnabled'}=="1"?"selected":""?>>Enable</option>
  272. </select>
  273. </div>
  274. <div class="form-group">
  275. <label>APN</label>
  276. <input type="text" name="TelcomApn" id="TelcomApn" class="form-control" value="<?php echo $obj->{'TelcomApn'};?>">
  277. </div>
  278. <div class="form-group">
  279. <label>Network Type</label>
  280. <select class="form-control" id="TelcomNetworkType" name="TelcomEnabled">
  281. <option value="0" <?php echo $obj->{'TelcomNetworkType'}=="0"?"selected":""?>>Auto</option>
  282. <option value="1" <?php echo $obj->{'TelcomNetworkType'}=="1"?"selected":""?>>2G</option>
  283. <option value="5" <?php echo $obj->{'TelcomNetworkType'}=="5"?"selected":""?>>3G</option>
  284. <option value="3" <?php echo $obj->{'TelcomNetworkType'}=="3"?"selected":""?>>4G</option>
  285. </select>
  286. </div>
  287. <div class="form-group">
  288. <label>RSSI</label>
  289. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomRssi'};?> dBm">
  290. <input type="hidden" name="TelcomRssi" id="TelcomRssi" value="<?php echo $obj->{'TelcomRssi'};?>">
  291. </div>
  292. <div class="form-group">
  293. <label>Chap Pap Id</label>
  294. <input type="text" name="TelcomChapPapId" id="TelcomChapPapId" class="form-control" value="<?php echo $obj->{'TelcomChapPapId'};?>">
  295. </div>
  296. <div class="form-group">
  297. <label><?php echo $lang->showWord("chap_pap_pwd"); ?></label>
  298. <input type="text" name="TelcomChapPapPwd" id="TelcomChapPapPwd" class="form-control" value="<?php echo $obj->{'TelcomChapPapPwd'};?>">
  299. </div>
  300. <div class="form-group">
  301. <label><?php echo $lang->showWord("modem_imei"); ?></label>
  302. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomModemImei'};?>">
  303. <input type="hidden" name="TelcomModemImei" id="TelcomModemImei" value="<?php echo $obj->{'TelcomModemImei'};?>">
  304. </div>
  305. <div class="form-group">
  306. <label>SIM IMSI</label>
  307. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomSimImsi'};?>">
  308. <input type="hidden" name="TelcomSimImsi" id="TelcomSimImsi" value="<?php echo $obj->{'TelcomSimImsi'};?>">
  309. </div>
  310. <div class="form-group">
  311. <label>SIM ICCID</label>
  312. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomSimIccid'};?>">
  313. <input type="hidden" name="TelcomSimIccid" id="TelcomSimIccid" value="<?php echo $obj->{'TelcomSimIccid'};?>">
  314. </div>
  315. <div class="form-group">
  316. <label><?php echo $lang->showWord("sim_status"); ?></label>
  317. <input type="text" readonly class="form-control" placeholder="<?php echo $TelcomSimStatus;?>">
  318. <input type="hidden" name="TelcomSimStatus" id="TelcomSimStatus" value="<?php echo $obj->{'TelcomSimStatus'};?>">
  319. </div>
  320. <div class="form-group">
  321. <label><?php echo $lang->showWord("modem_mode"); ?></label>
  322. <input type="text" readonly class="form-control" placeholder="<?php echo $TelcomModemMode;?>">
  323. <input type="hidden" name="TelcomModemMode" id="TelcomModemMode" value="<?php echo $obj->{'TelcomModemMode'};?>">
  324. </div>
  325. <div class="form-group">
  326. <label><?php echo $lang->showWord("ip_address"); ?></label>
  327. <input type="text" name="TelcomIpAddress" id="TelcomIpAddress" class="form-control" value="<?php echo $obj->{'TelcomIpAddress'};?>" disabled>
  328. </div>
  329. <div class="form-group">
  330. <label><?php echo $lang->showWord("network_connection_status"); ?></label>
  331. <input type="text" readonly class="form-control" value="<?php echo $TelcomNetworkConn;?>">
  332. <input type="hidden" name="TelcomNetworkConn" id="TelcomNetworkConn" value="<?php echo $obj->{'TelcomNetworkConn'};?>">
  333. </div>
  334. </section>
  335. </article>
  336. <!--firewall-->
  337. <article class="envor-sorting-item css">
  338. <header><?php echo $lang->showWord("Firewall"); ?><i class="fa fa-plus"></i></header>
  339. <section>
  340. <div class="form-group">
  341. <label><?php echo $lang->showWord("mode"); ?></label>
  342. <select class="form-control" id="isEnalbleFirewall" name="isEnalbleFirewall" onchange="Firewall_changed();">
  343. <option value="0" <?php echo $obj->{'isEnalbleFirewall'}=="0"?"selected":""?>>Disable</option>
  344. <option value="1" <?php echo $obj->{'isEnalbleFirewall'}=="1"?"selected":""?>>Enable</option>
  345. </select>
  346. </div>
  347. <div class="form-group" id="FirewallAcceptAddrDiv">
  348. <div class="form-group">
  349. <label><?php echo 'Firewall Accept Addr0' ?></label>
  350. <input type="text" name="FirewallAcceptAddr0" id="FirewallAcceptAddr0" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[0];?>">
  351. </div>
  352. <div class="form-group">
  353. <label><?php echo 'Firewall Accept Addr1' ?></label>
  354. <input type="text" name="FirewallAcceptAddr1" id="FirewallAcceptAddr1" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[1];?>">
  355. </div>
  356. <div class="form-group">
  357. <label><?php echo 'Firewall Accept Addr2' ?></label>
  358. <input type="text" name="FirewallAcceptAddr2" id="FirewallAcceptAddr2" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[2];?>">
  359. </div>
  360. <div class="form-group">
  361. <label><?php echo 'Firewall Accept Addr3' ?></label>
  362. <input type="text" name="FirewallAcceptAddr3" id="FirewallAcceptAddr3" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[3];?>">
  363. </div>
  364. <div class="form-group">
  365. <label><?php echo 'Firewall Accept Addr4' ?></label>
  366. <input type="text" name="FirewallAcceptAddr4" id="FirewallAcceptAddr4" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[4];?>">
  367. </div>
  368. <div class="form-group">
  369. <label><?php echo 'Firewall Accept Addr5' ?></label>
  370. <input type="text" name="FirewallAcceptAddr5" id="FirewallAcceptAddr5" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[5];?>">
  371. </div>
  372. <div class="form-group">
  373. <label><?php echo 'Firewall Accept Addr6' ?></label>
  374. <input type="text" name="FirewallAcceptAddr6" id="FirewallAcceptAddr6" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[6];?>">
  375. </div>
  376. <div class="form-group">
  377. <label><?php echo 'Firewall Accept Addr7' ?></label>
  378. <input type="text" name="FirewallAcceptAddr7" id="FirewallAcceptAddr7" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[7];?>">
  379. </div>
  380. <div class="form-group">
  381. <label><?php echo 'Firewall Accept Addr8' ?></label>
  382. <input type="text" name="FirewallAcceptAddr8" id="FirewallAcceptAddr8" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[8];?>">
  383. </div>
  384. <div class="form-group">
  385. <label><?php echo 'Firewall Accept Addr9' ?></label>
  386. <input type="text" name="FirewallAcceptAddr9" id="FirewallAcceptAddr9" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[9];?>">
  387. </div>
  388. </div>
  389. </section>
  390. </article>
  391. <!--Bluetooth Module-->
  392. <?php /* <article class="envor-sorting-item css">
  393. <header><?php echo $lang->showWord("bluetooth_module"); ?><i class="fa fa-plus"></i></header>
  394. <section>
  395. <div class="form-group" style="display:<?php echo $am101;?>">
  396. <label>LoginCentralID</label>
  397. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'LoginCentralID'};?>">
  398. <input type="hidden" name="LoginCentralID" id="LoginCentralID" value="<?php echo $obj->{'LoginCentralID'};?>">
  399. </div>
  400. <div class="form-group" style="display:<?php echo $am101;?>">
  401. <label>isLogin</label>
  402. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'isLogin'};?>">
  403. <input type="hidden" name="isLogin" id="isLogin" value="<?php echo $obj->{'isLogin'};?>">
  404. </div>
  405. <div class="form-group" style="display:<?php echo $am101;?>">
  406. <label>isRequestStart</label>
  407. <input type="text" readonly class="form-control" value="<?php echo $isRequestStart;?>">
  408. <input type="hidden" name="isRequestStart" id="isRequestStart" value="<?php echo $obj->{'isRequestStart'};?>">
  409. </div>
  410. <div class="form-group" style="display:<?php echo $am101;?>">
  411. <label>isRequestStop</label>
  412. <input type="text" readonly class="form-control" value="<?php echo $isRequestStop;?>">
  413. <input type="hidden" name="isRequestStop" id="isRequestStop" value="<?php echo $obj->{'isRequestStop'};?>">
  414. </div>
  415. </section>
  416. </article> */?>
  417. <article class="envor-sorting-item css">
  418. <div align="center"><button id="save"><?php echo $lang->showWord("set")?></button></div>
  419. </article>
  420. </div>
  421. </div>
  422. </div>
  423. </div>
  424. </div>
  425. </section>
  426. </div>
  427. <?php
  428. include 'foot.php';
  429. ?>
  430. <script type="text/JavaScript">
  431. $(document).ready(function(){
  432. WifiMode_changed();
  433. EthDhcp_changed();
  434. WifiDhcp_changed();
  435. Firewall_changed();
  436. });
  437. document.getElementById("save").onclick = function() {
  438. if(formCheck())
  439. {
  440. window.location="#loadinghref";
  441. document.getElementById("loading").style.display="block";
  442. // 發送 Ajax 查詢請求並處理
  443. var request = new XMLHttpRequest();
  444. request.open("POST", "set_network_action.php");
  445. // POST 參數須使用 send() 發送
  446. var data = "Eth0DhcpClient=" + document.getElementById("Eth0DhcpClient").value+
  447. "&Eth0IpAddress=" + document.getElementById("Eth0IpAddress").value+
  448. "&Eth0SubmaskAddress=" + document.getElementById("Eth0SubmaskAddress").value+
  449. "&Eth0GatewayAddress=" + document.getElementById("Eth0GatewayAddress").value+
  450. "&WifiMode=" + document.getElementById("WifiMode").value+
  451. "&WifiSsid=" + escape(document.getElementById("WifiSsid").value)+
  452. "&WifiPassword=" + escape(document.getElementById("WifiPassword").value)+
  453. "&WifiBroadcastSsid=" + document.getElementById("WifiBroadcastSsid").value+
  454. "&WifiTargetBssidMac=" + escape(document.getElementById("WifiTargetBssidMac").value)+
  455. "&WifiDhcpServer=" + document.getElementById("WifiDhcpServer").value+
  456. "&WifiDhcpClient=" + document.getElementById("WifiDhcpClient").value+
  457. "&WifiIpAddress=" + document.getElementById("WifiIpAddress").value+
  458. "&WifiSubmaskAddress=" + document.getElementById("WifiSubmaskAddress").value+
  459. "&WifiGatewayAddress=" + document.getElementById("WifiGatewayAddress").value+
  460. "&TelcomApn=" + escape(document.getElementById("TelcomApn").value)+
  461. "&TelcomNetworkType=" + escape(document.getElementById("TelcomNetworkType").value)+
  462. "&TelcomChapPapId=" + escape(document.getElementById("TelcomChapPapId").value)+
  463. "&TelcomChapPapPwd=" + escape(document.getElementById("TelcomChapPapPwd").value)+
  464. "&TelcomIpAddress=" + document.getElementById("TelcomIpAddress").value+
  465. "&TelcomEnabled=" + document.getElementById("TelcomEnabled").value+
  466. "&isEnalbleFirewall=" + document.getElementById("isEnalbleFirewall").value+
  467. "&FirewallAcceptAddr0=" + document.getElementById("FirewallAcceptAddr0").value+
  468. "&FirewallAcceptAddr1=" + document.getElementById("FirewallAcceptAddr1").value+
  469. "&FirewallAcceptAddr2=" + document.getElementById("FirewallAcceptAddr2").value+
  470. "&FirewallAcceptAddr3=" + document.getElementById("FirewallAcceptAddr3").value+
  471. "&FirewallAcceptAddr4=" + document.getElementById("FirewallAcceptAddr4").value+
  472. "&FirewallAcceptAddr5=" + document.getElementById("FirewallAcceptAddr5").value+
  473. "&FirewallAcceptAddr6=" + document.getElementById("FirewallAcceptAddr6").value+
  474. "&FirewallAcceptAddr7=" + document.getElementById("FirewallAcceptAddr7").value+
  475. "&FirewallAcceptAddr8=" + document.getElementById("FirewallAcceptAddr8").value+
  476. "&FirewallAcceptAddr9=" + document.getElementById("FirewallAcceptAddr9").value;
  477. // POST 請求必須設置表頭在 open() 下面,send() 上面
  478. request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  479. request.send(data);
  480. request.onreadystatechange = function() {
  481. // 伺服器請求完成
  482. if (request.readyState == 4) {
  483. document.getElementById("loading").style.display="none";
  484. // 伺服器回應成功
  485. if (request.status == 200 && JSON.parse(request.responseText).result=="Success") {
  486. alert("<?php echo $lang->showWord("done")?>");
  487. location.href="set_network.php";
  488. } else {
  489. alert(JSON.parse(request.responseText).message);
  490. }
  491. request = null;
  492. }
  493. }
  494. }
  495. }
  496. function formCheck()
  497. {
  498. if(document.getElementById("Eth0IpAddress").value != ""){
  499. if(!ValidateIPaddress("Eth0IpAddress")) return false;
  500. }
  501. if(document.getElementById("Eth0SubmaskAddress").value != ""){
  502. if(!ValidateIPaddress("Eth0SubmaskAddress")) return false;
  503. }
  504. if(document.getElementById("Eth0GatewayAddress").value != ""){
  505. if(!ValidateIPaddress("Eth0GatewayAddress")) return false;
  506. }
  507. // if(document.getElementById("Eth1IpAddress").value != ""){
  508. // if(!ValidateIPaddress("Eth1IpAddress")) return false;
  509. // }
  510. // if(document.getElementById("Eth1SubmaskAddress").value != ""){
  511. // if(!ValidateIPaddress("Eth1SubmaskAddress")) return false;
  512. // }
  513. // if(document.getElementById("Eth1GatewayAddress").value != ""){
  514. // if(!ValidateIPaddress("Eth1GatewayAddress")) return false;
  515. // }
  516. if(document.getElementById("WifiIpAddress").value != ""){
  517. if(!ValidateIPaddress("WifiIpAddress")) return false;
  518. }
  519. if(document.getElementById("WifiSubmaskAddress").value != ""){
  520. if(!ValidateIPaddress("WifiSubmaskAddress")) return false;
  521. }
  522. if(document.getElementById("WifiGatewayAddress").value != ""){
  523. if(!ValidateIPaddress("WifiGatewayAddress")) return false;
  524. }
  525. if(document.getElementById("TelcomIpAddress").value != ""){
  526. if(!ValidateIPaddress("TelcomIpAddress")) return false;
  527. }
  528. return true;
  529. }
  530. function WifiMode_changed(){
  531. if(document.getElementById("WifiMode").value=="0"){
  532. document.getElementById("WifiDhcpServer").disabled=true;
  533. document.getElementById("WifiDhcpClient").disabled=true;
  534. document.getElementById("WifiSsid").disabled=true;
  535. document.getElementById("WifiPassword").disabled=true;
  536. document.getElementById("WifiIpAddress").disabled=true;
  537. document.getElementById("WifiSubmaskAddress").disabled=true;
  538. document.getElementById("WifiGatewayAddress").disabled=true;
  539. document.getElementById("WifiDhcpServerDiv").style.display="none";
  540. document.getElementById("WifiDhcpClientDiv").style.display="none";
  541. document.getElementById("WifiSsidDiv").style.display="none";
  542. document.getElementById("WifiPasswordDiv").style.display="none";
  543. document.getElementById("WifiBroadcastSsidDiv").style.display="none";
  544. document.getElementById("WifiTargetBssidMacDiv").style.display="none";
  545. document.getElementById("WifiRssiDiv").style.display="none";
  546. document.getElementById("WifiMacAddressDiv").style.display="none";
  547. document.getElementById("WifiIpAddressDiv").style.display="none";
  548. document.getElementById("WifiSubmaskAddressDiv").style.display="none";
  549. document.getElementById("WifiGatewayAddressDiv").style.display="none";
  550. document.getElementById("WifiNetworkConnDiv").style.display="none";
  551. }
  552. if(document.getElementById("WifiMode").value=="1"){
  553. document.getElementById("WifiDhcpServer").disabled=true;
  554. document.getElementById("WifiDhcpClient").disabled=false;
  555. document.getElementById("WifiSsid").disabled=false;
  556. document.getElementById("WifiPassword").disabled=false;
  557. document.getElementById("WifiSsid").value="<?php echo $obj->{'WifiSsid'};?>";
  558. document.getElementById("WifiPassword").value="<?php echo $obj->{'WifiPassword'};?>";
  559. document.getElementById("WifiIpAddress").disabled=false;
  560. document.getElementById("WifiSubmaskAddress").disabled=false;
  561. document.getElementById("WifiGatewayAddress").disabled=false;
  562. document.getElementById("WifiIpAddress").value="<?php echo $obj->{'WifiIpAddress'};?>";
  563. document.getElementById("WifiSubmaskAddress").value="<?php echo $obj->{'WifiSubmaskAddress'};?>";
  564. document.getElementById("WifiGatewayAddress").value="<?php echo $obj->{'WifiGatewayAddress'};?>";
  565. document.getElementById("WifiDhcpServerDiv").style.display="none";
  566. document.getElementById("WifiDhcpClientDiv").style.display="block";
  567. document.getElementById("WifiSsidDiv").style.display="block";
  568. document.getElementById("WifiPasswordDiv").style.display="block";
  569. document.getElementById("WifiBroadcastSsidDiv").style.display="none";
  570. document.getElementById("WifiTargetBssidMacDiv").style.display="block";
  571. document.getElementById("WifiRssiDiv").style.display="block";
  572. document.getElementById("WifiMacAddressDiv").style.display="block";
  573. document.getElementById("WifiIpAddressDiv").style.display="block";
  574. document.getElementById("WifiSubmaskAddressDiv").style.display="block";
  575. document.getElementById("WifiGatewayAddressDiv").style.display="block";
  576. document.getElementById("WifiNetworkConnDiv").style.display="block";
  577. }
  578. if(document.getElementById("WifiMode").value=="2"){
  579. document.getElementById("WifiDhcpServer").disabled=false;
  580. document.getElementById("WifiDhcpClient").disabled=true;
  581. document.getElementById("WifiSsid").disabled=true;
  582. document.getElementById("WifiPassword").disabled=true;
  583. document.getElementById("WifiSsid").value="<?php echo $ModelName.$SerialNumber?>";
  584. document.getElementById("WifiPassword").value="";
  585. document.getElementById("WifiIpAddress").disabled=true;
  586. document.getElementById("WifiSubmaskAddress").disabled=true;
  587. document.getElementById("WifiGatewayAddress").disabled=true;
  588. document.getElementById("WifiDhcpServerDiv").style.display="block";
  589. document.getElementById("WifiDhcpClientDiv").style.display="none";
  590. document.getElementById("WifiSsidDiv").style.display="block";
  591. document.getElementById("WifiPasswordDiv").style.display="block";
  592. document.getElementById("WifiBroadcastSsidDiv").style.display="block";
  593. document.getElementById("WifiTargetBssidMacDiv").style.display="none";
  594. document.getElementById("WifiRssiDiv").style.display="block";
  595. document.getElementById("WifiMacAddressDiv").style.display="block";
  596. document.getElementById("WifiIpAddressDiv").style.display="none";
  597. document.getElementById("WifiSubmaskAddressDiv").style.display="none";
  598. document.getElementById("WifiGatewayAddressDiv").style.display="none";
  599. document.getElementById("WifiNetworkConnDiv").style.display="block";
  600. }
  601. WifiDhcp_changed();
  602. }
  603. function EthDhcp_changed(){
  604. if(document.getElementById("Eth0DhcpClient").value=="0"){
  605. document.getElementById("Eth0IpAddress").disabled=true;
  606. document.getElementById("Eth0SubmaskAddress").disabled=true;
  607. document.getElementById("Eth0GatewayAddress").disabled=true;
  608. }
  609. if(document.getElementById("Eth0DhcpClient").value=="1"){
  610. document.getElementById("Eth0IpAddress").disabled=false;
  611. document.getElementById("Eth0SubmaskAddress").disabled=false;
  612. document.getElementById("Eth0GatewayAddress").disabled=false;
  613. document.getElementById("Eth0IpAddress").value="<?php echo $obj->{'Eth0IpAddress'};?>";
  614. document.getElementById("Eth0SubmaskAddress").value="<?php echo $obj->{'Eth0SubmaskAddress'};?>";
  615. document.getElementById("Eth0GatewayAddress").value="<?php echo $obj->{'Eth0GatewayAddress'};?>";
  616. }
  617. }
  618. function WifiDhcp_changed(){
  619. if(document.getElementById("WifiDhcpClient").disabled===false && document.getElementById("WifiDhcpClient").value=="0"){
  620. document.getElementById("WifiIpAddress").disabled=true;
  621. document.getElementById("WifiSubmaskAddress").disabled=true;
  622. document.getElementById("WifiGatewayAddress").disabled=true;
  623. }
  624. if(document.getElementById("WifiDhcpClient").disabled===false && document.getElementById("WifiDhcpClient").value=="1"){
  625. document.getElementById("WifiIpAddress").disabled=false;
  626. document.getElementById("WifiSubmaskAddress").disabled=false;
  627. document.getElementById("WifiGatewayAddress").disabled=false;
  628. document.getElementById("WifiIpAddress").value="<?php echo $obj->{'WifiIpAddress'};?>";
  629. document.getElementById("WifiSubmaskAddress").value="<?php echo $obj->{'WifiSubmaskAddress'};?>";
  630. document.getElementById("WifiGatewayAddress").value="<?php echo $obj->{'WifiGatewayAddress'};?>";
  631. }
  632. }
  633. function Firewall_changed(){
  634. if(document.getElementById("isEnalbleFirewall").value=="1"){
  635. document.getElementById("FirewallAcceptAddrDiv").style.display="block";
  636. }
  637. else{
  638. document.getElementById("FirewallAcceptAddrDiv").style.display="none";
  639. }
  640. }
  641. function isNumberKey(evt)
  642. {
  643. var charCode = (evt.which) ? evt.which : event.keyCode
  644. if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 46))
  645. return false;
  646. return true;
  647. }
  648. function ValidateIPaddress(id) {
  649. var ipaddress = document.getElementById(id).value;
  650. 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)) {
  651. return true;
  652. }
  653. alert("You have entered an invalid IP address on " + id + "!")
  654. document.getElementById(id).focus();
  655. return false;
  656. }
  657. function scan_wifi()
  658. {
  659. window.open("scan_wifi.php","_blank","height=200,width=400, status=yes,toolbar=no,menubar=no,location=no");
  660. }
  661. $("#scan").fancybox({
  662. 'type' : 'iframe',
  663. 'iframe' : {
  664. 'css' : {
  665. 'width' : '600px',
  666. 'height': '200px'
  667. }
  668. }
  669. });
  670. </script>
  671. </html>