D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
probwael
/
public_html
/
Filename :
checkout.php
back
Copy
<?php session_cache_expire(120); ini_set('session.gc_maxlifetime', 7200); @session_start(); include("conn.php"); $em=$_SESSION["em"]; $transid=$_SESSION['transid']; //get admin email $dsettt = mysqli_query($conn, "select * FROM _security where id='1'") or die(mysqli_error($conn)); $trow = $dsettt->fetch_assoc(); $dcompany=$trow['dcompany']; $dcomm_phone=$trow['dphone']; $dcomm_phone2=$trow['dphone2']; $dcomm_email=$trow['demail']; $currency=$trow['icurrency']; //------------------- $result=mysqli_query($conn, "select id, email from _register where email='$em' and status='online'") or die(mysqli_error($conn)); if (mysqli_num_rows($result)==0) { $_SESSION["loginto"]='checkout.php'; $_SESSION["msg"]="<b><font color=green><b>You should Login below or <a href=signup><u>Register Here</u></a> to complete transaction</b></font></b><br>"; header("location: login"); } else { //get settings $dsett = mysqli_query($conn, "select * FROM _register where email='$em'") or die(mysqli_error($conn)); while($irow = $dsett->fetch_assoc()){ $cname=$irow['fullname']; $cphone=$irow['phone']; $cmail=$irow['email']; $cpostal=$irow['postal']; } mysqli_query($conn, "update _dcart set cname='$cname', cmail='$cmail', cphone='$cphone', caddress='$cpostal' where transid='$transid'"); $subject1='New Order - '.$transid; $message1='Hello Admin, You have received a new order from '.$cname.'. Order No: '.$transid.'. Kindly login to your admin area to process this request'; $subject2='Order Received - '.$transid; $message2='Hello '.$cname.',Your order on the website of '.$dcompany.' was received, you shall be contacted shortly. Your Order No: '.$transid; //notify admin via email @mail($dcomm_email,$subject1,$message1,'From: noreply@mamajanet.com'); //notify customer via email @mail($cmail,$subject2,$message2,'From: {$dcomm_email}'); $_SESSION['transid']=''; $_SESSION["msg"]="<font color=green><b>Your order was successful and is being processed. <br>You can make payment online using the payment button found on this page</b></font><br>"; header("location: view_shopping_details?transid={$transid}"); } ?>