<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Course_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-course_id" data-rule="required" data-source="course/index" class="form-control selectpage" name="row[course_id]" type="text" value="">
        </div>
    </div>
    {if isset($store_id)}
    <div class="form-group" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('Store_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-store_id" data-rule="required" data-source="store/index" class="form-control" name="row[store_id]" type="text" value="{$store_id}">
        </div>
    </div>
    {else}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Store_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-store_id" data-rule="required" data-source="store/index" class="form-control selectpage" name="row[store_id]" type="text" value="">
        </div>
    </div>
    {/if}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Count')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-count" data-rule="required integer" class="form-control" name="row[count]" type="number">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Teacher')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-teacher" data-rule="required" class="form-control" name="row[teacher]" type="text">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Notify_count')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-notify_count" data-rule="required integer" class="form-control" name="row[notify_count]" type="number">
        </div>
    </div>

    <div class="form-group row">
        <label class="control-label col-xs-12 col-sm-2">{:__('Date')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl class="fieldlist" data-template="eventtpl" data-name="row[date]">
                <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
                <!--请注意 dd和textarea间不能存在其它任何元素,实际开发中textarea应该添加个hidden进行隐藏-->
                <textarea id="c-date" name="row[date]" data-rule="required" class="form-control" cols="30" rows="5" style="display: none"></textarea>
            </dl>
            <script id="eventtpl" type="text/html">
                <dd class="form-inline">
                    <ins><input type="text" name="<%=name%>[<%=index%>][date]" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" value="<%=row.date%>" placeholder="{:__('Date')}" size="10"/></ins>
                    <!--下面的两个按钮务必保留-->
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
            </script>
        </div>
    </div>


    <div class="form-group row">
        <label class="control-label col-xs-12 col-sm-2">{:__('Time')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl class="fieldlist" data-template="eventtpl_1" data-name="row[time]">
                <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
                <!--请注意 dd和textarea间不能存在其它任何元素,实际开发中textarea应该添加个hidden进行隐藏-->
                <textarea id="c-time" name="row[time]" class="form-control" data-rule="required" cols="30" rows="5" style="display: none"></textarea>
            </dl>
            <script id="eventtpl_1" type="text/html">
                <dd class="form-inline">
                    <ins><input type="text" name="<%=name%>[<%=index%>][time_start]" data-rule="required" class="form-control datetimepicker" data-date-format="HH:mm:ss" value="<%=row.time_start%>" placeholder="{:__('Time_start')}" size="10"/></ins>
                    <ins><input type="text" name="<%=name%>[<%=index%>][time_end]" data-rule="required match(gte, row[time][<%=index%>][time_start], time)" class="form-control datetimepicker" data-date-format="HH:mm:ss" value="<%=row.time_end%>" placeholder="{:__('Time_end')}" size="10"/></ins>
                    <!--下面的两个按钮务必保留-->
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
            </script>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>