?
| Current Path : /home/webyoo/www/leumi/site/ |
| Current File : /home/webyoo/www/leumi/site/valid_property.php |
<?php
include "start.php";
include "send_email.php";
// extract($_POST);
//print_r($_POST);
if(isset($_GET['id'])){
$id = (int)$_GET['id'];
$myinsert = "UPDATE rent_properties SET `status` = 3 WHERE id_property = ".$id;
$sql = mysqli_query($link,$myinsert);
// Rรฉcupรฉrer les informations du propriรฉtaire et du bien
$property_query = mysqli_query($link, "SELECT title, id_user FROM rent_properties WHERE id_property = ".$id);
$property_data = mysqli_fetch_array($property_query, MYSQLI_ASSOC);
$user_query = mysqli_query($link, "SELECT email, name FROM rent_users WHERE id = ".$property_data['id_user']);
$user_data = mysqli_fetch_array($user_query, MYSQLI_ASSOC);
// Envoi d'email de notification pour feliciter l'utilisateur pour le statut "ืคืขืื"
$status_text = "ืคืขืื";
$subject = "ืฉืื ืื ืืกืืืืก ืฉื ืื ืืก ืฉืื - ืคืขืื!!!";
$email_message = "<html><head><meta charset='UTF-8'></head><body dir='rtl'>";
$email_message .= "<h2>ืฉืืื ".$user_data['name'].",</h2>";
$email_message .= "<p>ืืื ืืื ๐ฅณ๐ฅณ๐ฅณ !</p>";
$email_message .= "<p>ืืกืืืืก ืฉื ืื ืืก ืฉืื ืฉืื ื ื'ืคืขืื'.</p>";
$email_message .= "<p><strong>ื ืืก:</strong> ".$property_data['title']."</p>";
$email_message .= "<p><strong>ืกืืืืก ืืืฉ:</strong> ".$status_text."</p>";
$email_message .= "<p>ืืชืืืจ ืืืชืจ ืืื ืื ืื ืืช ืื ืืก ืฉืื.</p>";
$email_message .= "</body></html>";
sendEmail($user_data['email'], $subject, $email_message, 'ืืฉืืจื - ืขืืืื ืกืืืืก ื ืืก');
//redirect to admin page
header("Location: https://web4yoo.com/leumi/site/dashboard-my-properties.php");
} else {
die("Invalid input");
}
?>