set_system.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  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":""?>>OCPP backend</option>
  119. <option value="1" <?php echo $obj->{'AuthorisationMode'}=="1"?"selected":""?>>free mode</option>
  120. </select>
  121. </div>
  122. <div class="form-group" style="display:<?php echo $am001;?>">
  123. <label>Default Language</label>
  124. <select class="form-control" id="DefaultLanguage" name="DefaultLanguage">
  125. <option value="0" <?php echo $obj->{'DefaultLanguage'}=="0"?"selected":""?>>English</option>
  126. <option value="1" <?php echo $obj->{'DefaultLanguage'}=="1"?"selected":""?>>繁體中文</option>
  127. <option value="2" <?php echo $obj->{'DefaultLanguage'}=="2"?"selected":""?>>简体中文</option>
  128. <option value="3" <?php echo $obj->{'DefaultLanguage'}=="3"?"selected":""?>>日本語</option>
  129. <option value="4" <?php echo $obj->{'DefaultLanguage'}=="4"?"selected":""?>>Français</option>
  130. <option value="5" <?php echo $obj->{'DefaultLanguage'}=="5"?"selected":""?>>Italiano</option>
  131. <option value="6" <?php echo $obj->{'DefaultLanguage'}=="6"?"selected":""?>>Español</option>
  132. <option value="7" <?php echo $obj->{'DefaultLanguage'}=="7"?"selected":""?>>Deutsch</option>
  133. <option value="8" <?php echo $obj->{'DefaultLanguage'}=="8"?"selected":""?>>Nederland</option>
  134. <option value="9" <?php echo $obj->{'DefaultLanguage'}=="9"?"selected":""?>>Norsk</option>
  135. <option value="10" <?php echo $obj->{'DefaultLanguage'}=="10"?"selected":""?>>Suomalainen</option>
  136. <option value="11" <?php echo $obj->{'DefaultLanguage'}=="11"?"selected":""?>>Svenska</option>
  137. <option value="12" <?php echo $obj->{'DefaultLanguage'}=="12"?"selected":""?>>Pусский</option>
  138. <option value="13" <?php echo $obj->{'DefaultLanguage'}=="13"?"selected":""?>> ไทย</option>
  139. </select>
  140. </div>
  141. <div class="form-group" style="display:<?php echo $am111;?>">
  142. <label>InputVoltageR</label>
  143. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'InputVoltageR'};?> volt">
  144. <input type="hidden" name="InputVoltageR" id="InputVoltageR" value="<?php echo $obj->{'InputVoltageR'};?>">
  145. </div>
  146. <div class="form-group" style="display:<?php echo $am111;?>">
  147. <label>InputVoltageS</label>
  148. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'InputVoltageS'};?> volt">
  149. <input type="hidden" name="InputVoltageS" id="InputVoltageS" value="<?php echo $obj->{'InputVoltageS'};?>">
  150. </div>
  151. <div class="form-group" style="display:<?php echo $am111;?>">
  152. <label>InputVoltageT</label>
  153. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'InputVoltageT'};?> volt">
  154. <input type="hidden" name="InputVoltageT" id="InputVoltageT" value="<?php echo $obj->{'InputVoltageT'};?>">
  155. </div>
  156. <div class="form-group" style="display:<?php echo $am001;?>">
  157. <label>SystemFanRotaSpeed</label>
  158. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'SystemFanRotaSpeed'};?> RPM">
  159. <input type="hidden" name="SystemFanRotaSpeed" id="SystemFanRotaSpeed" value="<?php echo $obj->{'SystemFanRotaSpeed'};?>">
  160. </div>
  161. <div class="form-group" style="display:<?php echo $am001;?>">
  162. <label>PsuFanRotaSpeed</label>
  163. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'PsuFanRotaSpeed'};?> RPM">
  164. <input type="hidden" name="PsuFanRotaSpeed" id="PsuFanRotaSpeed" value="<?php echo $obj->{'PsuFanRotaSpeed'};?>">
  165. </div>
  166. <div class="form-group" style="display:<?php echo $am111;?>">
  167. <label>RfidCardNumEndian</label>
  168. <select class="form-control" id="RfidCardNumEndian" name="RfidCardNumEndian">
  169. <option value="0" <?php echo $obj->{'RfidCardNumEndian'}=="0"?"selected":""?>>little endian</option>
  170. <option value="1" <?php echo $obj->{'RfidCardNumEndian'}=="1"?"selected":""?>>big endian</option>
  171. </select>
  172. </div>
  173. <div class="form-group" style="display:<?php echo $am120;?>">
  174. <label>PsuAcInputType</label>
  175. <select class="form-control" id="PsuAcInputType" name="PsuAcInputType">
  176. <option value="0" <?php echo $obj->{'PsuAcInputType'}=="0"?"selected":""?>>220~230 +/- 15%</option>
  177. <option value="1" <?php echo $obj->{'PsuAcInputType'}=="1"?"selected":""?>>277 +10%/-15%</option>
  178. </select>
  179. </div>
  180. </section>
  181. </article>
  182. <!--Aux. power Information-->
  183. <article class="envor-sorting-item css" style="display:<?php echo $am001;?>">
  184. <header><?php echo $lang->showWord("aux_power_information"); ?><i class="fa fa-plus"></i></header>
  185. <section>
  186. <div class="form-group" style="display:<?php echo $am001;?>">
  187. <label>Aux Power 5V</label>
  188. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AuxPower5V'};?> volt">
  189. <input type="hidden" name="AuxPower5V" id="AuxPower5V" value="<?php echo $obj->{'AuxPower5V'};?>">
  190. </div>
  191. <div class="form-group" style="display:<?php echo $am001;?>">
  192. <label>Aux Power 12V</label>
  193. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AuxPower12V'};?> volt">
  194. <input type="hidden" name="AuxPower12V" id="AuxPower12V" value="<?php echo $obj->{'AuxPower12V'};?>">
  195. </div>
  196. <div class="form-group" style="display:<?php echo $am001;?>">
  197. <label>Aux Power 24V</label>
  198. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AuxPower24V'};?> volt">
  199. <input type="hidden" name="AuxPower24V" id="AuxPower24V" value="<?php echo $obj->{'AuxPower24V'};?>">
  200. </div>
  201. <div class="form-group" style="display:<?php echo $am001;?>">
  202. <label>Aux Power 48V</label>
  203. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AuxPower48V'};?> volt">
  204. <input type="hidden" name="AuxPower48V" id="AuxPower48V" value="<?php echo $obj->{'AuxPower48V'};?>">
  205. </div>
  206. </section>
  207. </article>
  208. <!--Version Information-->
  209. <article class="envor-sorting-item css">
  210. <header><?php echo $lang->showWord("version_information"); ?><i class="fa fa-plus"></i></header>
  211. <section>
  212. <div class="form-group" style="display:<?php echo $am111;?>">
  213. <label>CsuHwRev</label>
  214. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CsuHwRev'};?>">
  215. <input type="hidden" name="CsuHwRev" id="CsuHwRev" value="<?php echo $obj->{'CsuHwRev'};?>">
  216. </div>
  217. <div class="form-group" style="display:<?php echo $am111;?>">
  218. <label>CsuBootLoadFwRev</label>
  219. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CsuBootLoadFwRev'};?>">
  220. <input type="hidden" name="CsuBootLoadFwRev" id="CsuBootLoadFwRev" value="<?php echo $obj->{'CsuBootLoadFwRev'};?>">
  221. </div>
  222. <div class="form-group" style="display:<?php echo $am111;?>">
  223. <label>CsuKernelFwRev</label>
  224. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CsuKernelFwRev'};?>">
  225. <input type="hidden" name="CsuKernelFwRev" id="CsuKernelFwRev" value="<?php echo $obj->{'CsuKernelFwRev'};?>">
  226. </div>
  227. <div class="form-group" style="display:<?php echo $am111;?>">
  228. <label>CsuRootFsFwRev</label>
  229. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CsuRootFsFwRev'};?>">
  230. <input type="hidden" name="CsuRootFsFwRev" id="CsuRootFsFwRev" value="<?php echo $obj->{'CsuRootFsFwRev'};?>">
  231. </div>
  232. <div class="form-group" style="display:<?php echo $am111;?>">
  233. <label>CsuPrimFwRev</label>
  234. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CsuPrimFwRev'};?>">
  235. <input type="hidden" name="CsuPrimFwRev" id="CsuPrimFwRev" value="<?php echo $obj->{'CsuPrimFwRev'};?>">
  236. </div>
  237. <div class="form-group" style="display:<?php echo $am001;?>">
  238. <label>LcmHwRev</label>
  239. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'LcmHwRev'};?>">
  240. <input type="hidden" name="LcmHwRev" id="LcmHwRev" value="<?php echo $obj->{'LcmHwRev'};?>">
  241. </div>
  242. <div class="form-group" style="display:<?php echo $am001;?>">
  243. <label>LcmFwRev</label>
  244. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'LcmFwRev'};?>">
  245. <input type="hidden" name="LcmFwRev" id="LcmFwRev" value="<?php echo $obj->{'LcmFwRev'};?>">
  246. </div>
  247. <div class="form-group" style="display:<?php echo $am001;?>">
  248. <label>PsuHwRev</label>
  249. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'PsuHwRev'};?>">
  250. <input type="hidden" name="PsuHwRev" id="PsuHwRev" value="<?php echo $obj->{'PsuHwRev'};?>">
  251. </div>
  252. <div class="form-group" style="display:<?php echo $am001;?>">
  253. <label>PsuPrimFwRev</label>
  254. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'PsuPrimFwRev'};?>">
  255. <input type="hidden" name="PsuPrimFwRev" id="PsuPrimFwRev" value="<?php echo $obj->{'PsuPrimFwRev'};?>">
  256. </div>
  257. <div class="form-group" style="display:<?php echo $am001;?>">
  258. <label>PsuSecFwRev</label>
  259. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'PsuSecFwRev'};?>">
  260. <input type="hidden" name="PsuSecFwRev" id="PsuSecFwRev" value="<?php echo $obj->{'PsuSecFwRev'};?>">
  261. </div>
  262. <div class="form-group" style="display:<?php echo $am001;?>">
  263. <label>AuxPwrHwRev</label>
  264. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AuxPwrHwRev'};?>">
  265. <input type="hidden" name="AuxPwrHwRev" id="AuxPwrHwRev" value="<?php echo $obj->{'AuxPwrHwRev'};?>">
  266. </div>
  267. <div class="form-group" style="display:<?php echo $am001;?>">
  268. <label>AuxPwrFwRev</label>
  269. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AuxPwrFwRev'};?>">
  270. <input type="hidden" name="AuxPwrFwRev" id="AuxPwrFwRev" value="<?php echo $obj->{'AuxPwrFwRev'};?>">
  271. </div>
  272. <div class="form-group" style="display:<?php echo $am001;?>">
  273. <label>FanModuleHwRev</label>
  274. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'FanModuleHwRev'};?>">
  275. <input type="hidden" name="FanModuleHwRev" id="FanModuleHwRev" value="<?php echo $obj->{'FanModuleHwRev'};?>">
  276. </div>
  277. <div class="form-group" style="display:<?php echo $am001;?>">
  278. <label>FanModuleFwRev</label>
  279. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'FanModuleFwRev'};?>">
  280. <input type="hidden" name="FanModuleFwRev" id="FanModuleFwRev" value="<?php echo $obj->{'FanModuleFwRev'};?>">
  281. </div>
  282. <div class="form-group" style="display:<?php echo $am001;?>">
  283. <label>RelayModuleHwRev</label>
  284. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'RelayModuleHwRev'};?>">
  285. <input type="hidden" name="RelayModuleHwRev" id="RelayModuleHwRev" value="<?php echo $obj->{'RelayModuleHwRev'};?>">
  286. </div>
  287. <div class="form-group" style="display:<?php echo $am001;?>">
  288. <label>RelayModuleFwRev</label>
  289. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'RelayModuleFwRev'};?>">
  290. <input type="hidden" name="RelayModuleFwRev" id="RelayModuleFwRev" value="<?php echo $obj->{'RelayModuleFwRev'};?>">
  291. </div>
  292. <div class="form-group" style="display:<?php echo $am001;?>">
  293. <label>TelcomModemFwRev</label>
  294. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomModemFwRev'};?>">
  295. <input type="hidden" name="TelcomModemFwRev" id="TelcomModemFwRev" value="<?php echo $obj->{'TelcomModemFwRev'};?>">
  296. </div>
  297. </section>
  298. </article>
  299. <!--Temperature Information-->
  300. <article class="envor-sorting-item css">
  301. <header><?php echo $lang->showWord("temperature_information"); ?><i class="fa fa-plus"></i></header>
  302. <section>
  303. <div class="form-group" style="display:<?php echo $am111;?>">
  304. <label>SystemAmbientTemp</label>
  305. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'SystemAmbientTemp'};?> ℃">
  306. <input type="hidden" name="SystemAmbientTemp" id="SystemAmbientTemp" value="<?php echo $obj->{'SystemAmbientTemp'};?>">
  307. </div>
  308. <div class="form-group" style="display:<?php echo $am001;?>">
  309. <label>SystemCriticalTemp</label>
  310. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'SystemCriticalTemp'};?> ℃">
  311. <input type="hidden" name="SystemCriticalTemp" id="SystemCriticalTemp" value="<?php echo $obj->{'SystemCriticalTemp'};?>">
  312. </div>
  313. <div class="form-group" style="display:<?php echo $am001;?>">
  314. <label>CcsConnectorTemp</label>
  315. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CcsConnectorTemp'};?> ℃">
  316. <input type="hidden" name="CcsConnectorTemp" id="CcsConnectorTemp" value="<?php echo $obj->{'CcsConnectorTemp'};?>">
  317. </div>
  318. <div class="form-group" style="display:<?php echo $am001;?>">
  319. <label>PsuAmbientTemp</label>
  320. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'PsuAmbientTemp'};?> ℃">
  321. <input type="hidden" name="PsuAmbientTemp" id="PsuAmbientTemp" value="<?php echo $obj->{'PsuAmbientTemp'};?>">
  322. </div>
  323. </section>
  324. </article>
  325. <!--Connector Plug-in Information-->
  326. <article class="envor-sorting-item css">
  327. <header><?php echo $lang->showWord("connector_plug-in_information"); ?><i class="fa fa-plus"></i></header>
  328. <section>
  329. <div class="form-group" style="display:<?php echo $am100;?>">
  330. <label>AcPlugInTimes</label>
  331. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AcPlugInTimes'};?>">
  332. <input type="hidden" name="AcPlugInTimes" id="AcPlugInTimes" value="<?php echo $obj->{'AcPlugInTimes'};?>">
  333. </div>
  334. <div class="form-group" style="display:<?php echo $am001;?>">
  335. <label>GbPlugInTimes</label>
  336. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'GbPlugInTimes'};?>">
  337. <input type="hidden" name="GbPlugInTimes" id="GbPlugInTimes" value="<?php echo $obj->{'GbPlugInTimes'};?>">
  338. </div>
  339. <div class="form-group" style="display:<?php echo $am001;?>">
  340. <label>Ccs1PlugInTimes</label>
  341. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Ccs1PlugInTimes'};?>">
  342. <input type="hidden" name="Ccs1PlugInTimes" id="Ccs1PlugInTimes" value="<?php echo $obj->{'Ccs1PlugInTimes'};?>">
  343. </div>
  344. <div class="form-group" style="display:<?php echo $am001;?>">
  345. <label>Ccs2PlugInTimes</label>
  346. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Ccs2PlugInTimes'};?>">
  347. <input type="hidden" name="Ccs2PlugInTimes" id="Ccs2PlugInTimes" value="<?php echo $obj->{'Ccs2PlugInTimes'};?>">
  348. </div>
  349. <div class="form-group" style="display:<?php echo $am001;?>">
  350. <label>ChademoPlugInTimes</label>
  351. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'ChademoPlugInTimes'};?>">
  352. <input type="hidden" name="ChademoPlugInTimes" id="ChademoPlugInTimes" value="<?php echo $obj->{'ChademoPlugInTimes'};?>">
  353. </div>
  354. </section>
  355. </article>
  356. <article class="envor-sorting-item css">
  357. <div align="center"><button id="save"><?php echo $lang->showWord("set")?></button></div>
  358. </article>
  359. </div>
  360. </div>
  361. </div>
  362. </div>
  363. </div>
  364. </section>
  365. </div>
  366. <?php
  367. include 'foot.php';
  368. ?>
  369. <script type="text/JavaScript">
  370. $(document).ready(function(){
  371. $("#datetimepicker1").datetimepicker({
  372. format:"YYYY-MM-DD HH:mm:ss"
  373. });
  374. });
  375. document.getElementById("save").onclick = function() {
  376. if(formCheck())
  377. {
  378. document.getElementById("loading").style.display="block";
  379. // 發送 Ajax 查詢請求並處理
  380. var request = new XMLHttpRequest();
  381. request.open("POST", "set_system_action.php");
  382. // POST 參數須使用 send() 發送
  383. var data = "SystemId=" + document.getElementById("SystemId").value+
  384. "&SystemDateTime=" + document.getElementById("SystemDateTime").value+
  385. "&AcPhaseCount=" + document.getElementById("AcPhaseCount").value+
  386. "&FactoryConfiguration=" + document.getElementById("FactoryConfiguration").value+
  387. "&AuthorisationMode=" + document.getElementById("AuthorisationMode").value+
  388. "&DefaultLanguage=" + document.getElementById("DefaultLanguage").value+
  389. "&RfidCardNumEndian=" + document.getElementById("RfidCardNumEndian").value+
  390. "&PsuAcInputType=" + document.getElementById("PsuAcInputType").value;
  391. // POST 請求必須設置表頭在 open() 下面,send() 上面
  392. request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  393. request.send(data);
  394. request.onreadystatechange = function() {
  395. // 伺服器請求完成
  396. if (request.readyState == 4) {
  397. document.getElementById("loading").style.display="none";
  398. // 伺服器回應成功
  399. if (request.status == 200 && JSON.parse(request.responseText).result=="Success") {
  400. alert("<?php echo $lang->showWord("done")?>");
  401. } else {
  402. alert(JSON.parse(request.responseText).message);
  403. }
  404. request = null;
  405. }
  406. }
  407. }
  408. }
  409. function formCheck()
  410. {
  411. var SystemId = document.getElementById("SystemId").value;
  412. var SystemDateTime = document.getElementById("SystemDateTime").value;
  413. var result=true;
  414. /*
  415. if(SystemId.length < 1)
  416. {
  417. alert("SystemId format is not correct, ID is required .");
  418. document.getElementById("SystemId").focus();
  419. result = false;
  420. }
  421. if(SystemDateTime.length <=0)
  422. {
  423. alert("SystemDateTime format is not correct, SystemDateTime is required .");
  424. document.getElementById("SystemDateTime").focus();
  425. result = false;
  426. }*/
  427. return result;
  428. }
  429. function isNumberKey(evt)
  430. {
  431. var charCode = (evt.which) ? evt.which : event.keyCode
  432. if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 46))
  433. return false;
  434. return true;
  435. }
  436. function isExistDate(dateStr) { // yyyy/mm/dd
  437. var dateObj = dateStr.split('/');
  438. //列出12個月,每月最大日期限制
  439. var limitInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  440. var theYear = parseInt(dateObj[0]);
  441. var theMonth = parseInt(dateObj[1]);
  442. var theDay = parseInt(dateObj[2]);
  443. var isLeap = new Date(theYear, 1, 29).getDate() === 29; // 是否為閏年?
  444. if(isLeap) { // 若為閏年,最大日期限制改為 29
  445. limitInMonth[1] = 29;
  446. }
  447. // 比對該日是否超過每個月份最大日期限制
  448. return theDay <= limitInMonth[theMonth - 1]
  449. }
  450. </script>