-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofil.php
129 lines (117 loc) · 5.14 KB
/
profil.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
<!DOCTYPE html>
<html lang="tr-TR">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ThinkTalk</title>
<link rel="stylesheet" href="bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="css/all.min.css">
</head>
<body>
<div class="container">
<?php
include 'db.php';
if (!isset($_SESSION['user_id'])) {
header('Location: giris.php');
exit();
}
$userId = $_SESSION['user_id'];
$profileUserId = isset($_GET['id']) ? (int)$_GET['id'] : $userId;
$stmt = $conn->prepare("SELECT kullanici_adi, email, hakkinda FROM kullanicilar WHERE id = ?");
$stmt->bind_param("i", $profileUserId);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$user = $result->fetch_assoc();
} else {
echo "Kullanıcı bilgileri alınamadı.";
exit();
}
?>
<h1>ThinkTalk</h1>
<h5>Profilim</h5>
<br>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="anasayfa.php"><i class="fas fa-home"></i> Ana Sayfa</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="profil.php"><i class="fas fa-user"></i> Profil</a>
</li>
<li class="nav-item">
<a class="nav-link" href="konuac.php"><i class="fas fa-plus"></i> Konu aç</a>
</li>
<li class="nav-item">
<a class="nav-link" href="konubak.php"><i class="fas fa-eye"></i> Konulara bak</a>
</li>
<li class="nav-item">
<a class="nav-link" href="admin.php"><i class="fas fa-cog"></i> Admin</a>
</li>
</ul>
</div>
</nav>
<div class="container mt-4">
<div class="card">
<div class="card-header">
<h5>Kullanıcı Bilgileri</h5>
</div>
<div class="card-body">
<form method="POST" action="guncelle_profil.php">
<div class="mb-3">
<label for="username" class="form-label">Kullanıcı Adı</label>
<input type="text" class="form-control" id="username" value="<?php
echo htmlspecialchars($user['kullanici_adi']); ?>" required readonly>
</div>
<div class="mb-3">
<label for="email" class="form-label">E-posta</label>
<input type="email" class="form-control" id="email" value="<?php
echo htmlspecialchars($user['email']); ?>" required readonly>
</div>
<div class="mb-3">
<label for="bio" class="form-label">Hakkında</label>
<textarea class="form-control" id="bio" name="hakkinda" rows="3" placeholder="Kendiniz hakkında bir şeyler yazın..."><?php
echo htmlspecialchars($user['hakkinda']); ?></textarea>
</div>
<button type="submit" class="btn btn-success">Güncelle</button>
</form>
</div>
</div>
</div>
<div class="container mt-4">
<div class="card">
<div class="card-header">
<h5>Şifre Değiştir</h5>
</div>
<div class="card-body">
<form method="POST" action="sifre_degistir.php">
<div class="mb-3">
<label for="current_password" class="form-label">Mevcut Şifre</label>
<input type="password" class="form-control" id="current_password" name="current_password" required>
</div>
<div class="mb-3">
<label for="new_password" class="form-label">Yeni Şifre</label>
<input type="password" class="form-control" id="new_password" name="new_password" required>
</div>
<div class="mb-3">
<label for="confirm_password" class="form-label">Yeni Şifre (Tekrar)</label>
<input type="password" class="form-control" id="confirm_password" name="confirm_password" required>
</div>
<button type="submit" class="btn btn-danger">Şifreyi Değiştir</button>
</form>
</div>
</div>
</div>
<div class="div2" id="notification">
Profiliniz
</div>
<script src="bootstrap/jquery-3.7.1.min.js"></script>
<script src="bootstrap/bootstrap.min.js"></script>
<script src="main.js"></script>
</div>
</body>
</html>