query($studentCountQuery)->num_rows > 0; $studentCount = "N/A"; if ($studentTableExists) { $countStudentsQuery = "SELECT COUNT(*) as student_count FROM students_info"; $countStudentsResult = $conn->query($countStudentsQuery); if ($countStudentsResult && $countStudentsResult->num_rows > 0) { $studentCount = $countStudentsResult->fetch_assoc()['student_count']; } } // Get recent projects from all domains $recentProjects = []; foreach ($domainTables as $tableName) { $domainNumber = str_replace('domain_', '', $tableName); // Get the correct project name field $projectNameField = getProjectNameField($conn, $tableName); $recentProjectsQuery = "SELECT *, '$domainNumber' as domain_number FROM $tableName ORDER BY Project_ID DESC LIMIT 3"; $recentProjectsResult = $conn->query($recentProjectsQuery); if ($recentProjectsResult && $recentProjectsResult->num_rows > 0) { while ($project = $recentProjectsResult->fetch_assoc()) { $project['project_name_field'] = $projectNameField; $recentProjects[] = $project; } } } // Sort recent projects by ID in descending order and limit to 5 usort($recentProjects, function($a, $b) { return intval($b['Project_ID']) - intval($a['Project_ID']); }); $recentProjects = array_slice($recentProjects, 0, 5); // Get domain descriptions $domainDescriptions = getDomainDescriptions($conn); // Include header include 'includes/header.php'; ?>
This system provides access to projects, domains, and student information from our database.
Logged in as: ()
| Project ID | Project Name | Type | Domain | Action |
|---|---|---|---|---|
| Domain : | View Details |