public function actionStarRatingAjax($userid, $id) { $ratingAjax = isset($_POST['rate']) ? $_POST['rate'] : 0; PropertyRatingApi::addRating($id, $userid, $ratingAjax); echo 'Your Rating is ' . $ratingAjax; }
<h1 class="property_search_results_top">' . $propertiesCount . ' Properties Found <span class="right"></span> </h1> '; echo '<div id="test-results">'; foreach ($properties as $property) { if (isset($images[$property->id])) { $image = $images[$property->id]; } ?> <div class="post property" style="cursor:pointer;" onClick="location.href='<?php echo Yii::app()->createAbsoluteUrl('/property/' . $property->id); ?> '"> <?php echo '<div class="left">'; echo '<img src="' . $image . '" width="124" alt="" />'; echo '<br /><a href="/property/' . $property->id . '">Rate : ' . PropertyRatingApi::getRating($property->id) . '</a>'; echo '</div> <div class="right" style="width:533px;"> <h1><a href="#">' . $property->property_name . '</a></h1>'; if ($property->total_price) { echo '<h3>Price Rs. ' . $property->total_price . '</h3>'; } else { echo '<h3> </h3>'; } echo '<p>' . substr($property->description, 0, 150) . ' ...<a href="/property/' . $property->id . '">more</a></p> <div class="left bedrooms"><span>' . $property->bedrooms . '</span> Bedrooms | <span>' . $property->available_units . '</span> Sq.Ft | <span>Rs. ' . $property->per_unit_price . '/ </span> Sq.Ft | ' . $property->propertyType->property_type . '</div> <div class="right"> <a href="/property/' . $property->id . '" class="btn-view-details"></a>'; if ($wishlistRemove) { ?> <a href="<?php
$images = PropertyImagesApi::getAllImages($model->id); $propertyAmenities = $model->propertyAmenities; $amenities = null; foreach ($propertyAmenities as $i => $propertyAmenity) { if ($i != 0) { $amenities .= ", "; } $amenities .= $propertyAmenity->amenity->amenity; } ?> <table id="yw0" class="detail-view"> <tbody> <tr class="even"> <th>Average Rating</th> <td><?php echo PropertyRatingApi::getRating($model->id); ?> </td> </tr> </tbody> </table> <table id="yw0" class="detail-view"> <tbody> <tr class="even"> <th>Amenities</th> <td><?php echo $amenities; ?> </td>
} ?> <div class="post property" style="cursor:pointer;" onClick="window.open('<?php echo Yii::app()->createAbsoluteUrl('/property/' . $property->id); ?> ')"> <div class="left"> <img src="<?php echo $image; ?> " width="124" alt="" /> <br /><a href="/property/<?php echo $property->id; ?> ">Rate : <?php echo PropertyRatingApi::getRating($property->id); ?> </a> </div> <div class="right" style="width:533px;"> <h1><a href="#"><?php echo $property->property_name; ?> </a></h1> <?php if ($property->total_price) { ?> <h3>Price Rs. <?php echo $property->total_price; ?> </h3>