set_charging.php 34 KB

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