?

webshll2019

Current Path : /home/webyoo/www/leumi/site/
Upload File :
Current File : /home/webyoo/www/leumi/site/reminder_owner_unanswered_offers.php

<?php
include "start.php";
include "send_email.php";

// Basic daily guard to avoid duplicate sends in ad-hoc runs.
$guardFile = __DIR__ . DIRECTORY_SEPARATOR . '.reminder_owner_daily';
$today = date('Y-m-d');
if (file_exists($guardFile) && trim((string)@file_get_contents($guardFile)) === $today) {
    exit("Already sent today\n");
}

$sql = "SELECT 
    p.id_property,
    p.name_property,
    p.city,
    o.email AS owner_email,
    o.name AS owner_name,
    COUNT(b.id) AS pending_count
FROM rent_properties p
INNER JOIN rent_users o ON o.id = p.id_user
INNER JOIN rent_bids b ON b.id_property = p.id_property
WHERE (b.status_bid IS NULL OR b.status_bid = '')
GROUP BY p.id_property, p.name_property, p.city, o.email, o.name
HAVING pending_count > 0";

$query = mysqli_query($link, $sql);
if (!$query) {
    exit("Query failed\n");
}

$baseUrl = 'https://web4yoo.com/leumi/site';
$sent = 0;

while ($row = mysqli_fetch_assoc($query)) {
    if (empty($row['owner_email'])) {
        continue;
    }

    $dashboardLink = $baseUrl . '/dashboard-my-properties.php';

    $message = "砖诇讜诐 " . $row['owner_name'] . ",<br><br>"
        . "讬砖 诇讱 " . (int)$row['pending_count'] . " 讛爪注讜转 砖注讚讬讬谉 诪诪转讬谞讜转 诇转讙讜讘讛 注讘讜专 "
        . $row['name_property'] . (!empty($row['city']) ? " (" . $row['city'] . ")" : "") . ".<br>"
        . "诪讜诪诇抓 诇注讘讜专 注诇 讛讛爪注讜转 讜诇注谞讜转 诇砖讜讻专讬诐 讘讛拽讚诐:<br>"
        . "<a href=\"" . $dashboardLink . "\">" . $dashboardLink . "</a><br><br>"
        . "转讜讚讛,<br>爪讜讜转 讗砖讻专讛";

    if (function_exists('sendEmail')) {
        sendEmail($row['owner_email'], '转讝讻讜专转: 讛爪注讜转 诪诪转讬谞讜转 诇诪注谞讛', $message, '讗砖讻专讛 - 转讝讻讜专转 诇诪砖讻讬专');
        $sent++;
    }
}

mysqli_free_result($query);
@file_put_contents($guardFile, $today);

echo "Sent reminders: " . $sent . "\n";



web shell, Coded By 2019