<?php

require_once('../config/database.php');
// include objects
include_once "../resources/offering.php";
include_once '../config/properties.php';
// initialize objects
$offering = new Offering();
$rating_value = 0;
$comment = null;
$offering_id = $_POST['offering_id'];
$user_id = $_POST['user_id'];
$offering->offering_id = $offering_id;
$offering->user_id = $user_id;
$stmt = $offering->get_your_rating_value();
if ($stmt->rowCount() > 0) {
    if ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
        $rating_value = $row['rating_value'];
        if ($row['comments'] != "") {
            $comment = $row['comments'];
        }
    }
}
echo $rating_value;
echo "<br/>";
echo $comment;
?>

