Viewing File: /home/webrbaew/ratings.webriders.co/index.php

<!DOCTYPE html>
<html lang="en">
    <head>
        <?php include "includes/headerlinks.php";?>
        <?php include "database.php";?>
        <?php include "functions.php";?>
    </head>
    <body>
        <section class="page-title-wrap" data-bg-img="img/page-header.jpg" data-rjs="2">
            <div class="container">
                <div class="row align-items-center">
                    <div class="col">
                        <div class="page-title">
                            <h1 class="text-center">RATE YOUR EXPERIENCE</h1>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <section class="pt-120 default-bg">
            <div class="container">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="shop-details">
                            <div class="row">
                                <div class="col-lg-12">
                                    <div class="shop--details-inner">
                                        <div class="product-tabbed">
                                            <div class="row">
                                                <div class="col">
                                                    <div class="product--info-review">
														<form action="operations.php" method="POST">
															<div class="client-add-form">
																<h4>Add Review</h4>
																<input type="hidden" id="review_stars" name="review_stars" value="5">
																<div class="client-reating">
																	<span class="raiting-list">
																		<i class="fa fa-star" id="fa-star-1" style="color:;cursor:pointer" onclick="change_stars(1)"></i>
																		<i class="fa fa-star" id="fa-star-2" style="color:;cursor:pointer" onclick="change_stars(2)"></i>
																		<i class="fa fa-star" id="fa-star-3" style="color:;cursor:pointer" onclick="change_stars(3)"></i>
																		<i class="fa fa-star" id="fa-star-4" style="color:;cursor:pointer" onclick="change_stars(4)"></i>
																		<i class="fa fa-star" id="fa-star-5" style="color:;cursor:pointer" onclick="change_stars(5)"></i>
																	</span>
																</div><br>
																
																	<div class="row">
																		<div class="col-md-6">
																			<div class="form-group">
																				<label><b>Name <span>*</b></span></label> <input type="text" class="theme-input-style" placeholder="Enter Your Name" name="review_name" required />
																			</div>
																		</div>
																		<div class="col-md-6">
																			<div class="form-group">
																				<label><b>Email</b><span></span></label> <input type="email" class="theme-input-style" name="review_title" placeholder="Enter Your Email"  />
																			</div>
																		</div>
																	</div>
																	<div class="form-group">
																		<label><b>Your Review <span>*</b></span></label> <textarea name="review_text" placeholder="Write Your Message" class="theme-input-style" required></textarea>
																	</div>
																	<button class="btn" name="submit_review" type="submit">Submit Review</button>
															</div>
														</form><hr/>
                                                        <div class="product--nav-inner mb-30">
                                                            <nav>
                                                                <div class="nav info-tabs">
                                                                    <a class="product--nav-item active" data-toggle="tab" href="#dis">Happy Clients</a>
                                                                </div>
                                                            </nav>
                                                        </div>
                                                        <div class="product--discription-inner">
                                                            <div class="tab-content product--review-info">
                                                                <div class="tab-pane show active" id="dis" role="tabpanel">
                                                                   <?php
																		$review_res = mysqli_query($con, "SELECT * FROM review LIMIT 5");
																		if (mysqli_num_rows($review_res)>0) {
																			$overall_rev_res = mysqli_query($con, "SELECT AVG(review_stars) AS overall_stars FROM review");
																			$overall_rev_row = mysqli_fetch_array($overall_rev_res);
																			$overall_stars = $overall_rev_row['overall_stars'];
																			?>
																			<h3 style="font-size:40px !important">
																				<b><?php echo number_format($overall_stars, 1, '.', '') ?> <span style="font-size:12px">out of</span> 5.0</b>
																			</h3>
																				<h3><b><?php echo show_stars($overall_stars) ?></b></h3><hr>
																			<?php
																		}
																	?>
																	<?php $reviews_limit = 20; ?>
																	<input type="hidden" id="reviews_offset" value="0">
																	<div id="show_reviews_loading">
																	
																	</div>
																	<div id="show_reviews_here">
																	
																	</div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <?php include "includes/footerlinks.php";?>
		<script>
			function change_stars(stars) {
				for (var i=1;i<=stars;i++) {
					$('#fa-star-'+i).attr('class', 'fa fa-star');
				}
				for (var i=stars+1;i<=5;i++) {
					$('#fa-star-'+i).attr('class', 'fa fa-star-o');
				}
				$('#review_stars').val(stars);
			}
			get_reviews();
			function get_reviews() {
				$('#show_reviews_loading').html('<br><h5><i class="fa fa-spinner fa-spin"></i></h5>');
				$.ajax({
					url : 'ajax.php',
					type : 'post',
					data : {
						'get_reviews' : 1,
						'reviews_limit' : <?php echo $reviews_limit ?>,
						'reviews_offset' : $('#reviews_offset').val()
					},
					success : function (res) {
						$('#show_reviews_loading').html('');
						$('#show_reviews_here').append(res);
						$('#reviews_offset').val(parseInt($('#reviews_offset').val())+parseInt(<?php echo $reviews_limit ?>));
					}
				});
			}
		</script>
    </body>
</html>
Back to Directory File Manager