Je voudrais savoir si quelqu'un peut m'aider afin d'afficher un calcul différent pour chaque film.
Peut être en utilisant: <?php $result['product_id'];?> afin de différencier chaque calcul?
Je n'y arrive vraiment pas j'ai besoin d'aide si quelqu'un peut
Merci beaucoup si quelqu'un y arrive!
Code : Tout sélectionner
<div style="display:none">
<?php
//Note moyenne presse et public et autre multipliable autant de fois que necessaire
foreach ($product['attribute_groups'] as $attribute_group) {
foreach ($attribute_group['attribute'] as $attribute) {
if ($attribute_group['name'] == 'Public') {
$note1 = substr($attribute['text'], 0, -4);
$ref1 = substr($attribute['text'], -3);
echo $note1;echo $ref1;
}
if ($attribute_group['name'] == 'Presse') {
$note2 = substr($attribute['text'], 0, -4);
$ref2 = substr($attribute['text'], -3);
echo $note2;echo $ref2;
}
}}
//Moyenne des avis en pourcentage
$moyenne=(+$note1+$note2)*100/(+$ref1+$ref2);
//Resultat note moyenne
echo $moyenne;
?></div>Code : Tout sélectionner
<?php if ($moyenne < 99.99 )
{
echo substr("$moyenne",0,2);
}
else
{
echo substr("$moyenne",0,3);
}
?>