set_charging.php 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  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='update';
  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='update';
  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='update';
  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. <small class="form-text text-muted-red">kWh</small>
  254. <input type="text" name="MaxChargingEnergy" id="MaxChargingEnergy" class="form-control" value="<?php echo $obj['MaxChargingEnergy'];?>">
  255. </div>
  256. <div class="form-group" style="display:<?php echo $am001;?>">
  257. <label>MaxChargingPower</label>
  258. <small class="form-text text-muted-red">kW</small>
  259. <input type="text" name="MaxChargingPower" id="MaxChargingPower" class="form-control" value="<?php echo $obj['MaxChargingPower'];?>">
  260. <input type="hidden" name="RatingPower" id="RatingPower" value="<?php echo $RatingPower;?>">
  261. </div>
  262. <div class="form-group" style="display:<?php echo $am111;?>">
  263. <label>MaxChargingCurrent</label>
  264. <small class="form-text text-muted-red">amp</small>
  265. <input type="text" name="MaxChargingCurrent" id="MaxChargingCurrent" class="form-control" value="<?php echo $obj['MaxChargingCurrent'];?>">
  266. <input type="hidden" name="RatingCurrent" id="RatingCurrent" value="<?php echo $RatingCurrent;?>">
  267. </div>
  268. <div class="form-group" style="display:<?php echo $am111;?>">
  269. <label>MaxChargingDuration</label>
  270. <small class="form-text text-muted-red">minutes</small>
  271. <input type="text" name="MaxChargingDuration" id="MaxChargingDuration" class="form-control" value="<?php echo $obj['MaxChargingDuration'];?>">
  272. </div>
  273. <div class="form-group" style="display:<?php echo $am001;?>">
  274. <label>PhaseLossPolicy</label>
  275. <select class="form-control" id="PhaseLossPolicy" name="PhaseLossPolicy">
  276. <option value="0" <?php echo $obj['PhaseLossPolicy']=="0"?"selected":""?>>charging</option>
  277. <option value="1" <?php echo $obj['PhaseLossPolicy']=="1"?"selected":""?>>stop charging</option>
  278. </select>
  279. </div>
  280. <div class="form-group" style="display:<?php echo $am111;?>">
  281. <label>LocalWhiteCard0</label>
  282. <input type="text" name="LocalWhiteCard0" id="LocalWhiteCard0" class="form-control" value="<?php echo $obj['LocalWhiteCard'][0];?>">
  283. </div>
  284. <div class="form-group" style="display:<?php echo $am111;?>">
  285. <label>LocalWhiteCard1</label>
  286. <input type="text" name="LocalWhiteCard1" id="LocalWhiteCard1" class="form-control" value="<?php echo $obj['LocalWhiteCard'][1];?>">
  287. </div>
  288. <div class="form-group" style="display:<?php echo $am111;?>">
  289. <label>LocalWhiteCard2</label>
  290. <input type="text" name="LocalWhiteCard2" id="LocalWhiteCard2" class="form-control" value="<?php echo $obj['LocalWhiteCard'][2];?>">
  291. </div>
  292. <div class="form-group" style="display:<?php echo $am111;?>">
  293. <label>LocalWhiteCard3</label>
  294. <input type="text" name="LocalWhiteCard3" id="LocalWhiteCard3" class="form-control" value="<?php echo $obj['LocalWhiteCard'][3];?>">
  295. </div>
  296. <div class="form-group" style="display:<?php echo $am111;?>">
  297. <label>LocalWhiteCard4</label>
  298. <input type="text" name="LocalWhiteCard4" id="LocalWhiteCard4" class="form-control" value="<?php echo $obj['LocalWhiteCard'][4];?>">
  299. </div>
  300. <div class="form-group" style="display:<?php echo $am111;?>">
  301. <label>LocalWhiteCard5</label>
  302. <input type="text" name="LocalWhiteCard5" id="LocalWhiteCard5" class="form-control" value="<?php echo $obj['LocalWhiteCard'][5];?>">
  303. </div>
  304. <div class="form-group" style="display:<?php echo $am111;?>">
  305. <label>LocalWhiteCard6</label>
  306. <input type="text" name="LocalWhiteCard6" id="LocalWhiteCard6" class="form-control" value="<?php echo $obj['LocalWhiteCard'][6];?>">
  307. </div>
  308. <div class="form-group" style="display:<?php echo $am111;?>">
  309. <label>LocalWhiteCard7</label>
  310. <input type="text" name="LocalWhiteCard7" id="LocalWhiteCard7" class="form-control" value="<?php echo $obj['LocalWhiteCard'][7];?>">
  311. </div>
  312. <div class="form-group" style="display:<?php echo $am111;?>">
  313. <label>LocalWhiteCard8</label>
  314. <input type="text" name="LocalWhiteCard8" id="LocalWhiteCard8" class="form-control" value="<?php echo $obj['LocalWhiteCard'][8];?>">
  315. </div>
  316. <div class="form-group" style="display:<?php echo $am111;?>">
  317. <label>LocalWhiteCard9</label>
  318. <input type="text" name="LocalWhiteCard9" id="LocalWhiteCard9" class="form-control" value="<?php echo $obj['LocalWhiteCard'][9];?>">
  319. </div>
  320. <?php /* <div class="form-group" style="display:<?php echo $am111;?>">
  321. <label>CcsAuthentication</label>
  322. <select class="form-control" id="CcsAuthentication" name="CcsAuthentication">
  323. <option value="0" <?php echo $obj['CcsAuthentication']==0?"selected":""?>>EIM</option>
  324. <option value="1" <?php echo $obj['CcsAuthentication']==1?"selected":""?>>EIM&PnC mixed</option>
  325. </select>
  326. </div>
  327. <div class="form-group" style="display:<?php echo $am111;?>">
  328. <label>AcCcsChargingModel</label>
  329. <select class="form-control" id="AcCcsChargingModel" name="AcCcsChargingModel">
  330. <option value="0" <?php echo $obj['AcCcsChargingModel']==0?"selected":""?>>BC (PWM) only</option>
  331. <option value="1" <?php echo $obj['AcCcsChargingModel']==0?"selected":""?>>BC&PLC mixed</option>
  332. </select>
  333. </div>*/?>
  334. </section>
  335. </article>
  336. <?php if($obj['ChargingInfo1']){ $idx++;?>
  337. <!--Charging Information-->
  338. <article class="envor-sorting-item css">
  339. <header><?php echo $lang->showWord("charging_information").$idx; ?><i class="fa fa-plus"></i></header>
  340. <section>
  341. <div class="form-group" style="display:<?php echo $am111;?>">
  342. <label>User Id</label>
  343. <input type="text" readonly class="form-control" value="<?php echo $obj['ChargingInfo1']['StartUserId'];?>">
  344. <input type="hidden" name="UserId1" id="UserId1" value="<?php echo $obj['ChargingInfo1']['StartUserId'];?>">
  345. </div>
  346. <div class="form-group" style="display:<?php echo $am111;?>">
  347. <label>StartDateTime</label>
  348. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StartDateTime'];?>">
  349. <input type="hidden" name="StartDateTime1" id="StartDateTime1" value="<?php echo $obj['ChargingInfo1']['StartDateTime'];?>">
  350. </div>
  351. <div class="form-group" style="display:<?php echo $am111;?>">
  352. <label>StopDateTime</label>
  353. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StopDateTime'];?>">
  354. <input type="hidden" name="StopDateTime1" id="StopDateTime1" value="<?php echo $obj['ChargingInfo1']['StopDateTime'];?>">
  355. </div>
  356. <div class="form-group" style="display:<?php echo $am111;?>">
  357. <label>StartMethod</label>
  358. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StartMethod'];?>">
  359. <input type="hidden" name="StartMethod1" id="StartMethod1" value="<?php echo $obj['ChargingInfo1']['StartMethod'];?>">
  360. </div>
  361. <div class="form-group" style="display:<?php echo $am111;?>">
  362. <label>SystemStatus</label>
  363. <input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus1;?>">
  364. <input type="hidden" name="SystemStatus1" id="SystemStatus1" value="<?php echo $obj['ChargingInfo1']['SystemStatus'];?>">
  365. </div>
  366. <div class="form-group" style="display:<?php echo $am111;?>">
  367. <label>ConnectorTemp</label>
  368. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['ConnectorTemp'];?> ℃">
  369. <input type="hidden" name="ConnectorTemp1" id="ConnectorTemp1" value="<?php echo $obj['ChargingInfo1']['ConnectorTemp'];?>">
  370. </div>
  371. <div class="form-group" style="display:<?php echo $am001;?>">
  372. <label>PresentChargingVoltage</label>
  373. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargingVoltage'];?> volt">
  374. <input type="hidden" name="PresentChargingVoltage1" id="PresentChargingVoltage1" value="<?php echo $obj['ChargingInfo1']['PresentChargingVoltage'];?>">
  375. </div>
  376. <div class="form-group" style="display:<?php echo $am111;?>">
  377. <label>PresentChargingCurrent</label>
  378. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargingCurrent'];?> amp">
  379. <input type="hidden" name="PresentChargingCurrent1" id="PresentChargingCurrent1" value="<?php echo $obj['ChargingInfo1']['PresentChargingCurrent'];?>">
  380. </div>
  381. <div class="form-group" style="display:<?php echo $am111;?>">
  382. <label>PresentChargingPower</label>
  383. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargingPower'];?> kW">
  384. <input type="hidden" name="PresentChargingPower1" id="PresentChargingPower1" value="<?php echo $obj['ChargingInfo1']['PresentChargingPower'];?>">
  385. </div>
  386. <div class="form-group" style="display:<?php echo $am111;?>">
  387. <label>PresentChargedEnergy</label>
  388. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargedEnergy'];?> kWh">
  389. <input type="hidden" name="PresentChargedEnergy1" id="PresentChargedEnergy1" value="<?php echo $obj['ChargingInfo1']['PresentChargedEnergy'];?>">
  390. </div>
  391. <div class="form-group" style="display:<?php echo $am111;?>">
  392. <label>PresentChargedDuration</label>
  393. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargedDuration'];?> seconds">
  394. <input type="hidden" name="PresentChargedDuration1" id="PresentChargedDuration1" value="<?php echo $obj['ChargingInfo1']['PresentChargedDuration'];?>">
  395. </div>
  396. <div class="form-group" style="display:<?php echo $am001;?>">
  397. <label>RemainChargingDuration</label>
  398. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['RemainChargingDuration'];?> seconds">
  399. <input type="hidden" name="RemainChargingDuration1" id="RemainChargingDuration1" value="<?php echo $obj['ChargingInfo1']['RemainChargingDuration'];?>">
  400. </div>
  401. <div class="form-group" style="display:<?php echo $am001;?>">
  402. <label>EvBatteryMaxVoltage</label>
  403. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['EvBatteryMaxVoltage'];?> volt">
  404. <input type="hidden" name="EvBatteryMaxVoltage1" id="EvBatteryMaxVoltage1" value="<?php echo $obj['ChargingInfo1']['EvBatteryMaxVoltage'];?>">
  405. </div>
  406. <div class="form-group" style="display:<?php echo $am001;?>">
  407. <label>EvBatterytargetVoltage</label>
  408. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['EvBatterytargetVoltage'];?> volt">
  409. <input type="hidden" name="EvBatterytargetVoltage1" id="EvBatterytargetVoltage1" value="<?php echo $obj['ChargingInfo1']['EvBatterytargetVoltage'];?>">
  410. </div>
  411. <div class="form-group" style="display:<?php echo $am001;?>">
  412. <label>EvBatterySoc</label>
  413. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['EvBatterySoc'];?>">
  414. <input type="hidden" name="EvBatterySoc1" id="EvBatterySoc1" value="<?php echo $obj['ChargingInfo1']['EvBatterySoc'];?>">
  415. </div>
  416. </section>
  417. </article>
  418. <?php }?>
  419. <?php if($obj['ChargingInfo2']){ $idx++;?>
  420. <!--Charging Information-->
  421. <article class="envor-sorting-item css">
  422. <header><?php echo $lang->showWord("charging_information").$idx; ?><i class="fa fa-plus"></i></header>
  423. <section>
  424. <div class="form-group" style="display:<?php echo $am111;?>">
  425. <label>User Id</label>
  426. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartUserId'];?>">
  427. <input type="hidden" name="UserId2" id="UserId2" value="<?php echo $obj['ChargingInfo2']['StartUserId'];?>">
  428. </div>
  429. <div class="form-group" style="display:<?php echo $am111;?>">
  430. <label>StartDateTime</label>
  431. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartDateTime'];?>">
  432. <input type="hidden" name="StartDateTime2" id="StartDateTime2" value="<?php echo $obj['ChargingInfo2']['StartDateTime'];?>">
  433. </div>
  434. <div class="form-group" style="display:<?php echo $am111;?>">
  435. <label>StopDateTime</label>
  436. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StopDateTime'];?>">
  437. <input type="hidden" name="StopDateTime2" id="StopDateTime2" value="<?php echo $obj['ChargingInfo2']['StopDateTime'];?>">
  438. </div>
  439. <div class="form-group" style="display:<?php echo $am111;?>">
  440. <label>StartMethod</label>
  441. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartMethod'];?>">
  442. <input type="hidden" name="StartMethod2" id="StartMethod2" value="<?php echo $obj['ChargingInfo2']['StartMethod'];?>">
  443. </div>
  444. <div class="form-group" style="display:<?php echo $am111;?>">
  445. <label>SystemStatus</label>
  446. <input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus2;?>">
  447. <input type="hidden" name="SystemStatus2" id="SystemStatus2" value="<?php echo $obj['ChargingInfo2']['SystemStatus'];?>">
  448. </div>
  449. <div class="form-group" style="display:<?php echo $am111;?>">
  450. <label>ConnectorTemp</label>
  451. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['ConnectorTemp'];?> ℃">
  452. <input type="hidden" name="ConnectorTemp2" id="ConnectorTemp2" value="<?php echo $obj['ChargingInfo2']['ConnectorTemp'];?>">
  453. </div>
  454. <div class="form-group" style="display:<?php echo $am001;?>">
  455. <label>PresentChargingVoltage</label>
  456. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargingVoltage'];?> volt">
  457. <input type="hidden" name="PresentChargingVoltage2" id="PresentChargingVoltage2" value="<?php echo $obj['ChargingInfo2']['PresentChargingVoltage'];?>">
  458. </div>
  459. <div class="form-group" style="display:<?php echo $am111;?>">
  460. <label>PresentChargingCurrent</label>
  461. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargingCurrent'];?> amp">
  462. <input type="hidden" name="PresentChargingCurrent2" id="PresentChargingCurrent2" value="<?php echo $obj['ChargingInfo2']['PresentChargingCurrent'];?>">
  463. </div>
  464. <div class="form-group" style="display:<?php echo $am111;?>">
  465. <label>PresentChargingPower</label>
  466. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargingPower'];?> kW">
  467. <input type="hidden" name="PresentChargingPower2" id="PresentChargingPower2" value="<?php echo $obj['ChargingInfo2']['PresentChargingPower'];?>">
  468. </div>
  469. <div class="form-group" style="display:<?php echo $am111;?>">
  470. <label>PresentChargedEnergy</label>
  471. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargedEnergy'];?> kWh">
  472. <input type="hidden" name="PresentChargedEnergy2" id="PresentChargedEnergy2" value="<?php echo $obj['ChargingInfo2']['PresentChargedEnergy'];?>">
  473. </div>
  474. <div class="form-group" style="display:<?php echo $am111;?>">
  475. <label>PresentChargedDuration</label>
  476. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargedDuration'];?> seconds">
  477. <input type="hidden" name="PresentChargedDuration2" id="PresentChargedDuration2" value="<?php echo $obj['ChargingInfo2']['PresentChargedDuration'];?>">
  478. </div>
  479. <div class="form-group" style="display:<?php echo $am001;?>">
  480. <label>RemainChargingDuration</label>
  481. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['RemainChargingDuration'];?> seconds">
  482. <input type="hidden" name="RemainChargingDuration2" id="RemainChargingDuration2" value="<?php echo $obj['ChargingInfo2']['RemainChargingDuration'];?>">
  483. </div>
  484. <div class="form-group" style="display:<?php echo $am001;?>">
  485. <label>EvBatteryMaxVoltage</label>
  486. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['EvBatteryMaxVoltage'];?> volt">
  487. <input type="hidden" name="EvBatteryMaxVoltage2" id="EvBatteryMaxVoltage2" value="<?php echo $obj['ChargingInfo2']['EvBatteryMaxVoltage'];?>">
  488. </div>
  489. <div class="form-group" style="display:<?php echo $am001;?>">
  490. <label>EvBatterytargetVoltage</label>
  491. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['EvBatterytargetVoltage'];?> volt">
  492. <input type="hidden" name="EvBatterytargetVoltage2" id="EvBatterytargetVoltage2" value="<?php echo $obj['ChargingInfo2']['EvBatterytargetVoltage'];?>">
  493. </div>
  494. <div class="form-group" style="display:<?php echo $am001;?>">
  495. <label>EvBatterySoc</label>
  496. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['EvBatterySoc'];?>">
  497. <input type="hidden" name="EvBatterySoc2" id="EvBatterySoc2" value="<?php echo $obj['ChargingInfo2']['EvBatterySoc'];?>">
  498. </div>
  499. </section>
  500. </article>
  501. <?php }?>
  502. <?php if($obj['ChargingInfo3']){ $idx++;?>
  503. <!--Charging Information-->
  504. <article class="envor-sorting-item css">
  505. <header><?php echo $lang->showWord("charging_information").$idx; ?><i class="fa fa-plus"></i></header>
  506. <section>
  507. <div class="form-group" style="display:<?php echo $am111;?>">
  508. <label>User Id</label>
  509. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartUserId'];?>">
  510. <input type="hidden" name="UserId3" id="UserId3" value="<?php echo $obj['ChargingInfo3']['StartUserId'];?>">
  511. </div>
  512. <div class="form-group" style="display:<?php echo $am111;?>">
  513. <label>StartDateTime</label>
  514. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartDateTime'];?>">
  515. <input type="hidden" name="StartDateTime3" id="StartDateTime3" value="<?php echo $obj['ChargingInfo3']['StartDateTime'];?>">
  516. </div>
  517. <div class="form-group" style="display:<?php echo $am111;?>">
  518. <label>StopDateTime</label>
  519. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StopDateTime'];?>">
  520. <input type="hidden" name="StopDateTime3" id="StopDateTime3" value="<?php echo $obj['ChargingInfo3']['StopDateTime'];?>">
  521. </div>
  522. <div class="form-group" style="display:<?php echo $am111;?>">
  523. <label>StartMethod</label>
  524. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartMethod'];?>">
  525. <input type="hidden" name="StartMethod3" id="StartMethod3" value="<?php echo $obj['ChargingInfo3']['StartMethod'];?>">
  526. </div>
  527. <div class="form-group" style="display:<?php echo $am111;?>">
  528. <label>SystemStatus</label>
  529. <input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus3;?>">
  530. <input type="hidden" name="SystemStatus3" id="SystemStatus3" value="<?php echo $obj['ChargingInfo3']['SystemStatus'];?>">
  531. </div>
  532. <div class="form-group" style="display:<?php echo $am111;?>">
  533. <label>ConnectorTemp</label>
  534. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['ConnectorTemp'];?> ℃">
  535. <input type="hidden" name="ConnectorTemp3" id="ConnectorTemp3" value="<?php echo $obj['ChargingInfo3']['ConnectorTemp'];?>">
  536. </div>
  537. <div class="form-group" style="display:<?php echo $am001;?>">
  538. <label>PresentChargingVoltage</label>
  539. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargingVoltage'];?> volt">
  540. <input type="hidden" name="PresentChargingVoltage3" id="PresentChargingVoltage3" value="<?php echo $obj['ChargingInfo3']['PresentChargingVoltage'];?>">
  541. </div>
  542. <div class="form-group" style="display:<?php echo $am111;?>">
  543. <label>PresentChargingCurrent</label>
  544. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargingCurrent'];?> amp">
  545. <input type="hidden" name="PresentChargingCurrent3" id="PresentChargingCurrent3" value="<?php echo $obj['ChargingInfo3']['PresentChargingCurrent'];?>">
  546. </div>
  547. <div class="form-group" style="display:<?php echo $am111;?>">
  548. <label>PresentChargingPower</label>
  549. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargingPower'];?> kW">
  550. <input type="hidden" name="PresentChargingPower3" id="PresentChargingPower3" value="<?php echo $obj['ChargingInfo3']['PresentChargingPower'];?>">
  551. </div>
  552. <div class="form-group" style="display:<?php echo $am111;?>">
  553. <label>PresentChargedEnergy</label>
  554. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargedEnergy'];?> kWh">
  555. <input type="hidden" name="PresentChargedEnergy3" id="PresentChargedEnergy3" value="<?php echo $obj['ChargingInfo3']['PresentChargedEnergy'];?>">
  556. </div>
  557. <div class="form-group" style="display:<?php echo $am111;?>">
  558. <label>PresentChargedDuration</label>
  559. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargedDuration'];?> seconds">
  560. <input type="hidden" name="PresentChargedDuration3" id="PresentChargedDuration3" value="<?php echo $obj['ChargingInfo3']['PresentChargedDuration'];?>">
  561. </div>
  562. <div class="form-group" style="display:<?php echo $am001;?>">
  563. <label>RemainChargingDuration</label>
  564. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['RemainChargingDuration'];?> seconds">
  565. <input type="hidden" name="RemainChargingDuration3" id="RemainChargingDuration3" value="<?php echo $obj['ChargingInfo3']['RemainChargingDuration'];?>">
  566. </div>
  567. <div class="form-group" style="display:<?php echo $am001;?>">
  568. <label>EvBatteryMaxVoltage</label>
  569. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['EvBatteryMaxVoltage'];?> volt">
  570. <input type="hidden" name="EvBatteryMaxVoltage3" id="EvBatteryMaxVoltage3" value="<?php echo $obj['ChargingInfo3']['EvBatteryMaxVoltage'];?>">
  571. </div>
  572. <div class="form-group" style="display:<?php echo $am001;?>">
  573. <label>EvBatterytargetVoltage</label>
  574. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['EvBatterytargetVoltage'];?> volt">
  575. <input type="hidden" name="EvBatterytargetVoltage3" id="EvBatterytargetVoltage3" value="<?php echo $obj['ChargingInfo3']['EvBatterytargetVoltage'];?>">
  576. </div>
  577. <div class="form-group" style="display:<?php echo $am001;?>">
  578. <label>EvBatterySoc</label>
  579. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['EvBatterySoc'];?>">
  580. <input type="hidden" name="EvBatterySoc3" id="EvBatterySoc3" value="<?php echo $obj['ChargingInfo3']['EvBatterySoc'];?>">
  581. </div>
  582. </section>
  583. </article>
  584. <?php }?>
  585. <article class="envor-sorting-item css">
  586. <div align="center"><button id="save"><?php echo $lang->showWord("set")?></button></div>
  587. </article>
  588. </div>
  589. </div>
  590. </div>
  591. </div>
  592. </div>
  593. </section>
  594. </div>
  595. <?php
  596. include 'foot.php';
  597. ?>
  598. <script type="text/JavaScript">
  599. document.getElementById("save").onclick = function() {
  600. if(formCheck())
  601. {
  602. document.getElementById("loading").style.display="block";
  603. // 發送 Ajax 查詢請求並處理
  604. var request = new XMLHttpRequest();
  605. request.open("POST", "set_charging_action.php");
  606. // POST 參數須使用 send() 發送
  607. var data = "MaxChargingEnergy=" + document.getElementById("MaxChargingEnergy").value +
  608. "&MaxChargingPower=" + document.getElementById("MaxChargingPower").value +
  609. "&MaxChargingCurrent=" + document.getElementById("MaxChargingCurrent").value+
  610. "&MaxChargingDuration=" + document.getElementById("MaxChargingDuration").value+
  611. "&PhaseLossPolicy=" + document.getElementById("PhaseLossPolicy").value+
  612. "&LocalWhiteCard0=" + document.getElementById("LocalWhiteCard0").value+
  613. "&LocalWhiteCard1=" + document.getElementById("LocalWhiteCard1").value+
  614. "&LocalWhiteCard2=" + document.getElementById("LocalWhiteCard2").value+
  615. "&LocalWhiteCard3=" + document.getElementById("LocalWhiteCard3").value+
  616. "&LocalWhiteCard4=" + document.getElementById("LocalWhiteCard4").value+
  617. "&LocalWhiteCard5=" + document.getElementById("LocalWhiteCard5").value+
  618. "&LocalWhiteCard6=" + document.getElementById("LocalWhiteCard6").value+
  619. "&LocalWhiteCard7=" + document.getElementById("LocalWhiteCard7").value+
  620. "&LocalWhiteCard8=" + document.getElementById("LocalWhiteCard8").value+
  621. "&LocalWhiteCard9=" + document.getElementById("LocalWhiteCard9").value;
  622. // "&CcsAuthentication=" + document.getElementById("CcsAuthentication").value+
  623. // "&AcCcsChargingModel=" + document.getElementById("AcCcsChargingModel").value;
  624. // POST 請求必須設置表頭在 open() 下面,send() 上面
  625. request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  626. request.send(data);
  627. request.onreadystatechange = function() {
  628. // 伺服器請求完成
  629. if (request.readyState == 4) {
  630. document.getElementById("loading").style.display="none";
  631. // 伺服器回應成功
  632. if (request.status == 200 && JSON.parse(request.responseText).result=="Success") {
  633. alert("<?php echo $lang->showWord("done")?>");
  634. } else {
  635. alert(JSON.parse(request.responseText).message);
  636. }
  637. request = null;
  638. }
  639. }
  640. }
  641. }
  642. function formCheck()
  643. {
  644. var RatingCurrent = document.getElementById("RatingCurrent").value;
  645. var RatingPower = document.getElementById("RatingPower").value;
  646. var MaxChargingEnergy = document.getElementById("MaxChargingEnergy").value;
  647. var MaxChargingPower = document.getElementById("MaxChargingPower").value;
  648. var MaxChargingCurrent = document.getElementById("MaxChargingCurrent").value;
  649. var MaxChargingDuration = document.getElementById("MaxChargingDuration").value;
  650. if(MaxChargingEnergy >65535)
  651. {
  652. alert("MaxChargingEnergy must <= 65535!");
  653. document.getElementById("MaxChargingEnergy").focus();
  654. return false;
  655. }
  656. if(MaxChargingEnergy < 0)
  657. {
  658. alert("MaxChargingEnergy must >= 0!");
  659. document.getElementById("MaxChargingEnergy").focus();
  660. return false;
  661. }
  662. if(RatingPower!="" && RatingPower!=0){
  663. if(MaxChargingPower > RatingPower)
  664. {
  665. alert("MaxChargingPower must be less than RatingPower("+RatingPower+")!");
  666. document.getElementById("MaxChargingPower").focus();
  667. return false;
  668. }
  669. }
  670. else{
  671. if(MaxChargingPower >65535)
  672. {
  673. alert("MaxChargingPower must <= 65535!");
  674. document.getElementById("MaxChargingPower").focus();
  675. return false;
  676. }
  677. }
  678. if(MaxChargingPower < 0)
  679. {
  680. alert("MaxChargingPower must >= 0!");
  681. document.getElementById("MaxChargingPower").focus();
  682. return false;
  683. }
  684. if(RatingCurrent!="" && RatingCurrent!=0){
  685. if(MaxChargingCurrent > RatingCurrent)
  686. {
  687. alert("MaxChargingCurrent must be less than RatingCurrent("+RatingCurrent+")!");
  688. document.getElementById("MaxChargingCurrent").focus();
  689. return false;
  690. }
  691. }
  692. else{
  693. if(MaxChargingCurrent >65535)
  694. {
  695. alert("MaxChargingCurrent must <= 65535!");
  696. document.getElementById("MaxChargingCurrent").focus();
  697. return false;
  698. }
  699. }
  700. if(MaxChargingCurrent < 0)
  701. {
  702. alert("MaxChargingCurrent must >= 0!");
  703. document.getElementById("MaxChargingCurrent").focus();
  704. return false;
  705. }
  706. if(MaxChargingDuration >65535)
  707. {
  708. alert("MaxChargingDuration must <= 65535!");
  709. document.getElementById("MaxChargingDuration").focus();
  710. return false;
  711. }
  712. if(MaxChargingDuration < 0)
  713. {
  714. alert("MaxChargingDuration must >= 0!");
  715. document.getElementById("MaxChargingDuration").focus();
  716. return false;
  717. }
  718. return true;
  719. }
  720. function isNumberKey(evt)
  721. {
  722. var charCode = (evt.which) ? evt.which : event.keyCode
  723. if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 46))
  724. return false;
  725. return true;
  726. }
  727. </script>
  728. </html>