-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathajax_run.php
More file actions
60 lines (40 loc) · 1.55 KB
/
ajax_run.php
File metadata and controls
60 lines (40 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
include_once 'admin/connection.php';
if(isset($_POST['rating']))
{
$rating = $_POST['rating'];
$review = $_POST['review'];
$name = $_POST['name'];
$email = $_POST['email'];
$sql_insert = "insert into `product_comment`(`rating`,`review`,`name`,`email`)values('$rating','$review','$name','$email')";
mysqli_query($conn,$sql_insert);
}
$sql_select_comment = "select * from `product_comment`";
$data_comment = mysqli_query($conn,$sql_select_comment);
// $sql_select_count = "select * from `product_comment`";
// $data_count = mysqli_query($conn,$sql_select_count);
// $comment_count = mysqli_num_rows($data_count);
?>
<?php while ($row_comment = mysqli_fetch_assoc($data_comment)) { ?>
<div class="flex-w flex-t p-b-68">
<div class="wrap-pic-s size-109 bor0 of-hidden m-r-18 m-t-6">
<img src="images/01.jpg" alt="AVATAR">
</div>
<div class="size-207">
<div class="flex-w flex-sb-m p-b-17">
<span class="mtext-107 cl2 p-r-20">
<?php echo $row_comment['name']; ?>
</span>
<span class="fs-18 cl11">
<?php $star='<i class="zmdi zmdi-star"></i>' ?>
<?php for ($i=1; $i<=$row_comment['rating']; $i++) {
echo $star;
} ?>
</span>
</div>
<p class="stext-102 cl6">
<?php echo $row_comment['review']; ?>
</p>
</div>
</div>
<?php } ?>