set_system.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  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[0]));//var_dump($obj);
  6. $AcPhaseCount='';
  7. switch ($obj->{'AcPhaseCount'}){
  8. case 1:
  9. $AcPhaseCount='one phase';
  10. break;
  11. case 3:
  12. $AcPhaseCount='three phase';
  13. break;
  14. default:
  15. $AcPhaseCount='unknown';
  16. break;
  17. }
  18. $ModelName = $obj->{'ModelName'};
  19. $RatingPower = substr($ModelName,4,2)*pow(10,-1+substr($ModelName,6,1));
  20. $Connector1=substr($ModelName,7,1);
  21. $Connector2=substr($ModelName,9,1);
  22. $Connector3=substr($ModelName,8,1);
  23. $connectorType1=ConnectorType($Connector1);
  24. $connectorType2=ConnectorType($Connector2);
  25. $connectorType3=ConnectorType($Connector3);
  26. $IsAcDc = substr($ModelName,0,1);
  27. $PsuQuantity = 0;
  28. if($IsAcDc == "D"){
  29. if($RatingPower>=30){
  30. $PsuQuantity = $RatingPower/30;
  31. }
  32. }
  33. function ConnectorType($connector){
  34. $result="";
  35. if($connector == "0"){
  36. $result= "";
  37. }
  38. else if($connector == "U" || $connector == "E"){
  39. $result= "CCS";
  40. }
  41. else if($connector == "G" || $connector == "D"){
  42. $result= "GB";
  43. }
  44. else if($connector == "J"){
  45. $result= "CHAdeMO";
  46. }
  47. else if($connector == "1" || $connector == "2" || $connector == "3" || $connector == "4" || $connector == "5" || $connector == "6"){
  48. $result= "AC";
  49. }
  50. else{
  51. $result= "";
  52. }
  53. return $result;
  54. }
  55. ?>
  56. <style>
  57. img {
  58. display: block;
  59. margin-left: auto;
  60. margin-right: auto;
  61. }
  62. </style>
  63. <div class="envor-content">
  64. <!--
  65. Page Title start
  66. //-->
  67. <section class="envor-page-title-1" data-stellar-background-ratio="0.5">
  68. <div class="container">
  69. <div class="row">
  70. <div class="col-lg-9 col-md-9 col-sm-9">
  71. <h1><?php echo $lang->showWord("system"); ?></h1>
  72. </div>
  73. </div>
  74. </div>
  75. <!--
  76. Page Title end
  77. //-->
  78. </section>
  79. <!--
  80. Main Content start
  81. //-->
  82. <a id="loadinghref"><div id="loading" style="display:none;"><img src="img/giphy.gif"/></div></a>
  83. <section class="envor-section">
  84. <div class="container">
  85. <div class="row">
  86. <div class="col-lg-12">
  87. <div class="envor-sorting" id="faq-sorting">
  88. <div class="envor-toggle">
  89. <!--System Information-->
  90. <article class="envor-sorting-item css">
  91. <header><?php echo $lang->showWord("system_information"); ?><i class="fa fa-plus"></i></header>
  92. <section>
  93. <div class="form-group" style="display:<?php echo $am111;?>">
  94. <label>Model Name</label>
  95. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'ModelName'};?>">
  96. <input type="hidden" name="ModelName" id="ModelName" value="<?php echo $obj->{'ModelName'};?>">
  97. </div>
  98. <div class="form-group" id="AcModelNameDiv">
  99. <label>AC Model Name</label>
  100. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AcModelName'};?>">
  101. <input type="hidden" name="AcModelName" id="AcModelName" value="<?php echo $obj->{'AcModelName'};?>">
  102. </div>
  103. <div class="form-group" style="display:<?php echo $am111;?>">
  104. <label>Serial Number</label>
  105. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'SerialNumber'};?>">
  106. <input type="hidden" name="SerialNumber" id="SerialNumber" value="<?php echo $obj->{'SerialNumber'};?>">
  107. </div>
  108. <div class="form-group" style="display:<?php echo $am111;?>">
  109. <label>System ID</label>
  110. <input type="text" name="SystemId" id="SystemId" class="form-control" value="<?php echo $obj->{'SystemId'};?>">
  111. </div>
  112. <div class="form-group" style="display:<?php echo $am111;?>">
  113. <label>System DateTime</label>
  114. <input type="text" readonly class="form-control" placeholder="<?php echo date('Y-m-d H:i:s');?>" id="SystemDateTime0"><br>
  115. <div class='input-group date' id='datetimepicker1'>
  116. <input type='text' class="form-control" name="SystemDateTime" id='SystemDateTime' />
  117. <span class="input-group-addon">
  118. <span class="glyphicon glyphicon-calendar"></span>
  119. </span>
  120. </div>
  121. </div>
  122. <div class="form-group" style="display:<?php echo $am001;?>">
  123. <label>AC Phase Loss Policy</label>
  124. <select class="form-control" id="PhaseLossPolicy" name="PhaseLossPolicy">
  125. <option value="0" <?php echo $obj->{'PhaseLossPolicy'}=="0"?"selected":""?>>de-rating</option>
  126. <option value="1" <?php echo $obj->{'PhaseLossPolicy'}=="1"?"selected":""?>>stop charging</option>
  127. </select>
  128. </div>
  129. <div class="form-group" style="display:<?php echo $am111;?>">
  130. <label>
  131. <input type="checkbox" id="FactoryConfiguration" name="FactoryConfiguration" <?php echo $obj->{'FactoryConfiguration'}==1?"checked":"";?>>
  132. Factory Default Configuration</label>
  133. <?php /* <select class="form-control" id="FactoryConfiguration" name="FactoryConfiguration">
  134. <option value="0" <?php echo $obj->{'FactoryConfiguration'}=="0"?"selected":""?>>Normal</option>
  135. <option value="1" <?php echo $obj->{'FactoryConfiguration'}=="1"?"selected":""?>>Trigger</option>
  136. </select>*/?>
  137. </div>
  138. <div class="form-group" style="display:<?php echo $am111;?>">
  139. <label>Authentication</label>
  140. <select class="form-control" id="AuthorisationMode" name="AuthorisationMode" onchange="AuthorisationMode_changed()">
  141. <option value="0" <?php echo $obj->{'AuthorisationMode'}=="0"?"selected":""?>>enable</option>
  142. <option value="1" <?php echo $obj->{'AuthorisationMode'}=="1"?"selected":""?>>disable</option>
  143. </select>
  144. </div>
  145. <div class="form-group" style="display:<?php echo $am111;?>">
  146. <label>Input Voltage R</label>
  147. <input type="text" readonly class="form-control" placeholder="<?php echo round($obj->{'InputVoltageR'},2);?> volt">
  148. <input type="hidden" name="InputVoltageR" id="InputVoltageR" value="<?php echo $obj->{'InputVoltageR'};?>">
  149. </div>
  150. <div class="form-group" style="display:<?php echo $am111;?>">
  151. <label>Input Voltage S</label>
  152. <input type="text" readonly class="form-control" placeholder="<?php echo round($obj->{'InputVoltageS'},2);?> volt">
  153. <input type="hidden" name="InputVoltageS" id="InputVoltageS" value="<?php echo $obj->{'InputVoltageS'};?>">
  154. </div>
  155. <div class="form-group" style="display:<?php echo $am111;?>">
  156. <label>Input Voltage T</label>
  157. <input type="text" readonly class="form-control" placeholder="<?php echo round($obj->{'InputVoltageT'},2);?> volt">
  158. <input type="hidden" name="InputVoltageT" id="InputVoltageT" value="<?php echo $obj->{'InputVoltageT'};?>">
  159. </div>
  160. <div class="form-group" style="display:<?php echo $am001;?>">
  161. <label>System Fan Speed</label>
  162. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'SystemFanRotaSpeed'};?> RPM">
  163. <input type="hidden" name="SystemFanRotaSpeed" id="SystemFanRotaSpeed" value="<?php echo $obj->{'SystemFanRotaSpeed'};?>">
  164. </div>
  165. <div class="form-group" style="display:<?php echo $am111;?>">
  166. <label>Rfid Card Num Endian</label>
  167. <select class="form-control" id="RfidCardNumEndian" name="RfidCardNumEndian">
  168. <option value="0" <?php echo $obj->{'RfidCardNumEndian'}=="0"?"selected":""?>>little endian</option>
  169. <option value="1" <?php echo $obj->{'RfidCardNumEndian'}=="1"?"selected":""?>>big endian</option>
  170. </select>
  171. </div>
  172. <div class="form-group" style="display:<?php echo $am120;?>">
  173. <label>Psu Ac Input Type</label>
  174. <select class="form-control" id="PsuAcInputType" name="PsuAcInputType">
  175. <option value="0" <?php echo $obj->{'PsuAcInputType'}=="0"?"selected":""?>>220~230 +/- 15%</option>
  176. <option value="1" <?php echo $obj->{'PsuAcInputType'}=="1"?"selected":""?>>277 +10%/-15%</option>
  177. </select>
  178. </div>
  179. <div class="form-group" style="display:<?php echo $am111;?>">
  180. <label id="RatingCurrentLbl">Rating Current</label>
  181. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'RatingCurrent'};?> amp">
  182. <input type="hidden" name="RatingCurrent" id="RatingCurrent" value="<?php echo $obj->{'RatingCurrent'};?>">
  183. </div>
  184. <div class="form-group" id="AcRatingCurrentDiv">
  185. <label>AC Rating Current</label>
  186. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AcRatingCurrent'};?> amp">
  187. <input type="hidden" name="AcRatingCurrent" id="AcRatingCurrent" value="<?php echo $obj->{'AcRatingCurrent'};?>">
  188. </div>
  189. <div class="form-group" style="display:<?php echo $am001;?>" id="startMode">
  190. <label id="isAPPLabel">
  191. <input type="checkbox" id="isAPP" name="isAPP" <?php echo $obj->{'isAPP'}==1?"checked":"";?> onclick="isAPP_clicked()">
  192. APP</label>
  193. <label id="isQRCodeLabel">
  194. <input type="checkbox" id="isQRCode" name="isQRCode" <?php echo $obj->{'isQRCode'}==1?"checked":"";?> onclick="isQRCode_clicked()">
  195. QR Code</label>
  196. <label id="isRFIDLabel">
  197. <input type="checkbox" id="isRFID" name="isRFID" <?php echo $obj->{'isRFID'}==1?"checked":"";?> onclick="isRFID_clicked()">
  198. RFID</label>
  199. </div>
  200. <div class="form-group" id="QRCodeMadeModeDiv">
  201. <label>QR Code Made Mode</label>
  202. <select class="form-control" id="QRCodeMadeMode" name="QRCodeMadeMode" onchange="QRCodeMadeMode_changed()">
  203. <option value="0" <?php echo $obj->{'QRCodeMadeMode'}=="0"?"selected":""?>>default</option>
  204. <option value="1" <?php echo $obj->{'QRCodeMadeMode'}=="1"?"selected":""?>>customized</option>
  205. </select>
  206. </div>
  207. <div class="form-group" id="QRCodeContentDiv">
  208. <label>QR Code Content</label>
  209. <input type="text" name="QRCodeContent" id="QRCodeContent" class="form-control" placeholder="<?php echo $obj->{'QRCodeContent'};?>" value="<?php echo $obj->{'QRCodeContent'};?>">
  210. </div>
  211. <div class="form-group" style="display:<?php echo $am111;?>">
  212. <label>LED Intensity</label>
  213. <select class="form-control" id="Intensity" name="Intensity">
  214. <option value="0" <?php echo $obj->{'Intensity'}=="0"?"selected":""?>>Darkest</option>
  215. <option value="1" <?php echo $obj->{'Intensity'}=="1"?"selected":""?>>Medium</option>
  216. <option value="2" <?php echo $obj->{'Intensity'}=="2"?"selected":""?>>Brightest</option>
  217. </select>
  218. </div>
  219. </section>
  220. </article>
  221. <article class="envor-sorting-item css">
  222. <header><?php echo $lang->showWord("version_information"); ?><i class="fa fa-plus"></i></header>
  223. <section>
  224. <div class="form-group" style="display:<?php echo $am111;?>">
  225. <label>Csu Boot Load Fw Rev</label>
  226. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CsuBootLoadFwRev'};?>">
  227. <input type="hidden" name="CsuBootLoadFwRev" id="CsuBootLoadFwRev" value="<?php echo $obj->{'CsuBootLoadFwRev'};?>">
  228. </div>
  229. <div class="form-group" style="display:<?php echo $am111;?>">
  230. <label>Csu Kernel Fw Rev</label>
  231. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CsuKernelFwRev'};?>">
  232. <input type="hidden" name="CsuKernelFwRev" id="CsuKernelFwRev" value="<?php echo $obj->{'CsuKernelFwRev'};?>">
  233. </div>
  234. <div class="form-group" style="display:<?php echo $am111;?>">
  235. <label>Csu Root Fs Fw Rev</label>
  236. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CsuRootFsFwRev'};?>">
  237. <input type="hidden" name="CsuRootFsFwRev" id="CsuRootFsFwRev" value="<?php echo $obj->{'CsuRootFsFwRev'};?>">
  238. </div>
  239. <div class="form-group" style="display:<?php echo $am111;?>">
  240. <label>Csu Prim Fw Rev</label>
  241. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'CsuPrimFwRev'};?>">
  242. <input type="hidden" name="CsuPrimFwRev" id="CsuPrimFwRev" value="<?php echo $obj->{'CsuPrimFwRev'};?>">
  243. </div>
  244. <?php for($i=0;$i<$PsuQuantity;$i++){?>
  245. <div class="form-group" style="display:<?php echo $am001;?>">
  246. <label>Psu Prim Fw Rev(<?php echo $i+1;?>)</label>
  247. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'FwPrimaryVersion'}[$i];?>">
  248. <input type="hidden" name="PsuPrimFwRev<?php echo $i;?>" id="PsuPrimFwRev<?php echo $i;?>" value="<?php echo $obj->{'FwPrimaryVersion'}[$i];?>">
  249. </div>
  250. <div class="form-group" style="display:<?php echo $am001;?>">
  251. <label>Psu Sec Fw Rev(<?php echo $i+1;?>)</label>
  252. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'FwSecondVersion'}[$i];?>">
  253. <input type="hidden" name="PsuSecFwRev<?php echo $i;?>" id="PsuSecFwRev<?php echo $i;?>" value="<?php echo $obj->{'FwSecondVersion'}[$i];?>">
  254. </div>
  255. <?php } ?>
  256. <div class="form-group" style="display:<?php echo $am001;?>">
  257. <label>Fan Module Fw Rev</label>
  258. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'FanModuleFwRev'};?>">
  259. <input type="hidden" name="FanModuleFwRev" id="FanModuleFwRev" value="<?php echo $obj->{'FanModuleFwRev'};?>">
  260. </div>
  261. <div class="form-group" style="display:<?php echo $am001;?>">
  262. <label>Relay Module Fw Rev</label>
  263. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'RelayModuleFwRev'};?>">
  264. <input type="hidden" name="RelayModuleFwRev" id="RelayModuleFwRev" value="<?php echo $obj->{'RelayModuleFwRev'};?>">
  265. </div>
  266. <div class="form-group" style="display:<?php echo $showTelcom;?>">
  267. <label>Telcom Modem Fw Rev</label>
  268. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomModemFwRev'};?>">
  269. <input type="hidden" name="TelcomModemFwRev" id="TelcomModemFwRev" value="<?php echo $obj->{'TelcomModemFwRev'};?>">
  270. </div>
  271. <div class="form-group" id="Connector1FwRevDiv" style="display:<?php echo $am001;?>">
  272. <label>Connector1(<?php echo $connectorType1;?>) Fw Rev</label>
  273. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Connector1FwRev'};?>">
  274. <input type="hidden" name="Connector1FwRev" id="Connector1FwRev" value="<?php echo $obj->{'Connector1FwRev'};?>">
  275. </div>
  276. <div class="form-group" id="Connector2FwRevDiv">
  277. <label>Connector2(<?php echo $connectorType2;?>) Fw Rev</label>
  278. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Connector2FwRev'};?>">
  279. <input type="hidden" name="Connector2FwRev" id="Connector2FwRev" value="<?php echo $obj->{'Connector2FwRev'};?>">
  280. </div>
  281. <div class="form-group" style="display:<?php echo $am001;?>">
  282. <label>Led Module Fw Rev</label>
  283. <input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'LedModuleFwRev'};?>">
  284. <input type="hidden" name="LedModuleFwRev" id="LedModuleFwRev" value="<?php echo $obj->{'LedModuleFwRev'};?>">
  285. </div>
  286. </section>
  287. </article>
  288. <article class="envor-sorting-item css">
  289. <div align="center"><button id="save"><?php echo $lang->showWord("set")?></button></div>
  290. </article>
  291. </div>
  292. </div>
  293. </div>
  294. </div>
  295. </div>
  296. </section>
  297. </div>
  298. <?php
  299. include 'foot.php';
  300. ?>
  301. <script type="text/JavaScript">
  302. $(document).ready(function(){
  303. $("#datetimepicker1").datetimepicker({
  304. format:"YYYY-MM-DD HH:mm:ss"
  305. });
  306. setInterval(function(){var t = new Date(document.getElementById("SystemDateTime0").placeholder);var t_s = t.getTime();t.setTime(t_s + 1000 );document.getElementById("SystemDateTime0").placeholder= t.Format("yyyy-MM-dd hh:mm:ss");}, 1000);
  307. if(document.getElementById("ModelName").value.substr(8,1) != "0"){
  308. document.getElementById("AcRatingCurrentDiv").style.display="block";
  309. }
  310. else{
  311. document.getElementById("AcRatingCurrentDiv").style.display="none";
  312. }
  313. if(document.getElementById("ModelName").value.substr(0,1) != "A" && document.getElementById("ModelName").value.substr(9,1) != "0"){
  314. document.getElementById("Connector2FwRevDiv").style.display="block";
  315. }
  316. else{
  317. document.getElementById("Connector2FwRevDiv").style.display="none";
  318. }
  319. if(document.getElementById("ModelName").value.substr(0,1) != "D"){
  320. document.getElementById("isAPPLabel").style.display="none";
  321. document.getElementById("isQRCodeLabel").style.display="none";
  322. document.getElementById("isRFIDLabel").style.display="none";
  323. }
  324. if(document.getElementById("ModelName").value.substr(8,1) != "0"){
  325. document.getElementById("AcModelNameDiv").style.display="block";
  326. document.getElementById("RatingCurrentLbl").innerHTML="DC Rating Current";
  327. }
  328. else{
  329. document.getElementById("AcModelNameDiv").style.display="none";
  330. }
  331. isQRCode_clicked();
  332. AuthorisationMode_changed();
  333. QRCodeMadeMode_changed();
  334. });
  335. document.getElementById("save").onclick = function() {
  336. if(formCheck())
  337. {
  338. window.location="#loadinghref";
  339. document.getElementById("loading").style.display="block";
  340. // 發送 Ajax 查詢請求並處理
  341. var request = new XMLHttpRequest();
  342. request.open("POST", "set_system_action.php");
  343. // POST 參數須使用 send() 發送
  344. var data = "SystemId=" + document.getElementById("SystemId").value+
  345. "&SystemDateTime=" + document.getElementById("SystemDateTime").value+
  346. "&PhaseLossPolicy=" + document.getElementById("PhaseLossPolicy").value+
  347. "&FactoryConfiguration=" + (document.getElementById("FactoryConfiguration").checked?1:0)+
  348. "&AuthorisationMode=" + document.getElementById("AuthorisationMode").value+
  349. "&isAPP=" + (document.getElementById("isAPP").checked?1:0)+
  350. "&isQRCode=" + (document.getElementById("isQRCode").checked?1:0)+
  351. "&isRFID=" + (document.getElementById("isRFID").checked?1:0)+
  352. "&QRCodeMadeMode=" + document.getElementById("QRCodeMadeMode").value+
  353. "&QRCodeContent=" + document.getElementById("QRCodeContent").value+
  354. "&Intensity=" + document.getElementById("Intensity").value+
  355. "&RfidCardNumEndian=" + document.getElementById("RfidCardNumEndian").value+
  356. "&PsuAcInputType=" + document.getElementById("PsuAcInputType").value;
  357. // POST 請求必須設置表頭在 open() 下面,send() 上面
  358. request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  359. request.send(data);
  360. request.onreadystatechange = function() {
  361. // 伺服器請求完成
  362. if (request.readyState == 4) {
  363. document.getElementById("loading").style.display="none";
  364. // 伺服器回應成功
  365. if (request.status == 200 && JSON.parse(request.responseText).result=="Success") {
  366. alert("<?php echo $lang->showWord("done")?>");
  367. location.href="set_system.php";
  368. } else {
  369. alert(JSON.parse(request.responseText).message);
  370. }
  371. request = null;
  372. }
  373. }
  374. }
  375. }
  376. function formCheck()
  377. {
  378. var SystemId = document.getElementById("SystemId").value;
  379. var SystemDateTime = document.getElementById("SystemDateTime").value;
  380. var result=true;
  381. /*
  382. if(SystemId.length < 1)
  383. {
  384. alert("SystemId format is not correct, ID is required .");
  385. document.getElementById("SystemId").focus();
  386. result = false;
  387. }
  388. */
  389. return result;
  390. }
  391. function AuthorisationMode_changed(){
  392. if(document.getElementById("AuthorisationMode").value == "0"){
  393. if(document.getElementById("ModelName").value.substr(0,1) == "D"){
  394. document.getElementById("startMode").style.display="block";
  395. }
  396. if(document.getElementById("ModelName").value.substr(0,1) == "D" && document.getElementById("AuthorisationMode").value == "0" && !document.getElementById("isAPP").checked && !document.getElementById("isRFID").checked && !document.getElementById("isQRCode").checked){
  397. alert("Please choose one of 'APP、QR code、RFID'");
  398. document.getElementById("isAPP").checked=true;
  399. document.getElementById("isQRCode").checked=true;
  400. document.getElementById("isRFID").checked=true;
  401. }
  402. }
  403. else{
  404. document.getElementById("startMode").style.display="none";
  405. }
  406. }
  407. function isQRCode_clicked(){
  408. if(document.getElementById("isQRCode").checked){
  409. document.getElementById("QRCodeMadeModeDiv").style.display="block";
  410. QRCodeMadeMode_changed();
  411. }
  412. else{
  413. document.getElementById("QRCodeMadeModeDiv").style.display="none";
  414. document.getElementById("QRCodeContentDiv").style.display="none";
  415. if(document.getElementById("ModelName").value.substr(0,1) == "D" && document.getElementById("AuthorisationMode").value == "0" && !document.getElementById("isAPP").checked && !document.getElementById("isRFID").checked){
  416. alert("Please choose one of 'APP、QR code、RFID'");
  417. document.getElementById("isQRCode").checked=true;
  418. }
  419. }
  420. }
  421. function isAPP_clicked(){
  422. if(document.getElementById("ModelName").value.substr(0,1) == "D" && document.getElementById("AuthorisationMode").value == "0" && !document.getElementById("isQRCode").checked && !document.getElementById("isAPP").checked && !document.getElementById("isRFID").checked){
  423. alert("Please choose one of 'APP、QR code、RFID'");
  424. document.getElementById("isAPP").checked=true;
  425. }
  426. }
  427. function isRFID_clicked(){
  428. if(document.getElementById("ModelName").value.substr(0,1) == "D" && document.getElementById("AuthorisationMode").value == "0" && !document.getElementById("isQRCode").checked && !document.getElementById("isAPP").checked && !document.getElementById("isRFID").checked){
  429. alert("Please choose one of 'APP、QR code、RFID'");
  430. document.getElementById("isRFID").checked=true;
  431. }
  432. }
  433. function QRCodeMadeMode_changed(){
  434. if(document.getElementById("QRCodeMadeMode").value == "1"){
  435. document.getElementById("QRCodeContentDiv").style.display="block";
  436. }
  437. else{
  438. document.getElementById("QRCodeContentDiv").style.display="none";
  439. }
  440. }
  441. Date.prototype.Format = function (fmt) { //author: meizz
  442. var o = {
  443. "M+": this.getMonth() + 1, //月份
  444. "d+": this.getDate(), //日
  445. "h+": this.getHours(), //小时
  446. "m+": this.getMinutes(), //分
  447. "s+": this.getSeconds(), //秒
  448. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  449. "S": this.getMilliseconds() //毫秒
  450. };
  451. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  452. for (var k in o)
  453. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  454. return fmt;
  455. }
  456. function isNumberKey(evt)
  457. {
  458. var charCode = (evt.which) ? evt.which : event.keyCode
  459. if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 46))
  460. return false;
  461. return true;
  462. }
  463. </script>