<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<html>
<head>
    <meta charset="UTF-8">
    <title>Demo</title>
    <link href="http://cdn.bootcss.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>

<div class="container">
    <div class="page-header">
        <h1>Product</h1>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading">Product List</div>
        <div class="panel-body">
            <div id="product"></div>
        </div>
    </div>
    <div id="checkuser"></div>
    <div id="checkuser1"></div>
    <div id="queryPiGroup"></div>
</div>

<script src="http://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="http://cdn.bootcss.com/handlebars.js/1.3.0/handlebars.min.js"></script>

<script type="text/x-handlebars-template" id="product_table_template">
    {{#if data}}
    <table class="table table-hover" id="product_table">
        <thead>
        <tr>
            <th>ID</th>
            <th>Product Name</th>
            <th>Product Desc</th>
        </tr>
        </thead>
        <tbody>
        {{#data}}
        <tr data-id="{EQUIPID}}" data-name="{{EQUIPNAME}}">
            <td>{{EQRUNSTATU}}</td>
            <td>{{EQUIPID}}</td>
            <td>{{EQUIPNAME}}</td>
        </tr>
        {{/data}}
        </tbody>
    </table>
    {{else}}
    <div class="alert alert-warning">Can not find any data!</div>
    {{/if}}
</script>

<script>


    // $(function(){
    //     $.getJSON('http://localhost:8080/sgapp/rest/pitask/UploadingPA_DATA?strContent=65^1510005^1510006^1^^2015-11-04 17:58:19^1^电气点检设备DQDJ_SB001^电气点检设备DQDJ_SB001^电气点检区域DQDJ_AREA001^廖东东^150003^JL^设备正常^^null^点检^111001^1;&Company_ID=YUDEAN&strGroup=2307001_2023_8_15_17_50&US_CODE=2307001&callback=?', {}, function(data){
    //         $('#Uploading').html("UploadingPA_EQUIP_STATUS++++++++=test444s");
    //
    //     });
    // });


    <%-- $(function() {
        $.ajax({
                    type : 'get',
                    url : '<%=basePath %>/rest/pitask/queryPiTask/7',
                    dataType : 'jsonp',
                    jsonp : '_jsonp',
                    jsonpcallback : 'callback',
                    success : function(data) {
                        alert(data);
                        var template = $("#product_table_template").html();
                        var render = Handlebars.compile(template);
                        var html = render({
                            data : data
                        });
                        $('#product').html(html);
                    }
                });
    }); --%>

    <%-- 	 $(function() {
            $.ajax({
                        type : 'get',
                        url : '<%=basePath %>/rest/pitask/checkUser/maxadmin/000000',
                        dataType : 'jsonp',
                        jsonp : '_jsonp',
                        jsonpcallback : 'callback',
                        success : function(data) {
                            alert(data.PASSWORD);
                            $('#checkuser1').html(data.PASSWORD);
                        },
                        error : function(e) {
                            alert("error");
                        }
                    });
        }); --%>

    <%--  $(function() {
          $.ajax({
                      type : 'get',
                      url : '<%=basePath %>/rest/pitask/enterFunction',
                      data:{
                          US_CODE:"maxadmin",
                          US_PWD:"000000"
                          },
                      dataType : 'jsonp',
                      jsonp : '_jsonp',
                      jsonpcallback : 'callback',
                      success : function(data) {
                           $('#checkuser1').html(data.US_NAME+"++++++++=test1");
                      }
                  });

      });  --%>


    // $(function(){
    //     $.getJSON('http://localhost:8080/sgapp/rest/pitask/UploadingPA_EQUIP_STATUS?strContent=73^1510005^1510006^1^^2015-11-04 17:58:19^1^电气点检设备DQDJ_SB001^电气点检设备DQDJ_SB001^电气点检区域DQDJ_AREA001^^150003^JL^^null^null^点检^undefined^1&Company_ID=YUDEAN&strGroup=150003_2015_11_4_17_50&US_CODE=1035&callback=?',{}, function(data){
    //         $('#checkuser').html("ss++++++++=test444s");
    //     });
    //
    // });
    /*  $(function(){
      $.getJSON('http://172.20.2.25:8080/cxfservice/rest/pitask/queryPiTask/7', function(data){
          var template = $("#product_table_template").html();
            var render = Handlebars.compile(template);
            var html = render({
              data: data
            });
            $('#product').html(html);
        });

    });



    $(function(){
      $.getJSON('http://172.20.2.25:8080/cxfservice/rest/pitask/queryPiGroup/MAXADMIN?callback=?', function(data){
          $('#queryPiGroup').html(data[0].papointid);
        });

    });


    $(function(){

      $.getJSON('http://172.20.2.25:8080/cxfservice/rest/pitask/executeUpdate/1?callback=?', function(data){
          alert(data);
        });

    }); */
</script>

</body>
</html>