-
Notifications
You must be signed in to change notification settings - Fork 0
/
shared.php
56 lines (51 loc) · 2.39 KB
/
shared.php
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
<?php
include 'db.php';
include 'encryption.php';
if (!isset($_GET['token']) || isset($_POST['back']))
header("Location: /");
else {
$token = $_GET['token'];
$sql = "SELECT id,field FROM storage WHERE token='$token'";
$result = mysqli_query($conn, $sql);
if ($result->num_rows > 0) {
$row = mysqli_fetch_assoc($result);
$clipboard = decrypt($row['field'], $token);
} else
header("Location: /");
}
?>
<!DOCTYPE html>
<html lang="id">
<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">
<link rel="icon" type="image/x-icon" href="/static/favicon.png">
<title>Clipboard #<?=$row['id']?></title>
<link rel="stylesheet" href="/static/css/editor.css"></link>
<link rel="stylesheet" href="/static/css/style.css"></link>
</head>
<body>
<div class="container">
<form>
<div class="nav" class="top">
<div class="left"><button type="button" onclick="delButt('clipboard', '<?=$token?>')" id="clipboard" name="delete-temp" class="btn btn-red form_data">Hapus</button></div>
<div class="center"><b>Clipboard #<?=$row['id']?></b></div>
<div class="right"><Button type="button" onclick="formButton('save', '<?=$token?>')" id="save" name="save-temp" class="btn btn-green form_data">Simpan</Button></div>
</div>
<div>
<p style="margin-block-start: 0.5em; margin-block-end: 0.6em"><textarea id="lineCounter" wrap="off" readonly>1.</textarea>
<textarea id="codeEditor" class="form_data" wrap="off" name="field" placeholder="Hapus jika sudah tidak digunakan."><?=$clipboard?></textarea>
</p>
</div>
</form>
<div class="nav">
<div class="left"><button class="btn btn-blue" id="copy-link" onclick="copyLink()">Copy Link</button></div>
<div class="center bottom"><b class="text-red text-mini">Data Akan Dihapus Tiap Minggu</b></div>
<div class="right"><button class="btn btn-yellow" id="copy-text" onclick="copyEditor()">Copy Text</button></div>
</div>
</div>
<script type="text/javascript" src="/static/js/editor.js"></script>
<script type="text/javascript" src="/static/js/button.js"></script>
</body>
</html>