<?php
/*
ArabCart, Free E-Commerce Solutions
http://www.arabcart.info
Copyright (c) 2005 Mhd Zaher Ghaibeh
Released under the GNU General Public License
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.
*/
session_start();
include("includes/lang-eng.php");
require_once("connections/connection.php");
require_once("info.php");
$sql_cart="select cart.product_id ,cart.id , cart.quantity , prod.name , cart.session from products prod , cart_temp cart ";
$sql_cart.="where prod.id = cart.product_id AND cart.session='".$PHPSESSID."' Order by cart.id DESC";
$cart=mysql_query($sql_cart) or die(mysql_error());
if(mysql_num_rows($cart)!=0)
{
$to=$_SalesPerson;
$subject = "ORDERS ".$PHPSESSID." ";
$message = "<b>Full Name</b> : ".$fname." ".$lname."<br>";
$message .= "<b>Email</b> : ".$email."<br>";
$message .= "<b>Phone Number</b> : ".$phoneno."<br>";
$message .= "<b>Fax Number</b> : ".$faxno."<br>";
$message .= "<b>Full Address</b> : ".nl2br($faddress)."<br>";
$message .= "------------------<br>";
$message .= "The Orders Are :<br>";
while($row=mysql_fetch_object($cart))
{
$message .= "Product Number : ".$row->product_id."<br>";
$message .= "Product Name : ".$row->name."<br>";
$message .= "Quantity : ".$row->quantity."<br>";
$message .= "------------------<br>";
}
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=".charset."\r\n";
$headers .= "To: <".$to.">\r\n" ;
$headers .= "From: ".$fname." ".$lname."<".$email.">\r\n";
mail($to, $subject, $message, $headers);
echo('
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset='.charset.'">
<link rel="stylesheet" href="style/style.css" type="text/css">
<meta http-equiv="Refresh" content="0; URL=index.php?sid='.$PHPSESSID.'">
<title>'.titel.'</title>
</head>
<body>
<br>
<br>
<br>
<div align="center">
<br><br>
<table width="50%" border="1" class="border">
<tr><td class="border">
<table border="0" width="100%" id="table1" cellpadding="5" cellspacing="0">
<tr>
<td align="center">
<b> '.sent.' </b>
</td>
</tr>
</table>
</td></tr>
</table>
</div>
</body>
</html>');
$cart_empty=mysql_query("DELETE FROM cart_temp where session='".$PHPSESSID."' ") or die(mysql_error());
}
else
{
echo('
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset='.charset.'">
<link rel="stylesheet" href="style/style.css" type="text/css">
<meta http-equiv="Refresh" content="0; URL=contact.php?sid='.$PHPSESSID.'">
<title>'.titel.'</title>
</head>
<body>
<br>
<br>
<br>
<div align="center">
<br><br>
<table width="50%" border="1" class="border">
<tr><td class="border">
<table border="0" width="100%" id="table1" cellpadding="5" cellspacing="0">
<tr>
<td align="center">
<b> '.try2contact.' </b>
</td>
</tr>
</table>
</td></tr>
</table>
</div>
</body>
</html>');
}
?>