<?php
/**
 * MJ Marketplace v3.0.4 active edit review integration snippet.
 * Use this inside existing edit-save pages for ACTIVE listing/company/deal records.
 * It stores the new submitted data in admin review queue and DOES NOT update the live row.
 * Old live version remains active until admin approves in admin/review-queue.php.
 */
require_once __DIR__ . '/../includes/mj_v304_review_helper.php';

// Example values from your existing edit page:
// $itemType = 'listing'; // listing | company | deal
// $itemId = (int)$_POST['id'];
// $userId = mjv304_current_user_id();
// $isActive = ((string)$existingRow['status'] === 'active' || (int)($existingRow['is_active'] ?? 0) === 1);
// $newData = [
//   'title' => $_POST['title'] ?? '',
//   'description' => $_POST['description'] ?? '',
//   'price' => $_POST['price'] ?? '',
//   'city' => $_POST['city'] ?? '',
// ];
//
// if ($isActive) {
//     $reviewId = mjv304_submit_active_edit_review($itemType, $itemId, $userId, $newData);
//     header('Location: my-reviews.php?submitted=1&review_id='.$reviewId);
//     exit;
// }
//
// If the item is not active yet, continue your old save logic as before.
