set_network.php 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  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="password" name="WifiPassword" id="WifiPassword" class="form-control floatingPassword" value="<?php echo $obj->{'WifiPassword'};?>">
  208. <i id="checkEye1" class="fa fa-eye" style="opacity: 0.5;color: red;"></i>
  209. </div>
  210. <div class="form-group" id="WifiBroadcastSsidDiv">
  211. <label>Wifi Broadcast SSID</label>
  212. <select class="form-control" id="WifiBroadcastSsid" name="WifiBroadcastSsid">
  213. <option value="0" <?php echo $obj->{'WifiBroadcastSsid'}=="0"?"selected":""?>>hidden</option>
  214. <option value="1" <?php echo $obj->{'WifiBroadcastSsid'}=="1"?"selected":""?>>broadcast</option>
  215. </select>
  216. </div>
  217. <div class="form-group" id="WifiTargetBssidMacDiv">
  218. <label>Wifi Target Bssid Mac</label>
  219. <input type="text" name="WifiTargetBssidMac" id="WifiTargetBssidMac" class="form-control" value="<?php echo $obj->{'WifiTargetBssidMac'};?>">
  220. </div>
  221. <div class="form-group" id="WifiRssiDiv">
  222. <label>RSSI</label>
  223. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'WifiRssi'};?> dBm">
  224. <input type="hidden" name="WifiRssi" id="WifiRssi" value="<?php echo $obj->{'WifiRssi'};?>">
  225. </div>
  226. <div class="form-group" id="WifiDhcpServerDiv">
  227. <label>DHCP Server</label>
  228. <select class="form-control" id="WifiDhcpServer" name="WifiDhcpServer">
  229. <option value="0" <?php echo $obj->{'WifiDhcpServer'}=="0"?"selected":""?>>enable</option>
  230. <option value="1" <?php echo $obj->{'WifiDhcpServer'}=="1"?"selected":""?>>disable</option>
  231. </select>
  232. </div>
  233. <div class="form-group" id="WifiDhcpClientDiv">
  234. <label>DHCP Client</label>
  235. <select class="form-control" id="WifiDhcpClient" name="WifiDhcpClient" onchange="WifiDhcp_changed();">
  236. <option value="0" <?php echo $obj->{'WifiDhcpClient'}=="0"?"selected":""?>>enable</option>
  237. <option value="1" <?php echo $obj->{'WifiDhcpClient'}=="1"?"selected":""?>>disable</option>
  238. </select>
  239. </div>
  240. <div class="form-group" id="WifiMacAddressDiv">
  241. <label><?php echo $lang->showWord("mac_address"); ?></label>
  242. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'WifiMacAddress'};?>">
  243. <input type="hidden" name="WifiMacAddress" id="WifiMacAddress" value="<?php echo $obj->{'WifiMacAddress'};?>">
  244. </div>
  245. <div class="form-group" id="WifiIpAddressDiv">
  246. <label><?php echo $lang->showWord("ip_address"); ?></label>
  247. <input type="text" name="WifiIpAddress" id="WifiIpAddress" class="form-control" value="<?php echo $obj->{'WifiIpAddress'};?>">
  248. </div>
  249. <div class="form-group" id="WifiSubmaskAddressDiv">
  250. <label><?php echo $lang->showWord("submask_address"); ?></label>
  251. <input type="text" name="WifiSubmaskAddress" id="WifiSubmaskAddress" class="form-control" value="<?php echo $obj->{'WifiSubmaskAddress'};?>">
  252. </div>
  253. <div class="form-group" id="WifiGatewayAddressDiv">
  254. <label><?php echo $lang->showWord("gateway_address"); ?></label>
  255. <input type="text" name="WifiGatewayAddress" id="WifiGatewayAddress" class="form-control" value="<?php echo $obj->{'WifiGatewayAddress'};?>">
  256. </div>
  257. <div class="form-group" id="WifiNetworkConnDiv">
  258. <label><?php echo $lang->showWord("network_connection_status"); ?></label>
  259. <input type="text" readonly class="form-control" value="<?php echo $WifiNetworkConn;?>">
  260. <input type="hidden" name="WifiNetworkConn" id="WifiNetworkConn" value="<?php echo $obj->{'WifiNetworkConn'};?>">
  261. </div>
  262. </section>
  263. </article>
  264. <!--3G/4G Module-->
  265. <article class="envor-sorting-item css" style="display:<?php echo $showTelcom;?>">
  266. <header><?php echo $lang->showWord("3G/4G_module"); ?><i class="fa fa-plus"></i></header>
  267. <section>
  268. <div class="form-group">
  269. <label><?php echo $lang->showWord("mode"); ?></label>
  270. <select class="form-control" id="TelcomEnabled" name="TelcomEnabled">
  271. <option value="0" <?php echo $obj->{'TelcomEnabled'}=="0"?"selected":""?>>Disable</option>
  272. <option value="1" <?php echo $obj->{'TelcomEnabled'}=="1"?"selected":""?>>Enable</option>
  273. </select>
  274. </div>
  275. <div class="form-group">
  276. <label>APN</label>
  277. <input type="text" name="TelcomApn" id="TelcomApn" class="form-control" value="<?php echo $obj->{'TelcomApn'};?>">
  278. </div>
  279. <div class="form-group">
  280. <label>Network Type</label>
  281. <select class="form-control" id="TelcomNetworkType" name="TelcomEnabled">
  282. <option value="0" <?php echo $obj->{'TelcomNetworkType'}=="0"?"selected":""?>>Auto</option>
  283. <option value="1" <?php echo $obj->{'TelcomNetworkType'}=="1"?"selected":""?>>2G</option>
  284. <option value="5" <?php echo $obj->{'TelcomNetworkType'}=="5"?"selected":""?>>3G</option>
  285. <option value="3" <?php echo $obj->{'TelcomNetworkType'}=="3"?"selected":""?>>4G</option>
  286. </select>
  287. </div>
  288. <div class="form-group">
  289. <label>RSSI</label>
  290. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomRssi'};?> dBm">
  291. <input type="hidden" name="TelcomRssi" id="TelcomRssi" value="<?php echo $obj->{'TelcomRssi'};?>">
  292. </div>
  293. <div class="form-group">
  294. <label>Chap Pap Id</label>
  295. <input type="text" name="TelcomChapPapId" id="TelcomChapPapId" class="form-control" value="<?php echo $obj->{'TelcomChapPapId'};?>">
  296. </div>
  297. <div class="form-group">
  298. <label><?php echo $lang->showWord("chap_pap_pwd"); ?></label>
  299. <input type="password" name="TelcomChapPapPwd" id="TelcomChapPapPwd" class="form-control floatingPassword" value="<?php echo $obj->{'TelcomChapPapPwd'};?>">
  300. <i id="checkEye2" class="fa fa-eye" style="opacity: 0.5;color: red;"></i>
  301. </div>
  302. <div class="form-group">
  303. <label><?php echo $lang->showWord("modem_imei"); ?></label>
  304. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomModemImei'};?>">
  305. <input type="hidden" name="TelcomModemImei" id="TelcomModemImei" value="<?php echo $obj->{'TelcomModemImei'};?>">
  306. </div>
  307. <div class="form-group">
  308. <label>SIM IMSI</label>
  309. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomSimImsi'};?>">
  310. <input type="hidden" name="TelcomSimImsi" id="TelcomSimImsi" value="<?php echo $obj->{'TelcomSimImsi'};?>">
  311. </div>
  312. <div class="form-group">
  313. <label>SIM ICCID</label>
  314. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomSimIccid'};?>">
  315. <input type="hidden" name="TelcomSimIccid" id="TelcomSimIccid" value="<?php echo $obj->{'TelcomSimIccid'};?>">
  316. </div>
  317. <div class="form-group">
  318. <label><?php echo $lang->showWord("sim_status"); ?></label>
  319. <input type="text" readonly class="form-control" placeholder="<?php echo $TelcomSimStatus;?>">
  320. <input type="hidden" name="TelcomSimStatus" id="TelcomSimStatus" value="<?php echo $obj->{'TelcomSimStatus'};?>">
  321. </div>
  322. <div class="form-group">
  323. <label><?php echo $lang->showWord("modem_mode"); ?></label>
  324. <input type="text" readonly class="form-control" placeholder="<?php echo $TelcomModemMode;?>">
  325. <input type="hidden" name="TelcomModemMode" id="TelcomModemMode" value="<?php echo $obj->{'TelcomModemMode'};?>">
  326. </div>
  327. <div class="form-group">
  328. <label><?php echo $lang->showWord("ip_address"); ?></label>
  329. <input type="text" name="TelcomIpAddress" id="TelcomIpAddress" class="form-control" value="<?php echo $obj->{'TelcomIpAddress'};?>" disabled>
  330. </div>
  331. <div class="form-group">
  332. <label><?php echo $lang->showWord("network_connection_status"); ?></label>
  333. <input type="text" readonly class="form-control" value="<?php echo $TelcomNetworkConn;?>">
  334. <input type="hidden" name="TelcomNetworkConn" id="TelcomNetworkConn" value="<?php echo $obj->{'TelcomNetworkConn'};?>">
  335. </div>
  336. </section>
  337. </article>
  338. <!--firewall-->
  339. <article class="envor-sorting-item css">
  340. <header><?php echo $lang->showWord("Firewall"); ?><i class="fa fa-plus"></i></header>
  341. <section>
  342. <div class="form-group">
  343. <label><?php echo $lang->showWord("mode"); ?></label>
  344. <select class="form-control" id="isEnalbleFirewall" name="isEnalbleFirewall" onchange="Firewall_changed();">
  345. <option value="0" <?php echo $obj->{'isEnalbleFirewall'}=="0"?"selected":""?>>Disable</option>
  346. <option value="1" <?php echo $obj->{'isEnalbleFirewall'}=="1"?"selected":""?>>Enable</option>
  347. </select>
  348. </div>
  349. <div class="form-group" id="FirewallAcceptAddrDiv">
  350. <div class="form-group">
  351. <label><?php echo 'Firewall Accept Addr0' ?></label>
  352. <input type="text" name="FirewallAcceptAddr0" id="FirewallAcceptAddr0" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[0];?>">
  353. </div>
  354. <div class="form-group">
  355. <label><?php echo 'Firewall Accept Addr1' ?></label>
  356. <input type="text" name="FirewallAcceptAddr1" id="FirewallAcceptAddr1" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[1];?>">
  357. </div>
  358. <div class="form-group">
  359. <label><?php echo 'Firewall Accept Addr2' ?></label>
  360. <input type="text" name="FirewallAcceptAddr2" id="FirewallAcceptAddr2" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[2];?>">
  361. </div>
  362. <div class="form-group">
  363. <label><?php echo 'Firewall Accept Addr3' ?></label>
  364. <input type="text" name="FirewallAcceptAddr3" id="FirewallAcceptAddr3" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[3];?>">
  365. </div>
  366. <div class="form-group">
  367. <label><?php echo 'Firewall Accept Addr4' ?></label>
  368. <input type="text" name="FirewallAcceptAddr4" id="FirewallAcceptAddr4" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[4];?>">
  369. </div>
  370. <div class="form-group">
  371. <label><?php echo 'Firewall Accept Addr5' ?></label>
  372. <input type="text" name="FirewallAcceptAddr5" id="FirewallAcceptAddr5" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[5];?>">
  373. </div>
  374. <div class="form-group">
  375. <label><?php echo 'Firewall Accept Addr6' ?></label>
  376. <input type="text" name="FirewallAcceptAddr6" id="FirewallAcceptAddr6" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[6];?>">
  377. </div>
  378. <div class="form-group">
  379. <label><?php echo 'Firewall Accept Addr7' ?></label>
  380. <input type="text" name="FirewallAcceptAddr7" id="FirewallAcceptAddr7" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[7];?>">
  381. </div>
  382. <div class="form-group">
  383. <label><?php echo 'Firewall Accept Addr8' ?></label>
  384. <input type="text" name="FirewallAcceptAddr8" id="FirewallAcceptAddr8" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[8];?>">
  385. </div>
  386. <div class="form-group">
  387. <label><?php echo 'Firewall Accept Addr9' ?></label>
  388. <input type="text" name="FirewallAcceptAddr9" id="FirewallAcceptAddr9" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[9];?>">
  389. </div>
  390. </div>
  391. </section>
  392. </article>
  393. <!--Bluetooth Module-->
  394. <?php /* <article class="envor-sorting-item css">
  395. <header><?php echo $lang->showWord("bluetooth_module"); ?><i class="fa fa-plus"></i></header>
  396. <section>
  397. <div class="form-group" style="display:<?php echo $am101;?>">
  398. <label>LoginCentralID</label>
  399. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'LoginCentralID'};?>">
  400. <input type="hidden" name="LoginCentralID" id="LoginCentralID" value="<?php echo $obj->{'LoginCentralID'};?>">
  401. </div>
  402. <div class="form-group" style="display:<?php echo $am101;?>">
  403. <label>isLogin</label>
  404. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'isLogin'};?>">
  405. <input type="hidden" name="isLogin" id="isLogin" value="<?php echo $obj->{'isLogin'};?>">
  406. </div>
  407. <div class="form-group" style="display:<?php echo $am101;?>">
  408. <label>isRequestStart</label>
  409. <input type="text" readonly class="form-control" value="<?php echo $isRequestStart;?>">
  410. <input type="hidden" name="isRequestStart" id="isRequestStart" value="<?php echo $obj->{'isRequestStart'};?>">
  411. </div>
  412. <div class="form-group" style="display:<?php echo $am101;?>">
  413. <label>isRequestStop</label>
  414. <input type="text" readonly class="form-control" value="<?php echo $isRequestStop;?>">
  415. <input type="hidden" name="isRequestStop" id="isRequestStop" value="<?php echo $obj->{'isRequestStop'};?>">
  416. </div>
  417. </section>
  418. </article> */?>
  419. <article class="envor-sorting-item css">
  420. <div align="center"><button id="save"><?php echo $lang->showWord("set")?></button></div>
  421. </article>
  422. </div>
  423. </div>
  424. </div>
  425. </div>
  426. </div>
  427. </section>
  428. </div>
  429. <?php
  430. include 'foot.php';
  431. ?>
  432. <script type="text/JavaScript">
  433. $(document).ready(function(){
  434. WifiMode_changed();
  435. EthDhcp_changed();
  436. WifiDhcp_changed();
  437. Firewall_changed();
  438. });
  439. document.getElementById("save").onclick = function() {
  440. if(formCheck())
  441. {
  442. window.location="#loadinghref";
  443. document.getElementById("loading").style.display="block";
  444. // 發送 Ajax 查詢請求並處理
  445. var request = new XMLHttpRequest();
  446. request.open("POST", "set_network_action.php");
  447. // POST 參數須使用 send() 發送
  448. var data = "Eth0DhcpClient=" + document.getElementById("Eth0DhcpClient").value+
  449. "&Eth0IpAddress=" + document.getElementById("Eth0IpAddress").value+
  450. "&Eth0SubmaskAddress=" + document.getElementById("Eth0SubmaskAddress").value+
  451. "&Eth0GatewayAddress=" + document.getElementById("Eth0GatewayAddress").value+
  452. "&WifiMode=" + document.getElementById("WifiMode").value+
  453. "&WifiSsid=" + escape(document.getElementById("WifiSsid").value)+
  454. "&WifiPassword=" + escape(document.getElementById("WifiPassword").value)+
  455. "&WifiBroadcastSsid=" + document.getElementById("WifiBroadcastSsid").value+
  456. "&WifiTargetBssidMac=" + escape(document.getElementById("WifiTargetBssidMac").value)+
  457. "&WifiDhcpServer=" + document.getElementById("WifiDhcpServer").value+
  458. "&WifiDhcpClient=" + document.getElementById("WifiDhcpClient").value+
  459. "&WifiIpAddress=" + document.getElementById("WifiIpAddress").value+
  460. "&WifiSubmaskAddress=" + document.getElementById("WifiSubmaskAddress").value+
  461. "&WifiGatewayAddress=" + document.getElementById("WifiGatewayAddress").value+
  462. "&TelcomApn=" + escape(document.getElementById("TelcomApn").value)+
  463. "&TelcomNetworkType=" + escape(document.getElementById("TelcomNetworkType").value)+
  464. "&TelcomChapPapId=" + escape(document.getElementById("TelcomChapPapId").value)+
  465. "&TelcomChapPapPwd=" + escape(document.getElementById("TelcomChapPapPwd").value)+
  466. "&TelcomIpAddress=" + document.getElementById("TelcomIpAddress").value+
  467. "&TelcomEnabled=" + document.getElementById("TelcomEnabled").value+
  468. "&isEnalbleFirewall=" + document.getElementById("isEnalbleFirewall").value+
  469. "&FirewallAcceptAddr0=" + document.getElementById("FirewallAcceptAddr0").value+
  470. "&FirewallAcceptAddr1=" + document.getElementById("FirewallAcceptAddr1").value+
  471. "&FirewallAcceptAddr2=" + document.getElementById("FirewallAcceptAddr2").value+
  472. "&FirewallAcceptAddr3=" + document.getElementById("FirewallAcceptAddr3").value+
  473. "&FirewallAcceptAddr4=" + document.getElementById("FirewallAcceptAddr4").value+
  474. "&FirewallAcceptAddr5=" + document.getElementById("FirewallAcceptAddr5").value+
  475. "&FirewallAcceptAddr6=" + document.getElementById("FirewallAcceptAddr6").value+
  476. "&FirewallAcceptAddr7=" + document.getElementById("FirewallAcceptAddr7").value+
  477. "&FirewallAcceptAddr8=" + document.getElementById("FirewallAcceptAddr8").value+
  478. "&FirewallAcceptAddr9=" + document.getElementById("FirewallAcceptAddr9").value;
  479. // POST 請求必須設置表頭在 open() 下面,send() 上面
  480. request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  481. request.send(data);
  482. request.onreadystatechange = function() {
  483. // 伺服器請求完成
  484. if (request.readyState == 4) {
  485. document.getElementById("loading").style.display="none";
  486. // 伺服器回應成功
  487. if (request.status == 200 && JSON.parse(request.responseText).result=="Success") {
  488. alert("<?php echo $lang->showWord("done")?>");
  489. location.href="set_network.php";
  490. } else {
  491. alert(JSON.parse(request.responseText).message);
  492. }
  493. request = null;
  494. }
  495. }
  496. }
  497. }
  498. function formCheck()
  499. {
  500. if(document.getElementById("Eth0IpAddress").value != ""){
  501. if(!ValidateIPaddress("Eth0IpAddress")) return false;
  502. }
  503. if(document.getElementById("Eth0SubmaskAddress").value != ""){
  504. if(!ValidateIPaddress("Eth0SubmaskAddress")) return false;
  505. }
  506. if(document.getElementById("Eth0GatewayAddress").value != ""){
  507. if(!ValidateIPaddress("Eth0GatewayAddress")) return false;
  508. }
  509. // if(document.getElementById("Eth1IpAddress").value != ""){
  510. // if(!ValidateIPaddress("Eth1IpAddress")) return false;
  511. // }
  512. // if(document.getElementById("Eth1SubmaskAddress").value != ""){
  513. // if(!ValidateIPaddress("Eth1SubmaskAddress")) return false;
  514. // }
  515. // if(document.getElementById("Eth1GatewayAddress").value != ""){
  516. // if(!ValidateIPaddress("Eth1GatewayAddress")) return false;
  517. // }
  518. if(document.getElementById("WifiIpAddress").value != ""){
  519. if(!ValidateIPaddress("WifiIpAddress")) return false;
  520. }
  521. if(document.getElementById("WifiSubmaskAddress").value != ""){
  522. if(!ValidateIPaddress("WifiSubmaskAddress")) return false;
  523. }
  524. if(document.getElementById("WifiGatewayAddress").value != ""){
  525. if(!ValidateIPaddress("WifiGatewayAddress")) return false;
  526. }
  527. if(document.getElementById("TelcomIpAddress").value != ""){
  528. if(!ValidateIPaddress("TelcomIpAddress")) return false;
  529. }
  530. return true;
  531. }
  532. function WifiMode_changed(){
  533. if(document.getElementById("WifiMode").value=="0"){
  534. document.getElementById("WifiDhcpServer").disabled=true;
  535. document.getElementById("WifiDhcpClient").disabled=true;
  536. document.getElementById("WifiSsid").disabled=true;
  537. document.getElementById("WifiPassword").disabled=true;
  538. document.getElementById("WifiIpAddress").disabled=true;
  539. document.getElementById("WifiSubmaskAddress").disabled=true;
  540. document.getElementById("WifiGatewayAddress").disabled=true;
  541. document.getElementById("WifiDhcpServerDiv").style.display="none";
  542. document.getElementById("WifiDhcpClientDiv").style.display="none";
  543. document.getElementById("WifiSsidDiv").style.display="none";
  544. document.getElementById("WifiPasswordDiv").style.display="none";
  545. document.getElementById("WifiBroadcastSsidDiv").style.display="none";
  546. document.getElementById("WifiTargetBssidMacDiv").style.display="none";
  547. document.getElementById("WifiRssiDiv").style.display="none";
  548. document.getElementById("WifiMacAddressDiv").style.display="none";
  549. document.getElementById("WifiIpAddressDiv").style.display="none";
  550. document.getElementById("WifiSubmaskAddressDiv").style.display="none";
  551. document.getElementById("WifiGatewayAddressDiv").style.display="none";
  552. document.getElementById("WifiNetworkConnDiv").style.display="none";
  553. }
  554. if(document.getElementById("WifiMode").value=="1"){
  555. document.getElementById("WifiDhcpServer").disabled=true;
  556. document.getElementById("WifiDhcpClient").disabled=false;
  557. document.getElementById("WifiSsid").disabled=false;
  558. document.getElementById("WifiPassword").disabled=false;
  559. document.getElementById("WifiSsid").value="<?php echo $obj->{'WifiSsid'};?>";
  560. document.getElementById("WifiPassword").value="<?php echo $obj->{'WifiPassword'};?>";
  561. document.getElementById("WifiIpAddress").disabled=false;
  562. document.getElementById("WifiSubmaskAddress").disabled=false;
  563. document.getElementById("WifiGatewayAddress").disabled=false;
  564. document.getElementById("WifiIpAddress").value="<?php echo $obj->{'WifiIpAddress'};?>";
  565. document.getElementById("WifiSubmaskAddress").value="<?php echo $obj->{'WifiSubmaskAddress'};?>";
  566. document.getElementById("WifiGatewayAddress").value="<?php echo $obj->{'WifiGatewayAddress'};?>";
  567. document.getElementById("WifiDhcpServerDiv").style.display="none";
  568. document.getElementById("WifiDhcpClientDiv").style.display="block";
  569. document.getElementById("WifiSsidDiv").style.display="block";
  570. document.getElementById("WifiPasswordDiv").style.display="block";
  571. document.getElementById("WifiBroadcastSsidDiv").style.display="none";
  572. document.getElementById("WifiTargetBssidMacDiv").style.display="block";
  573. document.getElementById("WifiRssiDiv").style.display="block";
  574. document.getElementById("WifiMacAddressDiv").style.display="block";
  575. document.getElementById("WifiIpAddressDiv").style.display="block";
  576. document.getElementById("WifiSubmaskAddressDiv").style.display="block";
  577. document.getElementById("WifiGatewayAddressDiv").style.display="block";
  578. document.getElementById("WifiNetworkConnDiv").style.display="block";
  579. }
  580. if(document.getElementById("WifiMode").value=="2"){
  581. document.getElementById("WifiDhcpServer").disabled=false;
  582. document.getElementById("WifiDhcpClient").disabled=true;
  583. document.getElementById("WifiSsid").disabled=true;
  584. document.getElementById("WifiPassword").disabled=true;
  585. document.getElementById("WifiSsid").value="<?php echo $ModelName.$SerialNumber?>";
  586. document.getElementById("WifiPassword").value="";
  587. document.getElementById("WifiIpAddress").disabled=true;
  588. document.getElementById("WifiSubmaskAddress").disabled=true;
  589. document.getElementById("WifiGatewayAddress").disabled=true;
  590. document.getElementById("WifiDhcpServerDiv").style.display="block";
  591. document.getElementById("WifiDhcpClientDiv").style.display="none";
  592. document.getElementById("WifiSsidDiv").style.display="block";
  593. document.getElementById("WifiPasswordDiv").style.display="block";
  594. document.getElementById("WifiBroadcastSsidDiv").style.display="block";
  595. document.getElementById("WifiTargetBssidMacDiv").style.display="none";
  596. document.getElementById("WifiRssiDiv").style.display="block";
  597. document.getElementById("WifiMacAddressDiv").style.display="block";
  598. document.getElementById("WifiIpAddressDiv").style.display="none";
  599. document.getElementById("WifiSubmaskAddressDiv").style.display="none";
  600. document.getElementById("WifiGatewayAddressDiv").style.display="none";
  601. document.getElementById("WifiNetworkConnDiv").style.display="block";
  602. }
  603. WifiDhcp_changed();
  604. }
  605. function EthDhcp_changed(){
  606. if(document.getElementById("Eth0DhcpClient").value=="0"){
  607. document.getElementById("Eth0IpAddress").disabled=true;
  608. document.getElementById("Eth0SubmaskAddress").disabled=true;
  609. document.getElementById("Eth0GatewayAddress").disabled=true;
  610. }
  611. if(document.getElementById("Eth0DhcpClient").value=="1"){
  612. document.getElementById("Eth0IpAddress").disabled=false;
  613. document.getElementById("Eth0SubmaskAddress").disabled=false;
  614. document.getElementById("Eth0GatewayAddress").disabled=false;
  615. document.getElementById("Eth0IpAddress").value="<?php echo $obj->{'Eth0IpAddress'};?>";
  616. document.getElementById("Eth0SubmaskAddress").value="<?php echo $obj->{'Eth0SubmaskAddress'};?>";
  617. document.getElementById("Eth0GatewayAddress").value="<?php echo $obj->{'Eth0GatewayAddress'};?>";
  618. }
  619. }
  620. function WifiDhcp_changed(){
  621. if(document.getElementById("WifiDhcpClient").disabled===false && document.getElementById("WifiDhcpClient").value=="0"){
  622. document.getElementById("WifiIpAddress").disabled=true;
  623. document.getElementById("WifiSubmaskAddress").disabled=true;
  624. document.getElementById("WifiGatewayAddress").disabled=true;
  625. }
  626. if(document.getElementById("WifiDhcpClient").disabled===false && document.getElementById("WifiDhcpClient").value=="1"){
  627. document.getElementById("WifiIpAddress").disabled=false;
  628. document.getElementById("WifiSubmaskAddress").disabled=false;
  629. document.getElementById("WifiGatewayAddress").disabled=false;
  630. document.getElementById("WifiIpAddress").value="<?php echo $obj->{'WifiIpAddress'};?>";
  631. document.getElementById("WifiSubmaskAddress").value="<?php echo $obj->{'WifiSubmaskAddress'};?>";
  632. document.getElementById("WifiGatewayAddress").value="<?php echo $obj->{'WifiGatewayAddress'};?>";
  633. }
  634. }
  635. function Firewall_changed(){
  636. if(document.getElementById("isEnalbleFirewall").value=="1"){
  637. document.getElementById("FirewallAcceptAddrDiv").style.display="block";
  638. }
  639. else{
  640. document.getElementById("FirewallAcceptAddrDiv").style.display="none";
  641. }
  642. }
  643. function isNumberKey(evt)
  644. {
  645. var charCode = (evt.which) ? evt.which : event.keyCode
  646. if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 46))
  647. return false;
  648. return true;
  649. }
  650. function ValidateIPaddress(id) {
  651. var ipaddress = document.getElementById(id).value;
  652. 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)) {
  653. return true;
  654. }
  655. alert("You have entered an invalid IP address on " + id + "!")
  656. document.getElementById(id).focus();
  657. return false;
  658. }
  659. function scan_wifi()
  660. {
  661. window.open("scan_wifi.php","_blank","height=200,width=400, status=yes,toolbar=no,menubar=no,location=no");
  662. }
  663. $("#scan").fancybox({
  664. 'type' : 'iframe',
  665. 'iframe' : {
  666. 'css' : {
  667. 'width' : '600px',
  668. 'height': '200px'
  669. }
  670. }
  671. });
  672. $("#checkEye1").click(function () {
  673. if($(this).hasClass('fa-eye')){
  674. $("#WifiPassword").attr('type', 'text');
  675. }else{
  676. $("#WifiPassword").attr('type', 'password');
  677. }
  678. $("#checkEye1").toggleClass('fa-eye').toggleClass('fa-eye-slash');
  679. });
  680. $("#checkEye2").click(function () {
  681. if($(this).hasClass('fa-eye')){
  682. $("#TelcomChapPapPwd").attr('type', 'text');
  683. }else{
  684. $("#TelcomChapPapPwd").attr('type', 'password');
  685. }
  686. $("#checkEye2").toggleClass('fa-eye').toggleClass('fa-eye-slash');
  687. });
  688. </script>
  689. </html>