diff --git a/functions.php b/functions.php
index 7ce5dae..05ed8f8 100644
--- a/functions.php
+++ b/functions.php
@@ -97,30 +97,35 @@ function post_demand ()
// A function to insert the own posts from the database into the website
function get_demand_titles ()
{
- global $con;
- $sql = "SELECT * FROM demands";
- $result = mysqli_query($con, $sql);
- while ($row = $result->fetch_assoc()) {
- echo "
";
- echo "" . $row['demandTitle'] .
- "" . "
";
- echo $row['date'] . "
";
- echo "
+ global $con;
+ $sql = "SELECT * FROM demands";
+ $result = mysqli_query($con, $sql);
+ while ($row = $result->fetch_assoc()) {
+ echo "
";
+ echo "" . $row['demandTitle'] . "" . "
";
+ echo $row['date'] . "
";
-
-
";
+ echo "
";
+
+ echo "
";
+
+ echo "
+
";
}
}
@@ -167,4 +172,35 @@ function delete_demand()
}
}
+function show_demand ()
+{
+ global $con;
+ $demandId = $_POST['demandId'];
+
+ $demand_query = "SELECT * FROM demands where demandId='$demandId'";
+ $demand_query_result = mysqli_query($con, $demand_query) or
+ die(mysqli_error($con));
+ $demand_rows = $demand_query_result->fetch_object();
+
+ $qualityId = $demand_rows->qualityId;
+ $quality_query = "SELECT * FROM quality where qualityId='$qualityId'";
+ $quality_query_result = mysqli_query($con, $quality_query) or
+ die(mysqli_error($con));
+ $quality_rows = $quality_query_result->fetch_object();
+
+ echo "