From c18de9ad4dad6e9600bd3d07f444a56c673c638f Mon Sep 17 00:00:00 2001 From: biema Date: Mon, 1 Dec 2025 11:11:04 +0700 Subject: [PATCH] add board.php --- includes/.htaccess | 1 - includes/config.php | 13 -- public/.htaccess | 8 -- public/assets/css/style.css | 271 ------------------------------------ public/assets/js/menu.js | 27 ---- public/board - Copy.php | 127 +++++++++++++++++ public/board.php | 28 ++-- public/index.php | 65 --------- public/logout.php | 5 - public/signin.php | 58 -------- public/signup.php | 56 -------- 11 files changed, 141 insertions(+), 518 deletions(-) delete mode 100644 includes/.htaccess delete mode 100644 includes/config.php delete mode 100644 public/.htaccess delete mode 100644 public/assets/css/style.css delete mode 100644 public/assets/js/menu.js create mode 100644 public/board - Copy.php delete mode 100644 public/index.php delete mode 100644 public/logout.php delete mode 100644 public/signin.php delete mode 100644 public/signup.php diff --git a/includes/.htaccess b/includes/.htaccess deleted file mode 100644 index 3418e55..0000000 --- a/includes/.htaccess +++ /dev/null @@ -1 +0,0 @@ -deny from all \ No newline at end of file diff --git a/includes/config.php b/includes/config.php deleted file mode 100644 index 94c9f0c..0000000 --- a/includes/config.php +++ /dev/null @@ -1,13 +0,0 @@ -connect_error) { - die("Connection failed: " . $conn->connect_error); -} - -session_start(); diff --git a/public/.htaccess b/public/.htaccess deleted file mode 100644 index f8fbdcd..0000000 --- a/public/.htaccess +++ /dev/null @@ -1,8 +0,0 @@ -RewriteEngine On - -# Don't rewrite existing files or directories -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d - -# Redirect everything else to index.php -RewriteRule ^(.*)$ index.php [L] diff --git a/public/assets/css/style.css b/public/assets/css/style.css deleted file mode 100644 index d3e51ef..0000000 --- a/public/assets/css/style.css +++ /dev/null @@ -1,271 +0,0 @@ -body, html{ - font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; - margin:0; - background: radial-gradient(circle at 10% 10%, rgba(255,255,255,0.03), transparent 5%), - linear-gradient(180deg, #000 0%, #071827 100%), - var(--bg); - color:var(--muted); - -webkit-font-smoothing:antialiased; - -moz-osx-font-smoothing:grayscale; - padding:24px; - display:flex; - align-items:center; - justify-content:center; - height:100%; - overflow: hidden; -} - -:root{ - --bg:#071827; - --card:#071827; - --accent:#ffd54a; - --muted:#cfe8d6; - --glass: rgba(255,255,255,0.04); - --shadow: 0 6px 18px rgba(2,8,3,0.6); - --glass-2: rgba(0,0,0,0.35); -} - -.container{ - width:100%; - background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); - border-radius:16px; - padding:20px; - box-shadow:var(--shadow); - backdrop-filter: blur(6px); -} - -.card{ - background:rgba(255,255,255,0.05); - padding:28px; - border-radius:16px; - width:320px; - box-shadow:0 8px 30px rgba(0,0,0,0.5); - backdrop-filter:blur(8px); -} - -h2{ - margin-top:0; - text-align:center -} - -label{ - display:block; - margin:10px 0 4px; - font-size:14px -} - -input{ - width:100%; - padding:10px; - border-radius:8px; - border:0; - margin-bottom:10px; - background:#ffffff12; - color:white; -} - -button{ - width:100%; - padding:10px; - border-radius:8px; - border:0; - cursor:pointer; - background:linear-gradient(90deg,#ffd54a); - color:black; - font-weight:600; - margin-top:10px; -} - -.note{ - text-align:center; - margin-top:10px; - font-size:14px -} - -a{ - color:#4ade80; - text-decoration:none -} - -.logo{ - font-size: 96px; - display:flex; - align-items:center; - justify-content:center; -} - -.header{ - display:flex; - gap:16px; - align-items:center; - margin-bottom:14px -} - -.w80{ - width: 80%; -} - -table{ - width:100%; - border-collapse:collapse; - font-size:14px -} - -thead th{ - font-size:12px; - text-align:left; - padding:8px 10px; - color:var(--muted); - opacity:0.9 -} - -tbody td{ - padding:10px; - border-top:1px dashed rgba(255,255,255,0.03) -} - -.panel{ - background:var(--card); - padding:16px; - border-radius:12px; - border:1px solid var(--glass-2) -} - -footer{ - margin-top:14px; - font-size:12px; - color:rgba(255,255,255,0.45); - text-align:center -} - -.userbox { - display: flex; - align-items: center; - gap: 14px; - margin-bottom: 20px; - background: rgba(255, 255, 255, 0.04); - padding: 14px; - border-radius: 14px; - border: 1px solid rgba(255, 255, 255, 0.06); - box-shadow: 0 8px 24px rgba(2, 6, 23, 0.45); -} - -.userbox .avatar { - width: 58px; - height: 58px; - border-radius: 50%; - background: linear-gradient(180deg, #0e3b33, #0b2a2f); - display: flex; - align-items: center; - justify-content: center; - font-size: 22px; - font-weight: 800; - color: var(--accent); - border: 2px solid rgba(246,198,79,0.4); - box-shadow: 0 6px 14px rgba(0,0,0,0.5); -} - -.userbox .info { - display: flex; - flex-direction: column; - line-height: 1.25; -} - -.userbox .name { - font-weight: 800; - font-size: 24px; -} - -.userbox .saldo { - margin-top: 4px; - font-size: 18px; - color: var(--muted); -} - -.userbox .saldo span { - color: var(--accent); - font-weight: 700; -} - -.userbox .status { - margin-top: 2px; - font-size: 16px; - color: var(--muted); -} - -.gamename { - font-size: 36px; -} - -.num-box { - display: inline-flex; - align-items: center; - border: 1px solid #444; - border-radius: 12px; - overflow: hidden; - background: #1e1e1e; - height: 50px; -} - -.num-box input { - height: 50px; - width: 100px; - font-size: 18px; - background: transparent; - border: none; - color: white; - text-align: center; - outline: none; - line-height: 50px; /* base centering */ - display: flex; /* optical fix */ - align-items: center; /* optical fix */ - justify-content: center; /* ensures centered horizontally */ -} - -.num-box input::-webkit-inner-spin-button, -.num-box input::-webkit-outer-spin-button { - -webkit-appearance: none; -} - -.num-box .btn { - width: 50px; - height: 50px; - border: none; - background: #2b2b2b; - color: white; - font-size: 22px; - cursor: pointer; - - display: flex; - justify-content: center; - align-items: center; -} - -.num-box .btn:hover { - background: #3a3a3a; -} - -.num-box .btn:active { - background: #555; -} - -.plus, .minus { - margin-top: 0 !important; -} - -.mb16 { - margin-bottom: 16px; -} - -/* Chrome, Edge, Safari */ -input::-webkit-outer-spin-button, -input::-webkit-inner-spin-button { - -webkit-appearance: none; - margin: 0; -} - -/* Firefox */ -input[type="number"] { - -moz-appearance: textfield; /* old syntax */ - appearance: textfield; /* standard property */ -} \ No newline at end of file diff --git a/public/assets/js/menu.js b/public/assets/js/menu.js deleted file mode 100644 index ffc4b52..0000000 --- a/public/assets/js/menu.js +++ /dev/null @@ -1,27 +0,0 @@ -document.querySelector(".plus").addEventListener("click", () => { - const input = document.querySelector(".num-box input"); - const step = Number(input.step) || 1000; - const max = Number(input.max); - - let newValue = Number(input.value) + step; - - if (!isNaN(max)) {https://git-eng.ukwms.ac.id/2526-web/Kelompok_13.git - newValue = Math.min(newValue, max); - } - - input.value = newValue; -}); - -document.querySelector(".minus").addEventListener("click", () => { - const input = document.querySelector(".num-box input"); - const step = Number(input.step) || 1000; - const min = Number(input.min); - - let newValue = Number(input.value) - step; - - if (!isNaN(min)) { - newValue = Math.max(newValue, min); - } - - input.value = newValue; -}); diff --git a/public/board - Copy.php b/public/board - Copy.php new file mode 100644 index 0000000..555098b --- /dev/null +++ b/public/board - Copy.php @@ -0,0 +1,127 @@ +prepare("SELECT b.bet, u.username FROM bets b JOIN users u ON b.uid = u.uid ORDER BY b.bet DESC LIMIT 10;"); + $stmt->execute(); + $result = $stmt->get_result(); + $bets = $result->fetch_all(MYSQLI_ASSOC); + $stmt->close(); + + // Top 10 wins + $stmt = $conn->prepare("SELECT b.win, u.username FROM wins b JOIN users u ON b.uid = u.uid ORDER BY b.win DESC LIMIT 10;"); + $stmt->execute(); + $result = $stmt->get_result(); + $wins = $result->fetch_all(MYSQLI_ASSOC); + $stmt->close(); + + // Top 10 users by money + $stmt = $conn->prepare("SELECT * FROM users ORDER BY money DESC LIMIT 10"); + $stmt->execute(); + $result = $stmt->get_result(); + $users = $result->fetch_all(MYSQLI_ASSOC); + $stmt->close(); + +?> + + + + + + Hit and Run — Leaderboard + + + +
+
+ +
+

Hit Or Run — Leaderboard

+
+
+ +
+
+

Top Rich Mans

+
+ + + + + + + + + + $user): ?> + + + + + + + +
#PlayerEarnings
+
+
+
+ +
+
+

Top Crazy Mans

+
+ + + + + + + + + + + + +
#Player + $bet): ?> +
+
+
+
+ +
+
+

Top Lucky Mans

+
+ + + + + + + + + + $win): ?> + + + + + + + +
#PlayerEarnings
+
+
+
+ +
© 2025 Hit Or Run Leaderboard
+
+ + diff --git a/public/board.php b/public/board.php index 6b07a80..555098b 100644 --- a/public/board.php +++ b/public/board.php @@ -50,17 +50,17 @@ - - - + + + - + $user): ?> - - + + @@ -76,12 +76,12 @@
#PlayerEarnings#PlayerEarnings
- - - + + + $bet): ?> @@ -102,12 +102,12 @@
#PlayerBets#Player +
- - - + + + - + $win): ?> diff --git a/public/index.php b/public/index.php deleted file mode 100644 index f05cf3f..0000000 --- a/public/index.php +++ /dev/null @@ -1,65 +0,0 @@ -prepare("SELECT money FROM users WHERE uid = ?"); - $stmt->bind_param("i", $_SESSION['data']['uid']); - $stmt->execute(); - $result = $stmt->get_result(); - $user = $result->fetch_assoc(); - $stmt->close(); - - // Update session - $_SESSION['data']['money'] = $user['money']; -?> - - - - - - - Hit & Run - - - - -
-
- Hit & Run
- Hit or you Lose. -
-
-
- - - -
- -
-
- -
-
-
P
- -
-
-
Saldo:
-
Status: Masih Pemula Banghh....
-
-
- -
- - - - - diff --git a/public/logout.php b/public/logout.php deleted file mode 100644 index 8ba2a2e..0000000 --- a/public/logout.php +++ /dev/null @@ -1,5 +0,0 @@ -prepare("SELECT * FROM users WHERE username = ?"); - $stmt->bind_param("s", $username); - $stmt->execute(); - - $result = $stmt->get_result(); - - if ($result->num_rows === 1) { - $user = $result->fetch_assoc(); - - if (password_verify($password, $user["password"])) { - $_SESSION["data"] = $user; - header("Location: home"); - exit; - } else { - $error = "Wrong Username or Password."; - } - } else { - $error = "Username not found."; - } - } -?> - - - - - - - Hit or Run — Sign In - - - -
- -

Hit or Run

- - $error

"; ?> - -
- - - - - - - - - -
Belum punya akun? Sign Up!
-
- - \ No newline at end of file diff --git a/public/signup.php b/public/signup.php deleted file mode 100644 index 7ddca55..0000000 --- a/public/signup.php +++ /dev/null @@ -1,56 +0,0 @@ -prepare("INSERT INTO users (username, password) VALUES (?, ?)"); - $stmt->bind_param("ss", $username, $password); - - try { - $stmt->execute(); - header("Location: signin.php"); - exit; - } catch (mysqli_sql_exception $e) { - if ($e->getCode() == 1062) { - $error = "Username already exists."; - } - } - - } -?> - - - - - - - Hit or Run — Sign Up - - - -
- -

Hit or Run

- - $error

"; ?> - -
- - - - - - - - - -
Sudah punya akun? Sign In!
-
- - \ No newline at end of file
#PlayerEarnings#PlayerEarnings