<!-- 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/Student/Save')}}" method="POST" request-type="ajax-url" request-value="{{:U('Admin/Student/Index')}}">
			<legend>
				<span class="fs-16">
					<if condition="empty($data['id'])">
						{{:L('student_add_name')}}
					<else />
						{{:L('student_edit_name')}}
					</if>
				</span>
				<a href="{{:U('Admin/Student/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('student_username_text')}}</label>
				<input type="text" name="username" placeholder="{{:L('student_username_text')}}" minlength="2" maxlength="16" data-validation-message="{{:L('student_username_format')}}" class="am-radius" <notempty name="data"> value="{{$data.username}}"</notempty> required />
			</div>
			<div class="am-form-group">
				<label>{{:L('common_view_student_number_text')}}</label>
				<input type="text" name="number" placeholder="{{:L('common_student_number_tips')}}" class="am-radius" <notempty name="data"> value="{{$data.number}}"</notempty> disabled />
			</div>
			<div class="am-form-group">
				<label>{{:L('common_view_id_card_text')}}</label>
				<input type="text" name="id_card" placeholder="{{:L('common_view_id_card_text')}}" pattern="{{:L('common_regex_id_card')}}" data-validation-message="{{:L('common_view_id_card_format')}}" class="am-radius" <notempty name="data"> value="{{$data.id_card}}" disabled</notempty> required />
			</div>
			<include file="Lib/Gender" />
			<div class="am-form-group">
				<label>{{:L('student_birthday_text')}}</label>
				<input type="text" name="birthday" class="am-radius" placeholder="{{:L('student_birthday_text')}}" pattern="{{:L('common_regex_birthday')}}" data-validation-message="{{:L('student_birthday_format')}}" <notempty name="data"> value="{{$data.birthday}}" </notempty> data-am-datepicker="{format: 'yyyy-mm-dd', viewMode: 'years'}" readonly required />
			</div>
			<div class="am-form-group">
				<label>{{:L('student_class_text')}}</label>
				<select name="class_id" class="am-radius c-p" data-validation-message="{{:L('student_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('student_region_text')}}</label>
				<select name="region_id" class="am-radius c-p" data-validation-message="{{:L('student_region_format')}}" required>
					<option value="">{{:L('common_select_can_choose')}}</option>
					<foreach name="region_list" item="v">
						<option value="{{$v.id}}" <if condition="isset($data['region_id']) and $data['region_id'] eq $v['id']">selected</if>>{{$v.name}}</option>
					</foreach>
				</select>
			</div>
			<div class="am-form-group">
				<label>{{:L('common_address_text')}}</label>
				<input type="text" placeholder="{{:L('common_address_text')}}" name="address" data-validation-message="{{:L('common_address_format')}}" class="am-radius" <notempty name="data"> value="{{$data.address}}"</notempty> />
			</div>
			<div class="am-form-group">
				<label>{{:L('common_view_tel_name')}}</label>
				<input type="text" placeholder="{{:L('common_view_tel_name')}}" name="tel" pattern="{{:L('common_regex_tel')}}" data-validation-message="{{:L('common_view_tel_error')}}" class="am-radius" <notempty name="data"> value="{{$data.tel}}"</notempty> />
			</div>
			<div class="am-form-group">
				<label>{{:L('student_my_mobile_name')}}</label>
				<input type="text" placeholder="{{:L('student_my_mobile_name')}}" name="my_mobile" pattern="{{:L('common_regex_mobile')}}" data-validation-message="{{:L('student_my_mobile_error')}}" class="am-radius" <notempty name="data"> value="{{$data.my_mobile}}"</notempty> />
			</div>
			<div class="am-form-group">
				<label>{{:L('common_view_parent_mobile_name')}}</label>
				<input type="text" placeholder="{{:L('common_view_parent_mobile_name')}}" name="parent_mobile" pattern="{{:L('common_regex_mobile')}}" data-validation-message="{{:L('common_view_parent_mobile_error')}}" class="am-radius" <notempty name="data"> value="{{$data.parent_mobile}}"</notempty> required />
			</div>
			<div class="am-form-group">
				<label>{{:L('common_email_name')}}</label>
				<input type="text" placeholder="{{:L('common_email_name')}}" name="email" pattern="{{:L('common_regex_email')}}" data-validation-message="{{:L('common_email_format_error')}}" maxlength="60" class="am-radius" <notempty name="data"> value="{{$data.email}}"</notempty> />
			</div>
			<include file="Lib/StudentState" />
			<div class="am-form-group">
				<label>{{:L('student_tuition_state_text')}}</label>
				<div>
					<foreach name="common_tuition_state_list" item="v">
						<label class="am-radio-inline m-r-10">
							<input type="radio" name="tuition_state" value="{{$v.id}}" <if condition="isset($data['tuition_state']) and $data['tuition_state'] eq $v['id']">checked="checked"<else /><if condition="!isset($data['tuition_state']) and isset($v['checked']) and $v['checked'] eq true">checked="checked"</if></if> data-am-ucheck /> {{$v.name}}
						</label>
					</foreach>
				</div>
			</div>
			<div class="am-form-group">
				<input type="hidden" name="id" <notempty name="data"> value="{{$data.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 -->