This repository has been archived by the owner on Mar 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
162 lines (146 loc) · 6.44 KB
/
test.html
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?php
//Mengirimkan Token Keamanan Ajax Request (Csrf Token)
session_start();
if (empty($_SESSION['csrf_token'])) {
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
}
?>
<html>
<head>
<style>
#more {
display: none;
}
</style>
<!-- Csrf Token -->
<meta name="csrf-token" content="<?= $_SESSION['csrf_token'] ?>">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
</head>
<body>
<nav class="navbar navbar-dark bg-danger fixed-top">
<a class="navbar-brand" href="index.php" style="color: #fff;">
7 Madinah
</a>
</nav>
<div class="container mb-3">
<h2 align="center" style="margin: 60px 10px 10px 10px;">Forum & Komentar</h2>
<hr>
<form method="POST" id="form_komen">
<div class="form-group">
<input type="text" name="nama_pengirim" id="nama_pengirim" class="form-control"
placeholder="Masukkan Nama" required />
</div>
<div class="form-group">
<textarea name="komen" id="komen" class="form-control" placeholder="Tulis Komentar" rows="5"></textarea>
</div>
<div class="form-group">
<input type="hidden" name="komentar_id" id="komentar_id" value="0" />
<input type="submit" name="submit" id="submit" class="btn btn-info" value="Submit" />
</div>
</form>
<div class="media border p-3 mb-2">
<img src="https://res.cloudinary.com/arsasatria/image/upload/v1597308431/loader.gif.gif" alt="foto-user"
class="mr-3 mt-3 rounded-circle" style="width:60px;">
<div class="media-body">
<div class="row">
<div class="col-sm-10">
<h4><b>admin@chat.arsasatria.my.id</b> <small> PENTING <i>PERATURAN CHAT</i></small></h4>
<p>PERATURAN MENGGUNAKAN CHAT:</p>
<p></p>
<p id="more">1. Segala Script/Kode dan Asset termasuk gambar adalah Hak Cipta
chat.arsasatria.my.id</p>
<p id="more">2. Segala Link / Konten Tidak pantas akan dilaporkan dan diblokir total aksesnya ke
server 7 Madinah.</p>
<p id="more">3. Nama harus menggunakan NAMA ASLI dan tidak mengatasnamakan orang lain.</p>
<p id="more">4. Segala Tindakan Peretasan/Perusakan yang dilakukan akan dilaporkan Ke Pihak
Berwenang.</p>
<p id="more">5. Konten yang tidak sesuai dengan S&K kami atau Tidak Menggunakan Nama Pengirim
akan dihapus secara berkala.</p>
<p id="more">6. Pelaku tindakan SPAM akan dihapus aksesnya ke akun ini.</p>
<p id="more">7. Syarat dan Ketentuan di atas dapat berubah sewaktu-waktu</p>
<p id="more">PELAKU PELANGGARAN PERATURAN DI ATAS AKAN DIHAPUS TOTAL AKSESNYA KE SERVER KAMI DAN
AKAN DILAPORKAN KE PIHAK BERWAJIB & KEAMANAN JARINGAN NASIONAL SETEMPAT</p>
<p id="more"></p>
<p id="more">Selamat Mengobrol!</p>
<p id="more">- Admin chat.arsasatria.my.id - </p>
<button onclick="Read();" id="Readbtn">Read more</button>
</div>
<div class="col-sm-2" align="right">
<button type="button" class="btn btn-primary reply">OK</button>
</div>
</div>
</div>
</div>
<hr>
<h4 class="mb-3">Komentar :</h4>
<span id="message"></span>
<div id="display_comment"></div>
</div>
<div class="navbar bg-dark">
<div style="color: #fff;">© <?php echo date('Y'); ?> Copyright:
<a href="https://arsasatria.my.id/">chat.arsasatria.my.id</a>
<a href="#report" onclick="report();" style="color:white"> - Laporkan Pesan!</a>
</div>
</div>
<script>
$(document).ready(function () {
//Mengirimkan Token Keamanan
$.ajaxSetup({
headers: {
'Csrf-Token': $('meta[name="csrf-token"]').attr('content')
}
});
$('#form_komen').on('submit', function (event) {
event.preventDefault();
var form_data = $(this).serialize();
$.ajax({
url: "https://madinah.my.id/tambah_komentar.php",
method: "POST",
data: form_data,
success: function (data) {
$('#form_komen')[0].reset();
$('#komentar_id').val('0');
load_comment();
}, error: function (data) {
console.log(data.responseText)
}
})
});
load_comment();
function load_comment() {
$.ajax({
url: "https://madinah.my.id/ambil_komentar.php",
method: "POST",
success: function (data) {
$('#display_comment').html(data);
}, error: function (data) {
console.log(data.responseText)
}
})
}
$(document).on('click', '.reply', function () {
var komentar_id = $(this).attr("id");
$('#komentar_id').val(komentar_id);
$('#nama_pengirim').focus();
});
});
</script>
<script>
function Read() {
var dots = document.getElementById("dots");
var moreText = document.getElementById("more");
var btnText = document.getElementById("Readbtn");
if (dots.style.display === "none") {
dots.style.display = "inline";
btnText.innerHTML = "Read more";
moreText.style.display = "none";
} else {
dots.style.display = "none";
btnText.innerHTML = "Read less";
moreText.style.display = "inline";
}
}
</script>
</body>
</html>