require_once("../database.php");
require_once("adminfuncties.php");
$q1 = "select * from oneshop_producten, oneshop_waardering where oneshop_producten.ItemID = oneshop_waardering.ItemID order by ItemName ";
$r1 = mysql_query($q1) or die(mysql_error());
if(mysql_num_rows($r1) == '0')
{
echo "
Er zijn geen waarderingen aanwezig...";
exit();
}
$select = "\n";
?>
Enkel de gewaardeerde producten zullen zichtbaar zijn.
if(isset($_POST[s1]))
{
$qr = "select * from oneshop_waardering where ItemID = '$_POST[ItemID]' ";
$rr = mysql_query($qr) or die(mysql_error());
$rrows = mysql_num_rows($rr);
if($rrows > '0')
{
while( $ar = mysql_fetch_array($rr))
{
$SumRate = $SumRate + $ar[rateing];
$RateingContent .= "\nedit | Verwijderen\n\n\tWaardering: $ar[rateing] | \n
\n\n";
$RateingContent .= "\n\tVan: $ar[names] | \n
\n";
$rtext = nl2br($ar[notes]);
$RateingContent .= "\n\n\t$rtext\n\t | \n
\n
\n\n
\n\n";
}
$ItemRateing = number_format($SumRate/$rrows, 2, ".", "");
$RateingHead = "Gemiddelde waardering: $ItemRateing
";
}
$DisplayRateing = "\n";
$DisplayRateing .= "\n\t$RateingHead | \n
\n";
$DisplayRateing .= "\n\t$RateingContent | \n
\n";
$DisplayRateing .= "
\n";
echo $DisplayRateing;
}
?>