0 && in_array($action, ['approve','reject'])) { // Get submission $row = $panelPdo->prepare("SELECT * FROM psh_review_submissions WHERE id=?"); $row->execute([$subId]); $sub = $row->fetch(); if ($sub && $sub['status'] === 'pending') { $adminNote = trim($_POST['admin_note'] ?? ''); if ($action === 'approve') { // Credit points in rrpanel $pts = (float)$sub['points_pending']; $uid = (int)$sub['user_id']; try { $panelPdo->beginTransaction(); $panelPdo->prepare("INSERT INTO user_points (user_id, points, total_earned) VALUES (?,?,?) ON DUPLICATE KEY UPDATE points=points+?, total_earned=total_earned+?") ->execute([$uid,$pts,$pts,$pts,$pts]); $panelPdo->prepare("INSERT INTO point_transactions (user_id, transaction_type, points, source, description, reference_id) VALUES (?,'earned',?,'psh_review',?,?)") ->execute([$uid,$pts,'PSH review reward: '.$sub['psh_survey_name'],'psh_rev_'.$subId]); $panelPdo->prepare("UPDATE psh_review_submissions SET status='approved', admin_note=?, reviewed_at=NOW() WHERE id=?") ->execute([$adminNote, $subId]); $panelPdo->commit(); $msg = "✅ Approved — ".number_format($pts,0)." points credited to member #".$uid."."; } catch (Exception $e) { $panelPdo->rollBack(); $msg = "❌ Error: ".$e->getMessage(); } } else { // Reject — no points $panelPdo->prepare("UPDATE psh_review_submissions SET status='rejected', admin_note=?, reviewed_at=NOW() WHERE id=?") ->execute([$adminNote, $subId]); $msg = "❌ Submission rejected."; } logActivity($_SESSION['admin_id'], $action.'_psh_review', $msg, 'psh_review', $subId); } else { $msg = "Submission not found or already processed."; } } } // ── Filters ─────────────────────────────────────────────────────────────── $filterStatus = $_GET['status'] ?? 'pending'; $filterSite = (int)($_GET['site'] ?? 0); $page = max(1,(int)($_GET['page']??1)); $perPage = 25; $offset = ($page-1)*$perPage; $where = ["s.campaign_id = 1"]; $params = []; if (in_array($filterStatus,['pending','approved','rejected'])) { $where[]='s.status=?'; $params[]=$filterStatus; } if ($filterSite > 0) { $where[]='s.psh_survey_id=?'; $params[]=$filterSite; } $whereStr = implode(' AND ', $where); // Count $whereStrCount = str_replace(['s.status','s.psh_survey_id','s.campaign_id'],['status','psh_survey_id','campaign_id'],$whereStr); $countStmt = $panelPdo->prepare("SELECT COUNT(*) FROM psh_review_submissions WHERE $whereStrCount"); $countStmt->execute($params); $total = (int)$countStmt->fetchColumn(); $pages = max(1, ceil($total/$perPage)); // Fetch submissions $listStmt = $panelPdo->prepare("SELECT s.*, u.email as member_email, COALESCE(up.first_name,'') as first_name, COALESCE(up.last_name,'') as last_name FROM psh_review_submissions s LEFT JOIN users u ON s.user_id = u.id LEFT JOIN users up ON s.user_id = up.id WHERE $whereStr ORDER BY s.submitted_at DESC LIMIT $perPage OFFSET $offset"); $listStmt->execute($params); $submissions = $listStmt->fetchAll(); // Stats $stats = $panelPdo->query("SELECT status, COUNT(*) as cnt, SUM(points_pending) as pts FROM psh_review_submissions WHERE campaign_id=1 GROUP BY status")->fetchAll(); $statMap = []; foreach ($stats as $s) $statMap[$s['status']] = $s; // Site list for filter $pshDb = new mysqli('localhost','u752449863_pshadmin','S@n@h2016','u752449863_psh'); $pshDb->set_charset('utf8mb4'); $sitesRes = $pshDb->query("SELECT id, title FROM survey_sites ORDER BY CASE WHEN rank IS NULL THEN 1 ELSE 0 END, rank ASC, title ASC"); $pshSites = []; while ($r = $sitesRes->fetch_assoc()) $pshSites[] = $r; ?> PSH Review Results — Admin
RelevantReflex — PSH Reviews
← Dashboard Logout

PSH Review Submissions

Member reviews submitted to PaidSurveyHub India via the survey campaign. Approve to credit points, reject to decline.

PSH Admin →
Pending · ₹ held
Approved · ₹ paid
Rejected
'All','pending'=>'Pending','approved'=>'Approved','rejected'=>'Rejected'] as $v=>$l): ?> result
No submissions match your filters.
# Member Survey Site Rating Review Proof Submitted Status Action
/5
words
📎 View Proof
Reviewed:
+ pts
1): ?>
1): ?>‹ Prev Next ›