-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
150 lines (143 loc) · 4.95 KB
/
index.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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Track prices of your favorite steam market items!">
<meta name="author" content="Crille#6623">
<meta name="generator" content="Hugo 0.84.0">
<title>SteamBot</title>
<!-- Bootstrap core CSS -->
<link href="./css/bootstrap.min.css" rel="stylesheet">
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
.btn-group{
position: absolute;
bottom: 1%;
}
.btn-primary {
color: #fff;
background-color: #5865F2;
border-color: #0d6efd;
}
.card {
border: 1px solid rgba(0,0,0,.125);
}
/* @media (prefers-color-scheme: dark) {
body {
background-color: var(--bs-dark);
color: var(--bs-light);
}
} */
</style>
</head>
<body>
<?php
include_once("cfg.php");
?>
<header>
<nav class="navbar navbar-expand-sm navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="./">SteamBot</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mynavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="mynavbar">
<ul class="navbar-nav me-auto">
<li class="nav-item">
<a class="nav-link" href="javascript:void(0)">Cases</a>
</li>
<li class="nav-item">
<a class="nav-link" href="javascript:void(0)">Knives</a>
</li>
<li class="nav-item">
<a class="nav-link" href="javascript:void(0)">Weaponskins</a>
</li>
</ul>
<ul class="navbar-nav me-auto">
<li class="nav-item">
<font color="white">
<?php
$query = mysqli_query($con, "SELECT * FROM bots");
$numrows=mysqli_num_rows($query);
echo "We've added a total of " . '<b>' . $numrows . '</b>' . " cases to Discord servers.";
$query -> close();
?>
</font>
</a>
</li>
</ul>
<form class="d-flex">
<?php
require __DIR__ . "/functions.php";
require __DIR__ . "/discord.php";
$auth_url = url($client_id, $redirect_url, $scopes);
if (isset($_SESSION['user'])) {
echo '<a href="profile.php"><button type="button" class="btn btn-success">Webhooks</button></a> ';
echo '<a href="logout.php"><button type="button" class="btn btn-danger">Logout</button></a>';
} else {
echo '<a href="' . $auth_url . '">' . '<button type="button" class="btn btn-primary">Login with Discord</button></a>';
}
?>
</form>
</div>
</div>
</nav>
</header>
<main>
<section class="album py-4 bg-dark">
<div class="col-lg-6 col-md-8 mx-auto">
<h1 class="fw-dark text-muted">SteamBot</h1>
<p class="lead text-muted">
Keep a hourly track on case prices directly on your discord server!<br>
Find your cases below and add them to your discord-server.</p>
</div>
</section>
<div class="album py-5 bg-dark">
<div class="container">
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-6 g-3">
<?php
$username = $_SESSION['user_id'];
$get_cases = mysqli_query($con,"SELECT * FROM items");
while($row = mysqli_fetch_array($get_cases))
{
echo '<div class="col "><div class="card h-100 shadow-sm bg-dark">';
echo '<img src="' . $row['img'] .'" class="card-img-top" alt="...">';
echo '<div class="card-body">';
echo '<p class="card-text text-muted">' . $row['name'] . '</p><br>';
echo '<div class="d-flex justify-content-between align-items-center">';
echo '<div class="btn-group ">';
if (isset($_SESSION['user'])) {
echo '<a href="add.php?id=' . $row['id'] . '"><button type="button" class="btn btn-primary">Add to Discord</button></a>';
} else {
echo '<a href="' . $auth_url . '">' . '<button type="button" class="btn btn-primary">Add to discord</button></a>';
}
echo '</div></div></div></div></div>';
}
?>
</div>
</div>
</div>
</main>
<footer class="text-muted py-5 bg-dark">
<div class="container">
<p class="float-end mb-1">
<a href="#">Back to top</a>
</p>
<p class="mb-1">Made with love by <a href="https://github.com/crilleaz/">Crilleaz</a></p>
</div>
</footer>
<script src="./js/bootstrap.bundle.min.js"></script>
</body>
</html>