Location: PHPKode > scripts > ECW commerce shop > ecw-commerce-shop-6-03/mail.php
<?

##################### register user order ##############################

$user_txt="<HTML><BODY>".$user_title;
$admin_txt="<HTML><BODY>".$admin_title;

$user_cart="<table border=1 width=100% bgcolor='#FFFFFF' cellpading='1' cellspacing='0'>
<tr><td bgcolor='#CCCCFF'>$lang[Title]:</td><td bgcolor='#CCCCFF'>$lang[Describe]:</td>
<td bgcolor='#CCCCFF'>$lang[IAN]:</td>
<td bgcolor='#CCCCFF'>$lang[Selected]:</td><td bgcolor='#CCCCFF'>$lang[Company]:</td>
<td bgcolor='#CCCCFF'>$lang[Category]:</td><td bgcolor='#CCCCFF'>$lang[Price]:</td></tr>\n";

$sql="SELECT * FROM $table_prod WHERE (";
$i=1;
$j=0;
while (list($tempkey,$tempvalue)=each($zamovl))
{
 if ($j<>0)
   {
     if ($zamovl[$tempkey]!='0')
     {
     $tempaa=$tempaa." or id=".$tempkey;
     }
    }
 else
   {
    if ($zamovl[$tempkey]!='0')
    {
    $tempaa=" id=".$tempkey;
    $j=1;
    }
   }

  $i++;
}

$sql_my=$sql.$tempaa.")";
@$res=mysql_query("$sql_my");

//echo mysql_errno().": ".mysql_error()."<br>$sql";
$sum='0';
while ( @$catt=mysql_fetch_array($res) )
 {$tpp=$zamovl[$catt[0]];
  $user_cart=$user_cart."</tr><td class='hd2'>$catt[2]</td><td class='hd2'>$catt[3]</td><td class='hd2'>$catt[1]</td>".
       "<td class='hd2'>$tpp</td>".
       "<td class='hd2'>$catt[5]</td><td class='hd2'>$catt[4]</td><td class='hd2'>$catt[6]</td>".
       "</tr>\n";
$sum=$sum+$catt[6]*$tpp;
 }
$user_cart=$user_cart."<td class=hd2></td><td class=hd2></td><td class=hd2></td><td></td><td></td><td class=title>$lang[Total]: </td><td class=title>$ $sum </td></tr></table>".
		    "</body></html>";


while (list ($key, $val) = each ($discount))
 {$ds=split (",",$key);
 if (($sum>=$ds[0]) and ($sum<=$ds[1]))
 {$zn=$sum*($val/100);
 $endd=$sum-$zn;
 $disc=$val;
 $txtdisc="<table  border=0 width=100% bgcolor='#FFFFFF' cellpading='1' cellspacing='0'>
 <tr><td width='200' class='detail'>$lang[Total] $lang[Pice]: </td><td class='detail' width='100'>$ $sum</td><td width='300'>&nbsp;</td></tr>
 <tr><td class='detail' width='200'>$lang[Discount]: </td><td class='detail' width='100'>$val%</td><td width='300'>&nbsp;</td></tr>
 <tr><td class='detail' width='200'>$lang[Pricewithdiscount]:</td><td class='detail' width='100'>$ $endd </td><td width='300'>&nbsp;</td></tr>
 </table>";
  }
  }


$admin_txt=$admin_txt.$user_cart.$txtdisc.$admin_bottom."</body></html>";
$user_txt=$user_txt.$user_cart.$txtdisc.$user_bottom;


#################### register end ###############################################

mail($user_mail,$user_subject,$user_txt,"From: $admin_mail\nReply-To: $admin_mail\nContent-type: text/html");
mail($admin_mail,$admin_subject,$admin_txt,"From: $user_mail\nReply-To: $user_mail\nContent-type: text/html");

?>
Return current item: ECW commerce shop