|
Server IP : 2a02:4780:11:1596:0:cbc:26e7:10 / Your IP : 216.73.217.7 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();
include 'connection.php';
if($_GET['transactionid'] != '' and $_GET['status'] != ''){
if(isset($_SESSION['last-id'])){
$query = mysqli_query($con,'UPDATE `orders` SET `transaction_id` = "'.$_GET['transactionid'].'", `status` = "success" WHERE `id` = "'.$_SESSION['last-id'].'"');
if($query){
if($_SESSION['cu-id'] !=""){
$sql = mysqli_query($con,'DELETE FROM cart WHERE userid="'.$_SESSION['cu-id'].'"');
if($sql){
header('location: success.php');
}
}
else{
header('location: success.php');
}
// client_mail();
admin_mail();
}
}
else{
$query = mysqli_query($con,'DELETE FROM `orders` WHERE `id` = "'.$_SESSION['last-id'].'"');
if($query){
header('location: failed.php');
}
}
}
function client_mail(){
$prod_name = '';
$query = mysqli_query($con,'SELECT * FROM `orders` WHERE id = "'.$_SESSION["last-id"].'"');
$result = mysqli_fetch_array($query);
$sql = mysqli_query($con,'SELECT * FROM `products` WHERE id IN ('.$result["productid"].')');
while($row = mysqli_fetch_array($sql)){
$prod_name .= $row["name"]. ', ';
}
$p_name = substr($prod_name, 0, -2);
$to = $_SESSION['uemail'];
$name = $_SESSION['name'];
$subject = 'Order Confirmation';
$msg = '<html>
<head>
<title>"'.$subject.'"</title>
</head>
<body style="background:#f9f9f9; padding:40px; align-items: center;">
<div style="width:100%; padding: 40px; padding-bottom:40px; font-family:Helvetica, Arial, sans-serif; font-size:14px;">
<span style="width:100%">Order Confirmed</span><br><br>
<span>Dear, '.$_SESSION['name'].' thankyou For shopping with <a href="http://mutiyanglobal.com/">Mutiyan Global Pvt Ltd</a>.<br> Your Order is confirmed</span><br><br>
<div>
<span> Product : '.$p_name.'</span><br>
<span> Quantity : '.$result['quantity'].'</span><br>
<span> Price : ₹'.$_SESSION['amt'].' </span><br>
<span> Shipping Cost : ₹0.00</span><br>
<span> Total Cost : ₹'.$_SESSION['amt'].'</span><br><br><br>
</div>
</div>
</body>
</html>';
$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));
return $html['success'] = "Sent";
}
function admin_mail(){
$to = 'mgofficial@mutiyanglobal.com';
$subject = 'New Order On Mutiyan';
$msg = 'New Order on Mutiyan Global Pvt Ltd. Login to check <a href="http://mutiyanglobal.com/admin">Click here</a>';
$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));
return $html['success'] = "Sent";
}