From d204dd2b999e8e7ddfd462354bfed5c39b829423 Mon Sep 17 00:00:00 2001 From: Hickmeister <35031453+Hickmeister@users.noreply.github.com> Date: Sat, 4 Jan 2025 02:05:59 +0000 Subject: [PATCH] Login and Auth --- assets/php/db.php | 13 + assets/php/login.php | 21 + assets/php/nav.php | 161 ++++ assets/php/session_check.php | 7 + index.html | 1720 ---------------------------------- index.php | 314 +++++++ login.html | 141 ++- logout.php | 7 + 8 files changed, 577 insertions(+), 1807 deletions(-) create mode 100644 assets/php/db.php create mode 100644 assets/php/login.php create mode 100644 assets/php/nav.php create mode 100644 assets/php/session_check.php delete mode 100644 index.html create mode 100644 index.php create mode 100644 logout.php diff --git a/assets/php/db.php b/assets/php/db.php new file mode 100644 index 0000000..5d8382e --- /dev/null +++ b/assets/php/db.php @@ -0,0 +1,13 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); +} catch (PDOException $e) { + die("Database connection failed: " . $e->getMessage()); +} +?> \ No newline at end of file diff --git a/assets/php/login.php b/assets/php/login.php new file mode 100644 index 0000000..db2d90e --- /dev/null +++ b/assets/php/login.php @@ -0,0 +1,21 @@ +prepare("SELECT * FROM users WHERE username = ?"); + $stmt->execute([$username]); + $user = $stmt->fetch(); + + if ($user && password_verify($password, $user['password'])) { + $_SESSION['user_id'] = $user['id']; + $_SESSION['username'] = $user['username']; + echo 'success'; + } else { + echo 'Invalid login credentials'; + } +} +?> \ No newline at end of file diff --git a/assets/php/nav.php b/assets/php/nav.php new file mode 100644 index 0000000..bf575fd --- /dev/null +++ b/assets/php/nav.php @@ -0,0 +1,161 @@ + + + \ No newline at end of file diff --git a/assets/php/session_check.php b/assets/php/session_check.php new file mode 100644 index 0000000..1b69a45 --- /dev/null +++ b/assets/php/session_check.php @@ -0,0 +1,7 @@ + diff --git a/index.html b/index.html deleted file mode 100644 index ecd73f0..0000000 --- a/index.html +++ /dev/null @@ -1,1720 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Syndron - Bootstrap 5 Admin Dashboard Template - - - - -
- - - - -
-
- -
-
- - -
-
- - -
-
- -
-
-
-
-
-
- -
-
-
-

$84,256 8.6%

-

Total Income

-
-
-
-
-
-
-
-
-
-
-
-
Active Users
-
- -
-
-
-
-
-
-

42.5K

-
-

+37.5K from last month

-
-
-
-
-
-
-
-
-
-
Sales & Views
-
- -
-
-
-
-
-
-
-
-
-
-

87.4K

-

Total Clicks

-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Card Data
-
- -
-
-
- -
-
-

$68,452

-

Total Card Transactions

-
-
- -
-
-
-
-
$9478
-

Transactions

-
-
-
-
-
-
$6482
-

Total Cashback

-
-
-
-
-
-
$5784
-

Credit Balance

-
-
-
-
-
-
$3652
-

Debit Money

-
-
-
-
-
-
-
-
-
-
-

- 5/7 -

-
-
-

New Visitors

-

65,127

-

+16.5%55.21 USD

-
-
- -
-
-

- 5/7 -

-
-
-

Old Visitors

-

984,246

-

-24.9%267.35 USD

-
-
-
-
-
-
-
-
-
-

Total Accounts

-

58.4K

-

+14% Since last Month

-
-
-
-
-
-
-
-
-
-
-

Bounce Rate

-

36.7%

-

+17% Since last Month

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

Total Orders

-

78.6K

-
-
-
-
-
-
-
-

+37.5K from last month

-
-
-
-
-
-
-

Total Clicks

-

256.7K - - 12.9% -

-
-
-
- -
-
-
-
-
-
-
- -
-
-

Total Views

-
98547
-
-

+41.3%

-
-
-
-
- -
-
-

User Clicks

-
67258
-
-

-34.7%

-
-
-
-
- -
-
-

Page Enteries

-
45972
-
-

+72.6%

-
-
-
-
-
-
-
-
-
Card Data
-
- -
-
-
-
- -
45,689
-
-

+28.5%

-
-
-
- -
34,248
-
-

-14.5%

-
-
-
- -
45,689
-
-

+28.5%

-
-
-
- -
67,249
-
-

-43.5%

-
-
-
- -
67,249
-
-

-43.5%

-
-
-
- -
89,178
-
-

+24.7%

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Rvenue Goal
-
- -
-
-
-

68%

-

Total Profit

-
-
-
-
-
-
Plan Completed
-
-
-

$8796

-
-
-
-
-
-
-
-
-
Overall Information
-
- -
- -
-

89

-
-

276 task done

-
-
-
-
-
-

-

64

-

Projects

-
-
-
-
-
-
-

-

48

-

In Progress

-
-
-
-
-
-
-

-

96

-

Completed

-
-
-
-
- -
-
-
-
-
-
-

Orders Last 30 Days

-

98,546 - - 26.7% -

-
-
-
-
- -
-
-

India

-

648

-
-
-
-
-
-
-
-

Dubai

-

472

-
-
-
-
-
-
-
-

USA

-

365

-
-
-
-
-
-
-
-

United Kingdom

-

875

-
-
-
-
-
-
-
-

China

-

248

-
-
-
-
-
- -
-
-
- -
-
-
-
-
- -
-
- - -
-
- - -
- - - - - -
- - - - - - - - - - - - -
-
-
-
Theme Customizer
-
- -
-
-
-

Theme variation

- -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
-
-
- - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..e53b4b9 --- /dev/null +++ b/index.php @@ -0,0 +1,314 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TOD Dashboard + + + + +
+ + + + +
+ +
+ + +
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+

$84,256 8.6%

+

Total Income

+
+
+
+
+
+
+
+
+
+
+
+
Active Users
+
+ +
+
+
+
+
+
+

42.5K

+
+

+37.5K from last month

+
+
+
+
+
+
+
+
+
+
Sales & Views
+
+ +
+
+
+
+
+
+
+
+
+
+

87.4K

+

Total Clicks

+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Total Accounts

+

58.4K

+

+14% Since last Month

+
+
+
+
+
+
+
+
+
+
+

Bounce Rate

+

36.7%

+

+17% Since last Month

+
+
+
+
+
+
+
+
+
+
+
+
+
+ + +
+ + + + +
+

Copyright © 2024. All right reserved.

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/login.html b/login.html index 9836c43..d358cd6 100644 --- a/login.html +++ b/login.html @@ -2,127 +2,94 @@ - - - - - - Syndron - Bootstrap 5 Admin Dashboard Template + Syndron - Admin Dashboard - - +
-
-
- -
- -
-
- -
-
- -
- -
-
-
-
-
- -
-
-
Syndron Admin
-

Please log in to your account

-
-
-
-
- - -
-
- -
- -
-
-
-
- - -
-
- -
-
- -
-
-
-
-

Don't have an account yet? Sign up here -

-
-
-
-
- -
-
+
+
+
+
+ +
+
+
+
+
+
+
+ +
Syndron Admin
+

Please log in to your account

+
+
+
+ + +
+
+ +
+ + +
+
+
+ +
+
+
-
-
- - + - - + - + - \ No newline at end of file diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..0c482a6 --- /dev/null +++ b/logout.php @@ -0,0 +1,7 @@ +