Ver Mensaje Individual
  #16 (permalink)  
Antiguo 16/04/2005, 01:36
Gux
 
Fecha de Ingreso: octubre-2003
Mensajes: 58
Antigüedad: 20 años, 6 meses
Puntos: 0
De acuerdo Solucionado

Problema solucionado por fin!!!!

Todo era mucho más sencillo de lo que yo lo hacía. Gracias Cluster por tu paciencia y tus indicaciones, sin ellas aun estría dando tumbos por el código.

Adjunto los codigos por si a alguien le pueden interesar:


Código PHP:
Funcion de compilación para envio por mail:

//Muestra el contenido del carrito para el mail
    
function prueba(){
        for (
$i=0;$i<$this->num_productos;$i++){
            if(
$this->array_id_prod[$i]!=0){
                if(
$this->array_familia_prod[$i]=='Material Oficina')
                {

          if(
$this->array_cantidad_prod[$i]<=1)
                {
                    
$descuento='0';
                }
                else if(
$this->array_cantidad_prod[$i]>=and $this->array_cantidad_prod[$i]<=4)
                {
                    
$descuento='2';
                }
                else if(
$this->array_cantidad_prod[$i]>=and $this->array_cantidad_prod[$i]<=9)
                {
                    
$descuento='4';
                }
                else if(
$this->array_cantidad_prod[$i]>=10 and $this->array_cantidad_prod[$i]<=18)
                {
                    
$descuento='8';
                }
                else if(
$this->array_cantidad_prod[$i]>=19 and $this->array_cantidad_prod[$i]<=24)
                {
                    
$descuento='10';
                }
                else if(
$this->array_cantidad_prod[$i]>=25 and $this->array_cantidad_prod[$i]<=35)
                {
                    
$descuento='11';
                }
                else if(
$this->array_cantidad_prod[$i]>=36)
                {
                    
$descuento='15';
                }

                }
                else
                {
                
                
$descuento='0';
                }

                
$rebaja $descuento/100;
                
$desc =  $this->array_precio_prod[$i]*$this->array_cantidad_prod[$i]*$rebaja;
                
$importe round($this->array_precio_prod[$i]*$this->array_cantidad_prod[$i]-$desc,2);

            
$familia $this->array_familia_prod[$i];
            
$producto $this->array_producto_prod[$i];
            
$referencia $this->array_referencia_prod[$i];
            
$articulo $this->array_articulo_prod[$i];
            
$precio $this->array_precio_prod[$i]; 
            
$cantidad $this->array_cantidad_prod[$i];

            
$html " $html
                <tr>
                 <td class='txt3p' height='30'> $familia<br> </td>
                 <td class='txt3p' height='30'> $producto<br> </td>
                 <td class='txt3p' height='30'> $referencia<br> </td>
                 <td class='txt3p' height='30'> $articulo<br> </td>
                 <td class='txt3p' height='30' align='center'> $precio<br> </td>
                 <td class='txt3p' height='30' align='center'> $cantidad<br> </td>
                 <td class='txt3p' height='30' align='center'> $descuento %<br> </td>
                 <td class='txt3p' height='30' align='center'> $importe €<br> </td>
                </tr>"
;

            }

            }

            return 
$html

    } 

Envio.php :

Código PHP:
<?php
include("lib_carrito.php");

if(!
$_SESSION[auth]) 
{
header("Location: index.php");
exit; 
}
else
{
    
$pedido$_SESSION["ocarrito"]->prueba();

    
$totaliva $_SESSION[pago];
    
$suma $_SESSION[pagosin];
}

$sfrom="$email"//cuenta que envia
$sdestinatario="[email protected]"//cuenta destino
$ssubject="Pedido desde la página web"//subject
$shtml="<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html>
<head>
<title>Pedido desde la página web</title>
<style>
.txt{
font-family: arial;
font-size: 9px;
color: '#444444';
}
.tit{
font-family: arial;
font-size: 11px;
color: '#444444';
font-weight: bold;
padding-left: 5px;
padding-right: 5px;
}
</style>
<link rel='stylesheet' href='http://www.buraltec.com/estilos.css' type='text/css'>
</head>
<body bgcolor='#E0E4EC' marginwidth='0' marginheight='0' topmargin='40' leftmargin='0'>
 <table align='center' bgcolor='ffffff' width='771' border='0' cellspacing='0' cellpadding='0'>
  <tr>
   <td colspan='2' class='a11gr' height='80'><center><font color='#357EB5'><u>HA RECIBIDO EL SIGUIENTE PEDIDO DESDE LA PÁGINA WEB</u></font></center>
   </td>
  </tr>
  <tr>
   <td valign='top' width='40%' height='200' align='center'><img src='http://www.uvedoblestudio.com/img/cereza.jpg' width='150' height='200'>
   </td>
   <td valign='top' class='tit'><u>ENVÍA:</u><br><br><br><span class='txt'><b>Empresa:</b> $empresa<br><br><b>CIF:</b> $cif<br><br><b>Nombre:</b> $nombre<br><br><b>Dirección:</b> $direccion - $municipio [ $provincia ]<br><br><b>Tlfno.:</b> $telefono - <b>Fax:</b> $fax<br><br><b>E-mail:</b> $email</span><br><br><br><br><u>PEDIDO:</u><br><br>
   </td>
  </tr>
  <tr>
   <td valign='top' colspan='2' class='px'>
   </td>
  </tr>
  <tr>
   <td valign='top' colspan='2' class='txt'>
    <table cellspacing='0' cellpadding='0' border='0'>
     <tr>
      <td width='711' bgcolor='#164D89' height='1' class='px' colspan='9'>
      </td>
     </tr>
     <tr>
      <td class='t9bl' bgcolor='#557FD7' height='20' width='110'>Familia
      </td>
      <td class='t9bl' bgcolor='#557FD7' height='20' width='90'>Producto
      </td>
      <td class='t9bl' bgcolor='#557FD7' height='20' width='80'>Referencia
      </td>
      <td class='t9bl' bgcolor='#557FD7' height='20' width='177'>Artículo
      </td>
      <td class='t9bl' bgcolor='#557FD7' height='20' width='70' align='center'>Precio
      </td>
      <td class='t9bl' bgcolor='#557FD7' height='20' width='30' align='center'>Cantidad
      </td>
      <td class='t9bl' bgcolor='#557FD7' height='20' width='40' align='center'>Descuento
      </td>
      <td class='t9bl' bgcolor='#557FD7' height='20' width='80' align='center'>Importe
      </td>
     </tr>
     <tr>
      <td width='711' bgcolor='#164D89' height='1' class='px' colspan='9'>
      </td>
     </tr>
     <tr>
      <td height='10' class='px' colspan='8'>
      </td>
     </tr>
     <tr>
      <td width='711' bgcolor='#164D89' height='1' class='px' colspan='9'>
      </td>
     </tr>

     $pedido

     <tr>
      <td height='30' class='px' colspan='8'>
      </td>
     </tr>
     <tr>
      <td height='10' class='txt' colspan='8'><img src='http://www.buraltec.com/img/px.gif' alt='gif' width='15' height='1'><b>TOTAL: $suma €</b><br><br><img src='http://www.buraltec.com/img/px.gif' alt='gif' width='15' height='1'><b>TOTAL + IVA ( 16 %): $totaliva €</b>
      </td>
     </tr>
    </table>
   </td>
  </tr>
  <tr>
   <td valign='top' colspan='2' height='30'>
   </td>
  </tr>
 </table>
</body>
</html>
"
//mensaje
$sheader="From:".$sfrom."\nReply-To:".$sfrom."\n";
$sheader=$sheader."X-Mailer:PHP/".phpversion()."\n";
$sheader=$sheader."Mime-Version: 1.0\n";
$sheader=$sheader."Content-Type: text/html";
mail($sdestinatario,$ssubject,$shtml,$sheader);


if(
mail)
    {
echo(
" Envio correcto ");
}
else
{
echo(
" Envío fallido ");
}
?>
Suerte