query($sql); if ($result->num_rows > 0) { while($array = $result->fetch_assoc()) { echo '
' . htmlspecialchars($array["project_name"], ENT_QUOTES, 'UTF-8') . '
' . htmlspecialchars($array["description_short"], ENT_QUOTES, 'UTF-8') . '
Project ' . htmlspecialchars($array[
'; echo '

'. $array["project_name"] .' is a '. $array["construction_type"] .' '. $array["project_type"].' project in '. $array["location_full"] .'. The project is made from '. $array["briks_used"] .' ecobricks, resulting in the sequestration of approxamitely '. $array["est_total_weight"] .' kg of plastic.

'; // Loop through the available photos (up to 5) for ($i = 1; $i <= 5; $i++) { $photo_main = $array["photo{$i}_main"]; $photo_tmb = $array["photo{$i}_tmb"]; // Check if the photo exists if (!empty($photo_main) && !empty($photo_tmb)) { echo '
'; } } echo '
'; echo '

'. $array["description_long"] .'


'; echo '

+++ Raw Data Record


--------------------

BEGIN PROJECT RECORD >

'; echo '

Project name: ' . $array["project_name"] . '

'; echo '

Started: ' . $array["start_dt"] . '

'; echo '

Short Description: ' . $array["description_short"] . '

'; // echo '

End: ' . $array["end_dt"] . '

'; // echo '

Briks Required: ' . $array["briks_required"] . '

'; echo '

Project Phase: ' . $array["project_phase"] . '

'; echo '

Percent Complete: ' . $array["project_perc_complete"] . ' %

'; echo '

Community: ' . $array["community"] . '

'; echo '

Project type: ' . $array["project_type"] . '

'; echo '

Construction Type: ' . $array["construction_type"] . '

'; echo '

Ecobricks Used: ' . $array["briks_used"] . '

'; echo '

Average Brik Weight: ' . $array["est_avg_brik_weight"] . ' g

'; echo '

Location: ' . $array["location_full"] . '

'; echo '

Lattitude: ' . $array["location_lat"] . '

'; echo '

Longitude: ' . $array["location_long"] . '

'; echo '

Project URL: ' . $array["project_url"] . '

'; echo '

Admins: ' . $array["project_admins"] . '

'; echo '

Feature Photo URL: ' . $array["photo1_main"] . '

'; echo '

Photo 2: ' . $array["photo2_main"] . '

'; echo '

Photo 3: ' . $array["photo3_main"] . '

'; echo '

Photo 4: ' . $array["photo4_main"] . '

'; echo '

Photo 5: ' . $array["photo5_main"] . '

'; echo '

Plastic Sequestered: ' . $array["est_total_weight"] . ' kg

'; echo '

Logged: ' . $array["logged_ts"] . '

'; echo '

Ready to Show: ' . $array["ready_to_show"] . '

'; echo '

||| END RECORD.

' ; $projectId = $_GET['project_id'] ?? 0; // Default to 0 if not set if ($projectId) { // Updated SQL to directly use location_lat and location_long $sql = "SELECT project_name, location_full, description_long, location_lat AS latitude, location_long AS longitude FROM tb_projects WHERE project_id = ?"; $stmt = $conn->prepare($sql); $stmt->bind_param('i', $projectId); $stmt->execute(); $result = $stmt->get_result(); $array = $result->fetch_assoc(); if ($array && $array['latitude'] && $array['longitude']) { echo '
'; } else { echo 'Project not found or no location data available.'; } } else { echo 'Invalid project ID.'; } echo '

' . $array["location_full"] . '





Ecobrick Applications

There are all sorts of ways to build with ecobricks! We invite you to get inspired by our searchable arcive of ecobrick projects. Search by location, project type, construction type and location.

Then, when you\'re ready to go, check out our ecobrick building guidelines. We\'ve got in-depth resources on general building, modules, open space, earth building and earth building techniques.


🔎 Browse the Archive

The live archive of ecobrick projects around the world.


🔎 Ecobrick Applications

An overview of ecobrick applications.

'; } } else { echo '
'; echo 'Sorry! :-(
There are no results for project '. $projectId .' in our database.
empty ecobrick


🚧 It seems project '. $projectId .' has not been published to the ecobricks.org database. This could be because of a publication error. It could also be because the project ID is mis-entered in the URL.




Ecobrick Applications

There are all sorts of ways to build with ecobricks! We invite you to get inspired by our searchable arcive of ecobrick projects. Search by location, project type, construction type and location.

Then, when you\'re ready to go, check out our ecobrick building guidelines. We\'ve got in-depth resources on general building, modules, open space, earth building and earth building techniques.


🔎 Browse the Archive

The live archive of ecobrick projects around the world.


🔎 Ecobrick Applications

An overview of ecobrick applications.

'; } $conn->close(); ?>
eco brik and earth building can make circular benches with trees planted in the middle

Post your project
Share your ecobrick application