set_charging.php 32 KB

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