<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改约球购票')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-AdmissionTicket-edit" th:object="${beilvAdmissionTicket}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">场馆id：</label>
                    <div class="col-sm-8">
                        <input name="venueId" th:field="*{venueId}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">场馆名称：</label>
                    <div class="col-sm-8">
                        <!-- 添加 value 属性绑定到 beilvSession.venueId -->
                        <select name="venueId" class="form-control" th:value="${beilvSession.venueId}">
                            <option th:each="post:${beilvSitesList}"
                                    th:value="${post.id}"
                                    th:text="${post.venueName}"
                                    th:selected="${post.id == beilvSession.venueId}">
                            </option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">场地时段：</label>
                    <div class="col-sm-8">
                        <input name="session" th:field="*{session}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">时段价格：</label>
                    <div class="col-sm-8">
                        <input name="price" th:field="*{price}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">门票日期：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="ticketDate" th:value="${#dates.format(beilvAdmissionTicket.ticketDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "admissionticket";
        $("#form-AdmissionTicket-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-AdmissionTicket-edit').serialize());
            }
        }

        $("input[name='ticketDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>