<?php
// Include your database connection code or configuration here
include('../config/dbcon.php');

// Create an array to hold the projects, including the "All Projects" option
$projects = array();

// Add the "All Projects" option as the first item
$projects[] = array('projectID' => '', 'projectName' => 'All Projects');

// Fetch all other projects
$project_query = "SELECT projectID, projectName FROM projects ORDER BY projectName ASC";
$project_result = mysqli_query($conn, $project_query);
while ($project = mysqli_fetch_assoc($project_result)) {
    $projects[] = $project;
}

// Close the database connection
$conn->close();

// Return the HTML options
$options = "";
foreach ($projects as $project) {
    $options .= "<option value='" . $project['projectID'] . "'>" . $project['projectName'] . "</option>";
}

echo $options;
?>