head.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
  3. <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
  4. <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
  5. <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
  6. <?php
  7. ini_set('error_reporting', E_ERROR | E_WARNING | E_PARSE);
  8. if(file_exists("/Storage/settings")){
  9. exec("cp /Storage/settings settings");
  10. }
  11. $json = json_decode(file_get_contents("settings"), true);
  12. include 'valid.php';
  13. $valid = new Valid;
  14. //=======================================
  15. // Auth
  16. //=======================================
  17. if(!$valid->validUser($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']))
  18. {
  19. header('WWW-Authenticate: Basic realm="My Realm"');
  20. header('HTTP/1.0 401 Unauthorized');
  21. echo 'Text to send if user hits Cancel button';
  22. exit;
  23. }
  24. include 'lang.php';
  25. $display2="block";
  26. $lang = new Lang;
  27. $lang->getLang();
  28. $acgun=array('1','2','3','4','5','6','7','8');
  29. //chdir("/home/phihong/Module_WebService");
  30. chdir("/root");
  31. exec("'./WebService' 'query'",$output,$return_var);
  32. if(count($output)==0){
  33. echo '<script>alert("Something went wrong on machine");</script>';
  34. echo "Something went wrong on machine";
  35. exit;
  36. }
  37. if(trim($output[0])=="InitShareMemory Error"){
  38. echo '<script>alert("InitShareMemory Error");</script>';
  39. echo "InitShareMemory Error";
  40. exit;
  41. }
  42. $model=json_decode(trim($output[0]))->{'ModelName'};
  43. if(substr($model,0,1)=="A"){
  44. if(substr($model,10,1)=="E" || substr($model,10,1)=="W" || substr($model,10,1)=="T" || substr($model,10,1)=="U" || substr($model,10,1)=="D" || substr($model,10,1)=="A" || substr($model,10,1)=="F"){
  45. $ModelName='AC Net';
  46. }
  47. else if(substr($model,10,1)=="0" || substr($model,10,1)=="R" || substr($model,10,1)=="B"){
  48. $ModelName='AC Eco';
  49. }
  50. }
  51. else if(substr($model,0,1)=="D"){
  52. if(in_array(substr($model,7,1),$acgun)||in_array(substr($model,8,1),$acgun)||in_array(substr($model,9,1),$acgun)){
  53. $ModelName='DC_AC';
  54. }else{
  55. $ModelName='DC';
  56. }
  57. }
  58. if(substr($model,10,1)=="E" || substr($model,10,1)=="U"){
  59. $showEthernet="block";
  60. $showWifi="none";
  61. $showTelcom="none";
  62. }
  63. if(substr($model,10,1)=="W"){
  64. $showEthernet="block";
  65. $showWifi="block";
  66. $showTelcom="none";
  67. }
  68. if(substr($model,10,1)=="T"){
  69. $showEthernet="block";
  70. $showWifi="none";
  71. $showTelcom="block";
  72. }
  73. if(substr($model,10,1)=="D" || substr($model,10,1)=="A"){
  74. $showEthernet="block";
  75. $showWifi="block";
  76. $showTelcom="block";
  77. }
  78. if(substr($model,10,1)=="F"){
  79. $showEthernet="none";
  80. $showWifi="block";
  81. $showTelcom="none";
  82. }
  83. //$ModelName='AC Net';
  84. //$ModelName='AC Eco';
  85. // $ModelName='DC';
  86. switch ($ModelName){
  87. case 'AC Net':
  88. $am111='block';
  89. $am101='block';
  90. $am100='block';
  91. $am001='none';
  92. break;
  93. case 'AC Eco':
  94. $am111='block';
  95. $am101='none';
  96. $am100='block';
  97. $am001='none';
  98. break;
  99. case 'DC':
  100. $am111='block';
  101. $am101='block';
  102. $am100='none';
  103. $am001='block';
  104. break;
  105. case 'DC_AC':
  106. $am111='block';
  107. $am101='block';
  108. $am100='block';
  109. $am001='block';
  110. break;
  111. default:
  112. $am111='block';
  113. $am101='block';
  114. $am100='block';
  115. $am001='block';
  116. break;
  117. }
  118. if(substr($model,4,3)=="122"){
  119. $am120='none';
  120. }
  121. else{
  122. $am120='none';
  123. }
  124. if(strstr($_SERVER['PHP_SELF'],"network") || strstr($_SERVER['PHP_SELF'],"backend")){
  125. $display2="none";
  126. }
  127. ?>
  128. <head>
  129. <meta charset="utf-8">
  130. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  131. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  132. <meta name="description" content="EV System Configuration">
  133. <link rel="shortcut icon" href="favicon.ico">
  134. <title>EV System Configuration</title>
  135. <!--
  136. * Google Fonts
  137. //-->
  138. <link href='css/googleRaleway.css' rel='stylesheet' type='text/css'>
  139. <link href='css/googleLato.css' rel='stylesheet' type='text/css'>
  140. <!-- Bootstrap core CSS -->
  141. <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
  142. <!-- Custom CSS -->
  143. <link href="css/animate.css" rel="stylesheet" type="text/css">
  144. <link href="css/jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css">
  145. <link href="css/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  146. <link rel="stylesheet" href="css/colorbox-skins/1/colorbox.css" type="text/css">
  147. <link href="css/main.css" rel="stylesheet" type="text/css">
  148. <link href="css/header/h3.css" rel="stylesheet" type="text/css">
  149. <link href="css/responsive.css" rel="stylesheet" type="text/css">
  150. <link href="css/color1.css" rel="stylesheet" type="text/css" id="envor-site-color">
  151. <link href="css/rivathemes.css" rel="stylesheet" type="text/css">
  152. <link href="css/jquery.fancybox.min.css" rel="stylesheet" type="text/css">
  153. <!-- LayerSlider styles -->
  154. <link rel="stylesheet" href="css/layerslider/css/layerslider.css" type="text/css">
  155. <!-- the main fileinput plugin css -->
  156. <link href="css/fileinput.min.css" rel="stylesheet" type="text/css">
  157. <link href="css/fileinput.css" media="all" rel="stylesheet" type="text/css"/>
  158. <!-- Just for debugging purposes. Don't actually copy this line! -->
  159. <!--[if lt IE 9]><script src="js/vendor/ie8-responsive-file-warning.js"></script><![endif]-->
  160. <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  161. <!--[if lt IE 9]>
  162. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  163. <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  164. <![endif]-->
  165. <?php /* <link rel="stylesheet" href="css/font-awesome.min.css">*/?>
  166. <link href="css/prettify-1.0.css" rel="stylesheet">
  167. <link rel="stylesheet" type="text/css" href="css/bootstrap-datetimepicker.css" />
  168. <!-- <script src="js/jquery-1.8.3.min.js"></script>
  169. <script src="js/moment.js"></script>
  170. <script src="js/bootstrap.min.js"></script>
  171. <script src="js/bootstrap-datetimepicker.min.js"></script>
  172. <!-- <script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>-->
  173. <!-- <script src="js/twitterFetcher_v10_min.js"></script>-->
  174. <script>
  175. function changeModel(e){
  176. location.href="<?php echo $_SERVER['PHP_SELF']!=""?$_SERVER['PHP_SELF']:"set_system.php"?>?ModelName="+e.value;
  177. }
  178. </script>
  179. </head>
  180. <body>
  181. <!--[if lt IE 7]>
  182. <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
  183. <![endif]-->
  184. <!--
  185. Scroll to the top
  186. //-->
  187. <div id="to-the-top"><i class="fa fa-chevron-up"></i></div>
  188. <!--
  189. Envor mobile menu start
  190. //-->
  191. <i class="glyphicon glyphicon-align-justify" id="envor-mobile-menu-btn"></i>
  192. <div class="envor-mobile-menu" id="envor-mobile-menu">
  193. <h3 style="color: #fff;">menu</h3>
  194. <nav>
  195. <ul>
  196. <li<?php echo ($tag_header=='set'?' class="active"':''); ?>>
  197. <a href="#" accesskey="1" title="Set"><?php echo $lang->showWord("set"); ?></a>
  198. <ul>
  199. <li>
  200. <a href="set_system.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>"><?php echo $lang->showWord("system"); ?></a>
  201. </li>
  202. <li>
  203. <a href="set_charging.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>"><?php echo $lang->showWord("charging"); ?></a>
  204. </li>
  205. <li>
  206. <a href="set_network.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>" style="display:<?php echo $am101;?>"><?php echo $lang->showWord("network"); ?></a>
  207. </li>
  208. <li>
  209. <a href="set_backend.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>" style="display:<?php echo $am101;?>"><?php echo $lang->showWord("backend"); ?></a>
  210. </li>
  211. </ul>
  212. </li>
  213. <li<?php echo ($tag_header=='upgrade'?' class="active"':''); ?>>
  214. <a href="upgrade_iso.php" accesskey="2" title="Upgrade"><?php echo $lang->showWord("upgrade"); ?></a>
  215. </li>
  216. <li<?php echo ($tag_header=='other'?' class="active"':''); ?>>
  217. <a href="#" accesskey="3" title="Other"><?php echo $lang->showWord("other"); ?></a>
  218. <ul>
  219. <?php /* <li>
  220. <a href="set_contact.php"><?php echo $lang->showWord("contact_info"); ?></a>
  221. </li>*/?>
  222. <li>
  223. <a href="log_download.php"><?php echo $lang->showWord("log_download"); ?></a>
  224. </li>
  225. <li>
  226. <a href="set_passwd.php"><?php echo $lang->showWord("passwd"); ?></a>
  227. </li>
  228. <li>
  229. <a href="set_restart.php"><?php echo $lang->showWord("restart"); ?></a>
  230. </li>
  231. </ul>
  232. </li>
  233. <li<?php echo ($tag_header=='language'?' class="active"':''); ?>>
  234. <a href="#" accesskey="4" title="Language"><?php echo $lang->showWord("language"); ?></a>
  235. <ul>
  236. <li>
  237. <a href="switch_lang.php?lang=ENG">English</a>
  238. </li>
  239. <li>
  240. <a href="switch_lang.php?lang=TW">繁體中文</a>
  241. </li>
  242. <li>
  243. <a href="switch_lang.php?lang=CN">简体中文</a>
  244. </li>
  245. </ul>
  246. </li>
  247. </ul>
  248. </nav>
  249. </div>
  250. <header class="envor-header envor-header-3">
  251. <!--
  252. Header Bg start
  253. //-->
  254. <div class="envor-header-bg">
  255. <div class="container">
  256. <div class="row">
  257. <div class="col-lg-12">
  258. <div class="envor-relative">
  259. <!--
  260. Site Logo start
  261. //-->
  262. <a href="index.php">
  263. <div class="envor-logo">
  264. <?php /* <h2><?php echo $lang->showWord("vender_name"); ?></h2>*/?>
  265. <h2>EV Quick Charger</h2>
  266. <!-- <img src="img/logo.png" alt="PHIHONG">-->
  267. <!--
  268. Site Logo end
  269. //-->
  270. </div>
  271. </a>
  272. </div>
  273. </div>
  274. </div>
  275. </div>
  276. <!--
  277. Header Bg end
  278. //-->
  279. </div>
  280. <!--
  281. Site Menu start
  282. //-->
  283. <div class="envor-desktop-menu-bg" id="envor-header-menu">
  284. <div class="container">
  285. <div class="row">
  286. <div class="col-lg-12">
  287. <!--
  288. Desktop Menu start
  289. //-->
  290. <nav>
  291. <ul>
  292. <li <?php echo ($tag_header=='set'?'class="active"':''); ?> >
  293. <a href="#" accesskey="1" title="Set"><?php echo $lang->showWord("set"); ?></a>
  294. <ul>
  295. <li>
  296. <a href="set_system.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>"><?php echo $lang->showWord("system"); ?></a>
  297. </li>
  298. <li>
  299. <a href="set_charging.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>"><?php echo $lang->showWord("charging"); ?></a>
  300. </li>
  301. <li>
  302. <a href="set_network.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>" style="display:<?php echo $am101;?>"><?php echo $lang->showWord("network"); ?></a>
  303. </li>
  304. <li>
  305. <a href="set_backend.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>" style="display:<?php echo $am101;?>"><?php echo $lang->showWord("backend"); ?></a>
  306. </li>
  307. </ul>
  308. </li>
  309. <li<?php echo ($tag_header=='upgrade'?' class="active"':''); ?>>
  310. <a href="upgrade_iso.php" accesskey="2" title="Upgrade"><?php echo $lang->showWord("upgrade"); ?></a>
  311. <?php /* <a href="#" accesskey="2" title="Upgrade"><?php echo $lang->showWord("upgrade"); ?></a>
  312. <ul>
  313. <li>
  314. <a href="upgrade_iso.php"><?php echo "Image"; ?></a>
  315. </li>
  316. </ul> */?>
  317. </li>
  318. <li<?php echo ($tag_header=='other'?' class="active"':''); ?>>
  319. <a href="#" accesskey="3" title="Other"><?php echo $lang->showWord("other"); ?></a>
  320. <ul>
  321. <?php /* <li>
  322. <a href="set_contact.php"><?php echo $lang->showWord("contact_info"); ?></a>
  323. </li>*/?>
  324. <li>
  325. <a href="log_download.php"><?php echo $lang->showWord("log_download"); ?></a>
  326. </li>
  327. <li>
  328. <a href="set_passwd.php"><?php echo $lang->showWord("passwd"); ?></a>
  329. </li>
  330. <li>
  331. <a href="set_restart.php"><?php echo $lang->showWord("restart"); ?></a>
  332. </li>
  333. </ul>
  334. </li>
  335. <li<?php echo ($tag_header=='language'?' class="active"':''); ?>>
  336. <a href="#" accesskey="4" title="Language"><?php echo $lang->showWord("language"); ?></a>
  337. <ul>
  338. <li>
  339. <a href="switch_lang.php?lang=ENG">English</a>
  340. </li>
  341. <li>
  342. <a href="switch_lang.php?lang=TW">繁體中文</a>
  343. </li>
  344. <li>
  345. <a href="switch_lang.php?lang=CN">简体中文</a>
  346. </li>
  347. <li>
  348. <a href="switch_lang.php?lang=JP">日本語</a>
  349. </li>
  350. </ul>
  351. </li>
  352. </ul>
  353. <!--
  354. Desktop Menu end
  355. //-->
  356. </nav>
  357. </div>
  358. </div>
  359. </div>
  360. <!--
  361. Site Menu end
  362. //-->
  363. </div></div></div></div></div>
  364. <!--
  365. Envor header end
  366. //-->
  367. </header>