set_charging.php 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881
  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":"";?>" title="'0' means unlimit" onchange="MaxValue_changed(document.getElementById('MaxChargingEnergy').id,document.getElementById('MaxChargingEnergyText').id);">
  282. <small class="form-text text-muted-red"><label id="MaxChargingEnergyText" style="display:none;">'0' means unlimit</label></small>
  283. </div>
  284. <div class="form-group" style="display:<?php echo $am001;?>">
  285. <label>Max Charging Power</label>
  286. <small class="form-text text-muted-red">kW</small>
  287. <input type="text" name="MaxChargingPower" id="MaxChargingPower" class="form-control" value="<?php echo $obj['MaxChargingPower'];?>" placeholder="<?php echo ($obj['MaxChargingPower']==0||$obj['MaxChargingPower']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit" onchange="MaxValue_changed(document.getElementById('MaxChargingPower').id,document.getElementById('MaxChargingPowerText').id);">
  288. <input type="hidden" name="RatingPower" id="RatingPower" value="<?php echo $RatingPower;?>">
  289. <small class="form-text text-muted-red"><label id="MaxChargingPowerText" style="display:none;">'0' means unlimit</label></small>
  290. </div>
  291. <div class="form-group" style="display:<?php echo $am111;?>">
  292. <label>Max Charging Current</label>
  293. <small class="form-text text-muted-red">amp</small>
  294. <input type="text" name="MaxChargingCurrent" id="MaxChargingCurrent" class="form-control" value="<?php echo $obj['MaxChargingCurrent'];?>" placeholder="<?php echo ($obj['MaxChargingCurrent']==0||$obj['MaxChargingCurrent']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit" onchange="MaxValue_changed(document.getElementById('MaxChargingCurrent').id,document.getElementById('MaxChargingCurrentText').id);">
  295. <input type="hidden" name="RatingCurrent" id="RatingCurrent" value="<?php echo $RatingCurrent;?>">
  296. <small class="form-text text-muted-red"><label id="MaxChargingCurrentText" style="display:none;">'0' means unlimit</label></small>
  297. </div>
  298. <div class="form-group" style="display:<?php echo $am111;?>">
  299. <label>Max Charging Duration</label>
  300. <small class="form-text text-muted-red">minutes</small>
  301. <input type="text" name="MaxChargingDuration" id="MaxChargingDuration" class="form-control" value="<?php echo $obj['MaxChargingDuration'];?>" placeholder="<?php echo ($obj['MaxChargingDuration']==0||$obj['MaxChargingDuration']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit" onchange="MaxValue_changed(document.getElementById('MaxChargingDuration').id,document.getElementById('MaxChargingDurationText').id);">
  302. <small class="form-text text-muted-red"><label id="MaxChargingDurationText" style="display:none;">'0' means unlimit</label></small>
  303. </div>
  304. <div class="form-group" style="display:<?php echo $am001;?>">
  305. <label>AC Phase Loss Policy</label>
  306. <select class="form-control" id="PhaseLossPolicy" name="PhaseLossPolicy">
  307. <option value="0" <?php echo $obj['PhaseLossPolicy']=="0"?"selected":""?>>de-rating</option>
  308. <option value="1" <?php echo $obj['PhaseLossPolicy']=="1"?"selected":""?>>stop charging</option>
  309. </select>
  310. </div>
  311. <div class="form-group" style="display:<?php echo $am111;?>">
  312. <label>Local White Card0</label>
  313. <input type="text" name="LocalWhiteCard0" id="LocalWhiteCard0" class="form-control" value="<?php echo $obj['LocalWhiteCard'][0];?>">
  314. </div>
  315. <div class="form-group" style="display:<?php echo $am111;?>">
  316. <label>Local White Card1</label>
  317. <input type="text" name="LocalWhiteCard1" id="LocalWhiteCard1" class="form-control" value="<?php echo $obj['LocalWhiteCard'][1];?>">
  318. </div>
  319. <div class="form-group" style="display:<?php echo $am111;?>">
  320. <label>Local White Card2</label>
  321. <input type="text" name="LocalWhiteCard2" id="LocalWhiteCard2" class="form-control" value="<?php echo $obj['LocalWhiteCard'][2];?>">
  322. </div>
  323. <div class="form-group" style="display:<?php echo $am111;?>">
  324. <label>Local White Card3</label>
  325. <input type="text" name="LocalWhiteCard3" id="LocalWhiteCard3" class="form-control" value="<?php echo $obj['LocalWhiteCard'][3];?>">
  326. </div>
  327. <div class="form-group" style="display:<?php echo $am111;?>">
  328. <label>Local White Card4</label>
  329. <input type="text" name="LocalWhiteCard4" id="LocalWhiteCard4" class="form-control" value="<?php echo $obj['LocalWhiteCard'][4];?>">
  330. </div>
  331. <div class="form-group" style="display:<?php echo $am111;?>">
  332. <label>Local White Card5</label>
  333. <input type="text" name="LocalWhiteCard5" id="LocalWhiteCard5" class="form-control" value="<?php echo $obj['LocalWhiteCard'][5];?>">
  334. </div>
  335. <div class="form-group" style="display:<?php echo $am111;?>">
  336. <label>Local White Card6</label>
  337. <input type="text" name="LocalWhiteCard6" id="LocalWhiteCard6" class="form-control" value="<?php echo $obj['LocalWhiteCard'][6];?>">
  338. </div>
  339. <div class="form-group" style="display:<?php echo $am111;?>">
  340. <label>Local White Card7</label>
  341. <input type="text" name="LocalWhiteCard7" id="LocalWhiteCard7" class="form-control" value="<?php echo $obj['LocalWhiteCard'][7];?>">
  342. </div>
  343. <div class="form-group" style="display:<?php echo $am111;?>">
  344. <label>Local White Card8</label>
  345. <input type="text" name="LocalWhiteCard8" id="LocalWhiteCard8" class="form-control" value="<?php echo $obj['LocalWhiteCard'][8];?>">
  346. </div>
  347. <div class="form-group" style="display:<?php echo $am111;?>">
  348. <label>Local White Card9</label>
  349. <input type="text" name="LocalWhiteCard9" id="LocalWhiteCard9" class="form-control" value="<?php echo $obj['LocalWhiteCard'][9];?>">
  350. </div>
  351. <?php /* <div class="form-group" style="display:<?php echo $am111;?>">
  352. <label>CcsAuthentication</label>
  353. <select class="form-control" id="CcsAuthentication" name="CcsAuthentication">
  354. <option value="0" <?php echo $obj['CcsAuthentication']==0?"selected":""?>>EIM</option>
  355. <option value="1" <?php echo $obj['CcsAuthentication']==1?"selected":""?>>EIM&PnC mixed</option>
  356. </select>
  357. </div>
  358. <div class="form-group" style="display:<?php echo $am111;?>">
  359. <label>AcCcsChargingModel</label>
  360. <select class="form-control" id="AcCcsChargingModel" name="AcCcsChargingModel">
  361. <option value="0" <?php echo $obj['AcCcsChargingModel']==0?"selected":""?>>BC (PWM) only</option>
  362. <option value="1" <?php echo $obj['AcCcsChargingModel']==0?"selected":""?>>BC&PLC mixed</option>
  363. </select>
  364. </div>*/?>
  365. </section>
  366. </article>
  367. <?php if($obj['ChargingInfo1']){ $idx++;?>
  368. <!--Charging Information-->
  369. <article class="envor-sorting-item css">
  370. <header><?php echo $connectorType1." ".$lang->showWord("charging_information")."(connector".$idx.")"; ?><i class="fa fa-plus"></i></header>
  371. <section>
  372. <div class="form-group" style="display:<?php echo $am111;?>">
  373. <label>User Id</label>
  374. <input type="text" readonly class="form-control" value="<?php echo $obj['ChargingInfo1']['StartUserId'];?>">
  375. <input type="hidden" name="UserId1" id="UserId1" value="<?php echo $obj['ChargingInfo1']['StartUserId'];?>">
  376. </div>
  377. <div class="form-group" style="display:<?php echo $am111;?>">
  378. <label>Start Date Time</label>
  379. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StartDateTime'];?>">
  380. <input type="hidden" name="StartDateTime1" id="StartDateTime1" value="<?php echo $obj['ChargingInfo1']['StartDateTime'];?>">
  381. </div>
  382. <div class="form-group" style="display:<?php echo $am111;?>">
  383. <label>Stop Date Time</label>
  384. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StopDateTime'];?>">
  385. <input type="hidden" name="StopDateTime1" id="StopDateTime1" value="<?php echo $obj['ChargingInfo1']['StopDateTime'];?>">
  386. </div>
  387. <?php /* <div class="form-group" style="display:<?php echo $am111;?>">
  388. <label>StartMethod</label>
  389. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StartMethod'];?>">
  390. <input type="hidden" name="StartMethod1" id="StartMethod1" value="<?php echo $obj['ChargingInfo1']['StartMethod'];?>">
  391. </div>*/?>
  392. <div class="form-group" style="display:<?php echo $am111;?>">
  393. <label>System Status</label>
  394. <input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus1;?>">
  395. <input type="hidden" name="SystemStatus1" id="SystemStatus1" value="<?php echo $obj['ChargingInfo1']['SystemStatus'];?>">
  396. </div>
  397. <div class="form-group" style="display:<?php echo $am111;?>">
  398. <label>Connector Temperature</label>
  399. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['ConnectorTemp'];?> ℃">
  400. <input type="hidden" name="ConnectorTemp1" id="ConnectorTemp1" value="<?php echo $obj['ChargingInfo1']['ConnectorTemp'];?>">
  401. </div>
  402. <div class="form-group" style="display:<?php echo $am001;?>">
  403. <label>Present Charging Voltage</label>
  404. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargingVoltage'];?> volt">
  405. <input type="hidden" name="PresentChargingVoltage1" id="PresentChargingVoltage1" value="<?php echo $obj['ChargingInfo1']['PresentChargingVoltage'];?>">
  406. </div>
  407. <div class="form-group" style="display:<?php echo $am111;?>">
  408. <label>Present Charging Current</label>
  409. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargingCurrent'];?> amp">
  410. <input type="hidden" name="PresentChargingCurrent1" id="PresentChargingCurrent1" value="<?php echo $obj['ChargingInfo1']['PresentChargingCurrent'];?>">
  411. </div>
  412. <div class="form-group" style="display:<?php echo $am111;?>">
  413. <label>Present Charging Power</label>
  414. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargingPower'];?> kW">
  415. <input type="hidden" name="PresentChargingPower1" id="PresentChargingPower1" value="<?php echo $obj['ChargingInfo1']['PresentChargingPower'];?>">
  416. </div>
  417. <div class="form-group" style="display:<?php echo $am111;?>">
  418. <label>Present Charging Energy</label>
  419. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargedEnergy'];?> kWh">
  420. <input type="hidden" name="PresentChargedEnergy1" id="PresentChargedEnergy1" value="<?php echo $obj['ChargingInfo1']['PresentChargedEnergy'];?>">
  421. </div>
  422. <div class="form-group" style="display:<?php echo $am111;?>">
  423. <label>Present Charging Duration</label>
  424. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargedDuration'];?> seconds">
  425. <input type="hidden" name="PresentChargedDuration1" id="PresentChargedDuration1" value="<?php echo $obj['ChargingInfo1']['PresentChargedDuration'];?>">
  426. </div>
  427. <div class="form-group" style="display:<?php echo $am001;?>">
  428. <label>Remain Charging Time</label>
  429. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['RemainChargingDuration'];?> seconds">
  430. <input type="hidden" name="RemainChargingDuration1" id="RemainChargingDuration1" value="<?php echo $obj['ChargingInfo1']['RemainChargingDuration'];?>">
  431. </div>
  432. <div class="form-group" style="display:<?php echo $am001;?>">
  433. <label>EV Battery Max Voltage</label>
  434. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['EvBatteryMaxVoltage'];?> volt">
  435. <input type="hidden" name="EvBatteryMaxVoltage1" id="EvBatteryMaxVoltage1" value="<?php echo $obj['ChargingInfo1']['EvBatteryMaxVoltage'];?>">
  436. </div>
  437. <div class="form-group" style="display:<?php echo $am001;?>">
  438. <label>EV Battery Target Voltage</label>
  439. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['EvBatterytargetVoltage'];?> volt">
  440. <input type="hidden" name="EvBatterytargetVoltage1" id="EvBatterytargetVoltage1" value="<?php echo $obj['ChargingInfo1']['EvBatterytargetVoltage'];?>">
  441. </div>
  442. <div class="form-group" style="display:<?php echo $am001;?>">
  443. <label>EV Battery Soc</label>
  444. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['EvBatterySoc'];?>">
  445. <input type="hidden" name="EvBatterySoc1" id="EvBatterySoc1" value="<?php echo $obj['ChargingInfo1']['EvBatterySoc'];?>">
  446. </div>
  447. </section>
  448. </article>
  449. <?php }?>
  450. <?php if($obj['ChargingInfo2']){ $idx++;?>
  451. <!--Charging Information-->
  452. <article class="envor-sorting-item css">
  453. <header><?php echo $connectorType2." ".$lang->showWord("charging_information")."(connector".$idx.")"; ?><i class="fa fa-plus"></i></header>
  454. <section>
  455. <div class="form-group" style="display:<?php echo $am111;?>">
  456. <label>User Id</label>
  457. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartUserId'];?>">
  458. <input type="hidden" name="UserId2" id="UserId2" value="<?php echo $obj['ChargingInfo2']['StartUserId'];?>">
  459. </div>
  460. <div class="form-group" style="display:<?php echo $am111;?>">
  461. <label>Start Date Time</label>
  462. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartDateTime'];?>">
  463. <input type="hidden" name="StartDateTime2" id="StartDateTime2" value="<?php echo $obj['ChargingInfo2']['StartDateTime'];?>">
  464. </div>
  465. <div class="form-group" style="display:<?php echo $am111;?>">
  466. <label>Stop Date Time</label>
  467. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StopDateTime'];?>">
  468. <input type="hidden" name="StopDateTime2" id="StopDateTime2" value="<?php echo $obj['ChargingInfo2']['StopDateTime'];?>">
  469. </div>
  470. <?php /* <div class="form-group" style="display:<?php echo $am111;?>">
  471. <label>StartMethod</label>
  472. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartMethod'];?>">
  473. <input type="hidden" name="StartMethod2" id="StartMethod2" value="<?php echo $obj['ChargingInfo2']['StartMethod'];?>">
  474. </div>*/?>
  475. <div class="form-group" style="display:<?php echo $am111;?>">
  476. <label>System Status</label>
  477. <input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus2;?>">
  478. <input type="hidden" name="SystemStatus2" id="SystemStatus2" value="<?php echo $obj['ChargingInfo2']['SystemStatus'];?>">
  479. </div>
  480. <div class="form-group" style="display:<?php echo $am111;?>">
  481. <label>Connector Temperature</label>
  482. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['ConnectorTemp'];?> ℃">
  483. <input type="hidden" name="ConnectorTemp2" id="ConnectorTemp2" value="<?php echo $obj['ChargingInfo2']['ConnectorTemp'];?>">
  484. </div>
  485. <div class="form-group" style="display:<?php echo $am001;?>">
  486. <label>Present Charging Voltage</label>
  487. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargingVoltage'];?> volt">
  488. <input type="hidden" name="PresentChargingVoltage2" id="PresentChargingVoltage2" value="<?php echo $obj['ChargingInfo2']['PresentChargingVoltage'];?>">
  489. </div>
  490. <div class="form-group" style="display:<?php echo $am111;?>">
  491. <label>Present Charging Current</label>
  492. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargingCurrent'];?> amp">
  493. <input type="hidden" name="PresentChargingCurrent2" id="PresentChargingCurrent2" value="<?php echo $obj['ChargingInfo2']['PresentChargingCurrent'];?>">
  494. </div>
  495. <div class="form-group" style="display:<?php echo $am111;?>">
  496. <label>Present Charging Power</label>
  497. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargingPower'];?> kW">
  498. <input type="hidden" name="PresentChargingPower2" id="PresentChargingPower2" value="<?php echo $obj['ChargingInfo2']['PresentChargingPower'];?>">
  499. </div>
  500. <div class="form-group" style="display:<?php echo $am111;?>">
  501. <label>Present Charging Energy</label>
  502. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargedEnergy'];?> kWh">
  503. <input type="hidden" name="PresentChargedEnergy2" id="PresentChargedEnergy2" value="<?php echo $obj['ChargingInfo2']['PresentChargedEnergy'];?>">
  504. </div>
  505. <div class="form-group" style="display:<?php echo $am111;?>">
  506. <label>Present Charging Duration</label>
  507. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargedDuration'];?> seconds">
  508. <input type="hidden" name="PresentChargedDuration2" id="PresentChargedDuration2" value="<?php echo $obj['ChargingInfo2']['PresentChargedDuration'];?>">
  509. </div>
  510. <div class="form-group" style="display:<?php echo $am001;?>">
  511. <label>Remain Charging Time</label>
  512. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['RemainChargingDuration'];?> seconds">
  513. <input type="hidden" name="RemainChargingDuration2" id="RemainChargingDuration2" value="<?php echo $obj['ChargingInfo2']['RemainChargingDuration'];?>">
  514. </div>
  515. <div class="form-group" style="display:<?php echo $am001;?>">
  516. <label>EV Battery Max Voltage</label>
  517. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['EvBatteryMaxVoltage'];?> volt">
  518. <input type="hidden" name="EvBatteryMaxVoltage2" id="EvBatteryMaxVoltage2" value="<?php echo $obj['ChargingInfo2']['EvBatteryMaxVoltage'];?>">
  519. </div>
  520. <div class="form-group" style="display:<?php echo $am001;?>">
  521. <label>EV Battery Target Voltage</label>
  522. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['EvBatterytargetVoltage'];?> volt">
  523. <input type="hidden" name="EvBatterytargetVoltage2" id="EvBatterytargetVoltage2" value="<?php echo $obj['ChargingInfo2']['EvBatterytargetVoltage'];?>">
  524. </div>
  525. <div class="form-group" style="display:<?php echo $am001;?>">
  526. <label>EV Battery Soc</label>
  527. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['EvBatterySoc'];?>">
  528. <input type="hidden" name="EvBatterySoc2" id="EvBatterySoc2" value="<?php echo $obj['ChargingInfo2']['EvBatterySoc'];?>">
  529. </div>
  530. </section>
  531. </article>
  532. <?php }?>
  533. <?php if($obj['ChargingInfo3']){ $idx++;?>
  534. <!--Charging Information-->
  535. <article class="envor-sorting-item css">
  536. <header><?php echo $connectorType3." ".$lang->showWord("charging_information")."(connector".$idx.")"; ?><i class="fa fa-plus"></i></header>
  537. <section>
  538. <div class="form-group" style="display:<?php echo $am111;?>">
  539. <label>User Id</label>
  540. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartUserId'];?>">
  541. <input type="hidden" name="UserId3" id="UserId3" value="<?php echo $obj['ChargingInfo3']['StartUserId'];?>">
  542. </div>
  543. <div class="form-group" style="display:<?php echo $am111;?>">
  544. <label>Start Date Time</label>
  545. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartDateTime'];?>">
  546. <input type="hidden" name="StartDateTime3" id="StartDateTime3" value="<?php echo $obj['ChargingInfo3']['StartDateTime'];?>">
  547. </div>
  548. <div class="form-group" style="display:<?php echo $am111;?>">
  549. <label>Stop Date Time</label>
  550. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StopDateTime'];?>">
  551. <input type="hidden" name="StopDateTime3" id="StopDateTime3" value="<?php echo $obj['ChargingInfo3']['StopDateTime'];?>">
  552. </div>
  553. <?php /* <div class="form-group" style="display:<?php echo $am111;?>">
  554. <label>StartMethod</label>
  555. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartMethod'];?>">
  556. <input type="hidden" name="StartMethod3" id="StartMethod3" value="<?php echo $obj['ChargingInfo3']['StartMethod'];?>">
  557. </div>*/?>
  558. <div class="form-group" style="display:<?php echo $am111;?>">
  559. <label>System Status</label>
  560. <input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus3;?>">
  561. <input type="hidden" name="SystemStatus3" id="SystemStatus3" value="<?php echo $obj['ChargingInfo3']['SystemStatus'];?>">
  562. </div>
  563. <div class="form-group" style="display:<?php echo $am111;?>">
  564. <label>Connector Temperature</label>
  565. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['ConnectorTemp'];?> ℃">
  566. <input type="hidden" name="ConnectorTemp3" id="ConnectorTemp3" value="<?php echo $obj['ChargingInfo3']['ConnectorTemp'];?>">
  567. </div>
  568. <div class="form-group" style="display:<?php echo $am001;?>">
  569. <label>Present Charging Voltage</label>
  570. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargingVoltage'];?> volt">
  571. <input type="hidden" name="PresentChargingVoltage3" id="PresentChargingVoltage3" value="<?php echo $obj['ChargingInfo3']['PresentChargingVoltage'];?>">
  572. </div>
  573. <div class="form-group" style="display:<?php echo $am111;?>">
  574. <label>Present Charging Current</label>
  575. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargingCurrent'];?> amp">
  576. <input type="hidden" name="PresentChargingCurrent3" id="PresentChargingCurrent3" value="<?php echo $obj['ChargingInfo3']['PresentChargingCurrent'];?>">
  577. </div>
  578. <div class="form-group" style="display:<?php echo $am111;?>">
  579. <label>Present Charging Power</label>
  580. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargingPower'];?> kW">
  581. <input type="hidden" name="PresentChargingPower3" id="PresentChargingPower3" value="<?php echo $obj['ChargingInfo3']['PresentChargingPower'];?>">
  582. </div>
  583. <div class="form-group" style="display:<?php echo $am111;?>">
  584. <label>Present Charging Energy</label>
  585. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargedEnergy'];?> kWh">
  586. <input type="hidden" name="PresentChargedEnergy3" id="PresentChargedEnergy3" value="<?php echo $obj['ChargingInfo3']['PresentChargedEnergy'];?>">
  587. </div>
  588. <div class="form-group" style="display:<?php echo $am111;?>">
  589. <label>Present Charging Duration</label>
  590. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargedDuration'];?> seconds">
  591. <input type="hidden" name="PresentChargedDuration3" id="PresentChargedDuration3" value="<?php echo $obj['ChargingInfo3']['PresentChargedDuration'];?>">
  592. </div>
  593. <div class="form-group" style="display:<?php echo $am001;?>">
  594. <label>Remain Charging Time</label>
  595. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['RemainChargingDuration'];?> seconds">
  596. <input type="hidden" name="RemainChargingDuration3" id="RemainChargingDuration3" value="<?php echo $obj['ChargingInfo3']['RemainChargingDuration'];?>">
  597. </div>
  598. <div class="form-group" style="display:<?php echo $am001;?>">
  599. <label>EV Battery Max Voltage</label>
  600. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['EvBatteryMaxVoltage'];?> volt">
  601. <input type="hidden" name="EvBatteryMaxVoltage3" id="EvBatteryMaxVoltage3" value="<?php echo $obj['ChargingInfo3']['EvBatteryMaxVoltage'];?>">
  602. </div>
  603. <div class="form-group" style="display:<?php echo $am001;?>">
  604. <label>EV Battery Target Voltage</label>
  605. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['EvBatterytargetVoltage'];?> volt">
  606. <input type="hidden" name="EvBatterytargetVoltage3" id="EvBatterytargetVoltage3" value="<?php echo $obj['ChargingInfo3']['EvBatterytargetVoltage'];?>">
  607. </div>
  608. <div class="form-group" style="display:<?php echo $am001;?>">
  609. <label>EV Battery Soc</label>
  610. <input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['EvBatterySoc'];?>">
  611. <input type="hidden" name="EvBatterySoc3" id="EvBatterySoc3" value="<?php echo $obj['ChargingInfo3']['EvBatterySoc'];?>">
  612. </div>
  613. </section>
  614. </article>
  615. <?php }?>
  616. <article class="envor-sorting-item css">
  617. <div align="center"><button id="save"><?php echo $lang->showWord("set")?></button></div>
  618. </article>
  619. </div>
  620. </div>
  621. </div>
  622. </div>
  623. </div>
  624. </section>
  625. </div>
  626. <?php
  627. include 'foot.php';
  628. ?>
  629. <script type="text/JavaScript">
  630. $(document).ready(function(){
  631. if(document.getElementById("MaxChargingEnergy").value=="0" || document.getElementById("MaxChargingEnergy").value==""){
  632. document.getElementById("MaxChargingEnergyText").style.display="block";
  633. }
  634. if(document.getElementById("MaxChargingPower").value=="0" || document.getElementById("MaxChargingPower").value==""){
  635. document.getElementById("MaxChargingPowerText").style.display="block";
  636. }
  637. if(document.getElementById("MaxChargingCurrent").value=="0" || document.getElementById("MaxChargingCurrent").value==""){
  638. document.getElementById("MaxChargingCurrentText").style.display="block";
  639. }
  640. if(document.getElementById("MaxChargingDuration").value=="0" || document.getElementById("MaxChargingDuration").value==""){
  641. document.getElementById("MaxChargingDurationText").style.display="block";
  642. }
  643. });
  644. document.getElementById("save").onclick = function() {
  645. if(formCheck())
  646. {
  647. window.location="#loadinghref";
  648. document.getElementById("loading").style.display="block";
  649. // 發送 Ajax 查詢請求並處理
  650. var request = new XMLHttpRequest();
  651. request.open("POST", "set_charging_action.php");
  652. // POST 參數須使用 send() 發送
  653. var data = "MaxChargingEnergy=" + document.getElementById("MaxChargingEnergy").value +
  654. "&MaxChargingPower=" + document.getElementById("MaxChargingPower").value +
  655. "&MaxChargingCurrent=" + document.getElementById("MaxChargingCurrent").value+
  656. "&MaxChargingDuration=" + document.getElementById("MaxChargingDuration").value+
  657. "&PhaseLossPolicy=" + document.getElementById("PhaseLossPolicy").value+
  658. "&LocalWhiteCard0=" + document.getElementById("LocalWhiteCard0").value+
  659. "&LocalWhiteCard1=" + document.getElementById("LocalWhiteCard1").value+
  660. "&LocalWhiteCard2=" + document.getElementById("LocalWhiteCard2").value+
  661. "&LocalWhiteCard3=" + document.getElementById("LocalWhiteCard3").value+
  662. "&LocalWhiteCard4=" + document.getElementById("LocalWhiteCard4").value+
  663. "&LocalWhiteCard5=" + document.getElementById("LocalWhiteCard5").value+
  664. "&LocalWhiteCard6=" + document.getElementById("LocalWhiteCard6").value+
  665. "&LocalWhiteCard7=" + document.getElementById("LocalWhiteCard7").value+
  666. "&LocalWhiteCard8=" + document.getElementById("LocalWhiteCard8").value+
  667. "&LocalWhiteCard9=" + document.getElementById("LocalWhiteCard9").value;
  668. // "&CcsAuthentication=" + document.getElementById("CcsAuthentication").value+
  669. // "&AcCcsChargingModel=" + document.getElementById("AcCcsChargingModel").value;
  670. // POST 請求必須設置表頭在 open() 下面,send() 上面
  671. request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  672. request.send(data);
  673. request.onreadystatechange = function() {
  674. // 伺服器請求完成
  675. if (request.readyState == 4) {
  676. document.getElementById("loading").style.display="none";
  677. // 伺服器回應成功
  678. if (request.status == 200 && JSON.parse(request.responseText).result=="Success") {
  679. alert("<?php echo $lang->showWord("done")?>");
  680. location.href="set_charging.php";
  681. } else {
  682. alert(JSON.parse(request.responseText).message);
  683. }
  684. request = null;
  685. }
  686. }
  687. }
  688. }
  689. function formCheck()
  690. {
  691. var LocalWhiteCard0 = document.getElementById("LocalWhiteCard0").value;
  692. var LocalWhiteCard1 = document.getElementById("LocalWhiteCard1").value;
  693. var LocalWhiteCard2 = document.getElementById("LocalWhiteCard2").value;
  694. var LocalWhiteCard3 = document.getElementById("LocalWhiteCard3").value;
  695. var LocalWhiteCard4 = document.getElementById("LocalWhiteCard4").value;
  696. var LocalWhiteCard5 = document.getElementById("LocalWhiteCard5").value;
  697. var LocalWhiteCard6 = document.getElementById("LocalWhiteCard6").value;
  698. var LocalWhiteCard7 = document.getElementById("LocalWhiteCard7").value;
  699. var LocalWhiteCard8 = document.getElementById("LocalWhiteCard8").value;
  700. var LocalWhiteCard9 = document.getElementById("LocalWhiteCard9").value;
  701. var RatingCurrent = document.getElementById("RatingCurrent").value;
  702. var RatingPower = document.getElementById("RatingPower").value;
  703. var MaxChargingEnergy = document.getElementById("MaxChargingEnergy").value;
  704. var MaxChargingPower = document.getElementById("MaxChargingPower").value;
  705. var MaxChargingCurrent = document.getElementById("MaxChargingCurrent").value;
  706. var MaxChargingDuration = document.getElementById("MaxChargingDuration").value;
  707. if(LocalWhiteCard0 != ""){
  708. if(LocalWhiteCard0.length>32){
  709. alert("Local White Card0 must be less than 32 bytes!");
  710. document.getElementById("LocalWhiteCard0").focus();
  711. return false;
  712. }
  713. }
  714. if(LocalWhiteCard1 != ""){
  715. if(LocalWhiteCard1.length>32){
  716. alert("Local White Card1 must be less than 32 bytes!");
  717. document.getElementById("LocalWhiteCard1").focus();
  718. return false;
  719. }
  720. }
  721. if(LocalWhiteCard2 != ""){
  722. if(LocalWhiteCard2.length>32){
  723. alert("Local White Card2 must be less than 32 bytes!");
  724. document.getElementById("LocalWhiteCard2").focus();
  725. return false;
  726. }
  727. }
  728. if(LocalWhiteCard3 != ""){
  729. if(LocalWhiteCard3.length>32){
  730. alert("Local White Card3 must be less than 32 bytes!");
  731. document.getElementById("LocalWhiteCard3").focus();
  732. return false;
  733. }
  734. }
  735. if(LocalWhiteCard4 != ""){
  736. if(LocalWhiteCard4.length>32){
  737. alert("Local White Card4 must be less than 32 bytes!");
  738. document.getElementById("LocalWhiteCard4").focus();
  739. return false;
  740. }
  741. }
  742. if(LocalWhiteCard5 != ""){
  743. if(LocalWhiteCard5.length>32){
  744. alert("Local White Card5 must be less than 32 bytes!");
  745. document.getElementById("LocalWhiteCard5").focus();
  746. return false;
  747. }
  748. }
  749. if(LocalWhiteCard6 != ""){
  750. if(LocalWhiteCard6.length>32){
  751. alert("Local White Card6 must be less than 32 bytes!");
  752. document.getElementById("LocalWhiteCard6").focus();
  753. return false;
  754. }
  755. }
  756. if(LocalWhiteCard7 != ""){
  757. if(LocalWhiteCard7.length>32){
  758. alert("Local White Card7 must be less than 32 bytes!");
  759. document.getElementById("LocalWhiteCard7").focus();
  760. return false;
  761. }
  762. }
  763. if(LocalWhiteCard8 != ""){
  764. if(LocalWhiteCard8.length>32){
  765. alert("Local White Card8 must be less than 32 bytes!");
  766. document.getElementById("LocalWhiteCard8").focus();
  767. return false;
  768. }
  769. }
  770. if(LocalWhiteCard9 != ""){
  771. if(LocalWhiteCard9.length>32){
  772. alert("Local White Card9 must be less than 32 bytes!");
  773. document.getElementById("LocalWhiteCard9").focus();
  774. return false;
  775. }
  776. }
  777. if(MaxChargingEnergy >65535)
  778. {
  779. alert("MaxChargingEnergy must <= 65535!");
  780. document.getElementById("MaxChargingEnergy").focus();
  781. return false;
  782. }
  783. if(MaxChargingEnergy < 0)
  784. {
  785. alert("MaxChargingEnergy must >= 0!");
  786. document.getElementById("MaxChargingEnergy").focus();
  787. return false;
  788. }
  789. if(RatingPower!="" && RatingPower!=0){
  790. if(MaxChargingPower > RatingPower)
  791. {
  792. alert("MaxChargingPower must be less than RatingPower("+RatingPower+")!");
  793. document.getElementById("MaxChargingPower").focus();
  794. return false;
  795. }
  796. }
  797. else{
  798. if(MaxChargingPower >65535)
  799. {
  800. alert("MaxChargingPower must <= 65535!");
  801. document.getElementById("MaxChargingPower").focus();
  802. return false;
  803. }
  804. }
  805. if(MaxChargingPower < 0)
  806. {
  807. alert("MaxChargingPower must >= 0!");
  808. document.getElementById("MaxChargingPower").focus();
  809. return false;
  810. }
  811. if(RatingCurrent!="" && RatingCurrent!=0){
  812. if(MaxChargingCurrent > RatingCurrent)
  813. {
  814. alert("MaxChargingCurrent must be less than RatingCurrent("+RatingCurrent+")!");
  815. document.getElementById("MaxChargingCurrent").focus();
  816. return false;
  817. }
  818. }
  819. else{
  820. if(MaxChargingCurrent >65535)
  821. {
  822. alert("MaxChargingCurrent must <= 65535!");
  823. document.getElementById("MaxChargingCurrent").focus();
  824. return false;
  825. }
  826. }
  827. if(MaxChargingCurrent < 0)
  828. {
  829. alert("MaxChargingCurrent must >= 0!");
  830. document.getElementById("MaxChargingCurrent").focus();
  831. return false;
  832. }
  833. if(MaxChargingDuration >65535)
  834. {
  835. alert("MaxChargingDuration must <= 65535!");
  836. document.getElementById("MaxChargingDuration").focus();
  837. return false;
  838. }
  839. if(MaxChargingDuration < 0)
  840. {
  841. alert("MaxChargingDuration must >= 0!");
  842. document.getElementById("MaxChargingDuration").focus();
  843. return false;
  844. }
  845. return true;
  846. }
  847. function MaxValue_changed(id,id2){
  848. if(document.getElementById(id).value == "0" || document.getElementById(id).value == ""){
  849. document.getElementById(id2).style.display="block";
  850. }
  851. else{
  852. document.getElementById(id2).style.display="none";
  853. }
  854. }
  855. function isNumberKey(evt)
  856. {
  857. var charCode = (evt.which) ? evt.which : event.keyCode
  858. if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 46))
  859. return false;
  860. return true;
  861. }
  862. </script>
  863. </html>