<%@ 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() {
            $("#value").focus();
            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);
                    }
                }
            });
        });
    </script>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="ibox-title">
            <h5>加入企业 </h5>
            <div class="ibox-tools">
                <a class="collapse-link">
                    <i class="fa fa-chevron-up"></i>
                </a>
            </div>
            <div class="ibox-content">
                <div id="messageBox"></div>
                <form:form id="inputForm" modelAttribute="company" action="${ctx}/sys/company/saveApplyCompany" method="post" class="form-horizontal">
                    <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="name" value="${user.loginName}" htmlEscape="false" readonly="readonly" class="form-control required"/>
                                <input type="hidden" name="master" value="${office.master}"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="width-15 active"><label class="pull-right"><font color="red">*</font>公司名称：</label></td>
                            <td class="width-35">
                                <form:input path="name" htmlEscape="false" readonly="readonly"  class="form-control required"/>
                                <input type="hidden" name="companyId" value="${office.id}"/>
                            </td>
                        </tr>
                        <tr>
                            <td  class="width-15 active"><label class="pull-right">申请内容:</label></td>
                            <td class="width-35" ><form:textarea path="remarks" value="" htmlEscape="false" rows="3" maxlength="200" class="form-control"/></td>
                        </tr>
                        </tbody>
                    </table>
                </form:form>
            </div>
        </div>
    </div>
</div>
</body>
</html>