Salut,

Am si eu o problema. Vreau sa fac o calculatie de reducere si nu-mi iese.

Am scriptul:
Cod PHP:
foreach($cotatii as $row)
                    {
                        if(!
is_null($row) and $row!='')
                        {
                            
$row = explode('@@@', $row);
                            
$cotatie_meta = explode('§', $row[1]);
                            
                            
$cotatie         = $cotatie_meta[0];
                            
$cotatie         = explode('%', $cotatie);
                            
                            
$price_asig        = $cotatie[0];
                            
$price_asig2    = $cotatie[0];
                            
$price_broker     = $cotatie[1];
                            
                            
$price_asig        = number_format((float)trim($price_asig), 2, ',', '.');
                            
$price_broker     = number_format((float)trim($price_broker), 2, ',', '.');
                            
                            if((int)
$cotatie_meta[0] > 0)
                            {                                
                                echo 
'<tr id="'.$row[0].'">';    
                                    echo 
'<td><div class="img_holder"><img src="'.SITE_URL.'/elven/img/'.strtolower($row[0]).'.jpg" alt="'.$row[0].'" /></div></td>';//logo asigurator
                                    
if( $price_broker > 0 )
                                    {    
                                        echo 
'<td class="price"><span><strong class="rca_value_discount">'.$price_broker.'</strong> LEI</span><br /><span style="text-decoration:line-through; color:#cc0000;"><strong class="rca_value">'.$price_asig2.'</strong> LEI<span></td>';    
                                    }else{
                                        
                                        echo 
'<td class="price"><span><strong class="rca_value">'.$price_asig.'</strong> LEI, redus '.$price_asig.'</td>';
                                    }
                                    echo 
'<td><a href="#" class="elven_asigurator comanda" title="'.$row[0].'">Comanda</a></td>';
                                echo 
'</tr>';
                                
                                
//partea cu oferta/bonus
                                
if(strlen($cotatie_meta[1]) > 0)
                                    echo 
'<tr class="bonus"><td colspan="3">'.$cotatie_meta[1].'</td></tr>';
                            }
                        }
                    } 
In linia
Cod PHP:
                            $price_asig2    = $cotatie[0]; 
am incercat sa fac $price_asig2 = $cotatie[0]*0.95; , dar nu-mi afiseaza. Ma gandeam sa fac o reducere de 5% (*0.95).

Aveti idee cum as putea rezolva aceasta?

Va multumesc anticipat.