?
| Current Path : /home/webyoo/www/backup/allback/docteur-site/cv/sym/a/leumi/site/ |
| Current File : /home/webyoo/www/backup/allback/docteur-site/cv/sym/a/leumi/site/payment_success.php |
<?php
include "start.php";
include "send_email.php";
$property_id = isset($_GET['property_id']) ? (int)$_GET['property_id'] : 0;
$user_id = isset($_GET['user_id']) ? (int)$_GET['user_id'] : 0;
if($property_id > 0 && $user_id > 0) {
// Rรฉcupรฉrer les informations du bien et de l'utilisateur
$property_query = mysqli_query($link, "SELECT title FROM rent_properties WHERE id_property = ".$property_id);
$property_data = mysqli_fetch_array($property_query, MYSQLI_ASSOC);
$user_query = mysqli_query($link, "SELECT email, name FROM rent_users WHERE id = ".$user_id);
$user_data = mysqli_fetch_array($user_query, MYSQLI_ASSOC);
// Marquer le paiement comme effectuรฉ dans la base de donnรฉes
$update = "UPDATE rent_properties SET payment_status = 1, payment_date = NOW() WHERE id_property = ".$property_id;
mysqli_query($link, $update);
// Envoyer un email de confirmation ร l'utilisateur
$subject = "ืืืฉืืจ ืชืฉืืื ืขืืื";
$email_message = "<html><head><meta charset='UTF-8'></head><body dir='rtl'>";
$email_message .= "<h2>ืฉืืื ".$user_data['name'].",</h2>";
$email_message .= "<p>ืชืืื! ืืชืฉืืื ืขืืืจ ืื ืืก <strong>".$property_data['title']."</strong> ืืชืงืื ืืืฆืืื.</p>";
$email_message .= "<p>ืื ื ืืืืื ืื ืขื ืืฉืืืืฉ ืืฉืืจืืชืื ื.</p>";
$email_message .= "</body></html>";
sendEmail($user_data['email'], $subject, $email_message, 'ืืฉืืจื - ืืืฉืืจ ืชืฉืืื');
// Envoyer une notification ร l'admin
$admin_subject = "ืชืฉืืื ืขืืื ืืชืงืื";
$admin_message = "<html><head><meta charset='UTF-8'></head><body dir='rtl'>";
$admin_message .= "<h2>ืฉืืื ืื ืื,</h2>";
$admin_message .= "<p>ืชืฉืืื ืขืืื ืืชืงืื ืขืืืจ ืื ืืก:</p>";
$admin_message .= "<p><strong>ื ืืก:</strong> ".$property_data['title']."</p>";
$admin_message .= "<p><strong>ืืฉืชืืฉ:</strong> ".$user_data['name']." (".$user_data['email'].")</p>";
$admin_message .= "<p><strong>ืชืืจืื:</strong> ".date('d/m/Y H:i')."</p>";
$admin_message .= "</body></html>";
sendEmail("hmichael26@gmail.com", $admin_subject, $admin_message, 'ืืฉืืจื - ืชืฉืืื ืขืืื');
sendEmail("leumi67@gmail.com", $admin_subject, $admin_message, 'ืืฉืืจื - ืชืฉืืื ืขืืื');
// Afficher la page de confirmation
?>
<!DOCTYPE html>
<html lang="he" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ืชืฉืืื ืืชืงืื ืืืฆืืื</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f5f5f5;
margin: 0;
padding: 20px;
direction: rtl;
}
.container {
max-width: 600px;
margin: 50px auto;
background-color: #fff;
padding: 40px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
text-align: center;
}
.success-icon {
width: 80px;
height: 80px;
background-color: #4CAF50;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 20px;
}
.success-icon::after {
content: "โ";
color: white;
font-size: 40px;
}
h1 {
color: #4CAF50;
margin-bottom: 20px;
}
p {
color: #666;
font-size: 16px;
line-height: 1.6;
}
.property-name {
font-weight: bold;
color: #333;
}
.btn {
display: inline-block;
margin-top: 30px;
padding: 15px 30px;
background-color: #0070ba;
color: white;
text-decoration: none;
border-radius: 5px;
font-size: 16px;
}
.btn:hover {
background-color: #005a9e;
}
</style>
</head>
<body>
<div class="container">
<div class="success-icon"></div>
<h1>ืชืืื! ืืชืฉืืื ืืชืงืื ืืืฆืืื</h1>
<p>ืืชืฉืืื ืขืืืจ ืื ืืก <span class="property-name"><?php echo htmlspecialchars($property_data['title']); ?></span> ืืชืงืื ืืืฆืืื.</p>
<p>ืืืฉืืจ ื ืฉืื ืืืชืืืช ืืืืื ืฉืื.</p>
<a href="https://web4yoo.com/leumi/site/" class="btn">ืืืจื ืืืชืจ</a>
</div>
</body>
</html>
<?php
} else {
// Erreur - paramรจtres manquants
?>
<!DOCTYPE html>
<html lang="he" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ืฉืืืื</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f5f5f5;
margin: 0;
padding: 20px;
direction: rtl;
}
.container {
max-width: 600px;
margin: 50px auto;
background-color: #fff;
padding: 40px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
text-align: center;
}
.error-icon {
width: 80px;
height: 80px;
background-color: #f44336;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 20px;
}
.error-icon::after {
content: "โ";
color: white;
font-size: 40px;
}
h1 {
color: #f44336;
margin-bottom: 20px;
}
p {
color: #666;
font-size: 16px;
}
.btn {
display: inline-block;
margin-top: 30px;
padding: 15px 30px;
background-color: #0070ba;
color: white;
text-decoration: none;
border-radius: 5px;
font-size: 16px;
}
</style>
</head>
<body>
<div class="container">
<div class="error-icon"></div>
<h1>ืฉืืืื ืืขืืืื ืืชืฉืืื</h1>
<p>ืืืจืขื ืฉืืืื ืืขืืืื ืืชืฉืืื. ืื ื ื ืกื ืฉืื ืื ืคื ื ืืชืืืื.</p>
<a href="https://web4yoo.com/leumi/site/" class="btn">ืืืจื ืืืชืจ</a>
</div>
</body>
</html>
<?php
}
?>