set_system.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. <?php
  2. ini_set('error_reporting', E_ALL | E_STRICT);
  3. $tag_header = 'set';
  4. include 'head.php';
  5. $obj = json_decode(trim($output[0]));//var_dump($obj);
  6. $SystemStatus='';
  7. switch ($obj->{'SystemStatus'}){
  8. case 0:
  9. $SystemStatus='Booting';
  10. break;
  11. case 1:
  12. $SystemStatus='idle';
  13. break;
  14. case 2:
  15. $SystemStatus='authorizing';
  16. break;
  17. case 3:
  18. $SystemStatus='preparing';
  19. break;
  20. case 4:
  21. $SystemStatus='charging';
  22. break;
  23. case 5:
  24. $SystemStatus='terminating';
  25. break;
  26. case 6:
  27. $SystemStatus='alarm';
  28. break;
  29. case 7:
  30. $SystemStatus='fault';
  31. break;
  32. }
  33. ?>
  34. <style>
  35. img {
  36. display: block;
  37. margin-left: auto;
  38. margin-right: auto;
  39. }
  40. </style>
  41. <div class="envor-content">
  42. <!--
  43. Page Title start
  44. //-->
  45. <section class="envor-page-title-1" data-stellar-background-ratio="0.5">
  46. <div class="container">
  47. <div class="row">
  48. <div class="col-lg-9 col-md-9 col-sm-9">
  49. <h1><?php echo $lang->showWord("system"); ?></h1>
  50. </div>
  51. </div>
  52. </div>
  53. <!--
  54. Page Title end
  55. //-->
  56. </section>
  57. <!--
  58. Main Content start
  59. //-->
  60. <div id="loading" style="display:none;"><img src="img/giphy.gif"/></div>
  61. <section class="envor-section">
  62. <div class="container">
  63. <div class="row">
  64. <div class="col-lg-12">
  65. <div class="envor-sorting" id="faq-sorting">
  66. <div class="envor-toggle">
  67. <!--System Information-->
  68. <article class="envor-sorting-item css">
  69. <header><?php echo $lang->showWord("system_information"); ?><i class="fa fa-plus"></i></header>
  70. <section>
  71. <div class="form-group" style="display:<?php echo $am111;?>">
  72. <label>Model Name</label>
  73. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'ModelName'};?>">
  74. <input type="hidden" name="ModelName" id="ModelName" value="<?php echo $obj->{'ModelName'};?>">
  75. </div>
  76. <div class="form-group" style="display:<?php echo $am111;?>">
  77. <label>Serial Number</label>
  78. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'SerialNumber'};?>">
  79. <input type="hidden" name="SerialNumber" id="SerialNumber" value="<?php echo $obj->{'SerialNumber'};?>">
  80. </div>
  81. <div class="form-group" style="display:<?php echo $am111;?>">
  82. <label>System ID</label>
  83. <input type="text" name="SystemId" id="SystemId" class="form-control" value="<?php echo $obj->{'SystemId'};?>">
  84. </div>
  85. <div class="form-group" style="display:<?php echo $am111;?>">
  86. <label>System DateTime</label>
  87. <input type="text" readonly class="form-control" placeholder="<?php echo date('Y-m-d H:i:s');?>"><br>
  88. <div class='input-group date' id='datetimepicker1'>
  89. <input type='text' class="form-control" name="SystemDateTime" id='SystemDateTime' />
  90. <span class="input-group-addon">
  91. <span class="glyphicon glyphicon-calendar"></span>
  92. </span>
  93. </div>
  94. <!--<input type="hidden" name="SystemDateTime" id="SystemDateTime" value="<?php echo $obj->{'SystemDateTime'};?>">-->
  95. </div>
  96. <div class="form-group" style="display:<?php echo $am111;?>">
  97. <label>AcPhaseCount</label>
  98. <select class="form-control" id="AcPhaseCount" name="AcPhaseCount">
  99. <option value="1" <?php echo $obj->{'AcPhaseCount'}=="1"?"selected":""?>>One phase</option>
  100. <option value="3" <?php echo $obj->{'AcPhaseCount'}=="3"?"selected":""?>>Three phase</option>
  101. </select>
  102. </div>
  103. <?php /* <div class="form-group" style="display:<?php echo $am111;?>">
  104. <label>System Status</label>
  105. <input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus;?>">
  106. <input type="hidden" name="SystemStatus" id="SystemStatus" value="<?php echo $SystemStatus;?>">
  107. </div>*/?>
  108. <div class="form-group" style="display:<?php echo $am111;?>">
  109. <label>Factory Configuration</label>
  110. <select class="form-control" id="FactoryConfiguration" name="FactoryConfiguration">
  111. <option value="0" <?php echo $obj->{'FactoryConfiguration'}=="0"?"selected":""?>>Normal</option>
  112. <option value="1" <?php echo $obj->{'FactoryConfiguration'}=="1"?"selected":""?>>Trigger</option>
  113. </select>
  114. </div>
  115. <div class="form-group" style="display:<?php echo $am111;?>">
  116. <label>Authorisation Mode</label>
  117. <select type="text" class="form-control" id="AuthorisationMode" name="AuthorisationMode">
  118. <option value="0" <?php echo $obj->{'AuthorisationMode'}=="0"?"selected":""?>>Phihong RFID tag</option>
  119. <option value="1" <?php echo $obj->{'AuthorisationMode'}=="1"?"selected":""?>>OCPP backend</option>
  120. <option value="2" <?php echo $obj->{'AuthorisationMode'}=="2"?"selected":""?>>Phihong backend</option>
  121. <option value="3" <?php echo $obj->{'AuthorisationMode'}=="3"?"selected":""?>>free mode</option>
  122. </select>
  123. </div>
  124. <div class="form-group" style="display:<?php echo $am001;?>">
  125. <label>Default Language</label>
  126. <select class="form-control" id="DefaultLanguage" name="DefaultLanguage">
  127. <option value="0" <?php echo $obj->{'DefaultLanguage'}=="0"?"selected":""?>>English</option>
  128. <option value="1" <?php echo $obj->{'DefaultLanguage'}=="1"?"selected":""?>>繁體中文</option>
  129. <option value="2" <?php echo $obj->{'DefaultLanguage'}=="2"?"selected":""?>>简体中文</option>
  130. <option value="3" <?php echo $obj->{'DefaultLanguage'}=="3"?"selected":""?>>日本語</option>
  131. <option value="4" <?php echo $obj->{'DefaultLanguage'}=="4"?"selected":""?>>Français</option>
  132. <option value="5" <?php echo $obj->{'DefaultLanguage'}=="5"?"selected":""?>>Italiano</option>
  133. <option value="6" <?php echo $obj->{'DefaultLanguage'}=="6"?"selected":""?>>Español</option>
  134. <option value="7" <?php echo $obj->{'DefaultLanguage'}=="7"?"selected":""?>>Deutsch</option>
  135. <option value="8" <?php echo $obj->{'DefaultLanguage'}=="8"?"selected":""?>>Nederland</option>
  136. <option value="9" <?php echo $obj->{'DefaultLanguage'}=="9"?"selected":""?>>Norsk</option>
  137. <option value="10" <?php echo $obj->{'DefaultLanguage'}=="10"?"selected":""?>>Suomalainen</option>
  138. <option value="11" <?php echo $obj->{'DefaultLanguage'}=="11"?"selected":""?>>Svenska</option>
  139. <option value="12" <?php echo $obj->{'DefaultLanguage'}=="12"?"selected":""?>>Pусский</option>
  140. <option value="13" <?php echo $obj->{'DefaultLanguage'}=="13"?"selected":""?>> ไทย</option>
  141. </select>
  142. </div>
  143. <div class="form-group" style="display:<?php echo $am111;?>">
  144. <label>InputVoltageR</label>
  145. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'InputVoltageR'};?> volt">
  146. <input type="hidden" name="InputVoltageR" id="InputVoltageR" value="<?php echo $obj->{'InputVoltageR'};?>">
  147. </div>
  148. <div class="form-group" style="display:<?php echo $am111;?>">
  149. <label>InputVoltageS</label>
  150. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'InputVoltageS'};?> volt">
  151. <input type="hidden" name="InputVoltageS" id="InputVoltageS" value="<?php echo $obj->{'InputVoltageS'};?>">
  152. </div>
  153. <div class="form-group" style="display:<?php echo $am111;?>">
  154. <label>InputVoltageT</label>
  155. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'InputVoltageT'};?> volt">
  156. <input type="hidden" name="InputVoltageT" id="InputVoltageT" value="<?php echo $obj->{'InputVoltageT'};?>">
  157. </div>
  158. <div class="form-group" style="display:<?php echo $am001;?>">
  159. <label>SystemFanRotaSpeed</label>
  160. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'SystemFanRotaSpeed'};?> RPM">
  161. <input type="hidden" name="SystemFanRotaSpeed" id="SystemFanRotaSpeed" value="<?php echo $obj->{'SystemFanRotaSpeed'};?>">
  162. </div>
  163. <div class="form-group" style="display:<?php echo $am001;?>">
  164. <label>PsuFanRotaSpeed</label>
  165. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'PsuFanRotaSpeed'};?> RPM">
  166. <input type="hidden" name="PsuFanRotaSpeed" id="PsuFanRotaSpeed" value="<?php echo $obj->{'PsuFanRotaSpeed'};?>">
  167. </div>
  168. <div class="form-group" style="display:<?php echo $am111;?>">
  169. <label>RfidCardNumEndian</label>
  170. <select class="form-control" id="RfidCardNumEndian" name="RfidCardNumEndian">
  171. <option value="0" <?php echo $obj->{'RfidCardNumEndian'}=="0"?"selected":""?>>little endian</option>
  172. <option value="1" <?php echo $obj->{'RfidCardNumEndian'}=="1"?"selected":""?>>big endian</option>
  173. </select>
  174. </div>
  175. <div class="form-group" style="display:<?php echo $am120;?>">
  176. <label>PsuAcInputType</label>
  177. <select class="form-control" id="PsuAcInputType" name="PsuAcInputType">
  178. <option value="0" <?php echo $obj->{'PsuAcInputType'}=="0"?"selected":""?>>220~230 +/- 15%</option>
  179. <option value="1" <?php echo $obj->{'PsuAcInputType'}=="1"?"selected":""?>>277 +10%/-15%</option>
  180. </select>
  181. </div>
  182. </section>
  183. </article>
  184. <!--Aux. power Information-->
  185. <article class="envor-sorting-item css" style="display:<?php echo $am001;?>">
  186. <header><?php echo $lang->showWord("aux_power_information"); ?><i class="fa fa-plus"></i></header>
  187. <section>
  188. <div class="form-group" style="display:<?php echo $am001;?>">
  189. <label>Aux Power 5V</label>
  190. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AuxPower5V'};?> volt">
  191. <input type="hidden" name="AuxPower5V" id="AuxPower5V" value="<?php echo $obj->{'AuxPower5V'};?>">
  192. </div>
  193. <div class="form-group" style="display:<?php echo $am001;?>">
  194. <label>Aux Power 12V</label>
  195. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AuxPower12V'};?> volt">
  196. <input type="hidden" name="AuxPower12V" id="AuxPower12V" value="<?php echo $obj->{'AuxPower12V'};?>">
  197. </div>
  198. <div class="form-group" style="display:<?php echo $am001;?>">
  199. <label>Aux Power 24V</label>
  200. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AuxPower24V'};?> volt">
  201. <input type="hidden" name="AuxPower24V" id="AuxPower24V" value="<?php echo $obj->{'AuxPower24V'};?>">
  202. </div>
  203. <div class="form-group" style="display:<?php echo $am001;?>">
  204. <label>Aux Power 48V</label>
  205. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AuxPower48V'};?> volt">
  206. <input type="hidden" name="AuxPower48V" id="AuxPower48V" value="<?php echo $obj->{'AuxPower48V'};?>">
  207. </div>
  208. </section>
  209. </article>
  210. <!--Version Information-->
  211. <article class="envor-sorting-item css">
  212. <header><?php echo $lang->showWord("version_information"); ?><i class="fa fa-plus"></i></header>
  213. <section>
  214. <div class="form-group" style="display:<?php echo $am111;?>">
  215. <label>CsuHwRev</label>
  216. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CsuHwRev'};?>">
  217. <input type="hidden" name="CsuHwRev" id="CsuHwRev" value="<?php echo $obj->{'CsuHwRev'};?>">
  218. </div>
  219. <div class="form-group" style="display:<?php echo $am111;?>">
  220. <label>CsuBootLoadFwRev</label>
  221. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CsuBootLoadFwRev'};?>">
  222. <input type="hidden" name="CsuBootLoadFwRev" id="CsuBootLoadFwRev" value="<?php echo $obj->{'CsuBootLoadFwRev'};?>">
  223. </div>
  224. <div class="form-group" style="display:<?php echo $am111;?>">
  225. <label>CsuKernelFwRev</label>
  226. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CsuKernelFwRev'};?>">
  227. <input type="hidden" name="CsuKernelFwRev" id="CsuKernelFwRev" value="<?php echo $obj->{'CsuKernelFwRev'};?>">
  228. </div>
  229. <div class="form-group" style="display:<?php echo $am111;?>">
  230. <label>CsuRootFsFwRev</label>
  231. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CsuRootFsFwRev'};?>">
  232. <input type="hidden" name="CsuRootFsFwRev" id="CsuRootFsFwRev" value="<?php echo $obj->{'CsuRootFsFwRev'};?>">
  233. </div>
  234. <div class="form-group" style="display:<?php echo $am111;?>">
  235. <label>CsuPrimFwRev</label>
  236. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CsuPrimFwRev'};?>">
  237. <input type="hidden" name="CsuPrimFwRev" id="CsuPrimFwRev" value="<?php echo $obj->{'CsuPrimFwRev'};?>">
  238. </div>
  239. <div class="form-group" style="display:<?php echo $am001;?>">
  240. <label>LcmHwRev</label>
  241. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'LcmHwRev'};?>">
  242. <input type="hidden" name="LcmHwRev" id="LcmHwRev" value="<?php echo $obj->{'LcmHwRev'};?>">
  243. </div>
  244. <div class="form-group" style="display:<?php echo $am001;?>">
  245. <label>LcmFwRev</label>
  246. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'LcmFwRev'};?>">
  247. <input type="hidden" name="LcmFwRev" id="LcmFwRev" value="<?php echo $obj->{'LcmFwRev'};?>">
  248. </div>
  249. <div class="form-group" style="display:<?php echo $am001;?>">
  250. <label>PsuHwRev</label>
  251. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'PsuHwRev'};?>">
  252. <input type="hidden" name="PsuHwRev" id="PsuHwRev" value="<?php echo $obj->{'PsuHwRev'};?>">
  253. </div>
  254. <div class="form-group" style="display:<?php echo $am001;?>">
  255. <label>PsuPrimFwRev</label>
  256. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'PsuPrimFwRev'};?>">
  257. <input type="hidden" name="PsuPrimFwRev" id="PsuPrimFwRev" value="<?php echo $obj->{'PsuPrimFwRev'};?>">
  258. </div>
  259. <div class="form-group" style="display:<?php echo $am001;?>">
  260. <label>PsuSecFwRev</label>
  261. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'PsuSecFwRev'};?>">
  262. <input type="hidden" name="PsuSecFwRev" id="PsuSecFwRev" value="<?php echo $obj->{'PsuSecFwRev'};?>">
  263. </div>
  264. <div class="form-group" style="display:<?php echo $am001;?>">
  265. <label>AuxPwrHwRev</label>
  266. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AuxPwrHwRev'};?>">
  267. <input type="hidden" name="AuxPwrHwRev" id="AuxPwrHwRev" value="<?php echo $obj->{'AuxPwrHwRev'};?>">
  268. </div>
  269. <div class="form-group" style="display:<?php echo $am001;?>">
  270. <label>AuxPwrFwRev</label>
  271. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AuxPwrFwRev'};?>">
  272. <input type="hidden" name="AuxPwrFwRev" id="AuxPwrFwRev" value="<?php echo $obj->{'AuxPwrFwRev'};?>">
  273. </div>
  274. <div class="form-group" style="display:<?php echo $am001;?>">
  275. <label>FanModuleHwRev</label>
  276. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'FanModuleHwRev'};?>">
  277. <input type="hidden" name="FanModuleHwRev" id="FanModuleHwRev" value="<?php echo $obj->{'FanModuleHwRev'};?>">
  278. </div>
  279. <div class="form-group" style="display:<?php echo $am001;?>">
  280. <label>FanModuleFwRev</label>
  281. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'FanModuleFwRev'};?>">
  282. <input type="hidden" name="FanModuleFwRev" id="FanModuleFwRev" value="<?php echo $obj->{'FanModuleFwRev'};?>">
  283. </div>
  284. <div class="form-group" style="display:<?php echo $am001;?>">
  285. <label>RelayModuleHwRev</label>
  286. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'RelayModuleHwRev'};?>">
  287. <input type="hidden" name="RelayModuleHwRev" id="RelayModuleHwRev" value="<?php echo $obj->{'RelayModuleHwRev'};?>">
  288. </div>
  289. <div class="form-group" style="display:<?php echo $am001;?>">
  290. <label>RelayModuleFwRev</label>
  291. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'RelayModuleFwRev'};?>">
  292. <input type="hidden" name="RelayModuleFwRev" id="RelayModuleFwRev" value="<?php echo $obj->{'RelayModuleFwRev'};?>">
  293. </div>
  294. <div class="form-group" style="display:<?php echo $am001;?>">
  295. <label>TelcomModemFwRev</label>
  296. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomModemFwRev'};?>">
  297. <input type="hidden" name="TelcomModemFwRev" id="TelcomModemFwRev" value="<?php echo $obj->{'TelcomModemFwRev'};?>">
  298. </div>
  299. </section>
  300. </article>
  301. <!--Temperature Information-->
  302. <article class="envor-sorting-item css">
  303. <header><?php echo $lang->showWord("temperature_information"); ?><i class="fa fa-plus"></i></header>
  304. <section>
  305. <div class="form-group" style="display:<?php echo $am111;?>">
  306. <label>SystemAmbientTemp</label>
  307. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'SystemAmbientTemp'};?> ℃">
  308. <input type="hidden" name="SystemAmbientTemp" id="SystemAmbientTemp" value="<?php echo $obj->{'SystemAmbientTemp'};?>">
  309. </div>
  310. <div class="form-group" style="display:<?php echo $am001;?>">
  311. <label>SystemCriticalTemp</label>
  312. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'SystemCriticalTemp'};?> ℃">
  313. <input type="hidden" name="SystemCriticalTemp" id="SystemCriticalTemp" value="<?php echo $obj->{'SystemCriticalTemp'};?>">
  314. </div>
  315. <div class="form-group" style="display:<?php echo $am001;?>">
  316. <label>CcsConnectorTemp</label>
  317. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CcsConnectorTemp'};?> ℃">
  318. <input type="hidden" name="CcsConnectorTemp" id="CcsConnectorTemp" value="<?php echo $obj->{'CcsConnectorTemp'};?>">
  319. </div>
  320. <div class="form-group" style="display:<?php echo $am001;?>">
  321. <label>PsuAmbientTemp</label>
  322. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'PsuAmbientTemp'};?> ℃">
  323. <input type="hidden" name="PsuAmbientTemp" id="PsuAmbientTemp" value="<?php echo $obj->{'PsuAmbientTemp'};?>">
  324. </div>
  325. </section>
  326. </article>
  327. <!--Connector Plug-in Information-->
  328. <article class="envor-sorting-item css">
  329. <header><?php echo $lang->showWord("connector_plug-in_information"); ?><i class="fa fa-plus"></i></header>
  330. <section>
  331. <div class="form-group" style="display:<?php echo $am100;?>">
  332. <label>AcPlugInTimes</label>
  333. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AcPlugInTimes'};?>">
  334. <input type="hidden" name="AcPlugInTimes" id="AcPlugInTimes" value="<?php echo $obj->{'AcPlugInTimes'};?>">
  335. </div>
  336. <div class="form-group" style="display:<?php echo $am001;?>">
  337. <label>GbPlugInTimes</label>
  338. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'GbPlugInTimes'};?>">
  339. <input type="hidden" name="GbPlugInTimes" id="GbPlugInTimes" value="<?php echo $obj->{'GbPlugInTimes'};?>">
  340. </div>
  341. <div class="form-group" style="display:<?php echo $am001;?>">
  342. <label>Ccs1PlugInTimes</label>
  343. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Ccs1PlugInTimes'};?>">
  344. <input type="hidden" name="Ccs1PlugInTimes" id="Ccs1PlugInTimes" value="<?php echo $obj->{'Ccs1PlugInTimes'};?>">
  345. </div>
  346. <div class="form-group" style="display:<?php echo $am001;?>">
  347. <label>Ccs2PlugInTimes</label>
  348. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Ccs2PlugInTimes'};?>">
  349. <input type="hidden" name="Ccs2PlugInTimes" id="Ccs2PlugInTimes" value="<?php echo $obj->{'Ccs2PlugInTimes'};?>">
  350. </div>
  351. <div class="form-group" style="display:<?php echo $am001;?>">
  352. <label>ChademoPlugInTimes</label>
  353. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'ChademoPlugInTimes'};?>">
  354. <input type="hidden" name="ChademoPlugInTimes" id="ChademoPlugInTimes" value="<?php echo $obj->{'ChademoPlugInTimes'};?>">
  355. </div>
  356. </section>
  357. </article>
  358. <article class="envor-sorting-item css">
  359. <div align="center"><button id="save"><?php echo $lang->showWord("set")?></button></div>
  360. </article>
  361. </div>
  362. </div>
  363. </div>
  364. </div>
  365. </div>
  366. </section>
  367. </div>
  368. <?php
  369. include 'foot.php';
  370. ?>
  371. <script type="text/JavaScript">
  372. $(document).ready(function(){
  373. $("#datetimepicker1").datetimepicker({
  374. format:"YYYY-MM-DD HH:mm:ss"
  375. });
  376. });
  377. document.getElementById("save").onclick = function() {
  378. if(formCheck())
  379. {
  380. document.getElementById("loading").style.display="block";
  381. // 發送 Ajax 查詢請求並處理
  382. var request = new XMLHttpRequest();
  383. request.open("POST", "set_system_action.php");
  384. // POST 參數須使用 send() 發送
  385. var data = "SystemId=" + document.getElementById("SystemId").value+
  386. "&SystemDateTime=" + document.getElementById("SystemDateTime").value+
  387. "&AcPhaseCount=" + document.getElementById("AcPhaseCount").value+
  388. "&FactoryConfiguration=" + document.getElementById("FactoryConfiguration").value+
  389. "&AuthorisationMode=" + document.getElementById("AuthorisationMode").value+
  390. "&DefaultLanguage=" + document.getElementById("DefaultLanguage").value+
  391. "&RfidCardNumEndian=" + document.getElementById("RfidCardNumEndian").value+
  392. "&PsuAcInputType=" + document.getElementById("PsuAcInputType").value;
  393. // POST 請求必須設置表頭在 open() 下面,send() 上面
  394. request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  395. request.send(data);
  396. request.onreadystatechange = function() {
  397. // 伺服器請求完成
  398. if (request.readyState == 4) {
  399. document.getElementById("loading").style.display="none";
  400. // 伺服器回應成功
  401. if (request.status == 200 && JSON.parse(request.responseText).result=="Success") {
  402. alert("<?php echo $lang->showWord("done")?>");
  403. } else {
  404. alert(JSON.parse(request.responseText).message);
  405. }
  406. request = null;
  407. }
  408. }
  409. }
  410. }
  411. function formCheck()
  412. {
  413. var SystemId = document.getElementById("SystemId").value;
  414. var SystemDateTime = document.getElementById("SystemDateTime").value;
  415. var result=true;
  416. /*
  417. if(SystemId.length < 1)
  418. {
  419. alert("SystemId format is not correct, ID is required .");
  420. document.getElementById("SystemId").focus();
  421. result = false;
  422. }
  423. if(SystemDateTime.length <=0)
  424. {
  425. alert("SystemDateTime format is not correct, SystemDateTime is required .");
  426. document.getElementById("SystemDateTime").focus();
  427. result = false;
  428. }*/
  429. return result;
  430. }
  431. function isNumberKey(evt)
  432. {
  433. var charCode = (evt.which) ? evt.which : event.keyCode
  434. if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 46))
  435. return false;
  436. return true;
  437. }
  438. function isExistDate(dateStr) { // yyyy/mm/dd
  439. var dateObj = dateStr.split('/');
  440. //列出12個月,每月最大日期限制
  441. var limitInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  442. var theYear = parseInt(dateObj[0]);
  443. var theMonth = parseInt(dateObj[1]);
  444. var theDay = parseInt(dateObj[2]);
  445. var isLeap = new Date(theYear, 1, 29).getDate() === 29; // 是否為閏年?
  446. if(isLeap) { // 若為閏年,最大日期限制改為 29
  447. limitInMonth[1] = 29;
  448. }
  449. // 比對該日是否超過每個月份最大日期限制
  450. return theDay <= limitInMonth[theMonth - 1]
  451. }
  452. </script>