123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489 |
- <?php
- ini_set('error_reporting', E_ALL | E_STRICT);
- $tag_header = 'set';
- include 'head.php';
- $obj = json_decode(trim($output[2]));
- $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;
- }
- ?>
- <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>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">
- <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>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>IP Address</label>
- <input type="text" name="Eth0IpAddress" id="Eth0IpAddress" class="form-control" value="<?php echo $obj->{'Eth0IpAddress'};?>">
- </div>
- <div class="form-group">
- <label>Submask Address</label>
- <input type="text" name="Eth0SubmaskAddress" id="Eth0SubmaskAddress" class="form-control" value="<?php echo $obj->{'Eth0SubmaskAddress'};?>">
- </div>
- <div class="form-group">
- <label>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>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":""?>>Acess Point</option>
- <?php /* <option value="3" <?php echo $obj->{'WifiMode'}=="3"?"selected":""?>>Ad-Hoc</option>*/?>
- </select>
- </div>
- <div class="form-group">
- <label>SSID</label>
- <input type="text" name="WifiSsid" id="WifiSsid" class="form-control" value="<?php echo $obj->{'WifiSsid'};?>">
- </div>
- <div class="form-group">
- <label>Password</label>
- <input type="text" name="WifiPassword" id="WifiPassword" class="form-control" value="<?php echo $obj->{'WifiPassword'};?>">
- </div>
- <div class="form-group">
- <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">
- <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">
- <label>DHCP Client</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">
- <label>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">
- <label>IP Address</label>
- <input type="text" name="WifiIpAddress" id="WifiIpAddress" class="form-control" value="<?php echo $obj->{'WifiIpAddress'};?>">
- </div>
- <div class="form-group">
- <label>Submask Address</label>
- <input type="text" name="WifiSubmaskAddress" id="WifiSubmaskAddress" class="form-control" value="<?php echo $obj->{'WifiSubmaskAddress'};?>">
- </div>
- <div class="form-group">
- <label>Gateway Address</label>
- <input type="text" name="WifiGatewayAddress" id="WifiGatewayAddress" class="form-control" value="<?php echo $obj->{'WifiGatewayAddress'};?>">
- </div>
- <div class="form-group">
- <label>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>APN</label>
- <input type="text" name="TelcomApn" id="TelcomApn" class="form-control" value="<?php echo $obj->{'TelcomApn'};?>">
- </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>Chap Pap Pwd</label>
- <input type="text" name="TelcomChapPapPwd" id="TelcomChapPapPwd" class="form-control" value="<?php echo $obj->{'TelcomChapPapPwd'};?>">
- </div>
- <div class="form-group">
- <label>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>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>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>IP Address</label>
- <input type="text" name="TelcomIpAddress" id="TelcomIpAddress" class="form-control" value="<?php echo $obj->{'TelcomIpAddress'};?>">
- </div>
- <div class="form-group">
- <label>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>
- <!--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();
- });
- document.getElementById("save").onclick = function() {
- if(formCheck())
- {
- window.location="
- document.getElementById("loading").style.display="block";
-
- var request = new XMLHttpRequest();
- request.open("POST", "set_network_action.php");
-
- 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=" + document.getElementById("WifiSsid").value+
- "&WifiPassword=" + document.getElementById("WifiPassword").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=" + document.getElementById("TelcomApn").value+
- "&TelcomChapPapId=" + document.getElementById("TelcomChapPapId").value+
- "&TelcomChapPapPwd=" + document.getElementById("TelcomChapPapPwd").value+
- "&TelcomIpAddress=" + document.getElementById("TelcomIpAddress").value;
-
- 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("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("WifiDhcpServer").selectedIndex=1;
- document.getElementById("WifiDhcpClient").selectedIndex=1;
- document.getElementById("WifiSsid").disabled=true;
- document.getElementById("WifiPassword").disabled=true;
- document.getElementById("WifiSsid").value="";
- document.getElementById("WifiPassword").value="";
- }
- if(document.getElementById("WifiMode").value=="1"){
- document.getElementById("WifiDhcpServer").disabled=true;
- document.getElementById("WifiDhcpClient").disabled=false;
- document.getElementById("WifiDhcpServer").selectedIndex=1;
- document.getElementById("WifiDhcpClient").selectedIndex=0;
- 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'};?>";
- }
- if(document.getElementById("WifiMode").value=="2"){
- document.getElementById("WifiDhcpServer").disabled=false;
- document.getElementById("WifiDhcpClient").disabled=true;
- document.getElementById("WifiDhcpServer").selectedIndex=0;
- document.getElementById("WifiDhcpClient").selectedIndex=1;
- document.getElementById("WifiSsid").disabled=true;
- document.getElementById("WifiPassword").disabled=true;
- document.getElementById("WifiSsid").value="";
- document.getElementById("WifiPassword").value="";
- }
- }
- 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;
- }
- </script>
- </html>
|