query($checkQuery); if ($checkResult && $checkResult->num_rows > 0) { $domainNumber = str_replace('domain_', '', $domainTable); break; } } // If still not found, redirect if ($domainNumber === null) { header("Location: index.php"); exit; } } $domainTable = "domain_" . $domainNumber; // Get domain description $domainDescription = isset($domainDescriptions[$domainNumber]) ? $domainDescriptions[$domainNumber] : 'Domain ' . $domainNumber; // Check if table exists $tableExistsQuery = "SHOW TABLES LIKE '$domainTable'"; $tableExists = $conn->query($tableExistsQuery)->num_rows > 0; if (!$tableExists) { header("Location: index.php"); exit; } // Fetch project details $projectQuery = "SELECT * FROM $domainTable WHERE Project_ID = $projectId LIMIT 1"; $projectResult = $conn->query($projectQuery); if (!$projectResult || $projectResult->num_rows === 0) { header("Location: domain_projects.php?domain=$domainNumber"); exit; } $project = $projectResult->fetch_assoc(); // Get the correct project name field $projectNameField = getProjectNameField($conn, $domainTable); // Get project name using the correct field $projectName = $project[$projectNameField]; // Fetch students associated with this project if students_info table exists $studentsQuery = "SHOW TABLES LIKE 'students_info'"; $studentsTableExists = $conn->query($studentsQuery)->num_rows > 0; $students = []; if ($studentsTableExists) { $studentsQuery = "SELECT * FROM students_info WHERE Project_ID = $projectId"; $studentsResult = $conn->query($studentsQuery); if ($studentsResult && $studentsResult->num_rows > 0) { while ($student = $studentsResult->fetch_assoc()) { $students[] = $student; } } } // Include header include 'includes/header.php'; ?>
Email:
| Student ID | Name | Division | Roll No. | Phone | |
|---|---|---|---|---|---|