diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..fa9a2e1 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,54 @@ +body { + background-color: #f9fafb; + font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; + color: #111827; +} + +.card { + border-radius: 0.5rem; + border: 1px solid #e5e7eb; +} + +.btn-primary { + background-color: #1e3a8a; + border-color: #1e3a8a; +} + +.btn-primary:hover { + background-color: #1c327a; + border-color: #1c327a; +} + +.btn-secondary { + background-color: #f59e0b; + border-color: #f59e0b; +} + +.genealogy-tree ul { + padding-left: 20px; + list-style-type: none; +} + +.genealogy-tree li { + margin: 10px 0; + position: relative; +} + +.genealogy-tree li::before { + content: ''; + position: absolute; + top: -10px; + left: -20px; + border-left: 1px solid #ccc; + border-bottom: 1px solid #ccc; + width: 20px; + height: 20px; +} + +.genealogy-tree li:first-child::before { + border-top: 1px solid #ccc; +} + +.genealogy-tree li:last-child::before { + height: 20px; +} diff --git a/auth.php b/auth.php new file mode 100644 index 0000000..4734aeb --- /dev/null +++ b/auth.php @@ -0,0 +1,58 @@ +prepare("SELECT id FROM users WHERE referral_code = ?"); + $stmt->execute([$sponsor_code]); + $sponsor = $stmt->fetch(); + if (!$sponsor) { + return 'Invalid sponsor code.'; + } + $sponsor_id = $sponsor['id']; + } + + $password_hash = password_hash($password, PASSWORD_BCRYPT); + $referral_code = uniqid(); + + try { + $stmt = $db->prepare("INSERT INTO users (name, email, password, referral_code, sponsor_id) VALUES (?, ?, ?, ?, ?)"); + $stmt->execute([$name, $email, $password_hash, $referral_code, $sponsor_id]); + return true; + } catch (PDOException $e) { + if ($e->errorInfo[1] == 1062) { + return 'Email already exists.'; + } + return $e->getMessage(); + } +} + +function login($email, $password) { + $db = db(); + $stmt = $db->prepare("SELECT * FROM users WHERE email = ?"); + $stmt->execute([$email]); + $user = $stmt->fetch(); + + if ($user && password_verify($password, $user['password'])) { + $_SESSION['user_id'] = $user['id']; + return true; + } + return false; +} + +function get_user_by_id($id) { + $db = db(); + $stmt = $db->prepare("SELECT * FROM users WHERE id = ?"); + $stmt->execute([$id]); + return $stmt->fetch(); +} + +function get_downline($user_id) { + $db = db(); + $stmt = $db->prepare("SELECT * FROM users WHERE sponsor_id = ?"); + $stmt->execute([$user_id]); + return $stmt->fetchAll(); +} diff --git a/dashboard.php b/dashboard.php new file mode 100644 index 0000000..2a9433d --- /dev/null +++ b/dashboard.php @@ -0,0 +1,78 @@ + + + + + Dashboard + + + + + + +
+
+
+
+
Dashboard
+
+

Welcome, !

+

Your referral code is:

+

Your user type is:

+
+
+
+
+ +
+
+
+
Genealogy Tree
+
+
    + +
  • Upline:
  • + +
  • + You: + 0): ?> +
      + +
    • ()
    • + +
    + +

    You have no direct downline members yet.

    + +
  • +
+
+
+
+
+
+ + diff --git a/db/setup.php b/db/setup.php new file mode 100644 index 0000000..496f6ef --- /dev/null +++ b/db/setup.php @@ -0,0 +1,21 @@ +exec($sql); + echo "Table 'users' created successfully."; +} catch (PDOException $e) { + die("DB ERROR: ". $e->getMessage()); +} diff --git a/index.php b/index.php index 7205f3d..7e7f0c8 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,49 @@ - - + + - - - New Style - - - - - - - - - - - - - - - - - - - + Kutumbh Infra MLM + + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+ + +
+
+
+

Welcome to Kutumbh Infra MLM

+

Your partner in real estate success.

+ + Get Started + +
+
-
- - + \ No newline at end of file diff --git a/login.php b/login.php new file mode 100644 index 0000000..86b73cf --- /dev/null +++ b/login.php @@ -0,0 +1,52 @@ + + + + + Login + + + + +
+
+
+
+
Login
+
+ +
+ +
+
+ + +
+
+ + +
+ +
+
+
+

Don't have an account? Register here.

+
+
+
+ + diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..7649023 --- /dev/null +++ b/logout.php @@ -0,0 +1,5 @@ + + + + + Register + + + + +
+
+
+
+
Register
+
+ +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+

Already have an account? Login here.

+
+
+
+ +