

<?php $__env->startSection('title', 'Student Details'); ?>
<?php $__env->startSection('page-title', 'Student Details'); ?>

<?php $__env->startSection('content'); ?>
    <div style="margin-bottom: 20px;">
        <a href="<?php echo e(route('instructor.students.index')); ?>" class="btn btn-secondary">← Back to My Students</a>
    </div>
    
    <div class="card">
        <div class="card-header">
            <h3><?php echo e($student->name); ?></h3>
        </div>
        
        <div style="padding: 30px;">
            <!-- Profile Picture Section -->
            <div style="text-align: center; margin-bottom: 30px; padding-bottom: 30px; border-bottom: 1px solid #404040;">
                <?php if($student->profile_picture): ?>
                    <?php
                        try {
                            $decrypted = \Illuminate\Support\Facades\Crypt::decryptString($student->profile_picture);
                        } catch (\Exception $e) {
                            $decrypted = null;
                        }
                    ?>
                    <?php if($decrypted): ?>
                        <img src="<?php echo e($decrypted); ?>" alt="Profile Picture" 
                             style="width: 150px; height: 150px; border-radius: 50%; object-fit: cover; border: 3px solid #4a9eff; box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);">
                    <?php else: ?>
                        <div style="width: 150px; height: 150px; border-radius: 50%; background: #2d2d2d; display: flex; align-items: center; justify-content: center; border: 3px solid #4a9eff; margin: 0 auto; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);">
                            <i class="fas fa-user" style="font-size: 60px; color: #888;"></i>
                        </div>
                    <?php endif; ?>
                <?php else: ?>
                    <div style="width: 150px; height: 150px; border-radius: 50%; background: #2d2d2d; display: flex; align-items: center; justify-content: center; border: 3px solid #4a9eff; margin: 0 auto; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);">
                        <i class="fas fa-user" style="font-size: 60px; color: #888;"></i>
                    </div>
                <?php endif; ?>
            </div>
            
            <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-bottom: 30px;">
                <div>
                    <h4 style="color: #4a9eff; margin-bottom: 20px; border-bottom: 1px solid #404040; padding-bottom: 10px;">Student Information</h4>
                    <div style="margin-bottom: 15px;">
                        <strong style="color: #888; display: block; margin-bottom: 5px;">Full Name</strong>
                        <span style="color: #e0e0e0; font-size: 16px;"><?php echo e($student->name); ?></span>
                    </div>
                    <div style="margin-bottom: 15px;">
                        <strong style="color: #888; display: block; margin-bottom: 5px;">Email</strong>
                        <span style="color: #e0e0e0; font-size: 16px;"><?php echo e($student->email); ?></span>
                    </div>
                    <?php if($student->school_id): ?>
                    <div style="margin-bottom: 15px;">
                        <strong style="color: #888; display: block; margin-bottom: 5px;">School ID</strong>
                        <span style="color: #e0e0e0; font-size: 16px;"><?php echo e($student->school_id); ?></span>
                    </div>
                    <?php endif; ?>
                    <?php if($student->phone): ?>
                    <div style="margin-bottom: 15px;">
                        <strong style="color: #888; display: block; margin-bottom: 5px;">Phone</strong>
                        <span style="color: #e0e0e0; font-size: 16px;"><?php echo e($student->phone); ?></span>
                    </div>
                    <?php endif; ?>
                </div>
            </div>
            
            <!-- Enrolled Courses Section -->
            <div style="margin-top: 30px;">
                <h4 style="color: #4a9eff; margin-bottom: 20px; border-bottom: 1px solid #404040; padding-bottom: 10px;">Enrolled Courses</h4>
                <?php if($enrollments->count() > 0): ?>
                    <table class="table">
                        <thead>
                            <tr>
                                <th>Course</th>
                                <th>Code</th>
                                <th>Enrollment Date</th>
                                <th>Status</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__currentLoopData = $enrollments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $enrollment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td>
                                        <a href="<?php echo e(route('instructor.courses.show', $enrollment->course_id)); ?>" style="color: #4a9eff; text-decoration: none;">
                                            <?php echo e($enrollment->course->name); ?>

                                        </a>
                                    </td>
                                    <td><?php echo e($enrollment->course->code); ?></td>
                                    <td><?php echo e($enrollment->enrollment_date ? $enrollment->enrollment_date->format('M d, Y') : 'N/A'); ?></td>
                                    <td>
                                        <?php if($enrollment->status == 'active'): ?>
                                            <span style="color: #6bff6b;">Active</span>
                                        <?php else: ?>
                                            <span style="color: #888;"><?php echo e(ucfirst($enrollment->status)); ?></span>
                                        <?php endif; ?>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                <?php else: ?>
                    <p style="color: #888; text-align: center; padding: 20px;">This student is not enrolled in any of your courses.</p>
                <?php endif; ?>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.instructor', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/iksoftte/portal.afrilen.com/resources/views/instructor/students/show.blade.php ENDPATH**/ ?>