$v) { if (substr($k, 0, 3) == 'aid') { $vid = str_replace("aid", "", $k); $_SESSION['cart'][$vid] = 1; $aid = 1; } } if ($_POST['vid'] != "") { $vid = $_POST['vid']; $_SESSION['cart'][$vid] = 1; } if ($_POST['vid'] == "" AND $aid == "") { $message = "You didnt select any items."; } header ("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "cart/message/" . $message); exit(); } if (($tabliczka['cmd'] == "delete") || ($_REQUEST['cmd'] == "delete")) { session_start(); $vid = $tabliczka['vid']; $_SESSION['cart'][$vid] = NULL; unset($_SESSION['cart'][$vid]); header ("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "cart"); exit(); } if (($tabliczka['cmd'] == "alter") || ($_REQUEST['cmd'] == "alter")) { include("inc/database_ssi.php"); connect(); session_start(); $oid = $_POST['oid']; sql("D", "orders", "`oid`='$oid'", "1", "", ""); sql("D", "orderitems", "`oid`='$oid'", "", "", ""); header ("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "cart"); exit(); } include("inc/header.php"); foreach($_POST as $v => $k) { // echo $v . ' -> ' . $k . '
'; } if (isset($_POST['intStatus'])) { if ($_POST['intStatus'] == 1) { // successful payment $VPTransactionUnique = str_replace("%2D", "-", $_POST['cartID']); $pieces = explode("-", $VPTransactionUnique); $oid = $pieces[0]; $uni = $pieces[1]; $uid = $_SESSION['uid']; $VPCrossReference = $_POST['intTransID']; // Update the order table $query = "UPDATE `orders` SET `did`='$did', `status`='OK', `VPCrossReference`='$VPCrossReference', `updated_dt` = NOW() WHERE `oid` = '$oid' AND uni = '$uni' LIMIT 1"; $result = @mysqli_query($query); //echo $query . '

'; echo mysqli_error(); $result = sql("S", "orders", "`oid`='$oid'", "1", "", ""); $order = @mysqli_fetch_array($result, MYSQL_ASSOC); $uid = $order['uid']; $result = sql("S", "users", "`uid`='$uid'", "1", "", ""); $customer = @mysqli_fetch_array($result, MYSQL_ASSOC); $email = ' Jivili : View Invoice

JIVILI INVOICE
www.jivili.co.uk
Please Keep a copy of this invoice for your records.

Customer Address:
' . $customer['address1'] . ',
' . $customer['address2'] . ',
' . $customer['town'] . ',
' . $customer['county'] . ', ' . $customer['country'] . '
' . $customer['postcode'] . '
Order Number ' . $order['oid'] . '-' . $order['uni'] . '
Order Date ' . $order['updated_dt'] . '
Client Name ' . $customer['firstname'] . ', ' . $customer['surname'] . '
Account Number ' . $customer['uid'] . '
'; $result = sql("S", "orderitems", " `oid`='$oid'", "", "", ""); while($row = @mysqli_fetch_array($result, MYSQL_ASSOC)) { $email .= ' '; } $email .= '
Quantity Item Item Price Line Total
' . $row['qty'] . 'x ' . $row['name'] . ' £' . $row['price'] . ' £' . number_format(($row['price'] * $row['qty']), 2) . '
Shipping : £' . number_format($order['shipcost'], 2) . '
V.A.T : £' . number_format($order['vat'], 2) . '
Total : £' . number_format($order['total'], 2) . '

'; $result = $VPResponseCode; $message = "Thankyou, your order has been successful, you will receive an email confirmation with an invoice, if you have any questions please
contact us at sales@jivili.com or on 01636 627 020

"; unset($_SESSION['cart']); // Email $to = $customer['email']; $subject = "Jivili Order: Success (" . $VPTransactionUnique . ")"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "To: " . $customer['firstname'] . " <" . $customer['email'] . ">\r\n"; $headers .= "From: Jivili Sales \r\n"; $headers .= "Bcc: Andy ; Dean "; mail($to, $subject, $email, $headers); } } if ($_POST['cmd'] == "update") { foreach ($_POST['qty'] as $key => $value) { if ( ($value == 0) AND (is_numeric ($value)) ) { unset ($_SESSION['cart'][$key]); } elseif ( is_numeric ($value) AND ($value > 0) ) { $_SESSION['cart'][$key] = $value; } } } if ($_POST['cmd'] == "discount") { $code = $_POST['code']; $result = sql("S", "discounts", "`code`='$code' AND `used`='N'", "1", "", ""); $num = @mysqli_num_rows($result); $row = @mysqli_fetch_array($result, MYSQL_ASSOC); if ($num > 0) { $_SESSION['did'] = $row['did']; $_SESSION['amount'] = $row['amount']; $_SESSION['club'] = $row['name']; $_SESSION['code'] = $row['code']; } else { $message = 'Error with discount code, cannot be found. You may have already used it.'; } } unset($tabliczka); function iconfind($prid, $field) { $number = 0; if ($field == "StandardLaserScanner") { $query = "SELECT * FROM `variations` WHERE `prid`='" . $prid . "' AND (`StandardLaserScanner`='1' OR `LongRangeLaserScanner`='1' OR `RotatingLaserScanHead`='1')"; } elseif ($field == "Imager") { $query = "SELECT * FROM `variations` WHERE `prid`='" . $prid . "' AND (`Imager`='1' OR `2DImager`='1')"; } else { $query = "SELECT * FROM `variations` WHERE `prid`='" . $prid . "' AND `" . $field . "`='1'"; } $result = @mysqli_query($query); //echo $query . '
'; $number = @mysqli_num_rows($result); echo @mysqli_error(); // echo $number . '
'; return $number; } function connectionfind($prid, $field) { $number = 0; $query = "SELECT * FROM `variations` WHERE `prid`='" . $prid . "' AND `type`='1' LIMIT 1"; $result = @mysqli_query($query); // echo $query . '
'; $row = @mysqli_fetch_array($result, MYSQL_ASSOC); $number = $row[$field]; echo @mysqli_error(); //echo $result[$field] . '
'; return $number; } $p = 0; $query = 'SELECT * FROM `variations` WHERE vid IN ('; if (isset($_SESSION['cart'])) { foreach ($_SESSION['cart'] as $key => $value) { $query .= $key . ','; $p++; } } $query = substr ($query, 0, -1) . ')'; if ($p > 0) { $result = @mysqli_query($query); ?>
Your Cart

'; } ?>
Remove Product Price Qty Total
£ £
Sub-Total: £
Shipping: 150) { $shipping = 0.00; echo "FREE"; } else { $shipping = 10.00; echo '£' . $shipping; } ?>
V.A.T: £
Total (GBP): £

Your Cart

' . $_GET['message'] . $message . '
'; } ?>
Your cart is empty.