Ver Mensaje Individual
  #2 (permalink)  
Antiguo 21/09/2005, 02:45
Avatar de JuanKa
JuanKa
 
Fecha de Ingreso: septiembre-2004
Mensajes: 468
Antigüedad: 19 años, 7 meses
Puntos: 1
Yo uso esto espero que te sirvas.


$destinatario="[email protected]" ;

$asunto="Cesta de Compras de Productos Informaticos";
$asunto1="TU DOMINIO Pedido de Articulos Recibida";

$consultar=mysql_query("SELECT * FROM clientes WHERE cli_clave60='$clave_compra'");

$razon=mysql_result($consultar,0,'cli_nombre');
$cifnif=mysql_result($consultar,0,'cli_cifnif');
$contacto=mysql_result($consultar,0,'cli_contac');
$repres=mysql_result($consultar,0,'cli_repres');
$dire=mysql_result($consultar,0,'cli_direcc');
$pobla1=mysql_result($consultar,0,'cli_pobla1');
$provi1=mysql_result($consultar,0,'cli_provi1');
$postal=mysql_result($consultar,0,'cli_codpo1');
$correo=mysql_result($consultar,0,'cli_correo');
$pago=mysql_result($consultar,0,'cli_pago');
$telef=mysql_result($consultar,0,'cli_telef1');

$domi=mysql_result($consultar,0,'cli_domici');
$pobla=mysql_result($consultar,0,'cli_pobla2');
$provi=mysql_result($consultar,0,'cli_provi2');
$codi=mysql_result($consultar,0,'cli_codpo2');
$fono=mysql_result($consultar,0,'cli_telef2');

$consultita=mysql_query("select * from cesta,articulos where cesta.cod_art = articulos.cod_art and cesta.cookieId = '" . GetCartId() . "' ");

$cuerpo='

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#E6E6E6" class="Middle">
<tr>
<th scope="col">
<br>
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<th scope="col">
<table width="290" border="1" cellspacing="0" cellpadding="3" bordercolor="#0066CC" class="Middle">
<tr>
<th scope="col"><div align="left" class="Estilo71">
<div align="center">Datos Fiscales</div>
</div>
</th>
</tr>
<tr>
<th scope="col"><div align="left"><span class="Estilo110">'.$razon.'</span></div></th>
</tr>
<tr>
<td><div align="left"class="Estilo110">'.$dire.'</div></td>
</tr>
<tr>
<td><div align="left" class="Estilo110">'.$postal.' -- '.$pobla1.'</div> </td>
</tr>
<tr>
<td><div align="left" class="Estilo110">'.$provi1.'</div></td>
</tr>
<tr>
<td><div align="left" class="Estilo110">'.$telef.'</div></td>
</tr>
</table>
</th>
<th scope="col">

<table width="290" border="1" cellpadding="3" cellspacing="0" bordercolor="#0066CC" class="Middle">
<tr>
<th scope="col"><div align="left" class="Estilo71"> <div align="center">Datos de Entrega</div></div></th>
</tr>
<tr>
<th scope="col"><div align="left"><span class="Estilo110">'.$razon.'</span></div></th>
</tr>
<tr>
<td><div align="left"class="Estilo110">'.$domi.'</div></td>
</tr>
<tr>
<td><div align="left" class="Estilo110">'.$codi.' -- '.$pobla.'</div></td>
</tr>
<tr>
<td><div align="left" class="Estilo110">'.$provi.'</div></td>
</tr>
<tr>
<td><div align="left" class="Estilo110">'.$fono.'</div></td>
</tr>
</table>
</th>
</tr>
</table>
<br>
<span class="Estilo71">CESTA DE COMPRAS</span>
<br>
<table width="650" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF">
<tr bgcolor="#F7C459">
<td width="8%" height="20"><div align="center" class="Estilo4">Cantidad</div></td>
<td width="14%"><div align="center" class="Estilo4">C&oacute;digo</div></td>
<td width="55%" height="20"><div align="center" class="Estilo4">Descripci&oacute;n de Articulos </div></td>
<td width="9%" height="20"><div align="center" class="Estilo4">P. Unit </div></td>
<td width="14%" height="20"><div align="center" class="Estilo4">P. Total </div></td>
</tr>
<tr>
<td height="12" colspan="5"><hr size="1" color="red" noshade></td>
</tr>
';
$canti=0;
while($row = mysql_fetch_array($consultita))
{ $Total_prenda = ($row["can_art"] * $row["pre_art"]);
$totalCost += ($row["can_art"] * $row["pre_art"]);
$canti+=$row["can_art"];

$iva=$totalCost*0.16;
$t_sin_portes=$totalCost+$iva;
$cuerpo.='
<tr>
<td width="8%" height="25"><div align="center"><strong><font face="verdana" size="1" color="black">'.$row["can_art"].'</font></strong></div></td>
<td width="14%" height="25"><div align="center"><strong><font face="verdana" size="1" color="black">'.$row["cod_art"].'</font></strong></div></td>
<td height="25"><div align="left"><strong><font face="verdana" size="1" color="black">'.$row["nom_art"].'</font> </strong></div></td>
<td width="9%" height="25"><div align="right"><strong><font face="verdana" size="1" color="black">'. number_format($row["pre_art"], 2, ".", ",").'</font> </strong></div></td>
<td height="25"><div align="right"><strong><font face="verdana" size="1" color="black">'.number_format("$Total_prenda", 2, ".", ",").' </font></strong></div></td>
</tr>';
}

$cuerpo.=' <tr>
<td colspan="5">
<hr size="1" color="red" noshade>
</td>
</tr>
</table>
<br>
<table width="600" border="1" align="center" cellpadding="0" cellspacing="1">
<tr>
<th width="81" class="Estilo4" scope="col">Total Articulos</th>
<th width="93" class="Estilo4" scope="col">Sub_Total</th>
<th width="79" class="Estilo4" scope="col">Portes</th>
<th width="132" class="Estilo4" scope="col">Gastos Reembolso </th>
<th width="104" class="Estilo4" scope="col">I.V.A. (16%) </th>
<th width="90" class="Estilo4" scope="col">Total</th>
</tr>
<tr>
<td><div align="center"><span class="Estilo110"><b>'.$canti.'</b></span></div></td>
<td><div align="center"><font face="verdana" size="2" color="black"><span class="Estilo110"><b>'.number_format($totalCost, 2, ".", ",").'</b></span></font></div></td>
<td><div align="center">.</div></td>
<td><div align="center">.</div></td>
<td><div align="center"><font face="verdana" size="2" color="black"><span class="Estilo110"><b>'.number_format($iva, 2, ".", ",").'</b></span></font></div></td>
<td><div align="center"><font face="verdana" size="2" color="black"><span class="Estilo110"><b>'.number_format($t_sin_portes , 2, ".", ",").'</b></span></font></div></td>
</tr>
</table>
<p>&nbsp;</p></th>
</tr>
</table>
</body>
</html>';

$cuerpo0="TU DOMINIO a recibido su PEDIDO satisfactoriamente."."<br>"."Gracias por depositar su confianza en nosotros."."<br>"."En breve nos pondremos en contacto con Usted"."<br>";

$cuerpo1=$cuerpo0.$cuerpo;

$destinatario1=$correo;
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From:".$correo."\r\n";

$headers1 = "MIME-Version: 1.0\r\n";
$headers1 .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers1 .= "From:".$destinatario."\r\n";


mail($destinatario,$asunto,$cuerpo1,$headers) or die ("Su mensaje no se envio.");

mail($destinatario1,$asunto1,$cuerpo1,$headers1) or die ("Su mensaje no se envio.");

mysql_query("DELETE FROM cesta where cookieId='".GetCartId()."' ");


echo "<table width='500' border='2' align='center'>";
echo "<tr>";
echo "<th>";
echo "<center><strong><font color=\"#990000\" face=\"Verdana\"><br>Hemos recibido su CESTA DE COMPRA</font></strong></center>";
echo "<center><strong><font color=\"#990000\" face=\"Verdana\"><br>Muy pronto nos pondremos en contacto con Usted.</font></strong></center>"."<br>";
echo "<center><strong><font color=\"#990000\" face=\"Verdana\"><br>Haz click <a href=../index.php>aqu&iacute;</a> para regresar.</font></strong></center><br>";
echo "</th>";
echo "</tr>";
echo "</table>";
echo "<br>"."<br>"."<br>"."<br>"."<br>"."<br>";
echo '</tr>';
echo '</th>';
echo '</table>';