head.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  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');
  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"){
  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. //$ModelName='AC Net';
  58. //$ModelName='AC Eco';
  59. // $ModelName='DC';
  60. switch ($ModelName){
  61. case 'AC Net':
  62. $am111='block';
  63. $am101='block';
  64. $am100='block';
  65. $am001='none';
  66. break;
  67. case 'AC Eco':
  68. $am111='block';
  69. $am101='none';
  70. $am100='block';
  71. $am001='none';
  72. break;
  73. case 'DC':
  74. $am111='block';
  75. $am101='block';
  76. $am100='none';
  77. $am001='block';
  78. break;
  79. case 'DC_AC':
  80. $am111='block';
  81. $am101='block';
  82. $am100='block';
  83. $am001='block';
  84. break;
  85. default:
  86. $am111='block';
  87. $am101='block';
  88. $am100='block';
  89. $am001='block';
  90. break;
  91. }
  92. if(substr($model,4,3)=="122"){
  93. $am120='block';
  94. }
  95. else{
  96. $am120='none';
  97. }
  98. if(strstr($_SERVER['PHP_SELF'],"network") || strstr($_SERVER['PHP_SELF'],"backend")){
  99. $display2="none";
  100. }
  101. ?>
  102. <head>
  103. <meta charset="utf-8">
  104. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  105. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  106. <meta name="description" content="EV System Configuration">
  107. <link rel="shortcut icon" href="favicon.ico">
  108. <title>EV System Configuration</title>
  109. <!--
  110. * Google Fonts
  111. //-->
  112. <link href='//fonts.googleapis.com/css?family=Raleway:400,100,200,300,500,600,700,800' rel='stylesheet' type='text/css'>
  113. <link href='//fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'>
  114. <!-- Bootstrap core CSS -->
  115. <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
  116. <!-- Custom CSS -->
  117. <link href="css/animate.css" rel="stylesheet" type="text/css">
  118. <link href="css/jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css">
  119. <link href="css/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  120. <link rel="stylesheet" href="css/colorbox-skins/1/colorbox.css" type="text/css">
  121. <link href="css/main.css" rel="stylesheet" type="text/css">
  122. <link href="css/header/h3.css" rel="stylesheet" type="text/css">
  123. <link href="css/responsive.css" rel="stylesheet" type="text/css">
  124. <link href="css/color1.css" rel="stylesheet" type="text/css" id="envor-site-color">
  125. <link href="css/rivathemes.css" rel="stylesheet" type="text/css">
  126. <!-- LayerSlider styles -->
  127. <link rel="stylesheet" href="css/layerslider/css/layerslider.css" type="text/css">
  128. <!-- the main fileinput plugin css -->
  129. <link href="css/fileinput.min.css" rel="stylesheet" type="text/css">
  130. <link href="css/fileinput.css" media="all" rel="stylesheet" type="text/css"/>
  131. <!-- Just for debugging purposes. Don't actually copy this line! -->
  132. <!--[if lt IE 9]><script src="js/vendor/ie8-responsive-file-warning.js"></script><![endif]-->
  133. <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  134. <!--[if lt IE 9]>
  135. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  136. <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  137. <![endif]-->
  138. <link rel="stylesheet" href="css/font-awesome.min.css">
  139. <link href="css/prettify-1.0.css" rel="stylesheet">
  140. <link rel="stylesheet" type="text/css" href="css/bootstrap-datetimepicker.css" />
  141. <!-- <script src="js/jquery-1.8.3.min.js"></script>
  142. <script src="js/moment.js"></script>
  143. <script src="js/bootstrap.min.js"></script>
  144. <script src="js/bootstrap-datetimepicker.min.js"></script>
  145. <!-- <script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>-->
  146. <!-- <script src="js/twitterFetcher_v10_min.js"></script>-->
  147. <script>
  148. function changeModel(e){
  149. location.href="<?php echo $_SERVER['PHP_SELF']!=""?$_SERVER['PHP_SELF']:"set_system.php"?>?ModelName="+e.value;
  150. }
  151. </script>
  152. </head>
  153. <body>
  154. <!--[if lt IE 7]>
  155. <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>
  156. <![endif]-->
  157. <!--
  158. Scroll to the top
  159. //-->
  160. <div id="to-the-top"><i class="fa fa-chevron-up"></i></div>
  161. <!--
  162. Envor mobile menu start
  163. //-->
  164. <i class="glyphicon glyphicon-align-justify" id="envor-mobile-menu-btn"></i>
  165. <div class="envor-mobile-menu" id="envor-mobile-menu">
  166. <h3 style="color: #fff;">menu</h3>
  167. <nav>
  168. <ul>
  169. <li<?php echo ($tag_header=='set'?' class="active"':''); ?>>
  170. <a href="#" accesskey="1" title="Set"><?php echo $lang->showWord("set"); ?></a>
  171. <ul>
  172. <li>
  173. <a href="set_system.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>"><?php echo $lang->showWord("system"); ?></a>
  174. </li>
  175. <li>
  176. <a href="set_charging.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>"><?php echo $lang->showWord("charging"); ?></a>
  177. </li>
  178. <li>
  179. <a href="set_network.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>" style="display:<?php echo $am101;?>"><?php echo $lang->showWord("network"); ?></a>
  180. </li>
  181. <li>
  182. <a href="set_backend.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>" style="display:<?php echo $am101;?>"><?php echo $lang->showWord("backend"); ?></a>
  183. </li>
  184. </ul>
  185. </li>
  186. <li<?php echo ($tag_header=='upgrade'?' class="active"':''); ?>>
  187. <a href="#" accesskey="2" title="Upgrade"><?php echo $lang->showWord("upgrade"); ?></a>
  188. <ul>
  189. <li>
  190. <a href="upgrade_iso.php"><?php echo "Image"; ?></a>
  191. </li>
  192. </ul>
  193. </li>
  194. <li<?php echo ($tag_header=='other'?' class="active"':''); ?>>
  195. <a href="#" accesskey="3" title="Other"><?php echo $lang->showWord("other"); ?></a>
  196. <ul>
  197. <?php /* <li>
  198. <a href="set_contact.php"><?php echo $lang->showWord("contact_info"); ?></a>
  199. </li>*/?>
  200. <li>
  201. <a href="log_download.php"><?php echo $lang->showWord("log_download"); ?></a>
  202. </li>
  203. <li>
  204. <a href="set_passwd.php"><?php echo $lang->showWord("passwd"); ?></a>
  205. </li>
  206. <li>
  207. <a href="set_restart.php"><?php echo $lang->showWord("restart"); ?></a>
  208. </li>
  209. </ul>
  210. </li>
  211. <li<?php echo ($tag_header=='language'?' class="active"':''); ?>>
  212. <a href="#" accesskey="4" title="Language"><?php echo $lang->showWord("language"); ?></a>
  213. <ul>
  214. <li>
  215. <a href="switch_lang.php?lang=ENG">English</a>
  216. </li>
  217. <li>
  218. <a href="switch_lang.php?lang=TW">繁體中文</a>
  219. </li>
  220. <li>
  221. <a href="switch_lang.php?lang=CN">简体中文</a>
  222. </li>
  223. </ul>
  224. </li>
  225. </ul>
  226. </nav>
  227. </div>
  228. <header class="envor-header envor-header-3">
  229. <!--
  230. Header Bg start
  231. //-->
  232. <div class="envor-header-bg">
  233. <div class="container">
  234. <div class="row">
  235. <div class="col-lg-12">
  236. <div class="envor-relative">
  237. <!--
  238. Site Logo start
  239. //-->
  240. <a href="index.php">
  241. <div class="envor-logo">
  242. <h2><?php echo $lang->showWord("vender_name"); ?></h2>
  243. <!-- <img src="img/logo.png" alt="PHIHONG">-->
  244. <!--
  245. Site Logo end
  246. //-->
  247. </div>
  248. </a>
  249. </div>
  250. </div>
  251. </div>
  252. </div>
  253. <!--
  254. Header Bg end
  255. //-->
  256. </div>
  257. <!--
  258. Site Menu start
  259. //-->
  260. <div class="envor-desktop-menu-bg" id="envor-header-menu">
  261. <div class="container">
  262. <div class="row">
  263. <div class="col-lg-12">
  264. <!--
  265. Desktop Menu start
  266. //-->
  267. <nav>
  268. <ul>
  269. <li <?php echo ($tag_header=='set'?'class="active"':''); ?> >
  270. <a href="#" accesskey="1" title="Set"><?php echo $lang->showWord("set"); ?></a>
  271. <ul>
  272. <li>
  273. <a href="set_system.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>"><?php echo $lang->showWord("system"); ?></a>
  274. </li>
  275. <li>
  276. <a href="set_charging.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>"><?php echo $lang->showWord("charging"); ?></a>
  277. </li>
  278. <li>
  279. <a href="set_network.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>" style="display:<?php echo $am101;?>"><?php echo $lang->showWord("network"); ?></a>
  280. </li>
  281. <li>
  282. <a href="set_backend.php<?php echo $_SERVER['QUERY_STRING']!=""?'?'.$_SERVER['QUERY_STRING']:""?>" style="display:<?php echo $am101;?>"><?php echo $lang->showWord("backend"); ?></a>
  283. </li>
  284. </ul>
  285. </li>
  286. <li<?php echo ($tag_header=='upgrade'?' class="active"':''); ?>>
  287. <a href="#" accesskey="2" title="Upgrade"><?php echo $lang->showWord("upgrade"); ?></a>
  288. <ul>
  289. <li>
  290. <a href="upgrade_iso.php"><?php echo "Image"; ?></a>
  291. </li>
  292. </ul>
  293. </li>
  294. <li<?php echo ($tag_header=='other'?' class="active"':''); ?>>
  295. <a href="#" accesskey="3" title="Other"><?php echo $lang->showWord("other"); ?></a>
  296. <ul>
  297. <?php /* <li>
  298. <a href="set_contact.php"><?php echo $lang->showWord("contact_info"); ?></a>
  299. </li>*/?>
  300. <li>
  301. <a href="log_download.php"><?php echo $lang->showWord("log_download"); ?></a>
  302. </li>
  303. <li>
  304. <a href="set_passwd.php"><?php echo $lang->showWord("passwd"); ?></a>
  305. </li>
  306. <li>
  307. <a href="set_restart.php"><?php echo $lang->showWord("restart"); ?></a>
  308. </li>
  309. </ul>
  310. </li>
  311. <li<?php echo ($tag_header=='language'?' class="active"':''); ?>>
  312. <a href="#" accesskey="4" title="Language"><?php echo $lang->showWord("language"); ?></a>
  313. <ul>
  314. <li>
  315. <a href="switch_lang.php?lang=ENG">English</a>
  316. </li>
  317. <li>
  318. <a href="switch_lang.php?lang=TW">繁體中文</a>
  319. </li>
  320. <li>
  321. <a href="switch_lang.php?lang=CN">简体中文</a>
  322. </li>
  323. </ul>
  324. </li>
  325. </ul>
  326. <!--
  327. Desktop Menu end
  328. //-->
  329. </nav>
  330. </div>
  331. </div>
  332. </div>
  333. <!--
  334. Site Menu end
  335. //-->
  336. </div></div></div></div></div>
  337. <!--
  338. Envor header end
  339. //-->
  340. </header>