123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707 |
- <?php
- ini_set('error_reporting', E_ALL | E_STRICT);
- $tag_header = 'set';
- include 'head.php';
- $obj = json_decode(trim($output[2]));//var_dump($obj);
- $system = json_decode(trim($output[0]),true);//var_dump($obj);
- $ModelName = $system['ModelName'];
- $SerialNumber = $system['SerialNumber'];
- $InternetConn='';
- switch ($obj->{'InternetConn'}){
- case 0:
- $InternetConn=$lang->showWord('disconnected');
- break;
- case 1:
- $InternetConn=$lang->showWord('connected');
- break;
- }
- $WifiNetworkConn='';
- switch ($obj->{'WifiNetworkConn'}){
- case 0:
- $WifiNetworkConn=$lang->showWord('disconnected');
- break;
- case 1:
- $WifiNetworkConn=$lang->showWord('connected');
- break;
- }
- $TelcomNetworkConn='';
- switch ($obj->{'TelcomNetworkConn'}){
- case 0:
- $TelcomNetworkConn=$lang->showWord('disconnected');
- break;
- case 1:
- $TelcomNetworkConn=$lang->showWord('connected');
- break;
- }
- $TelcomSimStatus='';
- switch ($obj->{'TelcomSimStatus'}){
- case 0:
- $TelcomSimStatus='no SIM card is found';
- break;
- case 1:
- $TelcomSimStatus='valid SIM card';
- break;
- case 2:
- $TelcomSimStatus='invalid SIM card';
- break;
- }
- $TelcomModemMode='';
- switch ($obj->{'TelcomModemMode'}){
- case 0:
- $TelcomModemMode='No services';
- break;
- case 1:
- $TelcomModemMode='CDMA';
- break;
- case 2:
- $TelcomModemMode='GSM/GPRS';
- break;
- case 3:
- $TelcomModemMode='WCDMA';
- break;
- case 4:
- $TelcomModemMode='GSM/WCDMA';
- break;
- case 5:
- $TelcomModemMode='TD_SCDMA mode';
- break;
- case 6:
- $TelcomModemMode='HSPA';
- break;
- case 7:
- $TelcomModemMode='LTE';
- break;
- case 9:
- $TelcomModemMode='Unknown';
- break;
- }
- ?>
- <style>
- img {
- display: block;
- margin-left: auto;
- margin-right: auto;
- }
- </style>
- <div class="envor-content">
- <!--
- Page Title start
- //-->
- <section class="envor-page-title-1" data-stellar-background-ratio="0.5">
- <div class="container">
- <div class="row">
- <div class="col-lg-9 col-md-9 col-sm-9">
- <h1><?php echo $lang->showWord("network"); ?></h1>
- </div>
- </div>
- </div>
- <!--
- Page Title end
- //-->
- </section>
- <!--
- Main Content start
- //-->
- <a id="loadinghref"><div id="loading" style="display:none;"><img src="img/giphy.gif"/></div></a>
- <section class="envor-section">
- <div class="container">
- <div class="row">
- <div class="col-lg-12">
- <div class="envor-sorting" id="faq-sorting">
- <div class="envor-toggle">
- <!--Network Status-->
- <article class="envor-sorting-item css">
- <header><?php echo $lang->showWord("network_status"); ?><i class="fa fa-plus"></i></header>
- <section>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label><?php echo $lang->showWord("internet_connection_status"); ?></label>
- <input type="text" readonly class="form-control" placeholder="<?php echo $InternetConn;?>">
- <input type="hidden" name="InternetConn" id="InternetConn" value="<?php echo $obj->{'InternetConn'};?>">
- </div>
- <?php /* <div class="form-group" style="display:<?php echo $am101;?>">
- <label>FtpServer</label>
- <input type="text" name="FtpServer" id="FtpServer" class="form-control" value="<?php echo $obj->{'FtpServer'};?>">
- </div>*/?>
- </section>
- </article>
- <!--Ethernet Interface0-->
- <article class="envor-sorting-item css" style="display:<?php echo $am101;?>">
- <header><?php echo $lang->showWord("ethernet_interface"); ?><i class="fa fa-plus"></i></header>
- <section>
- <div class="form-group">
- <label>DHCP Client</label>
- <select class="form-control" id="Eth0DhcpClient" name="Eth0DhcpClient" onchange="EthDhcp_changed();">
- <option value="0" <?php echo $obj->{'Eth0DhcpClient'}=="0"?"selected":""?>>enable</option>
- <option value="1" <?php echo $obj->{'Eth0DhcpClient'}=="1"?"selected":""?>>disable</option>
- </select>
- </div>
- <div class="form-group">
- <label><?php echo $lang->showWord("mac_address"); ?></label>
- <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Eth0MacAddress'};?>">
- <input type="hidden" name="Eth0MacAddress" id="Eth0MacAddress" value="<?php echo $obj->{'Eth0MacAddress'};?>">
- </div>
- <div class="form-group">
- <label><?php echo $lang->showWord("ip_address"); ?></label>
- <input type="text" name="Eth0IpAddress" id="Eth0IpAddress" class="form-control" value="<?php echo $obj->{'Eth0IpAddress'};?>">
- </div>
- <div class="form-group">
- <label><?php echo $lang->showWord("submask_address"); ?></label>
- <input type="text" name="Eth0SubmaskAddress" id="Eth0SubmaskAddress" class="form-control" value="<?php echo $obj->{'Eth0SubmaskAddress'};?>">
- </div>
- <div class="form-group">
- <label><?php echo $lang->showWord("gateway_address"); ?></label>
- <input type="text" name="Eth0GatewayAddress" id="Eth0GatewayAddress" class="form-control" value="<?php echo $obj->{'Eth0GatewayAddress'};?>">
- </div>
- </section>
- </article>
- <?php /* <!--Ethernet Interface1-->
- <article class="envor-sorting-item css" style="display:<?php echo $am101;?>">
- <header><?php echo $lang->showWord("ethernet_interface"); ?><i class="fa fa-plus"></i></header>
- <section>
- <div class="form-group">
- <label>Eth1DhcpClient</label>
- <select class="form-control" id="Eth1DhcpClient" name="Eth1DhcpClient">
- <option value="0" <?php echo $obj->{'Eth1DhcpClient'}=="0"?"selected":""?>>enable</option>
- <option value="1" <?php echo $obj->{'Eth1DhcpClient'}=="1"?"selected":""?>>disable</option>
- </select>
- </div>
- <div class="form-group">
- <label>Eth1MacAddress</label>
- <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Eth1MacAddress'};?>">
- <input type="hidden" name="Eth1MacAddress" id="Eth1MacAddress" value="<?php echo $obj->{'Eth1MacAddress'};?>">
- </div>
- <div class="form-group">
- <label>Eth1IpAddress</label>
- <input type="text" name="Eth1IpAddress" id="Eth1IpAddress" class="form-control" value="<?php echo $obj->{'Eth1IpAddress'};?>">
- </div>
- <div class="form-group">
- <label>Eth1SubmaskAddress</label>
- <input type="text" name="Eth1SubmaskAddress" id="Eth1SubmaskAddress" class="form-control" value="<?php echo $obj->{'Eth1SubmaskAddress'};?>">
- </div>
- <div class="form-group">
- <label>Eth1GatewayAddress</label>
- <input type="text" name="Eth1GatewayAddress" id="Eth1GatewayAddress" class="form-control" value="<?php echo $obj->{'Eth1GatewayAddress'};?>">
- </div>
- </section>
- </article>*/?>
- <!--WiFi Module-->
- <article class="envor-sorting-item css" style="display:<?php echo $showWifi;?>">
- <header><?php echo $lang->showWord("WiFi_module"); ?><i class="fa fa-plus"></i></header>
- <section>
- <div class="form-group">
- <label><?php echo $lang->showWord("mode"); ?></label>
- <select class="form-control" id="WifiMode" name="WifiMode" onchange="WifiMode_changed();">
- <option value="0" <?php echo $obj->{'WifiMode'}=="0"?"selected":""?>>disable</option>
- <option value="1" <?php echo $obj->{'WifiMode'}=="1"?"selected":""?>>station</option>
- <option value="2" <?php echo $obj->{'WifiMode'}=="2"?"selected":""?>>Access Point</option>
- <?php /* <option value="3" <?php echo $obj->{'WifiMode'}=="3"?"selected":""?>>Ad-Hoc</option>*/?>
- </select>
- </div>
- <div class="form-group" id="WifiSsidDiv">
- <label>SSID</label>
- <input type="text" name="WifiSsid" id="WifiSsid" class="form-control" value="<?php echo $obj->{'WifiSsid'};?>">
- <a id="scan" href="scan_wifi.php"><input type="button" value="Scan" class="form-control"></a>
- </div>
- <div class="form-group" id="WifiPasswordDiv">
- <label>Password</label>
- <input type="password" name="WifiPassword" id="WifiPassword" class="form-control floatingPassword" value="<?php echo $obj->{'WifiPassword'};?>">
- <i id="checkEye1" class="fa fa-eye" style="opacity: 0.5;color: red;"></i>
- </div>
- <div class="form-group" id="WifiBroadcastSsidDiv">
- <label>Wifi Broadcast SSID</label>
- <select class="form-control" id="WifiBroadcastSsid" name="WifiBroadcastSsid">
- <option value="0" <?php echo $obj->{'WifiBroadcastSsid'}=="0"?"selected":""?>>hidden</option>
- <option value="1" <?php echo $obj->{'WifiBroadcastSsid'}=="1"?"selected":""?>>broadcast</option>
- </select>
- </div>
- <div class="form-group" id="WifiTargetBssidMacDiv">
- <label>Wifi Target Bssid Mac</label>
- <input type="text" name="WifiTargetBssidMac" id="WifiTargetBssidMac" class="form-control" value="<?php echo $obj->{'WifiTargetBssidMac'};?>">
- </div>
- <div class="form-group" id="WifiRssiDiv">
- <label>RSSI</label>
- <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'WifiRssi'};?> dBm">
- <input type="hidden" name="WifiRssi" id="WifiRssi" value="<?php echo $obj->{'WifiRssi'};?>">
- </div>
- <div class="form-group" id="WifiDhcpServerDiv">
- <label>DHCP Server</label>
- <select class="form-control" id="WifiDhcpServer" name="WifiDhcpServer">
- <option value="0" <?php echo $obj->{'WifiDhcpServer'}=="0"?"selected":""?>>enable</option>
- <option value="1" <?php echo $obj->{'WifiDhcpServer'}=="1"?"selected":""?>>disable</option>
- </select>
- </div>
- <div class="form-group" id="WifiDhcpClientDiv">
- <label>DHCP Client</label>
- <select class="form-control" id="WifiDhcpClient" name="WifiDhcpClient" onchange="WifiDhcp_changed();">
- <option value="0" <?php echo $obj->{'WifiDhcpClient'}=="0"?"selected":""?>>enable</option>
- <option value="1" <?php echo $obj->{'WifiDhcpClient'}=="1"?"selected":""?>>disable</option>
- </select>
- </div>
- <div class="form-group" id="WifiMacAddressDiv">
- <label><?php echo $lang->showWord("mac_address"); ?></label>
- <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'WifiMacAddress'};?>">
- <input type="hidden" name="WifiMacAddress" id="WifiMacAddress" value="<?php echo $obj->{'WifiMacAddress'};?>">
- </div>
- <div class="form-group" id="WifiIpAddressDiv">
- <label><?php echo $lang->showWord("ip_address"); ?></label>
- <input type="text" name="WifiIpAddress" id="WifiIpAddress" class="form-control" value="<?php echo $obj->{'WifiIpAddress'};?>">
- </div>
- <div class="form-group" id="WifiSubmaskAddressDiv">
- <label><?php echo $lang->showWord("submask_address"); ?></label>
- <input type="text" name="WifiSubmaskAddress" id="WifiSubmaskAddress" class="form-control" value="<?php echo $obj->{'WifiSubmaskAddress'};?>">
- </div>
- <div class="form-group" id="WifiGatewayAddressDiv">
- <label><?php echo $lang->showWord("gateway_address"); ?></label>
- <input type="text" name="WifiGatewayAddress" id="WifiGatewayAddress" class="form-control" value="<?php echo $obj->{'WifiGatewayAddress'};?>">
- </div>
- <div class="form-group" id="WifiNetworkConnDiv">
- <label><?php echo $lang->showWord("network_connection_status"); ?></label>
- <input type="text" readonly class="form-control" value="<?php echo $WifiNetworkConn;?>">
- <input type="hidden" name="WifiNetworkConn" id="WifiNetworkConn" value="<?php echo $obj->{'WifiNetworkConn'};?>">
- </div>
- </section>
- </article>
- <!--3G/4G Module-->
- <article class="envor-sorting-item css" style="display:<?php echo $showTelcom;?>">
- <header><?php echo $lang->showWord("3G/4G_module"); ?><i class="fa fa-plus"></i></header>
- <section>
- <div class="form-group">
- <label><?php echo $lang->showWord("mode"); ?></label>
- <select class="form-control" id="TelcomEnabled" name="TelcomEnabled">
- <option value="0" <?php echo $obj->{'TelcomEnabled'}=="0"?"selected":""?>>Disable</option>
- <option value="1" <?php echo $obj->{'TelcomEnabled'}=="1"?"selected":""?>>Enable</option>
- </select>
- </div>
- <div class="form-group">
- <label>APN</label>
- <input type="text" name="TelcomApn" id="TelcomApn" class="form-control" value="<?php echo $obj->{'TelcomApn'};?>">
- </div>
- <div class="form-group">
- <label>Network Type</label>
- <select class="form-control" id="TelcomNetworkType" name="TelcomEnabled">
- <option value="0" <?php echo $obj->{'TelcomNetworkType'}=="0"?"selected":""?>>Auto</option>
- <option value="1" <?php echo $obj->{'TelcomNetworkType'}=="1"?"selected":""?>>2G</option>
- <option value="5" <?php echo $obj->{'TelcomNetworkType'}=="5"?"selected":""?>>3G</option>
- <option value="3" <?php echo $obj->{'TelcomNetworkType'}=="3"?"selected":""?>>4G</option>
- </select>
- </div>
- <div class="form-group">
- <label>RSSI</label>
- <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomRssi'};?> dBm">
- <input type="hidden" name="TelcomRssi" id="TelcomRssi" value="<?php echo $obj->{'TelcomRssi'};?>">
- </div>
- <div class="form-group">
- <label>Chap Pap Id</label>
- <input type="text" name="TelcomChapPapId" id="TelcomChapPapId" class="form-control" value="<?php echo $obj->{'TelcomChapPapId'};?>">
- </div>
- <div class="form-group">
- <label><?php echo $lang->showWord("chap_pap_pwd"); ?></label>
- <input type="password" name="TelcomChapPapPwd" id="TelcomChapPapPwd" class="form-control floatingPassword" value="<?php echo $obj->{'TelcomChapPapPwd'};?>">
- <i id="checkEye2" class="fa fa-eye" style="opacity: 0.5;color: red;"></i>
- </div>
- <div class="form-group">
- <label><?php echo $lang->showWord("modem_imei"); ?></label>
- <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomModemImei'};?>">
- <input type="hidden" name="TelcomModemImei" id="TelcomModemImei" value="<?php echo $obj->{'TelcomModemImei'};?>">
- </div>
- <div class="form-group">
- <label>SIM IMSI</label>
- <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomSimImsi'};?>">
- <input type="hidden" name="TelcomSimImsi" id="TelcomSimImsi" value="<?php echo $obj->{'TelcomSimImsi'};?>">
- </div>
- <div class="form-group">
- <label>SIM ICCID</label>
- <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomSimIccid'};?>">
- <input type="hidden" name="TelcomSimIccid" id="TelcomSimIccid" value="<?php echo $obj->{'TelcomSimIccid'};?>">
- </div>
- <div class="form-group">
- <label><?php echo $lang->showWord("sim_status"); ?></label>
- <input type="text" readonly class="form-control" placeholder="<?php echo $TelcomSimStatus;?>">
- <input type="hidden" name="TelcomSimStatus" id="TelcomSimStatus" value="<?php echo $obj->{'TelcomSimStatus'};?>">
- </div>
- <div class="form-group">
- <label><?php echo $lang->showWord("modem_mode"); ?></label>
- <input type="text" readonly class="form-control" placeholder="<?php echo $TelcomModemMode;?>">
- <input type="hidden" name="TelcomModemMode" id="TelcomModemMode" value="<?php echo $obj->{'TelcomModemMode'};?>">
- </div>
- <div class="form-group">
- <label><?php echo $lang->showWord("ip_address"); ?></label>
- <input type="text" name="TelcomIpAddress" id="TelcomIpAddress" class="form-control" value="<?php echo $obj->{'TelcomIpAddress'};?>" disabled>
- </div>
- <div class="form-group">
- <label><?php echo $lang->showWord("network_connection_status"); ?></label>
- <input type="text" readonly class="form-control" value="<?php echo $TelcomNetworkConn;?>">
- <input type="hidden" name="TelcomNetworkConn" id="TelcomNetworkConn" value="<?php echo $obj->{'TelcomNetworkConn'};?>">
- </div>
- </section>
- </article>
- <!--firewall-->
- <article class="envor-sorting-item css">
- <header><?php echo $lang->showWord("Firewall"); ?><i class="fa fa-plus"></i></header>
- <section>
- <div class="form-group">
- <label><?php echo $lang->showWord("mode"); ?></label>
- <select class="form-control" id="isEnalbleFirewall" name="isEnalbleFirewall" onchange="Firewall_changed();">
- <option value="0" <?php echo $obj->{'isEnalbleFirewall'}=="0"?"selected":""?>>Disable</option>
- <option value="1" <?php echo $obj->{'isEnalbleFirewall'}=="1"?"selected":""?>>Enable</option>
- </select>
- </div>
- <div class="form-group" id="FirewallAcceptAddrDiv">
- <div class="form-group">
- <label><?php echo 'Firewall Accept Addr0' ?></label>
- <input type="text" name="FirewallAcceptAddr0" id="FirewallAcceptAddr0" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[0];?>">
- </div>
- <div class="form-group">
- <label><?php echo 'Firewall Accept Addr1' ?></label>
- <input type="text" name="FirewallAcceptAddr1" id="FirewallAcceptAddr1" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[1];?>">
- </div>
- <div class="form-group">
- <label><?php echo 'Firewall Accept Addr2' ?></label>
- <input type="text" name="FirewallAcceptAddr2" id="FirewallAcceptAddr2" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[2];?>">
- </div>
- <div class="form-group">
- <label><?php echo 'Firewall Accept Addr3' ?></label>
- <input type="text" name="FirewallAcceptAddr3" id="FirewallAcceptAddr3" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[3];?>">
- </div>
- <div class="form-group">
- <label><?php echo 'Firewall Accept Addr4' ?></label>
- <input type="text" name="FirewallAcceptAddr4" id="FirewallAcceptAddr4" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[4];?>">
- </div>
- <div class="form-group">
- <label><?php echo 'Firewall Accept Addr5' ?></label>
- <input type="text" name="FirewallAcceptAddr5" id="FirewallAcceptAddr5" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[5];?>">
- </div>
- <div class="form-group">
- <label><?php echo 'Firewall Accept Addr6' ?></label>
- <input type="text" name="FirewallAcceptAddr6" id="FirewallAcceptAddr6" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[6];?>">
- </div>
- <div class="form-group">
- <label><?php echo 'Firewall Accept Addr7' ?></label>
- <input type="text" name="FirewallAcceptAddr7" id="FirewallAcceptAddr7" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[7];?>">
- </div>
- <div class="form-group">
- <label><?php echo 'Firewall Accept Addr8' ?></label>
- <input type="text" name="FirewallAcceptAddr8" id="FirewallAcceptAddr8" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[8];?>">
- </div>
- <div class="form-group">
- <label><?php echo 'Firewall Accept Addr9' ?></label>
- <input type="text" name="FirewallAcceptAddr9" id="FirewallAcceptAddr9" class="form-control" value="<?php echo $obj->{'FirewallAcceptAddr'}[9];?>">
- </div>
- </div>
- </section>
- </article>
- <!--Bluetooth Module-->
- <?php /* <article class="envor-sorting-item css">
- <header><?php echo $lang->showWord("bluetooth_module"); ?><i class="fa fa-plus"></i></header>
- <section>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>LoginCentralID</label>
- <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'LoginCentralID'};?>">
- <input type="hidden" name="LoginCentralID" id="LoginCentralID" value="<?php echo $obj->{'LoginCentralID'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>isLogin</label>
- <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'isLogin'};?>">
- <input type="hidden" name="isLogin" id="isLogin" value="<?php echo $obj->{'isLogin'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>isRequestStart</label>
- <input type="text" readonly class="form-control" value="<?php echo $isRequestStart;?>">
- <input type="hidden" name="isRequestStart" id="isRequestStart" value="<?php echo $obj->{'isRequestStart'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>isRequestStop</label>
- <input type="text" readonly class="form-control" value="<?php echo $isRequestStop;?>">
- <input type="hidden" name="isRequestStop" id="isRequestStop" value="<?php echo $obj->{'isRequestStop'};?>">
- </div>
- </section>
- </article> */?>
- <article class="envor-sorting-item css">
- <div align="center"><button id="save"><?php echo $lang->showWord("set")?></button></div>
- </article>
- </div>
- </div>
- </div>
- </div>
- </div>
- </section>
- </div>
- <?php
- include 'foot.php';
- ?>
- <script type="text/JavaScript">
- $(document).ready(function(){
- WifiMode_changed();
- EthDhcp_changed();
- WifiDhcp_changed();
- Firewall_changed();
- });
- document.getElementById("save").onclick = function() {
- if(formCheck())
- {
- window.location="#loadinghref";
- document.getElementById("loading").style.display="block";
- // 發送 Ajax 查詢請求並處理
- var request = new XMLHttpRequest();
- request.open("POST", "set_network_action.php");
- // POST 參數須使用 send() 發送
- var data = "Eth0DhcpClient=" + document.getElementById("Eth0DhcpClient").value+
- "&Eth0IpAddress=" + document.getElementById("Eth0IpAddress").value+
- "&Eth0SubmaskAddress=" + document.getElementById("Eth0SubmaskAddress").value+
- "&Eth0GatewayAddress=" + document.getElementById("Eth0GatewayAddress").value+
- "&WifiMode=" + document.getElementById("WifiMode").value+
- "&WifiSsid=" + escape(document.getElementById("WifiSsid").value)+
- "&WifiPassword=" + escape(document.getElementById("WifiPassword").value)+
- "&WifiBroadcastSsid=" + document.getElementById("WifiBroadcastSsid").value+
- "&WifiTargetBssidMac=" + escape(document.getElementById("WifiTargetBssidMac").value)+
- "&WifiDhcpServer=" + document.getElementById("WifiDhcpServer").value+
- "&WifiDhcpClient=" + document.getElementById("WifiDhcpClient").value+
- "&WifiIpAddress=" + document.getElementById("WifiIpAddress").value+
- "&WifiSubmaskAddress=" + document.getElementById("WifiSubmaskAddress").value+
- "&WifiGatewayAddress=" + document.getElementById("WifiGatewayAddress").value+
- "&TelcomApn=" + escape(document.getElementById("TelcomApn").value)+
- "&TelcomNetworkType=" + escape(document.getElementById("TelcomNetworkType").value)+
- "&TelcomChapPapId=" + escape(document.getElementById("TelcomChapPapId").value)+
- "&TelcomChapPapPwd=" + escape(document.getElementById("TelcomChapPapPwd").value)+
- "&TelcomIpAddress=" + document.getElementById("TelcomIpAddress").value+
- "&TelcomEnabled=" + document.getElementById("TelcomEnabled").value+
- "&isEnalbleFirewall=" + document.getElementById("isEnalbleFirewall").value+
- "&FirewallAcceptAddr0=" + document.getElementById("FirewallAcceptAddr0").value+
- "&FirewallAcceptAddr1=" + document.getElementById("FirewallAcceptAddr1").value+
- "&FirewallAcceptAddr2=" + document.getElementById("FirewallAcceptAddr2").value+
- "&FirewallAcceptAddr3=" + document.getElementById("FirewallAcceptAddr3").value+
- "&FirewallAcceptAddr4=" + document.getElementById("FirewallAcceptAddr4").value+
- "&FirewallAcceptAddr5=" + document.getElementById("FirewallAcceptAddr5").value+
- "&FirewallAcceptAddr6=" + document.getElementById("FirewallAcceptAddr6").value+
- "&FirewallAcceptAddr7=" + document.getElementById("FirewallAcceptAddr7").value+
- "&FirewallAcceptAddr8=" + document.getElementById("FirewallAcceptAddr8").value+
- "&FirewallAcceptAddr9=" + document.getElementById("FirewallAcceptAddr9").value;
- // POST 請求必須設置表頭在 open() 下面,send() 上面
- request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
- request.send(data);
- request.onreadystatechange = function() {
- // 伺服器請求完成
- if (request.readyState == 4) {
- document.getElementById("loading").style.display="none";
- // 伺服器回應成功
- if (request.status == 200 && JSON.parse(request.responseText).result=="Success") {
- alert("<?php echo $lang->showWord("done")?>");
- location.href="set_network.php";
- } else {
- alert(JSON.parse(request.responseText).message);
- }
- request = null;
- }
- }
- }
- }
- function formCheck()
- {
- if(document.getElementById("Eth0IpAddress").value != ""){
- if(!ValidateIPaddress("Eth0IpAddress")) return false;
- }
- if(document.getElementById("Eth0SubmaskAddress").value != ""){
- if(!ValidateIPaddress("Eth0SubmaskAddress")) return false;
- }
- if(document.getElementById("Eth0GatewayAddress").value != ""){
- if(!ValidateIPaddress("Eth0GatewayAddress")) return false;
- }
- // if(document.getElementById("Eth1IpAddress").value != ""){
- // if(!ValidateIPaddress("Eth1IpAddress")) return false;
- // }
- // if(document.getElementById("Eth1SubmaskAddress").value != ""){
- // if(!ValidateIPaddress("Eth1SubmaskAddress")) return false;
- // }
- // if(document.getElementById("Eth1GatewayAddress").value != ""){
- // if(!ValidateIPaddress("Eth1GatewayAddress")) return false;
- // }
- if(document.getElementById("WifiIpAddress").value != ""){
- if(!ValidateIPaddress("WifiIpAddress")) return false;
- }
- if(document.getElementById("WifiSubmaskAddress").value != ""){
- if(!ValidateIPaddress("WifiSubmaskAddress")) return false;
- }
- if(document.getElementById("WifiGatewayAddress").value != ""){
- if(!ValidateIPaddress("WifiGatewayAddress")) return false;
- }
- if(document.getElementById("TelcomIpAddress").value != ""){
- if(!ValidateIPaddress("TelcomIpAddress")) return false;
- }
- return true;
- }
- function WifiMode_changed(){
- if(document.getElementById("WifiMode").value=="0"){
- document.getElementById("WifiDhcpServer").disabled=true;
- document.getElementById("WifiDhcpClient").disabled=true;
- document.getElementById("WifiSsid").disabled=true;
- document.getElementById("WifiPassword").disabled=true;
- document.getElementById("WifiIpAddress").disabled=true;
- document.getElementById("WifiSubmaskAddress").disabled=true;
- document.getElementById("WifiGatewayAddress").disabled=true;
- document.getElementById("WifiDhcpServerDiv").style.display="none";
- document.getElementById("WifiDhcpClientDiv").style.display="none";
- document.getElementById("WifiSsidDiv").style.display="none";
- document.getElementById("WifiPasswordDiv").style.display="none";
- document.getElementById("WifiBroadcastSsidDiv").style.display="none";
- document.getElementById("WifiTargetBssidMacDiv").style.display="none";
- document.getElementById("WifiRssiDiv").style.display="none";
- document.getElementById("WifiMacAddressDiv").style.display="none";
- document.getElementById("WifiIpAddressDiv").style.display="none";
- document.getElementById("WifiSubmaskAddressDiv").style.display="none";
- document.getElementById("WifiGatewayAddressDiv").style.display="none";
- document.getElementById("WifiNetworkConnDiv").style.display="none";
- }
- if(document.getElementById("WifiMode").value=="1"){
- document.getElementById("WifiDhcpServer").disabled=true;
- document.getElementById("WifiDhcpClient").disabled=false;
- document.getElementById("WifiSsid").disabled=false;
- document.getElementById("WifiPassword").disabled=false;
- document.getElementById("WifiSsid").value="<?php echo $obj->{'WifiSsid'};?>";
- document.getElementById("WifiPassword").value="<?php echo $obj->{'WifiPassword'};?>";
- document.getElementById("WifiIpAddress").disabled=false;
- document.getElementById("WifiSubmaskAddress").disabled=false;
- document.getElementById("WifiGatewayAddress").disabled=false;
- document.getElementById("WifiIpAddress").value="<?php echo $obj->{'WifiIpAddress'};?>";
- document.getElementById("WifiSubmaskAddress").value="<?php echo $obj->{'WifiSubmaskAddress'};?>";
- document.getElementById("WifiGatewayAddress").value="<?php echo $obj->{'WifiGatewayAddress'};?>";
- document.getElementById("WifiDhcpServerDiv").style.display="none";
- document.getElementById("WifiDhcpClientDiv").style.display="block";
- document.getElementById("WifiSsidDiv").style.display="block";
- document.getElementById("WifiPasswordDiv").style.display="block";
- document.getElementById("WifiBroadcastSsidDiv").style.display="none";
- document.getElementById("WifiTargetBssidMacDiv").style.display="block";
- document.getElementById("WifiRssiDiv").style.display="block";
- document.getElementById("WifiMacAddressDiv").style.display="block";
- document.getElementById("WifiIpAddressDiv").style.display="block";
- document.getElementById("WifiSubmaskAddressDiv").style.display="block";
- document.getElementById("WifiGatewayAddressDiv").style.display="block";
- document.getElementById("WifiNetworkConnDiv").style.display="block";
- }
- if(document.getElementById("WifiMode").value=="2"){
- document.getElementById("WifiDhcpServer").disabled=false;
- document.getElementById("WifiDhcpClient").disabled=true;
- document.getElementById("WifiSsid").disabled=true;
- document.getElementById("WifiPassword").disabled=true;
- document.getElementById("WifiSsid").value="<?php echo $ModelName.$SerialNumber?>";
- document.getElementById("WifiPassword").value="";
- document.getElementById("WifiIpAddress").disabled=true;
- document.getElementById("WifiSubmaskAddress").disabled=true;
- document.getElementById("WifiGatewayAddress").disabled=true;
- document.getElementById("WifiDhcpServerDiv").style.display="block";
- document.getElementById("WifiDhcpClientDiv").style.display="none";
- document.getElementById("WifiSsidDiv").style.display="block";
- document.getElementById("WifiPasswordDiv").style.display="block";
- document.getElementById("WifiBroadcastSsidDiv").style.display="block";
- document.getElementById("WifiTargetBssidMacDiv").style.display="none";
- document.getElementById("WifiRssiDiv").style.display="block";
- document.getElementById("WifiMacAddressDiv").style.display="block";
- document.getElementById("WifiIpAddressDiv").style.display="none";
- document.getElementById("WifiSubmaskAddressDiv").style.display="none";
- document.getElementById("WifiGatewayAddressDiv").style.display="none";
- document.getElementById("WifiNetworkConnDiv").style.display="block";
- }
- WifiDhcp_changed();
- }
- function EthDhcp_changed(){
- if(document.getElementById("Eth0DhcpClient").value=="0"){
- document.getElementById("Eth0IpAddress").disabled=true;
- document.getElementById("Eth0SubmaskAddress").disabled=true;
- document.getElementById("Eth0GatewayAddress").disabled=true;
- }
- if(document.getElementById("Eth0DhcpClient").value=="1"){
- document.getElementById("Eth0IpAddress").disabled=false;
- document.getElementById("Eth0SubmaskAddress").disabled=false;
- document.getElementById("Eth0GatewayAddress").disabled=false;
- document.getElementById("Eth0IpAddress").value="<?php echo $obj->{'Eth0IpAddress'};?>";
- document.getElementById("Eth0SubmaskAddress").value="<?php echo $obj->{'Eth0SubmaskAddress'};?>";
- document.getElementById("Eth0GatewayAddress").value="<?php echo $obj->{'Eth0GatewayAddress'};?>";
- }
- }
- function WifiDhcp_changed(){
- if(document.getElementById("WifiDhcpClient").disabled===false && document.getElementById("WifiDhcpClient").value=="0"){
- document.getElementById("WifiIpAddress").disabled=true;
- document.getElementById("WifiSubmaskAddress").disabled=true;
- document.getElementById("WifiGatewayAddress").disabled=true;
- }
- if(document.getElementById("WifiDhcpClient").disabled===false && document.getElementById("WifiDhcpClient").value=="1"){
- document.getElementById("WifiIpAddress").disabled=false;
- document.getElementById("WifiSubmaskAddress").disabled=false;
- document.getElementById("WifiGatewayAddress").disabled=false;
- document.getElementById("WifiIpAddress").value="<?php echo $obj->{'WifiIpAddress'};?>";
- document.getElementById("WifiSubmaskAddress").value="<?php echo $obj->{'WifiSubmaskAddress'};?>";
- document.getElementById("WifiGatewayAddress").value="<?php echo $obj->{'WifiGatewayAddress'};?>";
- }
- }
-
- function Firewall_changed(){
- if(document.getElementById("isEnalbleFirewall").value=="1"){
- document.getElementById("FirewallAcceptAddrDiv").style.display="block";
- }
- else{
- document.getElementById("FirewallAcceptAddrDiv").style.display="none";
- }
- }
- function isNumberKey(evt)
- {
- var charCode = (evt.which) ? evt.which : event.keyCode
- if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 46))
- return false;
- return true;
- }
- function ValidateIPaddress(id) {
- var ipaddress = document.getElementById(id).value;
- 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)) {
- return true;
- }
- alert("You have entered an invalid IP address on " + id + "!")
- document.getElementById(id).focus();
- return false;
- }
- function scan_wifi()
- {
- window.open("scan_wifi.php","_blank","height=200,width=400, status=yes,toolbar=no,menubar=no,location=no");
- }
- $("#scan").fancybox({
- 'type' : 'iframe',
- 'iframe' : {
- 'css' : {
- 'width' : '600px',
- 'height': '200px'
- }
- }
- });
- $("#checkEye1").click(function () {
- if($(this).hasClass('fa-eye')){
- $("#WifiPassword").attr('type', 'text');
- }else{
- $("#WifiPassword").attr('type', 'password');
- }
- $("#checkEye1").toggleClass('fa-eye').toggleClass('fa-eye-slash');
- });
- $("#checkEye2").click(function () {
- if($(this).hasClass('fa-eye')){
- $("#TelcomChapPapPwd").attr('type', 'text');
- }else{
- $("#TelcomChapPapPwd").attr('type', 'password');
- }
- $("#checkEye2").toggleClass('fa-eye').toggleClass('fa-eye-slash');
- });
- </script>
- </html>
|