|
Server IP : 2a02:4780:11:1596:0:cbc:26e7:10 / Your IP : 216.73.217.101 Web Server : LiteSpeed System : Linux in-mum-web1496.main-hosting.eu 5.14.0-611.38.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 10 17:21:28 EDT 2026 x86_64 User : u213657319 ( 213657319) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u213657319/domains/mutiyanglobal.com/public_html/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
session_start();
$email = $_SESSION['uemail'];
include 'connection.php';
$query = mysqli_query($con,'UPDATE `orders` SET `status`= "Cancelled" WHERE id = "'.$_GET["orderid"].'"');
if($query){
header('location: my-orders.php');
cancellation_mail();
}
function cancellation_mail(){
$name = '';
$query = mysqli_query($con,'SELECT productid FROM orders WHERE id = "'.$_GET["orderid"].'"');
$result = mysqli_fetch_array($query);
$id = $result['productid'];
$sql = mysqli_query($con,'SELECT name FROM products WHERE id IN ('.$id.')');
while($row = mysqli_fetch_array($sql)){
$name .= $row['name']. ', ';
}
$name = substr($name, 0, -2);
$to = $email;
$subject = 'Order Cancelled';
$msg = 'Dear, '.$_SESSION['name'].' your order of "'.$name.'" is cancelled and your amount will be refunded within 5-7 working days.';
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=iso-8859-1';
$headers[] = 'From: Mutiyan Global Pvt Ltd <no-reply@mutiyanglobal.com>';
mail($to, $subject, $msg, implode("\r\n", $headers));
}