403Webshell
Server IP : 10.200.247.200  /  Your IP : 216.73.217.19
Web Server : Apache
System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64
User : jeremy ( 1001)
PHP Version : 8.4.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/usa_sites/governmentgrants.us/vx/usa/ai-overviews/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/usa_sites/governmentgrants.us/vx/usa/ai-overviews/submit_feedback.php
<?php
session_start();
include_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/ua.php');
include_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/func.php');
include_once($_SERVER['DOCUMENT_ROOT'].'/vx_/site_info.php');
include_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/mysql.php');
include_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/mailgun.php');

header('Content-Type: application/json');

if($_SERVER['REQUEST_METHOD'] !== 'POST') {
	echo json_encode(['success' => false, 'error' => 'Invalid request method.']);
	exit;
}

$user = $_SESSION['user'] ?? '';
$rating = (int)($_POST['rating'] ?? 0);
$feedback = trim($_POST['feedback'] ?? '');

if($rating < 1 && $feedback === '') {
	echo json_encode(['success' => false, 'error' => 'Please provide a rating or feedback.']);
	exit;
}

// Get lead info for context
$lead_id = 0;
$lead_email = '';
$lead_name = '';
if(!empty($user)) {
	$lead_res = $db->query("SELECT l.id, l.email, l.first, l.last FROM lc2{$siteCode}_lc.lc_leads l WHERE l.customerID='".$db->clean($user)."'");
	if(!empty($lead_res)) {
		$lead_id = $lead_res[0]['id'];
		$lead_email = $lead_res[0]['email'] ?? '';
		$lead_name = trim(($lead_res[0]['first'] ?? '') . ' ' . ($lead_res[0]['last'] ?? ''));
	}
}

$stars = str_repeat('★', $rating) . str_repeat('☆', 5 - $rating);

$subject = "AI Overviews Beta Feedback";
$body = "AI Overviews Beta Feedback\n";
$body .= "==========================\n\n";
$body .= "Rating: {$stars} ({$rating}/5)\n";
$body .= "Feedback: " . ($feedback !== '' ? $feedback : '(none)') . "\n\n";
$body .= "---\n";
$body .= "Site: {$siteCode}\n";
$body .= "Lead ID: {$lead_id}\n";
$body .= "Name: {$lead_name}\n";
$body .= "Email: {$lead_email}\n";
$body .= "Customer ID: {$user}\n";
$body .= "Date: " . date('Y-m-d H:i:s') . "\n";

$to = 'heinz57@gmail.com';
$from = 'NoReply@surfcrm.com';
$cc = 'jeremy@usbusinessfundingsolutions.com';
$replyTo = '';

// Save to database
$db->query("INSERT INTO grdb.profile_recommendation_feedback (site_code, client_id, stars, feedback) VALUES ('".$db->clean($siteCode)."', '".$db->clean($user)."', {$rating}, '".$db->clean($feedback)."')");

$result = mailgun_send_message($to, $from, $subject, $body, 0, 'ai-overview feedback', $cc, '', $siteCode, $user, [], $replyTo);

$sent = (!empty($result->status) && $result->status === 'Success');

echo json_encode(['success' => $sent, 'message' => $sent ? 'Thank you for your feedback!' : 'Failed to send feedback. Please try again.']);

Youez - 2016 - github.com/yon3zu
LinuXploit