<!-- header start -->
<include file="Public/Header" />
<!-- header end -->

<!-- right content start  -->
<div class="content-right">
	<div class="content">
		<!-- form start -->
		<form class="am-form form-validation view-save" action="{{:U('Admin/Course/Save')}}" method="POST" request-type="ajax-url" request-value="{{$request_url}}">
			<legend>
				<span class="fs-16">
					<if condition="empty($data['id'])">
						{{:L('course_add_name')}}
					<else />
						{{:L('course_edit_name')}}
					</if>
				</span>
				<a href="{{:U('Admin/Course/Index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> {{:L('common_operation_back')}}</a>
			</legend>
			<div class="am-form-group">
				<label>{{:L('course_class_text')}}</label>
				<select name="class_id" class="am-radius c-p" data-validation-message="{{:L('course_class_format')}}" required>
					<option value="">{{:L('common_select_can_choose')}}</option>
					<foreach name="class_list" item="v">
						<if condition="empty($v['item'])">
							<option value="{{$v.id}}" <if condition="isset($data['class_id']) and $data['class_id'] eq $v['id']">selected</if>>{{$v.name}}</option>
						<else />
							<optgroup label="{{$v.name}}">
								<foreach name="v.item" item="vs">
									<option value="{{$vs.id}}" <if condition="isset($data['class_id']) and $data['class_id'] eq $vs['id']">selected</if>>{{$vs.name}}</option>
								</foreach>
							</optgroup>
						</if>
					</foreach>
				</select>
			</div>
			<div class="am-form-group">
				<label>{{:L('course_subject_text')}}</label>
				<select name="subject_id" class="am-radius c-p" data-validation-message="{{:L('course_subject_format')}}" required>
					<option value="">{{:L('common_select_can_choose')}}</option>
					<foreach name="subject_list" item="v">
						<option value="{{$v.id}}" <if condition="isset($data['subject_id']) and $data['subject_id'] eq $v['id']">selected</if>>{{$v.name}}</option>
					</foreach>
				</select>
			</div>
			<div class="am-form-group">
				<label>{{:L('course_week_text')}}</label>
				<select name="week_id" class="am-radius c-p" data-validation-message="{{:L('course_week_format')}}" required>
					<option value="">{{:L('common_select_can_choose')}}</option>
					<foreach name="week_list" item="v">
						<option value="{{$v.id}}" <if condition="isset($data['week_id']) and $data['week_id'] eq $v['id']">selected</if>>{{$v.name}}</option>
					</foreach>
				</select>
			</div>
			<div class="am-form-group">
				<label>{{:L('course_interval_text')}}</label>
				<select name="interval_id" class="am-radius c-p" data-validation-message="{{:L('course_interval_format')}}" required>
					<option value="">{{:L('common_select_can_choose')}}</option>
					<foreach name="interval_list" item="v">
						<option value="{{$v.id}}" <if condition="isset($data['interval_id']) and $data['interval_id'] eq $v['id']">selected</if>>{{$v.name}}</option>
					</foreach>
				</select>
			</div>
			<div class="am-form-group">
				<label>{{:L('course_room_text')}}</label>
				<select name="room_id" class="am-radius c-p" data-validation-message="{{:L('course_room_format')}}" required>
					<option value="">{{:L('common_select_can_choose')}}</option>
					<foreach name="room_list" item="v">
						<if condition="empty($v['item'])">
							<option value="{{$v.id}}" <if condition="isset($data['room_id']) and $data['room_id'] eq $v['id']">selected</if>>{{$v.name}}</option>
						<else />
							<optgroup label="{{$v.name}}">
								<foreach name="v.item" item="vs">
									<option value="{{$vs.id}}" <if condition="isset($data['room_id']) and $data['room_id'] eq $vs['id']">selected</if>>{{$vs.name}}</option>
								</foreach>
							</optgroup>
						</if>
					</foreach>
				</select>
			</div>
			<div class="am-form-group">
				<input type="hidden" name="id" <notempty name="data"> value="{{$data.id}}"</notempty>" />
				<input type="hidden" name="teacher_id" <notempty name="data"> value="{{$data.teacher_id}}"</notempty>" />
				<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>
			</div>
		</form>
        <!-- form end -->
	</div>
</div>
<!-- right content end  -->
		
<!-- footer start -->
<include file="Public/Footer" />
<!-- footer end -->