PHP Classes

File: set-item-rating.php

Recommend this page to a friend!
  Classes of akash   Star rating package   set-item-rating.php   Download  
File: set-item-rating.php
Role: Example script
Content type: text/plain
Description: Page used to save the rating for item
Class: Star rating package
Process and show rating stars given by the user
Author: By
Last change:
Date: 16 years ago
Size: 721 bytes
 

Contents

Class file image Download
<?php
$itemID
= $_POST['itemId'];
$rating = $_POST['rating'];
require_once(
'RatingManager.php');

$status = RatingManager::saveRating($itemID, $rating);

if (
$status === false) {
    exit;
}
?>
<html>
<head>
<script type="text/javascript">
function bodyLoaded() {
    if (!parent.document.getElementById('itemRating_<?php print $itemID; ?>')) {
        return;
    }
    parent.document.getElementById('itemRating_<?php print $itemID; ?>').innerHTML = document.getElementById('bodyContainer').innerHTML;
    document.getElementById('bodyContainer').innerHTML = '';
}
</script>

</head>
<body onLoad="return bodyLoaded();" id="bodyContainer">
<?php
RatingManager
::drawItemRating($itemID, false);
?>
</body>
</html>