set_charging.php 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  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[1]),true);//var_dump($obj);
  6. $ChargingInfo3=$obj['ChargingInfo3'];//var_dump($ChargingInfo3);
  7. $idx=0;
  8. if($obj['ChargingInfo1']){
  9. switch ($obj['ChargingInfo1']['SystemStatus']){
  10. case 0:
  11. $SystemStatus1='booting';
  12. break;
  13. case 1:
  14. $SystemStatus1='idle';
  15. break;
  16. case 2:
  17. $SystemStatus1='authorizing';
  18. break;
  19. case 3:
  20. $SystemStatus1='preparing';
  21. break;
  22. case 4:
  23. $SystemStatus1='charging';
  24. break;
  25. case 5:
  26. $SystemStatus1='terminating';
  27. break;
  28. case 6:
  29. $SystemStatus1='alarm';
  30. break;
  31. case 7:
  32. $SystemStatus1='fault';
  33. break;
  34. }
  35. }
  36. if($obj['ChargingInfo2']){
  37. switch ($obj['ChargingInfo2']['SystemStatus']){
  38. case 0:
  39. $SystemStatus2='booting';
  40. break;
  41. case 1:
  42. $SystemStatus2='idle';
  43. break;
  44. case 2:
  45. $SystemStatus2='authorizing';
  46. break;
  47. case 3:
  48. $SystemStatus2='preparing';
  49. break;
  50. case 4:
  51. $SystemStatus2='charging';
  52. break;
  53. case 5:
  54. $SystemStatus2='terminating';
  55. break;
  56. case 6:
  57. $SystemStatus2='alarm';
  58. break;
  59. case 7:
  60. $SystemStatus2='fault';
  61. break;
  62. }
  63. }
  64. if($obj['ChargingInfo3']){
  65. switch ($obj['ChargingInfo3']['SystemStatus']){
  66. case 0:
  67. $SystemStatus3='booting';
  68. break;
  69. case 1:
  70. $SystemStatus3='idle';
  71. break;
  72. case 2:
  73. $SystemStatus3='authorizing';
  74. break;
  75. case 3:
  76. $SystemStatus3='preparing';
  77. break;
  78. case 4:
  79. $SystemStatus3='charging';
  80. break;
  81. case 5:
  82. $SystemStatus3='terminating';
  83. break;
  84. case 6:
  85. $SystemStatus3='alarm';
  86. break;
  87. case 7:
  88. $SystemStatus3='fault';
  89. break;
  90. }
  91. }
  92. ?>
  93. <style>
  94. img {
  95. display: block;
  96. margin-left: auto;
  97. margin-right: auto;
  98. }
  99. </style>
  100. <div class="envor-content">
  101. <!--
  102. Page Title start
  103. //-->
  104. <section class="envor-page-title-1" data-stellar-background-ratio="0.5">
  105. <div class="container">
  106. <div class="row">
  107. <div class="col-lg-9 col-md-9 col-sm-9">
  108. <h1><?php echo $lang->showWord("charging"); ?></h1>
  109. </div>
  110. </div>
  111. </div>
  112. <!--
  113. Page Title end
  114. //-->
  115. </section>
  116. <!--
  117. Main Content start
  118. //-->
  119. <div id="loading" style="display:none;"><img src="img/giphy.gif"/></div>
  120. <section class="envor-section">
  121. <div class="container">
  122. <div class="row">
  123. <div class="col-lg-12">
  124. <div class="envor-sorting" id="faq-sorting">
  125. <div class="envor-toggle">
  126. <!--Charging relevant parameters-->
  127. <article class="envor-sorting-item css">
  128. <header><?php echo $lang->showWord("charging_relevant_parameters"); ?><i class="fa fa-plus"></i></header>
  129. <section>
  130. <div class="form-group" style="display:<?php echo $am111;?>">
  131. <label>MaxChargingEnergy</label>
  132. <input type="text" name="MaxChargingEnergy" id="MaxChargingEnergy" class="form-control" value="<?php echo $obj['MaxChargingEnergy'];?>">
  133. </div>
  134. <div class="form-group" style="display:<?php echo $am001;?>">
  135. <label>MaxChargingPower</label>
  136. <input type="text" name="MaxChargingPower" id="MaxChargingPower" class="form-control" value="<?php echo $obj['MaxChargingPower'];?>">
  137. </div>
  138. <div class="form-group" style="display:<?php echo $am111;?>">
  139. <label>MaxChargingCurrent</label>
  140. <input type="text" name="MaxChargingCurrent" id="MaxChargingCurrent" class="form-control" value="<?php echo $obj['MaxChargingCurrent'];?>">
  141. </div>
  142. <div class="form-group" style="display:<?php echo $am111;?>">
  143. <label>MaxChargingDuration</label>
  144. <input type="text" name="MaxChargingDuration" id="MaxChargingDuration" class="form-control" value="<?php echo $obj['MaxChargingDuration'];?>">
  145. </div>
  146. <div class="form-group" style="display:<?php echo $am001;?>">
  147. <label>PhaseLossPolicy</label>
  148. <select class="form-control" id="PhaseLossPolicy" name="PhaseLossPolicy">
  149. <option value="0" <?php echo $obj['PhaseLossPolicy']=="0"?"selected":""?>>charging</option>
  150. <option value="1" <?php echo $obj['PhaseLossPolicy']=="1"?"selected":""?>>stop charging</option>
  151. </select>
  152. </div>
  153. <div class="form-group" style="display:<?php echo $am111;?>">
  154. <label>LocalWhiteCard0</label>
  155. <input type="text" name="LocalWhiteCard0" id="LocalWhiteCard0" class="form-control" value="<?php echo $obj['LocalWhiteCard'][0];?>">
  156. </div>
  157. <div class="form-group" style="display:<?php echo $am111;?>">
  158. <label>LocalWhiteCard1</label>
  159. <input type="text" name="LocalWhiteCard1" id="LocalWhiteCard1" class="form-control" value="<?php echo $obj['LocalWhiteCard'][1];?>">
  160. </div>
  161. <div class="form-group" style="display:<?php echo $am111;?>">
  162. <label>LocalWhiteCard2</label>
  163. <input type="text" name="LocalWhiteCard2" id="LocalWhiteCard2" class="form-control" value="<?php echo $obj['LocalWhiteCard'][2];?>">
  164. </div>
  165. <div class="form-group" style="display:<?php echo $am111;?>">
  166. <label>LocalWhiteCard3</label>
  167. <input type="text" name="LocalWhiteCard3" id="LocalWhiteCard3" class="form-control" value="<?php echo $obj['LocalWhiteCard'][3];?>">
  168. </div>
  169. <div class="form-group" style="display:<?php echo $am111;?>">
  170. <label>LocalWhiteCard4</label>
  171. <input type="text" name="LocalWhiteCard4" id="LocalWhiteCard4" class="form-control" value="<?php echo $obj['LocalWhiteCard'][4];?>">
  172. </div>
  173. <div class="form-group" style="display:<?php echo $am111;?>">
  174. <label>LocalWhiteCard5</label>
  175. <input type="text" name="LocalWhiteCard5" id="LocalWhiteCard5" class="form-control" value="<?php echo $obj['LocalWhiteCard'][5];?>">
  176. </div>
  177. <div class="form-group" style="display:<?php echo $am111;?>">
  178. <label>LocalWhiteCard6</label>
  179. <input type="text" name="LocalWhiteCard6" id="LocalWhiteCard6" class="form-control" value="<?php echo $obj['LocalWhiteCard'][6];?>">
  180. </div>
  181. <div class="form-group" style="display:<?php echo $am111;?>">
  182. <label>LocalWhiteCard7</label>
  183. <input type="text" name="LocalWhiteCard7" id="LocalWhiteCard7" class="form-control" value="<?php echo $obj['LocalWhiteCard'][7];?>">
  184. </div>
  185. <div class="form-group" style="display:<?php echo $am111;?>">
  186. <label>LocalWhiteCard8</label>
  187. <input type="text" name="LocalWhiteCard8" id="LocalWhiteCard8" class="form-control" value="<?php echo $obj['LocalWhiteCard'][8];?>">
  188. </div>
  189. <div class="form-group" style="display:<?php echo $am111;?>">
  190. <label>LocalWhiteCard9</label>
  191. <input type="text" name="LocalWhiteCard9" id="LocalWhiteCard9" class="form-control" value="<?php echo $obj['LocalWhiteCard'][9];?>">
  192. </div>
  193. <?php /* <div class="form-group" style="display:<?php echo $am111;?>">
  194. <label>CcsAuthentication</label>
  195. <select class="form-control" id="CcsAuthentication" name="CcsAuthentication">
  196. <option value="0" <?php echo $obj['CcsAuthentication']==0?"selected":""?>>EIM</option>
  197. <option value="1" <?php echo $obj['CcsAuthentication']==1?"selected":""?>>EIM&PnC mixed</option>
  198. </select>
  199. </div>
  200. <div class="form-group" style="display:<?php echo $am111;?>">
  201. <label>AcCcsChargingModel</label>
  202. <select class="form-control" id="AcCcsChargingModel" name="AcCcsChargingModel">
  203. <option value="0" <?php echo $obj['AcCcsChargingModel']==0?"selected":""?>>BC (PWM) only</option>
  204. <option value="1" <?php echo $obj['AcCcsChargingModel']==0?"selected":""?>>BC&PLC mixed</option>
  205. </select>
  206. </div>*/?>
  207. </section>
  208. </article>
  209. <?php if($obj['ChargingInfo1']){ $idx++;?>
  210. <!--Charging Information-->
  211. <article class="envor-sorting-item css">
  212. <header><?php echo $lang->showWord("charging_information").$idx; ?><i class="fa fa-plus"></i></header>
  213. <section>
  214. <div class="form-group" style="display:<?php echo $am111;?>">
  215. <label>User Id</label>
  216. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StartUserId'];?>">
  217. <input type="hidden" name="UserId1" id="UserId1" value="<?php echo $obj['ChargingInfo1']['StartUserId'];?>">
  218. </div>
  219. <div class="form-group" style="display:<?php echo $am111;?>">
  220. <label>Card Number</label>
  221. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['CardNumber'];?>">
  222. <input type="hidden" name="CardNumber1" id="CardNumber1" value="<?php echo $obj['ChargingInfo1']['CardNumber'];?>">
  223. </div>
  224. <div class="form-group" style="display:<?php echo $am111;?>">
  225. <label>StartDateTime</label>
  226. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StartDateTime'];?>">
  227. <input type="hidden" name="StartDateTime1" id="StartDateTime1" value="<?php echo $obj['ChargingInfo1']['StartDateTime'];?>">
  228. </div>
  229. <div class="form-group" style="display:<?php echo $am111;?>">
  230. <label>StopDateTime</label>
  231. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StopDateTime'];?>">
  232. <input type="hidden" name="StopDateTime1" id="StopDateTime1" value="<?php echo $obj['ChargingInfo1']['StopDateTime'];?>">
  233. </div>
  234. <div class="form-group" style="display:<?php echo $am111;?>">
  235. <label>StartMethod</label>
  236. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StartMethod'];?>">
  237. <input type="hidden" name="StartMethod1" id="StartMethod1" value="<?php echo $obj['ChargingInfo1']['StartMethod'];?>">
  238. </div>
  239. <div class="form-group" style="display:<?php echo $am111;?>">
  240. <label>SystemStatus</label>
  241. <input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus1;?>">
  242. <input type="hidden" name="SystemStatus1" id="SystemStatus1" value="<?php echo $obj['ChargingInfo1']['SystemStatus'];?>">
  243. </div>
  244. <div class="form-group" style="display:<?php echo $am111;?>">
  245. <label>ConnectorTemp</label>
  246. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['ConnectorTemp'];?>">
  247. <input type="hidden" name="ConnectorTemp1" id="ConnectorTemp1" value="<?php echo $obj['ChargingInfo1']['ConnectorTemp'];?>">
  248. </div>
  249. <div class="form-group" style="display:<?php echo $am001;?>">
  250. <label>PresentChargingVoltage</label>
  251. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargingVoltage'];?>">
  252. <input type="hidden" name="PresentChargingVoltage1" id="PresentChargingVoltage1" value="<?php echo $obj['ChargingInfo1']['PresentChargingVoltage'];?>">
  253. </div>
  254. <div class="form-group" style="display:<?php echo $am111;?>">
  255. <label>PresentChargingCurrent</label>
  256. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargingCurrent'];?>">
  257. <input type="hidden" name="PresentChargingCurrent1" id="PresentChargingCurrent1" value="<?php echo $obj['ChargingInfo1']['PresentChargingCurrent'];?>">
  258. </div>
  259. <div class="form-group" style="display:<?php echo $am111;?>">
  260. <label>PresentChargingPower</label>
  261. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargingPower'];?>">
  262. <input type="hidden" name="PresentChargingPower1" id="PresentChargingPower1" value="<?php echo $obj['ChargingInfo1']['PresentChargingPower'];?>">
  263. </div>
  264. <div class="form-group" style="display:<?php echo $am111;?>">
  265. <label>PresentChargedEnergy</label>
  266. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargedEnergy'];?>">
  267. <input type="hidden" name="PresentChargedEnergy1" id="PresentChargedEnergy1" value="<?php echo $obj['ChargingInfo1']['PresentChargedEnergy'];?>">
  268. </div>
  269. <div class="form-group" style="display:<?php echo $am111;?>">
  270. <label>PresentChargedDuration</label>
  271. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargedDuration'];?>">
  272. <input type="hidden" name="PresentChargedDuration1" id="PresentChargedDuration1" value="<?php echo $obj['ChargingInfo1']['PresentChargedDuration'];?>">
  273. </div>
  274. <div class="form-group" style="display:<?php echo $am001;?>">
  275. <label>RemainChargingDuration</label>
  276. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['RemainChargingDuration'];?>">
  277. <input type="hidden" name="RemainChargingDuration1" id="RemainChargingDuration1" value="<?php echo $obj['ChargingInfo1']['RemainChargingDuration'];?>">
  278. </div>
  279. <div class="form-group" style="display:<?php echo $am001;?>">
  280. <label>EvBatteryMaxVoltage</label>
  281. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['EvBatteryMaxVoltage'];?>">
  282. <input type="hidden" name="EvBatteryMaxVoltage1" id="EvBatteryMaxVoltage1" value="<?php echo $obj['ChargingInfo1']['EvBatteryMaxVoltage'];?>">
  283. </div>
  284. <div class="form-group" style="display:<?php echo $am001;?>">
  285. <label>EvBatterytargetVoltage</label>
  286. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['EvBatterytargetVoltage'];?>">
  287. <input type="hidden" name="EvBatterytargetVoltage1" id="EvBatterytargetVoltage1" value="<?php echo $obj['ChargingInfo1']['EvBatterytargetVoltage'];?>">
  288. </div>
  289. <div class="form-group" style="display:<?php echo $am001;?>">
  290. <label>EvBatterySoc</label>
  291. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['EvBatterySoc'];?>">
  292. <input type="hidden" name="EvBatterySoc1" id="EvBatterySoc1" value="<?php echo $obj['ChargingInfo1']['EvBatterySoc'];?>">
  293. </div>
  294. </section>
  295. </article>
  296. <?php }?>
  297. <?php if($obj['ChargingInfo2']){ $idx++;?>
  298. <!--Charging Information-->
  299. <article class="envor-sorting-item css">
  300. <header><?php echo $lang->showWord("charging_information").$idx; ?><i class="fa fa-plus"></i></header>
  301. <section>
  302. <div class="form-group" style="display:<?php echo $am111;?>">
  303. <label>User Id</label>
  304. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartUserId'];?>">
  305. <input type="hidden" name="UserId2" id="UserId2" value="<?php echo $obj['ChargingInfo2']['StartUserId'];?>">
  306. </div>
  307. <div class="form-group" style="display:<?php echo $am111;?>">
  308. <label>Card Number</label>
  309. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['CardNumber'];?>">
  310. <input type="hidden" name="CardNumber2" id="CardNumber2" value="<?php echo $obj['ChargingInfo2']['CardNumber'];?>">
  311. </div>
  312. <div class="form-group" style="display:<?php echo $am111;?>">
  313. <label>StartDateTime</label>
  314. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartDateTime'];?>">
  315. <input type="hidden" name="StartDateTime2" id="StartDateTime2" value="<?php echo $obj['ChargingInfo2']['StartDateTime'];?>">
  316. </div>
  317. <div class="form-group" style="display:<?php echo $am111;?>">
  318. <label>StopDateTime</label>
  319. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StopDateTime'];?>">
  320. <input type="hidden" name="StopDateTime2" id="StopDateTime2" value="<?php echo $obj['ChargingInfo2']['StopDateTime'];?>">
  321. </div>
  322. <div class="form-group" style="display:<?php echo $am111;?>">
  323. <label>StartMethod</label>
  324. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartMethod'];?>">
  325. <input type="hidden" name="StartMethod2" id="StartMethod2" value="<?php echo $obj['ChargingInfo2']['StartMethod'];?>">
  326. </div>
  327. <div class="form-group" style="display:<?php echo $am111;?>">
  328. <label>SystemStatus</label>
  329. <input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus2;?>">
  330. <input type="hidden" name="SystemStatus2" id="SystemStatus2" value="<?php echo $obj['ChargingInfo2']['SystemStatus'];?>">
  331. </div>
  332. <div class="form-group" style="display:<?php echo $am111;?>">
  333. <label>ConnectorTemp</label>
  334. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['ConnectorTemp'];?>">
  335. <input type="hidden" name="ConnectorTemp2" id="ConnectorTemp2" value="<?php echo $obj['ChargingInfo2']['ConnectorTemp'];?>">
  336. </div>
  337. <div class="form-group" style="display:<?php echo $am001;?>">
  338. <label>PresentChargingVoltage</label>
  339. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargingVoltage'];?>">
  340. <input type="hidden" name="PresentChargingVoltage2" id="PresentChargingVoltage2" value="<?php echo $obj['ChargingInfo2']['PresentChargingVoltage'];?>">
  341. </div>
  342. <div class="form-group" style="display:<?php echo $am111;?>">
  343. <label>PresentChargingCurrent</label>
  344. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargingCurrent'];?>">
  345. <input type="hidden" name="PresentChargingCurrent2" id="PresentChargingCurrent2" value="<?php echo $obj['ChargingInfo2']['PresentChargingCurrent'];?>">
  346. </div>
  347. <div class="form-group" style="display:<?php echo $am111;?>">
  348. <label>PresentChargingPower</label>
  349. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargingPower'];?>">
  350. <input type="hidden" name="PresentChargingPower2" id="PresentChargingPower2" value="<?php echo $obj['ChargingInfo2']['PresentChargingPower'];?>">
  351. </div>
  352. <div class="form-group" style="display:<?php echo $am111;?>">
  353. <label>PresentChargedEnergy</label>
  354. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargedEnergy'];?>">
  355. <input type="hidden" name="PresentChargedEnergy2" id="PresentChargedEnergy2" value="<?php echo $obj['ChargingInfo2']['PresentChargedEnergy'];?>">
  356. </div>
  357. <div class="form-group" style="display:<?php echo $am111;?>">
  358. <label>PresentChargedDuration</label>
  359. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargedDuration'];?>">
  360. <input type="hidden" name="PresentChargedDuration2" id="PresentChargedDuration2" value="<?php echo $obj['ChargingInfo2']['PresentChargedDuration'];?>">
  361. </div>
  362. <div class="form-group" style="display:<?php echo $am001;?>">
  363. <label>RemainChargingDuration</label>
  364. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['RemainChargingDuration'];?>">
  365. <input type="hidden" name="RemainChargingDuration2" id="RemainChargingDuration2" value="<?php echo $obj['ChargingInfo2']['RemainChargingDuration'];?>">
  366. </div>
  367. <div class="form-group" style="display:<?php echo $am001;?>">
  368. <label>EvBatteryMaxVoltage</label>
  369. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['EvBatteryMaxVoltage'];?>">
  370. <input type="hidden" name="EvBatteryMaxVoltage2" id="EvBatteryMaxVoltage2" value="<?php echo $obj['ChargingInfo2']['EvBatteryMaxVoltage'];?>">
  371. </div>
  372. <div class="form-group" style="display:<?php echo $am001;?>">
  373. <label>EvBatterytargetVoltage</label>
  374. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['EvBatterytargetVoltage'];?>">
  375. <input type="hidden" name="EvBatterytargetVoltage2" id="EvBatterytargetVoltage2" value="<?php echo $obj['ChargingInfo2']['EvBatterytargetVoltage'];?>">
  376. </div>
  377. <div class="form-group" style="display:<?php echo $am001;?>">
  378. <label>EvBatterySoc</label>
  379. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['EvBatterySoc'];?>">
  380. <input type="hidden" name="EvBatterySoc2" id="EvBatterySoc2" value="<?php echo $obj['ChargingInfo2']['EvBatterySoc'];?>">
  381. </div>
  382. </section>
  383. </article>
  384. <?php }?>
  385. <?php if($obj['ChargingInfo3']){ $idx++;?>
  386. <!--Charging Information-->
  387. <article class="envor-sorting-item css">
  388. <header><?php echo $lang->showWord("charging_information").$idx; ?><i class="fa fa-plus"></i></header>
  389. <section>
  390. <div class="form-group" style="display:<?php echo $am111;?>">
  391. <label>User Id</label>
  392. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartUserId'];?>">
  393. <input type="hidden" name="UserId3" id="UserId3" value="<?php echo $obj['ChargingInfo3']['StartUserId'];?>">
  394. </div>
  395. <div class="form-group" style="display:<?php echo $am111;?>">
  396. <label>Card Number</label>
  397. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['CardNumber'];?>">
  398. <input type="hidden" name="CardNumber3" id="CardNumber3" value="<?php echo $obj['ChargingInfo3']['CardNumber'];?>">
  399. </div>
  400. <div class="form-group" style="display:<?php echo $am111;?>">
  401. <label>StartDateTime</label>
  402. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartDateTime'];?>">
  403. <input type="hidden" name="StartDateTime3" id="StartDateTime3" value="<?php echo $obj['ChargingInfo3']['StartDateTime'];?>">
  404. </div>
  405. <div class="form-group" style="display:<?php echo $am111;?>">
  406. <label>StopDateTime</label>
  407. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StopDateTime'];?>">
  408. <input type="hidden" name="StopDateTime3" id="StopDateTime3" value="<?php echo $obj['ChargingInfo3']['StopDateTime'];?>">
  409. </div>
  410. <div class="form-group" style="display:<?php echo $am111;?>">
  411. <label>StartMethod</label>
  412. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartMethod'];?>">
  413. <input type="hidden" name="StartMethod3" id="StartMethod3" value="<?php echo $obj['ChargingInfo3']['StartMethod'];?>">
  414. </div>
  415. <div class="form-group" style="display:<?php echo $am111;?>">
  416. <label>SystemStatus</label>
  417. <input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus3;?>">
  418. <input type="hidden" name="SystemStatus3" id="SystemStatus3" value="<?php echo $obj['ChargingInfo3']['SystemStatus'];?>">
  419. </div>
  420. <div class="form-group" style="display:<?php echo $am111;?>">
  421. <label>ConnectorTemp</label>
  422. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['ConnectorTemp'];?>">
  423. <input type="hidden" name="ConnectorTemp3" id="ConnectorTemp3" value="<?php echo $obj['ChargingInfo3']['ConnectorTemp'];?>">
  424. </div>
  425. <div class="form-group" style="display:<?php echo $am001;?>">
  426. <label>PresentChargingVoltage</label>
  427. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargingVoltage'];?>">
  428. <input type="hidden" name="PresentChargingVoltage3" id="PresentChargingVoltage3" value="<?php echo $obj['ChargingInfo3']['PresentChargingVoltage'];?>">
  429. </div>
  430. <div class="form-group" style="display:<?php echo $am111;?>">
  431. <label>PresentChargingCurrent</label>
  432. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargingCurrent'];?>">
  433. <input type="hidden" name="PresentChargingCurrent3" id="PresentChargingCurrent3" value="<?php echo $obj['ChargingInfo3']['PresentChargingCurrent'];?>">
  434. </div>
  435. <div class="form-group" style="display:<?php echo $am111;?>">
  436. <label>PresentChargingPower</label>
  437. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargingPower'];?>">
  438. <input type="hidden" name="PresentChargingPower3" id="PresentChargingPower3" value="<?php echo $obj['ChargingInfo3']['PresentChargingPower'];?>">
  439. </div>
  440. <div class="form-group" style="display:<?php echo $am111;?>">
  441. <label>PresentChargedEnergy</label>
  442. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargedEnergy'];?>">
  443. <input type="hidden" name="PresentChargedEnergy3" id="PresentChargedEnergy3" value="<?php echo $obj['ChargingInfo3']['PresentChargedEnergy'];?>">
  444. </div>
  445. <div class="form-group" style="display:<?php echo $am111;?>">
  446. <label>PresentChargedDuration</label>
  447. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargedDuration'];?>">
  448. <input type="hidden" name="PresentChargedDuration3" id="PresentChargedDuration3" value="<?php echo $obj['ChargingInfo3']['PresentChargedDuration'];?>">
  449. </div>
  450. <div class="form-group" style="display:<?php echo $am001;?>">
  451. <label>RemainChargingDuration</label>
  452. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['RemainChargingDuration'];?>">
  453. <input type="hidden" name="RemainChargingDuration3" id="RemainChargingDuration3" value="<?php echo $obj['ChargingInfo3']['RemainChargingDuration'];?>">
  454. </div>
  455. <div class="form-group" style="display:<?php echo $am001;?>">
  456. <label>EvBatteryMaxVoltage</label>
  457. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['EvBatteryMaxVoltage'];?>">
  458. <input type="hidden" name="EvBatteryMaxVoltage3" id="EvBatteryMaxVoltage3" value="<?php echo $obj['ChargingInfo3']['EvBatteryMaxVoltage'];?>">
  459. </div>
  460. <div class="form-group" style="display:<?php echo $am001;?>">
  461. <label>EvBatterytargetVoltage</label>
  462. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['EvBatterytargetVoltage'];?>">
  463. <input type="hidden" name="EvBatterytargetVoltage3" id="EvBatterytargetVoltage3" value="<?php echo $obj['ChargingInfo3']['EvBatterytargetVoltage'];?>">
  464. </div>
  465. <div class="form-group" style="display:<?php echo $am001;?>">
  466. <label>EvBatterySoc</label>
  467. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['EvBatterySoc'];?>">
  468. <input type="hidden" name="EvBatterySoc3" id="EvBatterySoc3" value="<?php echo $obj['ChargingInfo3']['EvBatterySoc'];?>">
  469. </div>
  470. </section>
  471. </article>
  472. <?php }?>
  473. <article class="envor-sorting-item css">
  474. <div align="center"><button id="save"><?php echo $lang->showWord("set")?></button></div>
  475. </article>
  476. </div>
  477. </div>
  478. </div>
  479. </div>
  480. </div>
  481. </section>
  482. </div>
  483. <?php
  484. include 'foot.php';
  485. ?>
  486. <script type="text/JavaScript">
  487. document.getElementById("save").onclick = function() {
  488. if(formCheck())
  489. {
  490. document.getElementById("loading").style.display="block";
  491. // 發送 Ajax 查詢請求並處理
  492. var request = new XMLHttpRequest();
  493. request.open("POST", "set_charging_action.php");
  494. // POST 參數須使用 send() 發送
  495. var data = "MaxChargingEnergy=" + document.getElementById("MaxChargingEnergy").value +
  496. "&MaxChargingPower=" + document.getElementById("MaxChargingPower").value +
  497. "&MaxChargingCurrent=" + document.getElementById("MaxChargingCurrent").value+
  498. "&MaxChargingDuration=" + document.getElementById("MaxChargingDuration").value+
  499. "&PhaseLossPolicy=" + document.getElementById("PhaseLossPolicy").value+
  500. "&LocalWhiteCard0=" + document.getElementById("LocalWhiteCard0").value+
  501. "&LocalWhiteCard1=" + document.getElementById("LocalWhiteCard1").value+
  502. "&LocalWhiteCard2=" + document.getElementById("LocalWhiteCard2").value+
  503. "&LocalWhiteCard3=" + document.getElementById("LocalWhiteCard3").value+
  504. "&LocalWhiteCard4=" + document.getElementById("LocalWhiteCard4").value+
  505. "&LocalWhiteCard5=" + document.getElementById("LocalWhiteCard5").value+
  506. "&LocalWhiteCard6=" + document.getElementById("LocalWhiteCard6").value+
  507. "&LocalWhiteCard7=" + document.getElementById("LocalWhiteCard7").value+
  508. "&LocalWhiteCard8=" + document.getElementById("LocalWhiteCard8").value+
  509. "&LocalWhiteCard9=" + document.getElementById("LocalWhiteCard9").value;
  510. // "&CcsAuthentication=" + document.getElementById("CcsAuthentication").value+
  511. // "&AcCcsChargingModel=" + document.getElementById("AcCcsChargingModel").value;
  512. // POST 請求必須設置表頭在 open() 下面,send() 上面
  513. request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  514. request.send(data);
  515. request.onreadystatechange = function() {
  516. // 伺服器請求完成
  517. if (request.readyState == 4) {
  518. document.getElementById("loading").style.display="none";
  519. // 伺服器回應成功
  520. if (request.status == 200 && JSON.parse(request.responseText).result=="Success") {
  521. alert("<?php echo $lang->showWord("done")?>");
  522. } else {
  523. alert(JSON.parse(request.responseText).message);
  524. }
  525. request = null;
  526. }
  527. }
  528. }
  529. }
  530. function formCheck()
  531. {
  532. var MaxChargingEnergy = document.getElementById("MaxChargingEnergy").value;
  533. var MaxChargingPower = document.getElementById("MaxChargingPower").value;
  534. var MaxChargingCurrent = document.getElementById("MaxChargingCurrent").value;
  535. var MaxChargingDuration = document.getElementById("MaxChargingDuration").value;
  536. if(MaxChargingEnergy >65535)
  537. {
  538. alert("MaxChargingEnergy must <= 65535!");
  539. document.getElementById("MaxChargingEnergy").focus();
  540. return false;
  541. }
  542. if(MaxChargingEnergy < 0)
  543. {
  544. alert("MaxChargingEnergy must >= 0!");
  545. document.getElementById("MaxChargingEnergy").focus();
  546. return false;
  547. }
  548. if(MaxChargingPower >65535)
  549. {
  550. alert("MaxChargingPower must <= 65535!");
  551. document.getElementById("MaxChargingPower").focus();
  552. return false;
  553. }
  554. if(MaxChargingPower < 0)
  555. {
  556. alert("MaxChargingPower must >= 0!");
  557. document.getElementById("MaxChargingPower").focus();
  558. return false;
  559. }
  560. if(MaxChargingCurrent >65535)
  561. {
  562. alert("MaxChargingCurrent must <= 65535!");
  563. document.getElementById("MaxChargingCurrent").focus();
  564. return false;
  565. }
  566. if(MaxChargingCurrent < 0)
  567. {
  568. alert("MaxChargingCurrent must >= 0!");
  569. document.getElementById("MaxChargingCurrent").focus();
  570. return false;
  571. }
  572. if(MaxChargingDuration >65535)
  573. {
  574. alert("MaxChargingDuration must <= 65535!");
  575. document.getElementById("MaxChargingDuration").focus();
  576. return false;
  577. }
  578. if(MaxChargingDuration < 0)
  579. {
  580. alert("MaxChargingDuration must >= 0!");
  581. document.getElementById("MaxChargingDuration").focus();
  582. return false;
  583. }
  584. return true;
  585. }
  586. function isNumberKey(evt)
  587. {
  588. var charCode = (evt.which) ? evt.which : event.keyCode
  589. if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 46))
  590. return false;
  591. return true;
  592. }
  593. </script>
  594. </html>