<?php $__env->startSection('title', 'Thêm học viên'); ?>
<?php $__env->startSection('content'); ?>
<div class="d-flex justify-content-between align-items-center mb-4"><div><h3 class="fw-bold mb-1">Thêm học viên</h3><div class="text-muted">Tạo mới hồ sơ học viên</div></div><a href="<?php echo e(route('students.index')); ?>" class="btn btn-outline-secondary"><i class="bi bi-arrow-left me-1"></i> Quay lại</a></div>
<?php if($errors->any()): ?><div class="alert alert-danger"><strong>Vui lòng kiểm tra lại thông tin nhập.</strong></div><?php endif; ?>
<div class="card shadow-sm"><div class="card-body"><form action="<?php echo e(route('students.store')); ?>" method="POST"><?php echo csrf_field(); ?>

<div class="row g-3">
    <div class="col-md-3"><label class="form-label">Mã học viên <span class="text-danger">*</span></label><input type="text" name="code" class="form-control" value="<?php echo e(old('code', $student->code ?? '')); ?>" required></div>
    <div class="col-md-5"><label class="form-label">Họ và tên <span class="text-danger">*</span></label><input type="text" name="full_name" class="form-control" value="<?php echo e(old('full_name', $student->full_name ?? '')); ?>" required></div>
    <div class="col-md-2"><label class="form-label">Giới tính</label><select name="gender" class="form-select"><?php $__currentLoopData = ['Nam','Nữ','Khác']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gender): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($gender); ?>" <?php echo e(old('gender', $student->gender ?? 'Nam') == $gender ? 'selected' : ''); ?>><?php echo e($gender); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select></div>
    <div class="col-md-2"><label class="form-label">Ngày sinh</label><input type="date" name="date_of_birth" class="form-control" value="<?php echo e(old('date_of_birth', $student->date_of_birth ?? '')); ?>"></div>
    <div class="col-md-4"><label class="form-label">CCCD/Hộ chiếu</label><input type="text" name="identity_number" class="form-control" value="<?php echo e(old('identity_number', $student->identity_number ?? '')); ?>"></div>
    <div class="col-md-4"><label class="form-label">Điện thoại</label><input type="text" name="phone" class="form-control" value="<?php echo e(old('phone', $student->phone ?? '')); ?>"></div>
    <div class="col-md-4"><label class="form-label">Email</label><input type="email" name="email" class="form-control" value="<?php echo e(old('email', $student->email ?? '')); ?>"></div>
    <div class="col-md-6"><label class="form-label">Đơn vị công tác</label><input type="text" name="organization" class="form-control" value="<?php echo e(old('organization', $student->organization ?? '')); ?>"></div>
    <div class="col-md-3"><label class="form-label">Chức vụ</label><input type="text" name="position" class="form-control" value="<?php echo e(old('position', $student->position ?? '')); ?>"></div>
    <div class="col-md-3"><label class="form-label">Trình độ</label><input type="text" name="education_level" class="form-control" value="<?php echo e(old('education_level', $student->education_level ?? '')); ?>"></div>
    <div class="col-md-4"><label class="form-label">Chuyên ngành</label><input type="text" name="major" class="form-control" value="<?php echo e(old('major', $student->major ?? '')); ?>"></div>
    <div class="col-md-4"><label class="form-label">Trạng thái</label><select name="status" class="form-select"><?php $__currentLoopData = ['Đang hoạt động','Tạm ngưng','Đã khóa']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $status): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($status); ?>" <?php echo e(old('status', $student->status ?? 'Đang hoạt động') == $status ? 'selected' : ''); ?>><?php echo e($status); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select></div>
    <div class="col-md-12"><label class="form-label">Địa chỉ</label><textarea name="address" rows="2" class="form-control"><?php echo e(old('address', $student->address ?? '')); ?></textarea></div>
    <div class="col-md-12"><label class="form-label">Ghi chú</label><textarea name="note" rows="3" class="form-control"><?php echo e(old('note', $student->note ?? '')); ?></textarea></div>
</div>

<div class="mt-4 text-end"><a href="<?php echo e(route('students.index')); ?>" class="btn btn-outline-secondary">Hủy</a><button class="btn btn-primary"><i class="bi bi-save me-1"></i> Lưu học viên</button></div></form></div></div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\TMS\resources\views/students/create.blade.php ENDPATH**/ ?>