<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
    <title>外勤签到信息</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        var validateForm;
        function doSubmit(){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
            if(validateForm.form()){
                $("#inputForm").submit();
                return true;
            }

            return false;
        }
        $(document).ready(function() {
            validateForm = $("#inputForm").validate({
                submitHandler: function(form){
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function(error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
            //只做查看时，禁用掉以下标签
            $('input,textarea,select').attr('disabled',<%=request.getAttribute("disabled")%>);
        });
    </script>
</head>
<body class="hideScroll">
<form:form id="inputForm" modelAttribute="workOutSignIn" action="${ctx}/workoutsginin/workOutSginIn/save" method="post" class="form-horizontal">
<form:hidden path="id"/>
<sys:message content="${message}"/>
<table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
    <tbody>
    <tr>
        <td  class="width-15 active">	<label class="pull-right"><font color="red">*</font>创建时间：</label></td>
        <td class="width-35" ><%--<form:input path="createDate" htmlEscape="false" cssClass="form-control required"/>--%>
            <fmt:formatDate value="${workOutSignIn.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
        </td>
        <td  class="width-15 active">	<label class="pull-right"><font color="red">*</font>用户信息：</label></td>
        <td class="width-35" >
            <c:choose>
                <c:when test="${!disabled}">
                <form:input path="user.name" htmlEscape="false"  class="form-control required"/>
                </c:when>
                <c:otherwise>
                    ${workOutSignIn.user.name}
                </c:otherwise>
            </c:choose>
        </td>
    </tr>
    <tr>
        <td class="width-15 active"><label class="pull-right"><font color="red">*</font>位置名称：</label></td>
        <td class="width-75" colspan="3">

            <c:choose>
                <c:when test="${!disabled}">
                     <form:input path="locationName" cssClass="form-control"/> </c:when>
                <c:otherwise>
                    ${workOutSignIn.locationName}
                </c:otherwise>
            </c:choose>
        </td>
    </tr>
    <tr>
        <td  class="width-15 active">	<label class="pull-right"><font color="red">*</font>位置详情：</label></td>
        <td class="width-75" colspan="3" >
            <c:choose>
                <c:when test="${!disabled}">
                    <form:textarea path="locationInfo" htmlEscape="false" colspan="3" rows="6" maxlength="550" class="form-control "/>
                </c:when>
                <c:otherwise>
                    ${workOutSignIn.locationInfo}
                </c:otherwise>
            </c:choose>
        </td>
    </tr>
    <tr>
        <td class="width-15 active"><label class="pull-right"><font color="red">*</font>经度：</label></td>
        <td class="width-75">
            <c:choose>
                <c:when test="${!disabled}">
                    <form:input  path="longitude" htmlEscape="false"  cssClass="form-control"/>
                </c:when>
                <c:otherwise>
                    ${workOutSignIn.longitude}
                </c:otherwise>
            </c:choose>
        </td>
        <td class="width-15 active"><label class="pull-right"> <font color="red">*</font>纬度：</label></td>
        <td>
            <c:choose>
                <c:when test="${!disabled}">
                    <form:input path="latitude" htmlEscape="false" cssClass="form-control"/>
                </c:when>
                <c:otherwise>
                    ${workOutSignIn.latitude}
                </c:otherwise>
            </c:choose>
        </td>
    </tr>
    </tbody>
    </form:form>
</body>
</html>