<?php
include_once '../config/database.php';
include_once '../security/session_config.php';
include_once '../security/csrf.php';
include_once '../config/properties.php';
// include object
require("../resources/offering.php");
$csrf_token = $_POST['csrf_token'];
validate_csrf_request($csrf_token);
// initialize objects
$title = $_POST['title'];
$user_id = $_POST['user_id'];
$offering_id = $_POST['offering_id'];
$rating_value = $_POST['rating'];
$last_updated_user = $_POST['user_id'];
$date_time = $date_time;
$status = "Open";
$offering = new Offering();
if ($title == "Report") {
    $val1 = $offering->review_spam_insert($user_id, $offering_id, $rating_value, $status, $last_updated_user, $date_time);
} else {
    $val1 = $offering->review_spam_delete($user_id, $offering_id, $rating_value);
}
echo $val1;
?>

