health3.jsp 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
  3. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  4. <jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
  5. <script type="text/javascript" src="/resources/js/mobile/health.js"></script>
  6. <script>
  7. $.validator.addMethod( "rangeOxygenSaturation", function( value, element ) {
  8. var result = true;
  9. if( value > 100 || value < 0 ) {
  10. result = false;
  11. }
  12. return this.optional(element) || result;
  13. }, "산소포화도는 [0 ~ 100] 사이의 숫자만 입력해주세요" );
  14. $( function(){
  15. $( "#healthForm" ).validate({
  16. rules : {
  17. oxygenSaturation : {
  18. floatNum : true,
  19. floatNumOne : true,
  20. rangeOxygenSaturation : true
  21. }
  22. },
  23. onkeyup: function( element, event ) {
  24. // $( "div.error-msg" ).text( "" );
  25. $( element ).valid();
  26. },
  27. onfocusout: function (element) {
  28. // $( "div.error-msg" ).text( "" );
  29. $( element ).valid();
  30. },
  31. errorPlacement: function(error, element) {
  32. $( "div.error-msg" ).empty().append( error );
  33. },
  34. submitHandler: function(form) {
  35. var oxygenSaturation = $.trim( $( "input[name='oxygenSaturation']" ).val() );
  36. if( oxygenSaturation.length == 0 ) {
  37. $( "div.error-msg" ).text( "산소포화도 % 를 입력하세요 (Please enter your oxygen saturation)" );
  38. } else {
  39. $( "#phrValue" ).val( oxygenSaturation );
  40. $( "button[type='submit'].confirm" ).prop( "disabled", true ).css("background", "#DBDBDB");
  41. form.submit();
  42. }
  43. }
  44. });
  45. })
  46. /*
  47. * 블루투스 기기연동 이벤트 처리를 위한 변수 정의
  48. * 공통 이벤트 처리는 -> health.js
  49. */
  50. var phrLocalStorageName = "bluetoothHealth3";
  51. var phrCallBackType = "oxysaturation";
  52. </script>
  53. <style>
  54. /* Rounded sliders */
  55. .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; -webkit-transition: .4s; transition: .4s;}
  56. .slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; -webkit-transition: .4s; transition: .4s;}
  57. input:checked + .slider { background-color: #2196F3;}
  58. input:focus + .slider { box-shadow: 0 0 1px #2196F3;}
  59. input:checked + .slider:before { -webkit-transform: translateX(26px); -ms-transform: translateX(26px); transform: translateX(26px);}
  60. .slider.round {border-radius: 34px;}
  61. .slider.round:before {border-radius: 50%;}
  62. div.bluetooth{font-size:18px;font-weight:600;padding:20px 0;border-bottom:1px solid #dddddd;text-align:center;}
  63. div.bluetooth .switch {position: relative;display: inline-block;width: 60px;height: 34px;margin:0 10px;}
  64. div.bluetooth .switch input {opacity: 0;width: 0;height: 0;}
  65. div.bluetooth span.insert-type{cursor:pointer;vertical-align:middle;font-weight:600;}
  66. div.bluetooth span.readonly{color:#999999;font-weight:500;}
  67. .examination .history {text-align: center;
  68. padding-bottom: 15px;
  69. border-bottom: 1px solid #ddd;
  70. margin-top: 15px;}
  71. .examination .history a {padding: 10px 15px}
  72. </style>
  73. </head>
  74. <body>
  75. <div id="sub">
  76. <div class="container">
  77. <div class="header">
  78. <div class="previous">
  79. <a href="/mobile/menu">이전</a>
  80. </div>
  81. <div class="title">건강정보기록</div>
  82. </div>
  83. <div class="device_tab">
  84. <ul>
  85. <li>
  86. <a href="./1" class="one">체온<span class="eng">body temperature</span></a>
  87. </li>
  88. <li>
  89. <a href="./2" class="two">혈압/맥박수<span class="eng">blood pressure/heart rate</span></a>
  90. </li>
  91. <li>
  92. <a href="./3" class="three active">산소포화도<span class="eng">oxygen</span></a>
  93. </li>
  94. <li>
  95. <a href="./4" class="four">혈당<span class="eng">blood sugar</span></a>
  96. </li>
  97. <li>
  98. <a href="./5" class="five">임상증상<span class="eng">symptom</span></a>
  99. </li>
  100. </ul>
  101. </div>
  102. <div id="bluetoothBtn" class="examination">
  103. <div class="history">
  104. <a href="javascript:;" onclick="phrValue( 'getPhrValue', phrCallBackType );">블루투스 기기 연결</a>
  105. </div>
  106. </div>
  107. <!-- <div class="bluetooth"> -->
  108. <!-- <span class="insert-type direct">직접입력</span> -->
  109. <!-- <label class="switch"> -->
  110. <!-- <input type="checkbox" class="checkbt" id="bluetooth-checkbox"> -->
  111. <!-- <span class="slider round"></span> -->
  112. <!-- </label> -->
  113. <!-- <span class="insert-type device">기기연동</span> -->
  114. <!-- </div> -->
  115. <form id="healthForm" method="post" action="./insert">
  116. <div class="health">
  117. <div class="part">
  118. <div class="title">날짜(Date)</div>
  119. <div class="input day">
  120. <!-- <a href="javascript:;" data-popup-open="popup-calendar">d</a> -->
  121. <input type="text" class="datePicker form-control" placeholder="현재 날짜" readonly>
  122. </div>
  123. </div>
  124. <div class="part">
  125. <div class="title">측정시간(Time)</div>
  126. <div class="input time">
  127. <!-- <a href="javascript:;" data-popup-open="popup-time">d</a> -->
  128. <input type="text" class="timePicker" placeholder="현재 시간" readonly>
  129. </div>
  130. </div>
  131. <div class="part tac mt30">
  132. <div class="title">산소포화도를 입력해주세요</div>
  133. <div class="title">(Please enter your oxygen saturation)</div>
  134. <div class="input time">
  135. </div>
  136. </div>
  137. <div class="data unlink">
  138. <div class="point">
  139. <span>
  140. <input type="number" name="oxygenSaturation" placeholder="--"> %
  141. </span>
  142. </div>
  143. </div>
  144. <div class="error-msg tac mt20 error"></div>
  145. </div>
  146. <div class="btn_group">
  147. <ul>
  148. <li>
  149. <input type="hidden" name="phrType" value="oxygenSaturation">
  150. <input type="hidden" id="phrValue" name="phrValue" value="">
  151. <!-- <input type="hidden" id="phrValue2" name="phrValue2" value=""> -->
  152. <button type="submit" class="confirm"><span class="check">기록하기(Submit)</span></button>
  153. </li>
  154. </ul>
  155. </div>
  156. </form>
  157. </div>
  158. </div>
  159. </body>
  160. </html>