set_charging.php 39 KB

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