/*
 * Generated by the Jasper component of Apache Tomcat
 * Version: Apache Tomcat/7.0.47
 * Generated at: 2018-12-26 03:20:31 UTC
 * Note: The last modified time of this file was set to
 *       the last modified time of the source file after
 *       generation to assist with modification tracking.
 */
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final javax.servlet.jsp.JspFactory _jspxFactory =
          javax.servlet.jsp.JspFactory.getDefaultFactory();

  private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.tomcat.InstanceManager _jsp_instancemanager;

  public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
  }

  public void _jspDestroy() {
  }

  public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
        throws java.io.IOException, javax.servlet.ServletException {

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html; charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\n");
      out.write("<!DOCTYPE html>\n");
      out.write("<html>\n");
      out.write("<head>\n");
      out.write("    <meta charset=\"UTF-8\"/>\n");
      out.write("    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n");
      out.write("    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n");
      out.write("    <meta name=\"keywords\" content=\"\"/>\n");
      out.write("    <link rel=\"stylesheet\" href=\"static/style/base.css\">\n");
      out.write("    <link rel=\"stylesheet\" href=\"static/style/style.css\">\n");
      out.write("    <link rel=\"stylesheet\" href=\"static/layui-v2.4.5/css/layui.css\">\n");
      out.write("    <script src=\"static/js/jquery-3.3.1.min.js\"></script>\n");
      out.write("    <script src=\"static/layui-v2.4.5/layui.js\"></script>\n");
      out.write("    <title>打卡</title>\n");
      out.write("\n");
      out.write("    <script>\n");
      out.write("\n");
      out.write("        $(document).ready(function () {\n");
      out.write("            $(document).keydown(function (event) {\n");
      out.write("                if (event.keyCode == 13) {//回车键的键值为13\n");
      out.write("                    var toClick = document.getElementById(\"submit\")\n");
      out.write("                    toClick.click();  //调用登录按钮的登录事件\n");
      out.write("                }\n");
      out.write("            });\n");
      out.write("            $(\"#index\").addClass(\"active\");\n");
      out.write("\n");
      out.write("\n");
      out.write("            /*start输入栏选中时隐藏底部导航栏\n");
      out.write("            *       为选中的输入框添加标识 */\n");
      out.write("            var input = $(\"input\");\n");
      out.write("            input.focus(function () {\n");
      out.write("                $(\"#footer\").hide();\n");
      out.write("                $(this).parent().parent().addClass(\"active\");\n");
      out.write("            });\n");
      out.write("            input.blur(function () {\n");
      out.write("                $(\"#footer\").show();\n");
      out.write("                $(this).parent().parent().removeClass(\"active\");\n");
      out.write("            });\n");
      out.write("            /*end输入栏选中时隐藏底部导航栏*/\n");
      out.write("\n");
      out.write("            // 函数中的参数为 要获取的cookie键的名称。\n");
      out.write("            function getCookie(c_name){\n");
      out.write("                if (document.cookie.length>0){\n");
      out.write("                    c_start=document.cookie.indexOf(c_name + \"=\");\n");
      out.write("                    if (c_start!=-1){\n");
      out.write("                        c_start=c_start + c_name.length+1;\n");
      out.write("                        c_end=document.cookie.indexOf(\";\",c_start);\n");
      out.write("                        if (c_end==-1){\n");
      out.write("                            c_end=document.cookie.length;\n");
      out.write("                        }\n");
      out.write("                        return unescape(document.cookie.substring(c_start,c_end));\n");
      out.write("                    }\n");
      out.write("                }\n");
      out.write("                return \"\";\n");
      out.write("            }\n");
      out.write("            var cookieVal = getCookie(\"ui\");\n");
      out.write("            if (cookieVal == null || cookieVal == \"\") {\n");
      out.write("                window.location.replace('login');\n");
      out.write("            }\n");
      out.write("        });\n");
      out.write("    </script>\n");
      out.write("</head>\n");
      out.write("\n");
      out.write("<body>\n");
      out.write("\n");
      out.write("<input style=\"height: 80px;width: 100%\" id=\"input\">\n");
      out.write("<div class=\"log\" style=\"width: 25%\">\n");
      out.write("    <a id=\"resolve\">解析</a>\n");
      out.write("</div>\n");
      out.write("<div class=\"login-form\">\n");
      out.write("    <ul>\n");
      out.write("        <li id=\"h\" class=\"touch\">\n");
      out.write("            <label>我的瘦身日记</label>\n");
      out.write("            <div>\n");
      out.write("                <input type=\"text\" name=\"name\" id=\"name\">\n");
      out.write("            </div>\n");
      out.write("        </li>\n");
      out.write("        <li id=\"f\" class=\"touch\">\n");
      out.write("            <label>今日体重</label>\n");
      out.write("            <div>\n");
      out.write("                <input type=\"text\" name=\"weight\" id=\"weight\"/>\n");
      out.write("            </div>\n");
      out.write("        </li>\n");
      out.write("        <li id=\"a\" class=\"touch\">\n");
      out.write("            <label>早餐</label>\n");
      out.write("            <div>\n");
      out.write("                <input type=\"text\" name=\"breakfast\" id=\"breakfast\">\n");
      out.write("            </div>\n");
      out.write("        </li>\n");
      out.write("        <li id=\"b\" class=\"touch\">\n");
      out.write("            <label>午餐</label>\n");
      out.write("            <div>\n");
      out.write("                <input type=\"text\" name=\"lunch\" id=\"lunch\">\n");
      out.write("            </div>\n");
      out.write("        </li>\n");
      out.write("        <li id=\"i\" class=\"touch\">\n");
      out.write("            <label>水果</label>\n");
      out.write("            <div>\n");
      out.write("                <input type=\"text\" name=\"fruits\" id=\"fruits\">\n");
      out.write("            </div>\n");
      out.write("        </li>\n");
      out.write("        <li id=\"c\" class=\"touch\">\n");
      out.write("            <label>晚餐</label>\n");
      out.write("            <div>\n");
      out.write("                <input type=\"text\" name=\"dinner\" id=\"dinner\">\n");
      out.write("            </div>\n");
      out.write("        </li>\n");
      out.write("        <li id=\"d\" class=\"touch\">\n");
      out.write("            <label>排便次数</label>\n");
      out.write("            <div>\n");
      out.write("                <input type=\"text\" name=\"defecation\" id=\"defecation\">\n");
      out.write("            </div>\n");
      out.write("        </li>\n");
      out.write("        <li id=\"e\" class=\"touch\">\n");
      out.write("            <label>饮水量</label>\n");
      out.write("            <div>\n");
      out.write("                <input type=\"text\" name=\"water\" id=\"water\">\n");
      out.write("            </div>\n");
      out.write("        </li>\n");
      out.write("        <li id=\"g\" class=\"touch\">\n");
      out.write("            <label>备注</label>\n");
      out.write("            <div>\n");
      out.write("                <input type=\"text\" name=\"tips\" id=\"tips\">\n");
      out.write("            </div>\n");
      out.write("        </li>\n");
      out.write("    </ul>\n");
      out.write("    <div class=\"log\" style=\"width: 25%\">\n");
      out.write("        <a id=\"submit\">提交</a>\n");
      out.write("    </div>\n");
      out.write("</div>\n");
      out.write("<div style=\"height:30px;margin:10px auto;text-align:center;\">\n");
      out.write("    <p style=\"height:30px;line-height:30px;color:#aaa\">点击空白区域显示导航栏</p>\n");
      out.write("</div>\n");
      out.write("<!--导航栏-->\n");
      out.write("<span id=\"footer\">\n");
      out.write("\n");
      out.write("</span>\n");
      out.write("</body>\n");
      out.write("<script>\n");
      out.write("    $(\"#resolve\").click(function () {\n");
      out.write("        var input = $(\"#input\").val();\n");
      out.write("        var arr = new Array();\n");
      out.write("        arr = input.split('|');\n");
      out.write("\n");
      out.write("        var name = arr[1].substring(7).trim();\n");
      out.write("        $(\"#name\").val(name);\n");
      out.write("        var weight = arr[4].substring(5).trim();\n");
      out.write("        $(\"#weight\").val(weight);\n");
      out.write("        var breakfast = arr[11].substring(3).trim();\n");
      out.write("        $(\"#breakfast\").val(breakfast);\n");
      out.write("        var lunch = arr[12].substring(3).trim();\n");
      out.write("        $(\"#lunch\").val(lunch);\n");
      out.write("        var fruits = arr[13].substring(3).trim();\n");
      out.write("        $(\"#fruits\").val(fruits);\n");
      out.write("        var dinner = arr[14].substring(3).trim();\n");
      out.write("        $(\"#dinner\").val(dinner);\n");
      out.write("        var defecation = arr[16].substring(5).trim();\n");
      out.write("        $(\"#defecation\").val(defecation);\n");
      out.write("        var water = arr[15].substring(4).trim();\n");
      out.write("        $(\"#water\").val(water);\n");
      out.write("        var tips = arr[10].substring(3).trim();\n");
      out.write("        $(\"#tips\").val(tips);\n");
      out.write("        layer.msg('解析成功');\n");
      out.write("    });\n");
      out.write("    $(\"#submit\").click(function () {\n");
      out.write("        var name = $(\"#name\").val().trim();\n");
      out.write("        var weight = $(\"#weight\").val().trim();\n");
      out.write("        var breakfast = $(\"#breakfast\").val().trim();\n");
      out.write("        var lunch = $(\"#lunch\").val().trim();\n");
      out.write("        var fruits = $(\"#fruits\").val().trim();\n");
      out.write("        var dinner = $(\"#dinner\").val().trim();\n");
      out.write("        var defecation = $(\"#defecation\").val().trim();\n");
      out.write("        var water = $(\"#water\").val().trim();\n");
      out.write("        var tips = $(\"#tips\").val().trim();\n");
      out.write("\n");
      out.write("        var nameTest = /^[\\u4e00-\\u9fa5]{0,5}$/;\n");
      out.write("        var weightTest = /^[0-9]+(.[0-9]{0,3})?$/;\n");
      out.write("        var Test = /^[0-9]{0,4}$/;\n");
      out.write("\n");
      out.write("        if (name === \"\") {\n");
      out.write("            alert(\"我的瘦身日记为必填项\");\n");
      out.write("            return;\n");
      out.write("        }\n");
      out.write("        if (weight === \"\") {\n");
      out.write("            alert(\"今日体重为必填项\");\n");
      out.write("            return;\n");
      out.write("        }\n");
      out.write("        if (!nameTest.test(name)) {\n");
      out.write("            alert(\"我的瘦身日记输入格式不合法\");\n");
      out.write("            return;\n");
      out.write("        }\n");
      out.write("        if (!weightTest.test(weight)) {\n");
      out.write("            alert(\"今日体重输入格式不合法\");\n");
      out.write("            return;\n");
      out.write("        }\n");
      out.write("        if (!Test.test(defecation)) {\n");
      out.write("            alert(\"排便次数输入格式不合法\");\n");
      out.write("            return;\n");
      out.write("        }if (!Test.test(water)) {\n");
      out.write("            alert(\"饮水量输入格式不合法\");\n");
      out.write("            return;\n");
      out.write("        }\n");
      out.write("\n");
      out.write("        $.ajax({\n");
      out.write("            type: \"POST\",\n");
      out.write("            url: \"/doFlowChange\",\n");
      out.write("            dataType: \"json\",\n");
      out.write("            data: {\n");
      out.write("                name: name,\n");
      out.write("                weight: weight,\n");
      out.write("                breakfast: breakfast,\n");
      out.write("                lunch: lunch,\n");
      out.write("                fruits: fruits,\n");
      out.write("                dinner: dinner,\n");
      out.write("                defecation: defecation,\n");
      out.write("                water: water,\n");
      out.write("                tips: tips\n");
      out.write("            },\n");
      out.write("            success: function (data) {\n");
      out.write("                if (data.respCode === 0) {\n");
      out.write("                    alert(\"打卡成功\");\n");
      out.write("                    window.location.href = \"/\";\n");
      out.write("                }\n");
      out.write("                if (data.respCode === 1) {\n");
      out.write("                    alert(\"更新成功\");\n");
      out.write("                }\n");
      out.write("                if (data.respCode === 2) {\n");
      out.write("                    alert(\"请先登陆\");\n");
      out.write("                }\n");
      out.write("            }\n");
      out.write("        });\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("    });\n");
      out.write("\n");
      out.write("</script>\n");
      out.write("</html>\n");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
