-
-
+
+
-
Logo Management
-
Upload a new logo for the site. The current logo will be replaced. The file should be a PNG, JPG, or GIF.
-
-
Logo uploaded successfully!
-
-
Error uploading logo:
-
-
-
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/change_password.php b/change_password.php
new file mode 100644
index 0000000..ec45868
--- /dev/null
+++ b/change_password.php
@@ -0,0 +1,21 @@
+prepare("UPDATE users SET password = ? WHERE id = ?");
+ $stmt->execute([$hashed_password, $_SESSION['user_id']]);
+
+ header('Location: admin.php');
+ exit;
+}
+?>
\ No newline at end of file
diff --git a/index.php b/index.php
index aa33734..53363b2 100644
--- a/index.php
+++ b/index.php
@@ -1,57 +1,23 @@
"C001",
- "Ticari Unvan" => "Flatlogic Inc.",
- "Sehir" => "New York",
- "Ad" => "John",
- "Soyad" => "Doe",
- "Telefon" => "123-456-7890",
- "E-posta" => "john.doe@example.com",
- "Grup Adı" => "VIP",
- ],
- [
- "Cust.Code" => "C002",
- "Ticari Unvan" => "Google LLC",
- "Sehir" => "Mountain View",
- "Ad" => "Jane",
- "Soyad" => "Smith",
- "Telefon" => "987-654-3210",
- "E-posta" => "jane.smith@example.com",
- "Grup Adı" => "Technology",
- ],
- [
- "Cust.Code" => "C003",
- "Ticari Unvan" => "Microsoft Corp.",
- "Sehir" => "Redmond",
- "Ad" => "Peter",
- "Soyad" => "Jones",
- "Telefon" => "555-123-4567",
- "E-posta" => "peter.jones@example.com",
- "Grup Adı" => "Software",
- ],
- [
- "Cust.Code" => "C004",
- "Ticari Unvan" => "Apple Inc.",
- "Sehir" => "Cupertino",
- "Ad" => "Mary",
- "Soyad" => "Johnson",
- "Telefon" => "555-987-6543",
- "E-posta" => "mary.j@example.com",
- "Grup Adı" => "Hardware",
- ],
- [
- "Cust.Code" => "C005",
- "Ticari Unvan" => "Amazon.com, Inc.",
- "Sehir" => "Seattle",
- "Ad" => "David",
- "Soyad" => "Williams",
- "Telefon" => "555-555-5555",
- "E-posta" => "david.w@example.com",
- "Grup Adı" => "e-Commerce",
- ]
-];
+session_start();
+require_once 'db/config.php';
+
+$is_logged_in = isset($_SESSION['user_id']);
+$user_permissions = [];
+$contacts = [];
+
+if ($is_logged_in) {
+ $pdo = db();
+ $stmt = $pdo->prepare("SELECT can_view, can_add, can_delete, can_edit, is_admin FROM users WHERE id = ?");
+ $stmt->execute([$_SESSION['user_id']]);
+ $user_permissions = $stmt->fetch();
+
+ if ($user_permissions['can_view']) {
+ $stmt = $pdo->query("SELECT * FROM contacts");
+ $contacts = $stmt->fetchAll();
+ }
+}
+
?>
@@ -75,22 +41,22 @@ $contacts = [
+