-
Notifications
You must be signed in to change notification settings - Fork 0
/
read_template.php
executable file
·103 lines (82 loc) · 3.21 KB
/
read_template.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
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
<html>
<head>
<title>
VSDb Client
</title>
<tt>
<style>
table {
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid black;
text-align: left;
padding: 8px;
}
</style>
</head>
<?php
session_start();
$key = $_SESSION['keys'];
if ($key == "") {
$key = $_POST["key"];
$_SESSION['keys'] = $key;
}
$servername = "localhost";
$username = "##USERNAME##";
$password = "##PASSWORD##";
$dbname = "##DATABASE##";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT A FROM ver";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$iv = "3450691827364523";
$key_check = openssl_decrypt($row["A"], "aes-128-cbc", $key, 0, $iv);
if ($key_check == "") {
echo '<center><BR><BR>No, that is not the key.<BR><BR><img src="no.gif"><BR><BR><B>Please contact the system administrator if you think this was an error.</B></center>';
$conn->close();
die();
} else {
$_SESSION['burned'] = "no";
}
}
} else {
error_log("Error: " . $sql);
}
echo '<form name="add" action="add.php" method="POST" enctype="multipart/form-data"><label for="name">Name: </label><input name="name" id="name" type="text" class="formbox" /><BR><label for="pic">Picture: </label><input type="file" name="pic" id="pic"><BR><label for="add">Address: </label><input name="add" id="add" type="text" class="formbox" /><BR><label for="con">Contact Number/Email: </label><input name="con" id="con" type="text" class="formbox" /><BR><label for="link">Social Media URL: </label><input name="link" id="link" type="text" class="formbox" /><BR><label for="rel">Relatives: </label><input name="rel" id="rel" type="text" class="formbox" /><BR><label for="gen">General Comments: </label><input name="gen" id="gen" type="text" class="formbox" /><BR><input name="submit" id="submit" type="submit" value="add" /><BR><BR></form>';
$sql = "SELECT * FROM data ORDER BY ID DESC";
$result = $conn->query($sql);
echo '<table><tr><th>Full Name</th><th>Picture</th><th>Address</th><th>Contact Number/Email</th><th>Social Media</th><th>Relatives</th><th>General Comments</th></tr>';
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$iv = "3450691827364523";
$n_de = openssl_decrypt($row["N"], "aes-128-cbc", $key, 0, $iv);
$p_de = openssl_decrypt($row["P"], "aes-128-cbc", $key, 0, $iv);
$a_de = openssl_decrypt($row["A"], "aes-128-cbc", $key, 0, $iv);
$c_de = openssl_decrypt($row["C"], "aes-128-cbc", $key, 0, $iv);
$s_de = openssl_decrypt($row["S"], "aes-128-cbc", $key, 0, $iv);
$r_de = openssl_decrypt($row["R"], "aes-128-cbc", $key, 0, $iv);
$g_de = openssl_decrypt($row["G"], "aes-128-cbc", $key, 0, $iv);
/*if ($p_de == "") {
$p_code = "";
} else {
}
for unlinking not existent images
*/
if ($n_de != "") {
print_r('<tr><td>' . $n_de . '</td><td><a href="img/' . $p_de . '"><img src="img/' . $p_de . '" height="100" width="100"></a></td><td>' . $a_de . '</td><td>' . $c_de . '</td><td><a href="' . $s_de . '">' . $s_de . '</a></td><td>' . $r_de . '</td><td>' . $g_de . '</td></tr>');
}
}
echo '</table>';
} else {
error_log("Error: " . $sql);
}
$conn->close();
?>
</tt>
</html>