-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost_comment.php
More file actions
99 lines (93 loc) · 4.24 KB
/
post_comment.php
File metadata and controls
99 lines (93 loc) · 4.24 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>校園論壇</title>
<link href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous" />
<link rel="stylesheet" href="./css/index.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand navbar-light">
<div class="container-fluid">
<a class="navbar-brand title" href="./faceIdentify.html">AsiaLife論壇</a>
<div class="collapse navbar-collapse" id="navbarText">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="school.php">首頁</a>
</li>
<li class="nav-item">
<a class="nav-link" href="school.php">校園</a>
</li>
<li class="nav-item">
<a class="nav-link" href="club.php">社團</a>
</li>
<li class="nav-item">
<a class="nav-link" href="house.php">房屋</a>
</li>
</ul>
<a class="nav-btn" href="./user_data.php">個人資料</a>
<a class="nav-logup-btn" href="./php/signout.php">登出</a>
</div>
</div>
</nav>
</header>
<div class="container">
<div class="row m-2 card-container bg-white"></div>
</div>
<footer class="footer">
<div class="container d-flex justify-content-center">
<p>Copyright © 2021 Asia University. All rights reserved. 亞洲大學資工系</p>
</div>
</footer>
</body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="plugins/jquery-ui/jquery-ui.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-/bQdsTh/da6pkI1MST/rWKFNjaCP5gBSY4sEBT38Q/9RBh9AH40zEOg7Hlq2THRZ" crossorigin="anonymous"></script>
<!-- JQVMap -->
<script src="plugins/jqvmap/jquery.vmap.min.js"></script>
<script src="plugins/jqvmap/maps/jquery.vmap.usa.js"></script>
<!-- jQuery Knob Chart -->
<script src="plugins/jquery-knob/jquery.knob.min.js"></script>
<script>
var get_value
getParameters = () => {
// Address of the current window
address = window.location.search
// Returns a URLSearchParams object instance
parameterList = new URLSearchParams(address)
// Created a map which holds key value pairs
let map = new Map()
// Storing every key value pair in the map
parameterList.forEach((value, key) => {
map.set(key, value)
})
// Returning the map of GET parameters
return map
}
//post_
var post_data = new FormData(document.forms[0]);
var data
var comment_card = ""
post_data.append("id", getParameters().get('post_id'))
fetch('select_comment.php', {
method: "POST",
body: post_data,
})
.then(function(response) {
return response.json();
})
.then(function(myJson) {
console.log(myJson);
data = myJson
for (let i = 0; i < data.comment_data.length; i++) {
comment_card += "<div class='col-4'><div class='card m-2' style='width: 18rem;'><img class='m-1' src='data:image/jpeg;base64," + data.comment_data[i].author_image + " 'style='width:50px;height:50px' ' class='card-img-top' alt='...'><div class='card-body'><h5 class='card-title'>" + data.comment_data[i].author + "</h5><p class='card-text'>" + data.comment_data[i].content + "</p> </div> </div></div>"
$(".card-container").html(comment_card)
}
});
//
</script>
</html>