I have this div where ratings are shown and the ratings are fetched from db and values are getting outputted But my Problem only the last star rating value of the userid is shown
View Page
<?php foreach($testi as $test){ ?>
<div class="form-group">
<fieldset class="rating">
<legend>Ratings Given:</legend>
<input type="radio" id="star5" name="hel_banners[rating]" disabled="true" value="5"<?php if($test->rating == 5) echo'checked'; ?> /><label for="star5" title="Rocks!">5 stars</label>
<input type="radio" id="star4" name="hel_banners[rating]" disabled="true" value="4"<?php if($test->rating == 4) echo'checked'; ?> /><label for="star4" title="Pretty good">4 stars</label>
<input type="radio" id="star3" name="hel_banners[rating]" disabled="true" value="3"<?php if($test->rating == 3) echo'checked'; ?> /><label for="star3" title="Meh">3 stars</label>
<input type="radio" id="star2" name="hel_banners[rating]" disabled="true" value="2"<?php if($test->rating == 2) echo'checked'; ?> /><label for="star2" title="Kinda bad">2 stars</label>
<input type="radio" id="star1" name="hel_banners[rating]" disabled="true" value="1"<?php if($test->rating == 1) echo'checked'; ?> /><label for="star1" title="Sucks big time">1 star</label>
</fieldset>
</div>
<?php } ?>
Controller:
public function index(){
$data['title'] = "HR & Employee Engagement Testimonials";
$data['descriptions'] = 'Check our website to learn what others say about us.';
$data['testi'] = $this->Home_model->GettestimonialApprove();
load_view_frond_template('home/testimonials',$data,$this);
$this->template->render();
}
Model:
public function GettestimonialApprove(){
$where = "categoryid ='7' AND act = '1' ";
$this->db->select("*")->from('hel_banners')->where($where)->order_by('bId', 'asc');
$query = $this->db->get();
return $query->result();
}