123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440 |
- <?php
- ini_set('error_reporting', E_ALL | E_STRICT);
- $tag_header = 'set';
- include 'head.php';
- $obj = json_decode(trim($output[2]));//var_dump($obj);
- $InternetConn='';
- switch ($obj->{'InternetConn'}){
- case 0:
- $InternetConn='disconnected';
- break;
- case 1:
- $InternetConn='connected';
- break;
- }
- $WifiNetworkConn='';
- switch ($obj->{'WifiNetworkConn'}){
- case 0:
- $WifiNetworkConn='disconnected';
- break;
- case 1:
- $WifiNetworkConn='connected';
- break;
- }
- $TelcomNetworkConn='';
- switch ($obj->{'TelcomNetworkConn'}){
- case 0:
- $TelcomNetworkConn='disconnected';
- break;
- case 1:
- $TelcomNetworkConn='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='Unknow';
- break;
- }
- ?>
- <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
- //-->
- <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>InternetConn</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>
- <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">
- <header><?php echo $lang->showWord("ethernet_interface"); ?><i class="fa fa-plus"></i></header>
- <section>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>Eth0DhcpClient</label>
- <select class="form-control" id="Eth0DhcpClient" name="Eth0DhcpClient">
- <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" style="display:<?php echo $am101;?>">
- <label>Eth0MacAddress</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" style="display:<?php echo $am101;?>">
- <label>Eth0IpAddress</label>
- <input type="text" name="Eth0IpAddress" id="Eth0IpAddress" class="form-control" value="<?php echo $obj->{'Eth0IpAddress'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>Eth0SubmaskAddress</label>
- <input type="text" name="Eth0SubmaskAddress" id="Eth0SubmaskAddress" class="form-control" value="<?php echo $obj->{'Eth0SubmaskAddress'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>Eth0GatewayAddress</label>
- <input type="text" name="Eth0GatewayAddress" id="Eth0GatewayAddress" class="form-control" value="<?php echo $obj->{'Eth0GatewayAddress'};?>">
- </div>
- </section>
- </article>
- <!--Ethernet Interface1-->
- <article class="envor-sorting-item css">
- <header><?php echo $lang->showWord("ethernet_interface"); ?><i class="fa fa-plus"></i></header>
- <section>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <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" style="display:<?php echo $am101;?>">
- <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" style="display:<?php echo $am101;?>">
- <label>Eth1IpAddress</label>
- <input type="text" name="Eth1IpAddress" id="Eth1IpAddress" class="form-control" value="<?php echo $obj->{'Eth1IpAddress'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>Eth1SubmaskAddress</label>
- <input type="text" name="Eth1SubmaskAddress" id="Eth1SubmaskAddress" class="form-control" value="<?php echo $obj->{'Eth1SubmaskAddress'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <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">
- <header><?php echo $lang->showWord("WiFi_module"); ?><i class="fa fa-plus"></i></header>
- <section>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>WifiMode</label>
- <select class="form-control" id="WifiMode" name="WifiMode">
- <option value="0" <?php echo $obj->{'WifiMode'}==0?"selected":""?>>disable</option>
- <option value="1" <?php echo $obj->{'WifiMode'}==1?"selected":""?>>Infrastructure client</option>
- <option value="2" <?php echo $obj->{'WifiMode'}==2?"selected":""?>>Infrastructure server</option>
- <option value="3" <?php echo $obj->{'WifiMode'}==3?"selected":""?>>Ad-Hoc</option>
- </select>
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>WifiSsid</label>
- <input type="text" name="WifiSsid" id="WifiSsid" class="form-control" value="<?php echo $obj->{'WifiSsid'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>WifiPassword</label>
- <input type="text" name="WifiPassword" id="WifiPassword" class="form-control" value="<?php echo $obj->{'WifiPassword'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>WifiRssi</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" style="display:<?php echo $am101;?>">
- <label>WifiDhcpServer</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" style="display:<?php echo $am101;?>">
- <label>WifiDhcpClient</label>
- <select class="form-control" id="WifiDhcpClient" name="WifiDhcpClient">
- <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" style="display:<?php echo $am101;?>">
- <label>WifiMacAddress</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" style="display:<?php echo $am101;?>">
- <label>WifiIpAddress</label>
- <input type="text" name="WifiIpAddress" id="WifiIpAddress" class="form-control" value="<?php echo $obj->{'WifiIpAddress'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>WifiSubmaskAddress</label>
- <input type="text" name="WifiSubmaskAddress" id="WifiSubmaskAddress" class="form-control" value="<?php echo $obj->{'WifiSubmaskAddress'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>WifiGatewayAddress</label>
- <input type="text" name="WifiGatewayAddress" id="WifiGatewayAddress" class="form-control" value="<?php echo $obj->{'WifiGatewayAddress'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>WifiNetworkConn</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">
- <header><?php echo $lang->showWord("3G/4G_module"); ?><i class="fa fa-plus"></i></header>
- <section>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>TelcomApn</label>
- <input type="text" name="TelcomApn" id="TelcomApn" class="form-control" value="<?php echo $obj->{'TelcomApn'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>TelcomRssi</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" style="display:<?php echo $am101;?>">
- <label>TelcomChapPapId</label>
- <input type="text" name="TelcomChapPapId" id="TelcomChapPapId" class="form-control" value="<?php echo $obj->{'TelcomChapPapId'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>TelcomChapPapPwd</label>
- <input type="text" name="TelcomChapPapPwd" id="TelcomChapPapPwd" class="form-control" value="<?php echo $obj->{'TelcomChapPapPwd'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>TelcomModemImei</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" style="display:<?php echo $am101;?>">
- <label>TelcomSimImsi</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" style="display:<?php echo $am101;?>">
- <label>TelcomSimIccid</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" style="display:<?php echo $am101;?>">
- <label>TelcomSimStatus</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" style="display:<?php echo $am101;?>">
- <label>TelcomModemMode</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" style="display:<?php echo $am101;?>">
- <label>TelcomIpAddress</label>
- <input type="text" name="TelcomIpAddress" id="TelcomIpAddress" class="form-control" value="<?php echo $obj->{'TelcomIpAddress'};?>">
- </div>
- <div class="form-group" style="display:<?php echo $am101;?>">
- <label>TelcomNetworkConn</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>
- <!--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.getElementById("save").onclick = function() {
- if(formCheck())
- {
- // 發送 Ajax 查詢請求並處理
- var request = new XMLHttpRequest();
- request.open("POST", "set_network_action.php");
- // POST 參數須使用 send() 發送
- var data = "InternetConn=" + document.getElementById("InternetConn").value +
- "&FtpServer=" + document.getElementById("FtpServer").value +
- "&Eth0DhcpClient=" + document.getElementById("Eth0DhcpClient").value+
- "&Eth0MacAddress=" + document.getElementById("Eth0MacAddress").value+
- "&Eth0IpAddress=" + document.getElementById("Eth0IpAddress").value+
- "&Eth0SubmaskAddress=" + document.getElementById("Eth0SubmaskAddress").value+
- "&Eth0GatewayAddress=" + document.getElementById("Eth0GatewayAddress").value+
- "&Eth1DhcpClient=" + document.getElementById("Eth1DhcpClient").value+
- "&Eth1MacAddress=" + document.getElementById("Eth1MacAddress").value+
- "&Eth1IpAddress=" + document.getElementById("Eth1IpAddress").value+
- "&Eth1SubmaskAddress=" + document.getElementById("Eth1SubmaskAddress").value+
- "&Eth1GatewayAddress=" + document.getElementById("Eth1GatewayAddress").value+
- "&WifiMode=" + document.getElementById("WifiMode").value+
- "&WifiSsid=" + document.getElementById("WifiSsid").value+
- "&WifiPassword=" + document.getElementById("WifiPassword").value+
- "&WifiRssi=" + document.getElementById("WifiRssi").value+
- "&WifiDhcpServer=" + document.getElementById("WifiDhcpServer").value+
- "&WifiDhcpClient=" + document.getElementById("WifiDhcpClient").value+
- "&WifiMacAddress=" + document.getElementById("WifiMacAddress").value+
- "&WifiIpAddress=" + document.getElementById("WifiIpAddress").value+
- "&WifiSubmaskAddress=" + document.getElementById("WifiSubmaskAddress").value+
- "&WifiGatewayAddress=" + document.getElementById("WifiGatewayAddress").value+
- "&TelcomApn=" + document.getElementById("TelcomApn").value+
- "&TelcomRssi=" + document.getElementById("TelcomRssi").value+
- "&TelcomChapPapId=" + document.getElementById("TelcomChapPapId").value+
- "&TelcomChapPapPwd=" + document.getElementById("TelcomChapPapPwd").value+
- "&TelcomModemImei=" + document.getElementById("TelcomModemImei").value+
- "&TelcomSimImsi=" + document.getElementById("TelcomSimImsi").value+
- "&TelcomSimIccid=" + document.getElementById("TelcomSimIccid").value+
- "&TelcomSimStatus=" + document.getElementById("TelcomSimStatus").value+
- "&TelcomModemMode=" + document.getElementById("TelcomModemMode").value+
- "&TelcomIpAddress=" + document.getElementById("TelcomIpAddress").value;
-
- // POST 請求必須設置表頭在 open() 下面,send() 上面
- request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
- request.send(data);
- request.onreadystatechange = function() {
- // 伺服器請求完成
- if (request.readyState == 4) {
- // 伺服器回應成功
- if (request.status == 200) {
- alert("<?php echo $lang->showWord("done")?>");
- //location.reload();
- // getInfo();
- } else {
- alert("發生錯誤" + request.status);
- }
- }
- }
- }
- }
-
- function formCheck()
- {
- // var ChargerID = document.getElementById("new_id").value;
- // var serverAddr = document.getElementById("new_server").value;
- // var serverPort = document.getElementById("new_server_port").value;
-
-
-
- // if(ChargerID.length < 6)
- // {
- // alert("Charger ID format is not correct, ID length is required 6 atleast.");
- // ChargerID.focus();
- // return false;
- // }
-
- // if(serverAddr.length <=0)
- // {
- // alert("Please check remote server address!");
- // serverAddr.focus();
- // return false;
- // }
-
- // if((serverPort.value >65535) || (serverPort.value<0))
- // {
- // alert("Please check remote server port, it's must <= 65535!");
- // serverPort.focus();
- // return false;
- // }
-
- return true;
- }
- function isNumberKey(evt)
- {
- var charCode = (evt.which) ? evt.which : event.keyCode
-
- if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 46))
- return false;
-
- return true;
- }
-
- </script>
- </html>
|